I have spamtrap@ and hamtrap@ addresses set up on my mail server and forward examples of spam to the spamtrap address. I was hoping that after a few examples, SpamAssassin would 'learn' to identify the particular characteristics of spammy mail with common attributes, but this doesn't appear to be the case - it still gets delivered as normal mail.

For example, some emails from the same sender and/ or with the same subject line, despite being sent several times to spamtrap@, are just delivered normally.

Does it sound like SpamAssassin isn't working or correctly configured, or have I misunderstood a fundamental aspect of how it works?

  • It is a misconfiguration. – mailq Nov 25 '11 at 22:02

Spamassassin uses a number of rules to decide if an email is blocked and creates a score of each email. This is normally included in the header of each email, so you can see which rules have trigged.

The Spamassassin training improves the Bayesian spam testing, so if the training is working you should see the following appear

X-Spam-Status: Yes/No, score=X.X required=5.0 tests=BAYES_99...... autolearn=no 

The BAYES_99 score means the email has spam probability is 99 to 100%, however you can get BAYES_00 to BAYES_99.

If you can't see the above line in any emails, then Spamassassin is not working.

On my Virtualmin setup i've changed to having a spam folder that i move emails to and then there is a daily job that runs the Spamassassing training and after 4 weeks deletes the email.

I currently setup the script for each user with the following:

/usr/bin/sa-learn -u <username> --spam /home/domain/homes/<user>/Maildir/.<folder name>/cur/  
/usr/bin/find /home/domain/homes/<user>/Maildir/.<folder name>/cur/ -mtime+28 -exec rm {} \;
  • 1
    But you are aware that you also have to train the Ham? Otherwise SpamAssassin leads to wrong results. – mailq Nov 28 '11 at 15:29
  • You don't really need to bother about Ham, as AWL and the auto learning does a very good job. 2 times an email has been identified as spam, one time the mail sender had a very strange setup, the other time Spamassassin was flagging any emails with a date after 01/01/2010 as spam which was quickly fixed. – AddersUK Nov 29 '11 at 11:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.