MailScanner/SA Rules

Matt Kettler mkettler at evi-inc.com
Mon Nov 20 19:00:39 GMT 2006


Jim Coates wrote:
> Ok - I'm a little confused here.
> 
> I was changing some scoring around for the RBL rules and searched through
> the list here to discover something:
> 
> I have been using a local.cf to set up custom rules.  They seem to work just
> fine.  Then I went to edit the RBL scores and noticed that changing them in
> local.cf didn't seem to do anything (yes - I restarted).  I started checking
> through the list and came across some postings that state that you shouldn't
> have a local.cf if you are using MailScanner, but you should instead be
> using the spam.assassin.prefs.conf

That's bad advice. In fact, from a SA perspective, you can't have rules in this
file, only rescore and other non-administrative options.

That said, in modern versions of mailscanner, spam.assassin.prefs.conf is
symlinked to mailscanner.cf, so it gets parsed the same as local.cf.


I'd check around and set your site rules directory in MailScanner.conf instead.

> 
> The messages said that it states this in the prefs file, but for some reason
> mine didn't - which is why I didn't change how I was doing it.
> 
> So I have a few questions...
> 
> 1) Should I add everything I currently have in my local.cf to my
> spam.assassin.prefs.conf and rename/remove the local.cf?

No. Technically, this file should be a replacement for user_prefs, although as
said above, it's now equivalent to local.cf due to symlinks.

> 2) Why were custom rules working, but not RBL score changes from the
> local.cf?

That seems very odd, I'd expect all or nothing. Unless a parse error is causing
half the file to be ignored.

Try running spamassassin --lint. It should run and exit quietly.

> 3) My rules from Rules Du Jour still get dropped into
> /usr/local/etc/mail/spamassassin, where the local.cf currently exists...
> will they function properly from there and can therefore be left alone, or
> should they be moved elsewhere, too?

Note: check to make sure /etc/mail/spamassassin doesn't exist. If it does, the
/usr/local one will be ignored unless SA is explicitly told to use it.

(SA by default does a search for reasonable equivalents to
/etc/mail/spamassassin, and it uses the first one it finds)




More information about the MailScanner mailing list