[HanoiLUG] SpamAssassin issue
David Favro
hanoilug at meta-dynamic.com
Wed Jan 17 18:57:28 ICT 2007
My personal preference for small systems is to call it from the MDA (or
at least make the rejection there), where it can be mixed with
user-defined filtering rules, helping to avoid false positives, etc.
Also, spamassassin is slow, so you can avoid scanning some messages
because you can determine based on filtering rules that it is or isn't
spam without scanning.
I have only used procmail a little in the past, but Google helped me
find this set of instructions which I think will help you:
http://www-static.cc.gatech.edu/~hutch/otherinfo/procmail.html
However, they are using the yes-or-no in the X-Spam-Status field to
reject (or, in their case, move to a spam-folder), while you want to
make a criteria based on the numeric score.
One easy solution is to change your threshold in SpamAssassin to 10 and
use the yes-or-no X-Spam-Flag like them. Otherwise, change their
instructions in procmailrc to something like:
:0
* ^X-Spam-Status: Yes, score=\/([0-9\.]+)
* ? test $MATCH -gt 10
spam-folder
WARNING! UNTESTED! I don't usually use procmail, so I'm not sure if this
works and you might need to tweak it -- see the man-page of
procmailrc(5) and procmailex(5) and try test-messages first. Very bad
that must call an external program just to compare two numbers. If
someone on the list is more of a procmail-guy, perhaps can suggest a
better way.
If you want to completely abandon the email (I don't recommend) rather
than put in a spam-folder, use /dev/null rather than "spam-folder" (ack,
procmail is so bad, does anyone know of a less kludgy way to abandon?)
I personally don't like any mail delivery agents and haven't had time to
write one yet, but I currently use maildrop because I find it to be a
horrible piece of crap, but better than anything else. In fact, my
feeling is that the best MDA would just be bash, then your script can
create any rules that you want, but we need to supply it with a few
additional capabilities to make it easy to manipulate 822 messages.
Someday...
Finally, those instructions run spamassassin directly, which is fine to
get started, but you can speed it up a little by using the spamd/spamc
daemon and client (see man pages) -- but even so, it is still very slow.
Hope that helps!
-- David F.
Truong Anh Tuan wrote:
> It is a small mail system running Sendmail. Mail deliver agent is
> Procmail.
>
> Tuan
More information about the HanoiLUG
mailing list