I had kind of the same issue with my SME server and Spamassassin. I filter email for most of my family through SME and Spamassassin but it was getting kind of irritating that the recipients still received the junk even though it was tagged with ****SPAM.
So I made a few adjustments to the server and the individual useraccounts, so that when Spamassassin detects spammail the spammail is sent to a specific mailaccount and NOT delivered to the intended recipient. This allows me (as BOFH) to scan incoming junk and decide whether a non-spam mail has been tagged incorrectly. Every non-spam mail is delivered normally.
This server-side filtering is done like this:
In a users homedir there is a file named .qmail. This file basically determines what happens when new mail arrives for the account. With SA installed it probably contains something like "ifspamh ..... ./Maildir".
The .qmail file should instead contain this line:
|/usr/bin/procmail ~/.procmailrc
This line tells SME that when new mail arrives, put it through procmail using a local .procmailrc file that determines what should happen. In the users homedir create a file named .procmailrc. You could also copy the template supplied with SA, I did that and modified it to my needs. My generic .procmailrc looks like this:
# SpamAssassin sample procmailrc
#
# Pipe the mail through spamassassin (replace 'spamassassin' with 'spamc'
# if you use the spamc/spamd combination)
# The condition line ensures that only messages smaller than 250 kB
# (250 * 1024 = 256000 bytes) are processed by SpamAssassin. Most spam
# isn't bigger than a few k and working with big messages can bring
# SpamAssassin to its knees.
:0fw
* < 256000
| spamassassin
# Mails with a score of 15 or higher are almost certainly spam (with 0.05%
# false positives according to rules/STATISTICS.txt). Let's put them in a
# different mbox. (This one is optional.)
#:0:
#* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
#almost-certainly-spam
:0
* ^X-Spam-Status: Yes
{
:0:spam.lock
! spam@mydomain.com
}
:0 w # pass along all other mail
./Maildir/
# Work around procmail bug: any output on stderr will cause the "F" in "From"
# to be dropped. This will re-add it.
:0 H
* ! ^From[ ]
* ^rom[ ]
{
LOG="*** Dropped F off From_ header! Fixing up. "
:0 fhw
| sed -e 's/^rom /From /'
}
Using the altered .qmail together with the above .procmailrc does what I was looking for - removing tagged spammail from a users mailqueue and forward it to another account. Of course you could send tagged spammail directly into /dev/null but I figure thats kind of hazardous...
I hope this can help you, if you need clarification don't hesitate to contact me...
Regards,
Thomas Kristensen