2.1.4 Setting Up Procmail to Filter Mailing List Messages
Date: 18 Apr 1995 00:02:14 GMT
From: FAQ Editor <faq-editor@ii.com>
8a] Once you have successfully tested procmail in steps 6 and 7, create
rc.maillists for filtering incoming mailing-list messages into mail
folders.
cd
cd .procmail
pico rc.maillists
8b] In rc.maillists, create a recipe, like the two example recipes
below, for each of your mailing lists.
:0:
* ^TOwww-talk
IN.www-talk
:0:
* ^TOprocmail
IN.procmail
The first recipe filters the www-talk mailing list and the second
recipe filters the procmail mailing lists. The meaning of the first
recipe is as follows:
Notation Meaning
======== =======
:0 Begin a recipe
: Use a lock file
* Begin a condition
^TO Match ``To:'' ``Cc:'' or other synonyms for To at the
beginning of a line, followed by any or no characters,
followed by....
www-talk ``www-talk''
IN.www-talk If successful match, put in folder $MAILDIR/IN.www-talk
IMPORTANT NOTES
===============
* ^TO is not a normal regular expression; it is a special
procmail expression that is designed to catch any destination
specification. For details, see the MISCELLANEOUS section of
the procmailrc(5) man pages.
* Do not put a space between the caret (^) and the word `TO' in
`^TO'.
* Do not put a space between the `^TO' and the text that you are
matching on; it must be `^TOtext'.
* Both letters in `TO' must be capitalized.
9] Repeat steps 6 and 7 to make sure that things are still working.
10] Comment out the rc.testing line in you .procmailrc file so that it looks
like this:
VERBOSE=off
MAILDIR=$HOME/mail
PMDIR=$HOME/.procmail
LOGFILE=$PMDIR/log
# INCLUDERC=$PMDIR/rc.testing
INCLUDERC=$PMDIR/rc.maillists
NOTE: Leaving the rc.testing line in your .procmailrc file is
useful for future testing.
Parent document is top of "Filtering Mail FAQ"
Previous document is " 2.1.3 Testing"
Next document is " 2.2 Troubleshooting Procmail"