[lug] SpamAssassin Configuration

Jeff Schroeder jeff at neobox.net
Wed Apr 9 13:35:02 MDT 2003


Shannon wrote:

> I've got it up and running on my system and it's catching all my
> spam, but now it's spamming me with messages that "This might be
> spam". I would like to delete the messages or at least re-direct them
> into another mailbox.

It's not clear from your message if you're trying to handle the spam on 
the server end or the client; obviously it can be done either way.

Basically, you need to process each incoming message through the 
SpamAssassin program, which will add the appropriate headers and/or 
subject line and/or message content to the e-mail.  All of this is 
configurable in the file you mentioned; I personally just add header 
information and leave the subject/body alone.  More on this in a 
moment.

I do all my spam-handling on the client, because there's always a danger 
that you'll get a false positive and miss something meaningful (like 
friends typing FREE MONEY somewhere in their message... heh).  In my 
mail program, I have a filter that searches messages for "X-Spam-Flag: 
Yes", which is what SpamAssassin will write if it thinks the message is 
spam.  The filter simply directs the message into my Spam folder, 
although it could just as easily delete it.  Then I can quickly page 
through my collected spam for the day and see if anything has been 
wrongly accused.

I mentioned "processing each incoming message", and that can be done 
either server-side or client-side.  To do it on a server running qmail, 
you'll need to compile qmail with the QMAILQUEUE patch and pipe all 
incoming messages through SpamAssassin.  To do it on the client, you'll 
need a mail program that's capable of sending incoming mail through a 
program.  I use KMail (plug: KMail is awesome) and created a filter 
whose action is "pipe through /usr/local/bin/spamc", which runs 
SpamAssassin and inserts the appropriate markers in the message.  Then 
a second filter does what I described above: check for the 
X-Spam-Status flag and do something about it.

All in all, I've been very impressed with SpamAssassin.  It seems to 
catch almost everything, although (as you've discovered) configuring it 
can be tricky.  As with much open-source software, there are quite a 
few different ways to do it-- all depending on your setup and your 
personal preferences.

HTH,
Jeff



More information about the LUG mailing list