On Thu, 23 Dec 2004 19:06:04 -0800 (GMT-08:00) Loren Wilton <[EMAIL PROTECTED]> wrote:
> > I have been looking around to see if I could find documentation on > > how > to customize spamassassin tests. For instance I have a client who > would like to be able to block a certain subject. Just wondering if > this is possible with spamassassin, and where I can find out how to > get it done. > > First, Spamassassin is a score generator, it is not a mail router. > Thus, SA cannot, *in itself* "block" anything. What it *can* do is > assign a score to the mail based on characteristics of that mail, and > then *somethign else* that routes mail can use this score to block or > otherwise route the specific message. > > With the above in mind, yes, what you want is possible. Standard > disclamer: it might not be a good idea, unless the subject being > blocked is VERY specific, and consists of a sequence of at least three > or four words which are unlikely to occur in any other subject. > Otherwise you are likely to end up blocking a lot of stuff you didn't > intend to block. > > There are two main ways to customize SA rules. The most approved way > is to put your new or modified rules into local.cf. Rules here will > override the standard rules. These rules apply to all users. If you > need specific rules only per certain users, then you have to create > per-user rules in the user_prefs file for each user. You also have to > enable a flag someplace to enable local user rules. This method is > discouraged for a number of reasons. (You can look up per-user rules > in the wiki and find out both how to enable them and why you > shouldn't.) > > SA rules are moderately well documented here and there. They > basically consist of regular expressions applied to various parts of > the mail message. In your case, to the subject. If I wanted to tag > all mail that had a subject starting with "Fresh new porn!" I would > probably write three lines something like the following. (Note this > is off the top of my head and untested, so may not work!) > > header BAD_SUBJECT Subject =~ /^\s*(?:(?:Re|Fw|Fwd):\s*)?Fresh new > porn!?/i score BAD_SUBJECT 5 # REALLY HIGH SCORE! > describe BAD_SUBJECT Subject is one I don't like! > > Now, in fact I wouldn't write a test like that for my own use, because > it might hit things that it shouldn't. However, I have written > subject tests looking for very specific and unlikely patterns that I > expect only in spam; in fact I wrote one of those just last week. > However, I give them lower scores, so that I need a few other rules > hitting before the message is declared to be spam. > > Loren > > Hello Loren, Thanks a bunch. You cleared a few hazy spots up for me with the beginning info, and with the rest I now have a good Idea what I need to do. I appreciate the help. Thanks Again, Mosenior Moses 'Mo'