Linux : SpamAssassin Bayes Filtering

This page last changed on Oct 30, 2016 by Kees de Kooter

Training the filter

I copied a load of ham and spam to the respective directories. Then I trained SA:

sa-learn --spam /var/spamassassin/spam &

sa-learn --ham /var/spamassassin/ham &

SA needs to have learned at least 200 ham and 200 spam messages to operate.

Checking the configuration

The bayes path prefix, that is the place where the token database is stored can be configures in /etc/mail/spamassassin/local.cf

bayes_path /var/spamassassin/bayes-db/bayes

Now the spamassassin daemon knows where to look.

Make sure the spamassassin user is able to read the database files.

See: https://spamassassin.apache.org/full/3.4.x/doc/sa-learn.html