[PLUG] spamassassin won't assassinate

Steve Bonds 1s7k8uhcd001 at sneakemail.com
Fri Aug 22 11:47:01 UTC 2003


On 22 Aug 2003, Mike De La Mater mikedela-at-theplatinumrule.com |PDX Linux| wrote:

> On Mon, 2003-08-11 at 11:40, Steve Bonds wrote:
> > Here's a sample .procmailrc for calling spamassassin directly:
> > 
> > -----
> > LOGFILE=/home/myuser/procmail.log
> > VERBOSE=yes
> > :0fw: spamassassin
> > | /home/myuser/bin/spamassassin.sh 2>/home/myuser/procmail-SA-errors.log
> > :0e
> > {
> >         EXITCODE=$?
> > }
> > 
> > :0:
> > * ^X-Spam-Status: Yes
> > /home/myuser/mail/sa-caught
> > -----
> > 
> I'm working up to all you suggested. I don't understand the procmailrc.
> is there one of theses per user, or do I need to put a variable in the
> place where you put "myuser"?

There is one .procmailrc per user, and "myuser" would be your username,
assuming that you use /home/<username>/bin as the location for the example
spamassassin.sh script mentioned in my earlier E-mail.

/home/<username>/mail/sa-caught is a mailbox in my Pine "mail" directory
that gets all the spam.  This gets reviewed and cleaned out periodically
so I don't have to worry about mail being accidently lost.  Your spam-box
location is likely to be different, depending on where your mail client
stores its mailboxes.

The one piece that was missing from my E-mail is how to run procmail-- I
do that via a ".forward" file, but there are other methods.  (See the
procmail docs for details if you want.)  My ".forward" file is:

"|exec /usr/local/bin/procmail || exit 75"

The quotes are included in the file.  This runs procmail, which reads the
.procmailrc file and runs the shell script in that file which runs
spamassassin.  Spamassassin forwards the mail right back to myself after
it has set the X-Spam-Status header appropriately and procmail runs
again.  This time if the X-Spam-Status header is "Yes" procmail files the
mail into "sa-caught", and if not, it delivers it normally to my inbox.

It's a bit convoluted, but it works.  Most of the time.  ;-)

This is all set up per user.  There may be a way to set it up globally,
but I haven't needed to do that.

  -- Steve





More information about the PLUG mailing list