I’ve not been posting much techie blog stuff recently. I’ll try to rectify the situation, starting with this entry.

My Gnome mail client, Evolution, uses Spamassassin as a junk mail filter. In my experience, with remote checks disabled, it is completely retarded. It seems to detect 0% of spam.
I rigged up Evolution to use Bogofilter instead (hey, Eric S. Raymond wrote it!). The result is a considerable jump in detected spams, and getting better with each new training.

Evolution isn’t really designed to use anything but Spamassassin as the junk mail filter, which I find odd. Especially considering how effective bogofilter is for me compared to it. I worked out a hack to get it going.

Here are the details. I’m using Evolution 2.40 and the menu layouts were recently re-designed so things might be in different places in older versions. The same functionality is there though, just beyond different clicks. I assume you have bogofilter installed.

Turn off junk mail checking: untick Edit->Preferences->Mail Preferences->Junk->Check incoming mail for junk

Add a new message filter rule, call it “bogofilter check”. Move it to the top of the rule list. This will check incoming mail for spam using bogofilter and set the status to Junk. Make it look like this:
evolution screen shot


Add another filter rule, call it “bogofilter teach spam”. Move it to the top of the rule list (above the last rule). This rule will detect when you’ve manually marked a spam as Junk, and have bogofilter re-learn it. Make it look like this:
evolution screen shot


The set up is now done. The process of training bogofilter has one extra step than when using Spamassassin. When you mark an undetected spam as Junk it is moved to the Junk folder. You now need to find and select the message in the Junk folder and manually “Apply Filters” (Message->Apply Filters) (or Cntrl+Y). This is the hacky bit.

If Evolution let us specify message filter rules to be applied to messages when their status is changed this wouldn’t be so much of a hack but it doesn’t, so it is. If Evolution could selectably support Bogofilter as well as Spamassassin”internally” this would be even better. For now, this works for me.

Another disadvantage of this is the inability to have Bogofilter “unlearn” a false positive. To teach Bogofilter that a message it previously thought spam should be known as non-spam, you’d have to save the message out as a file and manually pipe it into “bogofilter -N”

It’s late and I’m very tired. These instructions may well be a figment of my sleep deprived geek imagination. Handle with care.

UPDATED: The screen shot for the “bogofilter check” rule should have “/usr/bin/bogofilter -u”