This is all pretty standard however I have modified the MailCleaner engine (MailScanner) to deliver spam messages un-modified (no subject tagging) without quarantining a copy of message.
The reason for this is we insert a header to detected spams that an Exchange 2003 event sink picks up and moves the message to the users Spam folder server side. (il write up a howto on this and provide the sink we use at a later date)
This works well for us, however it leaves no copy of the message in our MailCleaner quarantine, so bayes training has to be done another way.
This is where Public Folders and IMAP come in.
If a user find a false-positive in his/her local Spam folder, they simply drag it into the Ham Public Folder. Likewise with undetected spam, they can drag the message into the Spam Public Folder.
Using a small perl script, we are able to remotely connect to our Exchange servers over the internet using the imap connector and fetch emails from Public Folders, sending spam and ham to SpamAssassin's sa-learn to be trained.
The original imap-sa-learn.pl was created by Nick Burch, you can find more of his work at http://www.gagravarr.org/code/
I have slightly modified his script to work with MailCleaner and is available at http://waix.blue-ferret.com.au/mailcleaner/imap-sa-learn.pl
Before you can use it however, you must install perl module Mail::IMAPClient using CPAN.
Start off by entering the CPAN shell
Code: Select all
mailcleaner:~# perl -MCPAN -eshell
Are you ready for manual configuration? [yes]
The only thing you have to do here is set your location so perl knows which mirror to use. You can pretty much use the defaults to all other questions asked, and dont worry that it cant find ncftpget.
Once CPAN is configured, tell it to fetch and install the module we need
Code: Select all
cpan> install Mail::IMAPClient
It will go and fetch the file, unpack and start compiling it.
Say no to extended tests and everything should be fine.
exit the CPAN shell and download the imap script making sure to edit the file and change configuration options $username, $password, $server, $defspamfolder and $defhamfolder to suit your needs.
We run the script hourly via crontab, to do this put it in /etc/cron.hourly/ and make sure its +x