Taming spam with spamassassin and evolution

I’ve found the anti-spam support on Linux to be pretty poor overall. Considering how common this problem is and how ingenious OSS guys usually are, I’m a bit surprised.

I am trying to use Evolution with SpamAssassin, and finding horrible slowness and bugs in the bayes_* databases to be the norm.

If you are attempting this setup, I recommend the following hacks:

1. Do not use bayesian autolearning in spam assassin, as this is a broken way to update your spam filters.
2. Instead, create a JUNK and HAM directory in Evolution, and move your junk mails and ham mails there.
3. If you have already tagged mails as Junk using Evo’s “Mark as Junk” feature, you need to hack these mails out of that folder and move them into a regular Evolution folder. “Mark as Junk” is really not moving mail anywhere, but just “tagging” it, and then the Junk folder is like a vfolder which searches for all mail tagged as junk. This is cool, but sucks if you want to run sa-learn on your mbox in order to train spamassassin. The way to get around it is to create a mail filter in Evo which says: “if mail is marked as junk, then mark it as not junk AND move it it to folder named JUNK.” Then you apply the filter to your Junk directory and Evo will copy them out. (Note: if you try to merely “copy” the mail messages to another folder, they will simply not move — again, Junk is a “tag” in evo, not a location).
4. Now from the shell, go to .evolution/mail/local and find your mbox for your mail. You can use sa-learn –spam –progress –mbox to learn it as a spam, and change –spam to –ham for ham.

This is much better than using the built-in Evo stuff. Do this every few weeks until you don’t have to anymore.

Leave a Reply