After some research and adaptation I came up with personal spam filter using bogofilter and spamassassin with Evolution.
Disclaimer:
I just compiled and adapted what others have written about filtering spam, I included the reference web site at the endo of this post.
I assumed you use standard installation so every directory will be as standard. Customise to your own situation
Make backup -- I can't strees this enough, proper backup have saved me many times.
Background:
I used Faculty of IT at UTS procmail spam filtering at server side. However since I will leaving soon I better "train" my laptop some spam filtering
Ok here is my spec
Dell Inspiron 5100 laptop wiht P4 2.8 GHz, 512 Mb RAM, 32 MB ATI 7500, 30 GB HDD
Ubuntu Breezy 5.10, Evolution 2.4.1, Spamassassin 3.0.4-2, Bogofilter 0.95-2
I used everything standard in Breezy (either cd or repo)
First install spamassassin and bogofilter if you have not done so with whatever methods you like. This is what I did
sudo apt-get install spamassassin bogofilter
After installation
First step enable Junk mail filter in Evolution
Edit->Preferences->Mail Preferences->Junk->Check incoming mail for junk and remote test
Second create two message filters in Evolution to utilise bogofilter
The first filter is to teach bogofilter to recognise spam email (either from marked automatically or manually by user).
Give the rule any name mine is Bogofilter teach spam
Set Status is Junk ThenPipe to program /usr/bin/bogofilter -s + Stop Processing
It looks like this
The second filter is the actual bogofilter action which (hopefully) remove spam
Give the rule any name mine is Bogofilter check spam
Set Pipe to program /usr/bin/bogofilter -u Then Set Status Junk + Stop Processing
It looks like this
You can stop here if you satisfied with bogofilter alone.
Then you have to train bogofilter using the first message filter (that is why the bogofilter teach is in the first position).
I have a collection of spam (700+) in spam folder (under evolution) and I used this for training both spamassassin and bogofilter.
Every spam email will be marked Junk and moved to Evolution Junk folder. You can marked every spam email you received and then it will be moved to Junk folder. I marked all the email in my Spam folder as junk.
Then I moved to Junk folder and select all message. To train bogofilter you just need to apply filter
Message -> Apply Filters or Ctrl+Y
It took about 5 minutes for bogofilter to learn 700+ spam email
You also can train bogofilter to identify spam and non spam (ham) using this command in CLI
bogofilter -s < /home/user/.evolution/mail/local/spam for spam message
bogofilter -n </home/user/.evolution/mail/local/Inbox for nonspam message and replace Inbox with whatever non spam folder you have in evolution
REMEMBER your non spam folder have to be free from spam. (thx dcstar for your comment).
If you want to add another layer to that (using spamassassin) then here it is
First generate the spamassassin configuration using this website if you like me (a.k.a.lazy)
http://www.yrex.com/spam/spamconfig.php
Then create a third message filter (after the first two for bogofilter above)
Give the rule any name mine is Spamassassin 1
Set Pipe to program spamassassin -e Does not return 0 Then Move to Folder Junk/Spam + Set Status Read + Stop Processing
It looks like this
Again you have to train your spamassassin. I used (again) the spam folder I collected.
To train spamassassin use this command in CLI
sa-learn --spam --mbox /home/user/.evolution/mail/local/spam
The other feature of spamassassin is you could also teach them to recognise non spam (ham) as in bogofilter. I use this command in CLI
sa-learn --ham --mbox /home/user/.evolution/mail/local/Inbox
Replace Inbox with whatever non spam mail folder in Evolution.
After the three filters then you can create any filter to sort your email to any folder you like.
All incoming mail will be filtered by those 3 filters before any other filters.
I still train both my bogofilter and spamassassin, but the number of spam I received and appeared in Inbox have been reduced considerably. For illustration I received about 500-750 emails per day.
Regards
Samiaji
Reference
Bogofilter
http://bogofilter.sourceforge.net/
SpamAssassin
http://spamassassin.apache.org/
Using bogofilter in evolution
http://johnleach.co.uk/words/archives/2005/09/15/180/
Spamassassin in evolution
http://software.newsforge.com/softwa....shtml?tid=130
Spamassassin configuration generator
http://www.yrex.com/spam/spamconfig.php
Bookmarks