1. Installation and setup
This is how to setup SpamBayes on a Windows PC with an IMAP account and Mulberry (optionally).
-
Create four folders on your IMAP account called
- spam dump
-
for SpamBayes to dump spam into,
- spam for training
-
for spam that you will use to train SpamBayes to recognise spam
- possible spam
-
for messages that might be spam but SpamBayes is unsure about and
- ham for training
-
for a selection of messages that you have received which are not spam.
-
Collect spam! Copy spam messages from your inbox into spam for training folder for a day or so.
-
Place a copy of some good messages into the ham for training folder. [Note it is considered good practice to have roughly equal amounts of spam and ham for SpamBayes to train on.]
-
Install
Python.
-
Install
SpamBayes.
-
Create two batch files (on your desktop is as good as anywhere)
-
sb-web.bat
cd c:\python23\scripts c:\python sb_imapfilter.py -b exit
-
spamfilter.bat
cd c:\python23\scripts c:\python sb_imapfilter.py -c -t -v -l 10
-
Run sb-web.bat
-
Click on Configuration Page.
-
Click on the 'Configure folders to filter' link.
-
The first group is for you to select where SpamBayes should put messages that it is unsure about. Select the folder that you created earlier called possible spam.
-
The second group of folders is for you to select where to place spam that SpamBayes has detected. Select the folder called spam dump.
-
The final group allows you to choose multiple folders to filter. Normally all you need to do here is to select the INBOX.
-
Click on the 'Configure Folders to Train' link
-
In the first list select the folder created above called ham for training
-
In the second list select the folder called spam for training Scroll to the bottom of the page and click Save Training Folders and then return Home.
-
Scroll to the bottom of the Home page and click Save and Shutdown. That has finished configuring SpamBayes.
-
This will launch a web page which will be used to configure SpamBayes.
We are only concerned with the links at the top of the page.
-
You need only fill in the top three entries, server, username and password. [You can leave the paswword blank but you need to add -P to each line in the bat files that start with "c:\python..." to get prompted every time for your password.]
Scroll to the bottom of the page and click the Save button and then return Home.
-
This shows a list of folders (mailboxes in Mulberry-speak) in your mailbox three times.
-
This should be called 'Configure Folders to use to Train SpamBayes'. This time two lists of folders are presented.
2. Running SpamBayes
Do not do this until you have collected spam and ham for training. Otherwise, you will be disappointed by the results of SpamBayes.-
Start the spamfilter.bat file. This will do two things.
-
Train SpamBayes to recogise the differences between your good mail and your spam.
-
Classify the messages in your INBOX, move spam to the spam dump folder and move messages that it cannnot easily classify into good mail or spam into the possible spam folder.
-
This will happen every 10 minutes.
-
Use your e-mail client as normal. It seems best to turn off checking for e-mail on a regular basis. Just use the Check button every now and then.
-
Every now and then, sort the possible spam folder by moving messages that you can see are spam into the spam for training folder and the good ones into ham for training. You may also want to move the good ones back into your INBOX so that you can deal with them as ordinary messages.
-
You can look at the 'spam dump' folder to see if there are any good messages wrongly classified but after a couple of days you will trust SpamBayes not to do this. Delete and expunge messages in this folder. You can also remove messages from the training folders once SpamBayes has analysed them.
So that is all there is to it. Just be sure to run spamfilter.bat when you logon in the morning and leave it running. You'll not have to search through your INBOX for good messages ever again.
