[wplug] Fetchmail and Procmail

Kevin Squire gentgeen at linuxmail.org
Sun Mar 6 01:24:16 EST 2005


With special thanks to Brandon K. for his help, I have a (what seems to
be) working procmail config.  I also have a system wide fetchmail config
that I have been using for a long time now, so I know it works.  I
tested my procmailrc by running the script found at the bottom of the
procmail man page.  

Now I need to get the two working together. I thought it would be as
simple as changing the MDA line (as you can see by the commented line if
the rc file.) After change the MDA to procmail, I left it for about 4
hours, and it seemed to have lost all my mail for that time period.

The googleing I have done, mentions needing a ~/.forward file, but they
all seem to assume you are running fetchmail with the ~/.fetchmailrc,
not the system wide /etc/fetchmail.  Do I still need it with this setup?
What should be my MTA line, if any at all?

As a side note, I eventually want to make the procmailrc file system
wide, and any comments/suggestiong/warning/etc will be appricated.

Here are my two files:
------------------------
/etc/fetchmailrc
------------------------
set postmaster "kevin"
#set bouncemail
#set no spambounce
#set properties ""
# Polls servers every 5 minutes
set daemon 300
poll imap.linuxmail.org with proto POP3
       user 'gentgeen:linuxmail.org#linuxmail.org' there with 
       password 'XXXXXX' 
       is 'kevin' here 
#       mda '/usr/bin/procmail'
       mda '/usr/bin/spamc | /usr/bin/deliver %T'

poll mail.comcast.net with proto POP3
       user 'kvsquire at comcast.net' there with 
       password 'XXXXXX' 
       is 'val' here
       mda '/usr/bin/spamc | /usr/bin/deliver %T'
------------------------
/home/kevin/.procmailrc
------------------------
PATH=$HOME/bin:/usr/bin:/usr/ucb:/bin:/usr/local/bin:.
MAILDIR=$HOME/Mail      # You'd better make sure it exists
DEFAULT=$MAILDIR/mbox
LOGFILE=$MAILDIR/from
LOCKFILE=$HOME/.lockmail

:0f
| formail -A "Time-Received: `date`"

# Next set of lines for ClamAssassin - http://drivel.com/clamassassin/
:0fw
| /usr/local/bin/clamassassin

# 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
| /usr/bin/spamc

# If the message was actually skipped, we want to know
:0Ef
| formail -A "X-Spam-Skipped:  Yes =Message not tested by SpamAssassin="

# 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/'
}  

:0f
| formail -A "Time-Delivered: `date`"




More information about the wplug mailing list