[ale] procmail setup

David S. Jackson dsj at dsj.net
Thu May 14 10:05:01 EDT 1998


On Wed, 13 May 1998, nlucent wrote:

> Does anyone know of any software that makes it a little easier to setup
> procmail recipes?

It's pretty easy to get set up without the dotfile generator.  What
distribution are you using?  

It's probably already set up, and you just have to write your first 
.procmailrc, which I'm sure we can help with.  If you're using 
RHL, for example, all you need is a .procmailrc in your home
directory.  Here's a sample:

==============<begin snip>====================================

#Set to 'on' when debugging
VERBOSE=on                      #set to 'off' when debugged

PATH=/bin:/usr/bin:/usr/sbin
MAILDIR=/home/dsj/mail		#this is pine's mailbox
PMDIR=$HOME/procmail
LOGFILE=$PMDIR/log

#Some common resources
SENDMAIL=/usr/sbin/sendmail
FORMAIL=/usr/bin/formail


# Create a backup
:0 c
backup

# Try not to lose any mail!
:0 ic
| cd backup && rm -f dummy `ls -t msg.* | sed -e 1,32d`

# Send my cron list results to my Admin folder
:0
* ^From:.*root at sylvester
/home/dsj/inbox/Admin

# Catch any duplicate mail from any mailing lists

:0 Wh: msgid.lock
| formail -D 8192 msgid.cache

# Now, on to the mailing lists...

:0
* ^Resent-From: procmail at informatik.rwth-aachen.de
/home/dsj/inbox/Procmail

:0
* ^Sender: owner-ale at cc.gatech.edu
$HOME/inbox/ALE

:0
* ^Sender:.*bugtraq
$HOME/inbox/BugTraQ

# This will burst digests . . . 
:0:
* ^To: afterstep-digest at eosys.com
| formail +1 -ds >>~/inbox/AfterStep


# Here's a terrific anti-spam package called JunkFilter:

#JunkFilter comes in! (see http://www.pobox.com/~gsutter/junkfilter)
JFDIR=$PMDIR/junkfilter		#Junkfilter's home directory
INCLUDERC=$JFDIR/junkfilter	#launches the junkfilter suite

#Here's what to do with the Junkfilter catch
:0
* JFEXP ?? .
$HOME/inbox/spam

==============<end snip>=====================

Now, you still need to do the following:

1. Create a 'procmail' directory in your home directory.  Just call it
procmail (same as $PMDIR).  This will be where your log file and any 
other files, such as junk filter, go.  Read your logfile for debugging
purposes.

2. You need to create someplace where your incoming mail can be put
into folders.  My example above shows a directory called 'inbox' in my
home directory.  You can create the folders from within Pine, which I
see you're using.

3. The above example shows that I subscribe to the procmail, ale,
bugtraq and afterstep mailing lists, so these have folders procmail
will deliver to.  These are just samples (I actually subscribe to many
more mailing lists).

You'll notice that each recipe has three basic parts:  The beginning
of a recipe starts with :0 (and sometimes other stuff, see man
procmailrc), the second part is the condition, usually starting with a
'*', and the final part has either the folder path or invokes another
program to deliver or process the mail.  This is the 'action' part of
the recipe.

This is an oversimplified explanation, but it's enough to get you
started.  Take a look at
http://www.helsinki.fi/~reriksso/procmail/mini-faq.html for some more
pointers.  Also, man pages for the following have lots of information
in them:  procmail, procmailrc, procmailex, and procmailsc.

--
David S. Jackson                           http://www.dsj.net
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
"An obstinate man does not hold opinions--they hold him."
                         --Samuel Butler






More information about the Ale mailing list