As far as I can tell, the position that ad hominem attacks are always invalid seems to be widespread within the philosophical community. I'm not entirely convinced that this is a reasonable position, however. I agree that many ad hominem attacks are invalid, I'm just not convinced that they all are.
For example, if somebody attempts to build a logical argument, with explicit premises and explicit conclusions, then I agree that attempting to dismiss such arguments by attacking the integrity (etc.) of the person making the argument is usually the wrong thing to do. You should deal with their argument, or admit that you haven't yet thought enough about it to give their reasoning the well-conceptualized critique it deserves.
However, most arguments aren't all that clear or logical. In fact, most "arguments" we hear in the media are little more than assertions, with words like "because" sprinkled in for persuasive effect. I think its acceptable to use ad hominems to dismiss such arguments. If, for example, an untrustworthy character says that we should invest more in roads because the benefits of building more roads exceed the costs, I think a useful and valid counterargument is to list times when that person has been intentionally dishonest, in order to cast (valid) doubt on their premise that the costs will exceed the benefits.
As a general rule, I think that filtering messages by the perceived integrity of the speaker is quite useful.
My questions are twofold.
Q0. What are the usual arguments against ad hominems, and how broad is their scope? That is to say, in what situations do they attempt to establish that ad hominems are an invalid form of rebuttal?
Q1. Have any philosophers argued that ad hominems are sometimes valid rebuttals, and if so, under what circumstances are they valid according to said philosophers?