With the release of Red Hat 9 I'm now using Evolution 1.2. With it's new filtering capabilities it can now be used as an effective client side SPAM filter. Here is a run through of how I set it up.The filters in Evolution 1.2 can run external scripts to filter the mail. I searched Google to see how people have used this, but didn't find much except for a few comments about it on the Ximian mailing list so I thought that I would write a mini howto.First thing is to decide what spam filter to use. Since Evolution takes any external program to filter mail you can use anything, you can even roll your own. I wasn't about to go into writing my own, I looked at the available solutions. There are two popular types of spam filtering, rules based like Spam Assassin and Baysian like Bogofilter.Rules based filters uses a table of rules that list words, phrases, and other entities in the e-mail each one has a score associated with it. When the mail is filtered if the sum of all the rules exceed a defined threshold then the mail is marked as spam.Baysian filters work on the premise that each word or entity can have a statistical value of how spammy the word is, words like 'viagra' and 'enlarge' no doubt should have a high spamisity, while words like 'Jeff' and 'Linux' should have a low spamisity. The filter looks at the statistical score of the entire e-mail to decide if it's spam or not.As you can see there are a few minor differences so far between the two, but this next part of the Baysian filter makes all the difference. It learns how to rate words based on the e-mail that you receive. You feed it a list of good mail and a list of spam. The more you feed it the better it knows your mail and the more accurate it becomes. You can check out the article A Plan for Spam by Paul Graham for more on Baysian filtering. I decided to go with Bogofilter since it reports say that it's more accureate than Spam Assassin. Installing Bogofilter on Red Hat 9 was a piece of cake. There is a RPM available on SourceForge. When I tried to install it I ran into a dependency problem it needed DB3 package, and apearently Shrike uses DB4, I haven't looked into the differences of the packages yet, and I didn't try recompiling Bogofilter, rather I installed the compat-db3 package. That did the trick so I didn't worry about it any further.After installing you need to feed it some spam and some good mail. In evolution I had 2 folders already that contained good mail and spam so I was able to simple import the 2 mail files directly.Feed it good mail:bogofilter -n < ~/evolution/local/Inbox/mboxFeed it the spam:bogofilter -s < ~/evolution/local/SPAM/mboxSetting up Evolution is rather simple. Bogofilter returns 0 on spam and 1 on good mail. So you can setup the rule accordingly.The next step is to be able to feed Bogofilter mail directly from evolution. When browsing the Evolution mailing list I noticed that in the criteria part of the filter if the first rule fails then the second rule isn't executed. In this case you can use the 'pipe to shell command' criteria as an action to feed bogo filter.The tricky part that I'm still trying to figure out the best way to activate the filter. Evolution doesn't have any actions or macros to that will manually launch a specific filter on a desired e-mail. I needed to find an option that would never be set on it's own, which I could set manually, and can be used as a criteria selection in Evolution. The one I came up with is the Label option, I set up the 'Later' label as the Spam and the 'To Do' label as the Non-Spam. The score may be another good trigger, but I didn't see a way to set the score except from a filter.I also wanted to start archiving all my spam so I wrote a quick and dirty shell script that registers the mail with bogo filter and saves the mail to an archive file.#!/bin/shfilepath="/home/user/mail_archive";if [ $1 = "-s" ]; then archivefile="spam.gz";else archivefile="good_mail.gz";fi email=$(cat -);echo $email | bogofilter $1echo $email | gzip -c - >> "$filepath/$archivefile"exit 0;Here is a screenshot of my feed spam filter:Setting up Spam filtering in evolution is not that complex of a subject, but if this writeup existed when I first tried to set this up it would of saved me some time. I can only hope that this saves somebody else time who is looking to set this up.