Spam filter training using IMAP

Doran L. Barton fozz at
Wed Aug 2 19:18:18 MDT 2006

Shane Hathaway wrote:
> I have a small mail server used by about a dozen family members.  I'd
> like to set up a bayesian spam filter on the server and make it easy for
> users to train their personal filters.  For a long while, I've wondered
> how to make the training easy, but today it finally hit me: just have
> the users put spam in a designated IMAP folder and "ham" in a different
> folder.  Then re-train at night if the users have changed the ham or
> spam folders during the day.
> Before I go off and do this, has anyone else tried the same thing?  Was
> it effective and easy to use?

Yes, it works great. We use it on a LOT of servers. Another nice thing is
you can configure Thunderbird to send junk it detects (that SpamAssassin
doesn't catch) into that folder for nightly training.

Here's the nightly script we wrote to do this:


for USER in `ls /home`
    #look for a spam-mail file in $USER's mail directory
    if [ -f /home/$USER/mail/spam-mail ]
        echo "Checking spam for $USER ..."
        su $USER -c "sa-learn --spam --mbox /home/$USER/mail/spam-mail"
        cp /dev/null /home/$USER/mail/spam-mail

fozz at is Doran L. Barton, president/CTO, Iodynamics LLC
Iodynamics: IT and Web services by Linux/Open Source specialists
 "Please leave your values at the front desk."
    -- Seen in a Paris hotel elevator

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 251 bytes
Desc: OpenPGP digital signature
Url : 

More information about the PLUG mailing list