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.

  1. Install SpamAssassin:
    $ sudo apt-get install spamassassin
    
  2. Enable the running of spamd:
    $ sudo sed -i 's/^ENABLED=.*/ENABLED=1/g' /etc/default/spamassassin ...

Get Linux Networking Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.