Author: Thomas Cameron Date: Subject: recipe for spamassassin
The SA web site has really good docs on integrating SA with procmail.
Here is the relevant portion of my .procmailrc:
# 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.
#
# The lock file ensures that only 1 spamassassin invocation happens
# at 1 time, to keep the load down.
#
:0fw: spamassassin.lock
* < 256000 | spamc
# All mail tagged as spam (eg. with a score higher than the set
threshold)
# is moved to "spam".
:0:
* ^X-Spam-Status: Yes
mail/spam
# Work around procmail bug: any output on stderr will cause the "F" in
"From"
# to be dropped. This will re-add it.
:0
* ^^rom[ ]
{
LOG="*** Dropped F off From_ header! Fixing up. "
:0 fhw | sed -e '1s/^/F/' }
# End spam assassin
On Mon, 2003-07-07 at 15:48, Lynn David Newton wrote: > Greetings,
>
> Would someone kindly summarize in a few sentences how
> spamassassin does its work? I.e., I know *what* it does
> -- takes email input, and either judges it normal and
> elivers it, or dispatches it according to the rules,
> while keeping logs and all.
>
> More pertinently, what I don't know is: *how( does
> incoming mail get passed to spamassassin? I use
> fetchmail to POP my mail from Cox. I also have procmail
> running with a bunch of rules of its own. Where does
> spamassassin fit in there?
>
> Apparently it must do its job *before* procmail (or
> whatever one uses to make final delivery) gets ahold of
> it, right? My procmail filters mail according to a
> complex set of rules that includes some anti-spam rules
> (and which I could simplify with spamassassin working),
> and then handes it to one of seven spool files.
>
> I've seen I can take single email messages and run
>
> cat messagefile | spamassassin
>
> and get wonderful and interesting output.
>
> Does anyone have or can anyone point to an existing
> bullet list of steps to take to get spamassassin
> actually functioning on a system -- something short and
> simple, like step (a), step (b), step (c) ... and not
> much more.
>
> It exists on my system (version 2.44), and I have a
> directory ~/.spamassassin with a couple of generic
> files that were evidently copied in the first time I
> tried to execute it from a command line, namely
> auto-whitelist and user_prefs, obviously a local
> configuration file for the rules that apply.
>
> Maybe I've already done what's necessary? I'm just
> missing the vital piece of information about how to
> start the engine. :-)
>
> Thanks,