Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z
faqs.org - Internet FAQ Archives

Filtering Mail FAQ
Section - 2.1.4 Setting Up Procmail to Filter Mailing List Messages

( Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Business Photos and Profiles ]


Top Document: Filtering Mail FAQ
Previous Document: 2.1.3 Testing
Next Document: 2.2 Troubleshooting Procmail
See reader questions & answers on this topic! - Help others by sharing your knowledge
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.

User Contributions:

Comment about this article, ask questions, or add new information about this topic:

CAPTCHA




Top Document: Filtering Mail FAQ
Previous Document: 2.1.3 Testing
Next Document: 2.2 Troubleshooting Procmail

Single Page

[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
FAQ Editor <faq-editor@ii.com>





Last Update March 27 2014 @ 02:11 PM