I have posted my spamlearn script for anyone to use. I tried to make it as useful as possible for cleaning up those things that amavis/spamassassin don’t cover, and made it as easy as possible to change to anyone’s needs.
The script will crawl through a set of user defined spam and ham IMAP-style Maildir folders, importing the new messages into the spamassassin database. It then gzips, renames, and moves the spam into the normal amavis quarantine. It logs everything it imports, and optionally generates an email to you to let you know what it has done. I recommend putting this in your cron.weekly.
If you use this, have a look through the top 30 or so lines and change the variables to suit you. Of particular note:
MAILDIR
Change this to the top level of your user’s Maildir format directory. This script assumes you are using IMAP compatible Maildirs.
SPAMDIRS and HAMDIRS
You can have as many of these as you like.
MAIL_REPORT
This will send out an email to $MAILTO with a report detailing which spam and ham have been imported into the database. But it will only send if spam was found. Just finding ham alone won’t trigger it.
LEARN_AS_USER
If you run spamassassin as a daemon with the defaults, leave this alone.
The rest should be pretty straightforward. Don’t forget to change the From address in MAILHEADER.
http://airwaterunix.org/spamlearn