Filtering spam with SpamAssassin
SpamAssassin is a very popular tool, which uses a number of methodologies to identify spam messages and then either filter, tag or drop them. A few of the methods it uses includes Bayesian detection and the use of RBLs.
SpamAssassin can be configured globally by integrating directly with your mail server, or can be implemented on a per client basis through Procmail or integration with your mail client. Thunderbird from the Mozilla project, for example, integrates with SpamAssassin.
How to do it…
Let's look at how to integrate SpamAssassin
directly in with Postfix.
Install
SpamAssassin
:$ sudo apt-get install spamassassin
Enable the running of
spamd
:$ sudo sed -i 's/^ENABLED=.*/ENABLED=1/g' /etc/default/spamassassin
Start
spamd
:sudo service spamassassin start
Copy
SpamAssassin's
example filtering script to a more useful location:$ sudo cp /usr/share/doc/spamassassin/examples/filter.sh /usr/local/bin/spamfilter
Modify
/etc/postfix/master.cf
to add a content...