1 (edited by take 2010-09-15 21:11:15)

Topic: Custom spamassassin rules?


I tried to add an custom rule for our spamassassin, and for some reason I can't get the results I'm after. Maybe I'm doing something totally wrong? For test purposes I created an file /usr/share/spamassassin/50_customrules with content:
header   TIVI_SUBJ_TEST         Subject =~ /^tivispamtest/
score    TIVI_SUBJ_TEST         20
describe TIVI_SUBJ_TEST         Test rule

So, as far as I can understand, now if the post arrives with subject starting 'tivispamtest' the post should get 20 points (well over the spam -limit) and get treated accordingly. However only header even remotely related to this is: X-Virus-Scanned: Debian amavisd-new at mail.myhost.foo

The spam filter itself works, since if I send GTUBE test from the same account it's marked as spam just like it should, but this custom rule doesn't apply.

Any help is appreciated.


Re: Custom spamassassin rules?

Add your custom rules in /etc/mail/spamassassin/local.cf.


Re: Custom spamassassin rules?

ZhangHuangbin wrote:

Add your custom rules in /etc/mail/spamassassin/local.cf.

I did this, but that TIVI_SUBJ_TEST -rule doesn't still match. Is there some process which I should restart? I restarted amavis, but that didn't do much.


Re: Custom spamassassin rules?

Don't forget to run 'spamassassin --lint' after you add new rules. Try it.


Re: Custom spamassassin rules?

That's it. Thanks! 'spamassassin --lint' and restart for amavis and now my test filter works like it should:

X-Spam-Flag: YES
X-Spam-Score: 8.421
X-Spam-Level: ********
X-Spam-Status: Yes, score=8.421 tagged_above=2 required=6.31
    tests=[AWL=-8.980, BAYES_00=-2.599, TIVI_SUBJ_TEST=20]