posted at: 4:29 pm on Mon 7th Aug 2006 , filed under: SysAdmin, programming, spam and all

Just by trial-n-error, I found out that the location of the .cf files for SpamAssassin is really dependent upon the install location of perl. I installed perl in a non-standard directory and used the CPAN module to install SpamAssassin.

For e.g.

perl is located in /export/perl

and then SpamAssassin is installed using

perl -MCPAN -e shell;
install Mail::SpamAssassin

Then all of your site-specific rules will be located in /export/perl/etc/mail/spamassassin, NOT in /etc/mail/spamassassin as a million other webpages make you think. It is also not true that /etc/mail/spamassassin files get read and appended. If you install perl in a non-standard location and install SpamAssassin as that perl module, from what I see, it WILL NOT consult /etc/mail/spamassassin AT ALL unless you specifically tell it to do so.

The README page on the SpamAssassin distribution tells you that much. However, some of the info seems to be incorrect as well. The file reads:

File Locations: 
	
~snip~
	
__prefix__    __def_rules_dir__              __local_rules_dir__
-------------------------------------------------------------------------
 /usr          /usr/share/spamassassin        /etc/mail/spamassassin
/usr/local    /usr/local/share/spamassassin  /etc/mail/spamassassin
/opt/$DIR     /opt/$DIR/share/spamassassin   /etc/opt/mail/spamassassin
$DIR          $DIR/share/spamassassin        $DIR/etc/mail/spamassassin

The 4th line does not look correct to me. If the prefix is /opt/$DIR, then the __def_rules_dir__  is correctly at /opt/$DIR/share/spamassassin BUT
 why should the __local_rules_dir be in /etc/opt/mail/spamassassin ? That does not look right. It should be /opt/$DIR/etc/mail/spamassassin. The line should be

  /opt/$DIR     /opt/$DIR/share/spamassassin   /opt/$DIR/etc/mail/spamassassin
Hopefully it did not trip you up too much.

Having done that, I can now head over to the rules emporiums to grab me some rules…

Technorati Tags: , , ,