You Are Here: Products & Services > Articles > SpamAssassin and Evolution

Using SpamAssassin with Ximian Evolution

by Frank Rietta, 5/24/2003


E-mail has become essential to me, even more important then my telephone. Hardly a day passes in which I do not exchange e-mail with numerous colleagues, customers, friends, and family. However, working with e-mail has become increasingly difficult as the volume of junk e-mail I receive has increased exponentially. For every legitimate piece of mail, I receive ten spams – and I am, frankly, fed up.


I have had very good experiences with SpamAssassin and Razor (Windows users should really take a look at www.cloudmark.com, which uses the Razor network). I use Ximian Evolution, an Outlook-like program, to read e-mail on my laptop, which is running Red Hat Linux. It is fairly easy to get Evolution to filter incoming messages through SpamAssassin and automatically move the offending junk mails to a special “Spam” folder, which can periodically be reviewed for any trapped legitimate mail.


Other authors have written about using SpamAssassin on a mail server or passing messages through procmail when working with other mail clients. Some links are included at the end of this article.

Outline:

  1. Prerequisites

  2. Creating a Spam Filter Rule in Ximian Evolution

  3. Performance Issues

  4. Brief Overview of Installing SpamAssassin and Razor

  5. Other Sources of Information

  6. About the Author



Prerequisites:

Creating a Spam Filter Rule in Ximian Evolution

Overview

Create a filter in Evolution to pipe the message content to “spamassassin -e > /dev/null” and move it to a spam folder if the return value is greater than 0. You will want to add a “Stop processing” action after the move action in the filter rules. Be sure to move the new spam rule to the top of the rule list.

Step-by-Step Instructions

  1. Create a Spam Folder

  2. Go to Tools->Filters

  3. Under Filter Rules, choose the “Add” button.

  4. In the Add Rule dialog:

    1. Under the Criterion, “IF,” frame.

      1. Choose a rule name, I chose “spam”

      2. Choose “Pipe Message to Shell Command” from the condition drop down list.

      3. In the command text box put: “ spamassassin -e > /dev/null”

      4. Select “returns greater than” from the return drop down list.

      5. Set 0 to the number box.

    2. Under the Action, “THEN,” frame.

      1. Choose the Move action and set the destination to your new spam folder.

      2. Click the “Add Criterion” button.

      3. Choose “Stop processing” from the new action list.

  1. Finally, Move the new Spam rule to the top of the filter list. Ximian Evolution processes filter rules sequentially.


Frame1

Performance Issues

Heuristic checking is computationally expensive, which means it takes a lot of processor cycles to complete. No matter how fast your computer is, adding spam filtering will slow down your mail download significantly. However, depending on the volume of mail you receive, adding the filtering will significantly reduce the headaches of dealing with the junk mail.


If you are running the “spamd” daemon from SpamAssassin, you can use “spamc” in the filter settings instead of “spamassassin.” This may speed things up slightly as it keeps from loading a new instance of Perl each time a message needs to be checked.


It has been suggested that placing the spam rule somewhere other than the top of the list may help improve performance for some configurations. Infinite Ink's Mail Filtering FAQ can be found at http://www.ii.com/internet/robots and may be helpful.


Periodically reviewing the spam folder for legitimate mail trapped by the spam filter is a good idea. When using the latest editions of SpamAssassin/Razor, I have had very few false positives.

Installing SpamAssassin

SpamAssassin is available for download as source, from the Perl CPAN repository, and even from an RPM package provided by Red Hat.

Installing from CPAN

I have always installed SpamAssassin from CPAN. Simply run the following commands at root.


perl -MCPAN -e shell

o conf prerequisites_policy ask

install Mail::SpamAssassin

quit

Installing the RPM

If you want to simply install the RPM from Red Hat 8, choose SpamAssassin from the mail server options on the CDROM or run the up2date command to download and install:


up2date spamassassin

Read the SpamAssassin Documentation

Read up on SpamAssassin at www.spamassassin.org. It is a very nice program with quite a few features.

Razor

Razor, also known as SpamNet, is a peer-to-peer spam filtering network. Unlike SpamAssassin, which runs a set of rules against the message, Razor compares the message to those which other human reviewers have deemed spam. Using Razor will add additional delays to the message scanning, but will also improve the accuracy of the filtering process.


Razor can be downloaded from http://razor.sourceforge.net.

Other Sources of Information

About the Author

Frank Rietta has been working with Linux for more than three years. He is a developer member of the Association for Shareware Professionals and has served as the President of the Georgia Tech Student Chapter of the Association for Computing Machinery (ACM). Frank is the owner of Rietta Solutions/Atlanta Web Host.