[sclug] Procmail and others!!

Keith Edmunds keith at midnighthax.com
Sat Oct 25 09:05:49 UTC 2003


On 20 Jul 2003 20:26:48 +0100
Scott Rixon <scott at green-flag.com> wrote:

> I have started looking at Spamassassin. It starts to talk about
> editing your procmail.rc file.. But I don't have one! What calls/looks
> at the procmail file?
> 
> I guess fetchmail downloads the mail.. To /var/spool/username. Then
> sendmail?? sends it to my mailbox?

fetchmail, by default, delivers mail to the local system's SMTP port,
port 25. It can be set up to deliver to some other MDA (Mail Delivery
Agent). One MDA is Procmail, which can filter mail based on various
hearders, so for example it can filter mail into different folders
depending on the subject or sender. Procmail is controlled with a
.promailrc file, and one option is to send all mails to SpamAssassin for
processing before delivering them to a mailbox. I used to use this in my
.procmailrc file:

==================================
# 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
| spamassassin

# All mail tagged as spam (eg. with a score higher than the set
threshold)# is moved to "probably-spam".
:0:
* ^X-Spam-Status: Yes
._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/'
}
==================================

I hope that helps a little...

-- 
Keith Edmunds



More information about the Sclug mailing list