2.1.2 Setting Up Procmail for Testing

Date: 18 Apr 1995 00:02:12 GMT
From: FAQ Editor <faq-editor@ii.com>

2a] Create ~/.procmailrc.  

     cd
     pico .procmailrc

    NOTE: Throughout this article I use pico for editing files.
          Replace `pico' with your editor.

2b] Enter a modified version of the following in your ~/.procmailrc.
    Note that lines that begin with # are comments and are ignored by
    procmail.

     #Set on when debugging
     VERBOSE=off
 
     #Replace `mail' with your mail directory (Pine uses mail, Elm uses Mail)
     MAILDIR=$HOME/mail
     
     #Directory for storing procmail log and rc files
     PMDIR=$HOME/.procmail
     
     LOGFILE=$PMDIR/log
     INCLUDERC=$PMDIR/rc.testing
     INCLUDERC=$PMDIR/rc.maillists

3] Create the directory where you will store your procmail log and rc files 
   (this is $PMDIR that you set above).

     cd
     mkdir .procmail


4a] Create an rc (run commands) file for testing:

     cd .procmail
     pico rc.testing


4b] Enter the following in ~/.procmail/rc.testing:

      :0:
      * ^Subject:.*test
      IN.testing

    Note that the first line contains a zero (0), not the letter "oh".
    For now, don't worry about the meaning of this recipe.  It is
    explained in 2.3 "Explanation of Test Recipe."


5a] Create a ~/.forward file by typing the following. (Pico's -w flag tells 
    pico not to auto wrap lines.)

     cd
     pico -w .forward



5b] Enter a modified version of the following in your ~/.forward:


     "|IFS=' ' && exec /usr/local/bin/procmail -f- || exit 75 #nancym"


    == IMPORTANT NOTES ==
    * Make sure you include all the quotes, both double (") and single (').
    * The vertical bar (|) is a pipe.
    * Replace /usr/local/bin with the correct path for procmail (see step 1).
    * Replace `nancym' with your userid.  You need to put your userid in 
      your .forward so that it will be different than any other .forward file 
      on your system.
   
    * Do NOT use ~ or environment variables, like $HOME, in your .forward
      file.  If procmail resides below your home directory write out the 
      *full* path.


5c] On many systems you need to make your .forward world 
    readable and your home directory world searchable in order for the
    mail transport agent to "see" it.  To do this type:
   
      cd
      chmod 644 .forward
      chmod a+x .

Parent document is top of "Filtering Mail FAQ"
Previous document is " 2.1.1 Is Procmail on Your System?"
Next document is " 2.1.3 Testing"