home *** CD-ROM | disk | FTP | other *** search
/ ftp.pasteur.org/FAQ/ / ftp-pasteur-org-FAQ.zip / FAQ / mail / filtering-faq < prev    next >
Encoding:
Internet Message Format  |  1996-10-17  |  48.8 KB

  1. Path: senator-bedfellow.mit.edu!bloom-beacon.mit.edu!eru.mt.luth.se!news.kth.se!newsfeed.sunet.se!news01.sunet.se!sunic!02-newsfeed.univie.ac.at!newsfeed.uk.ibm.net!arclight.uoregon.edu!feed1.news.erols.com!howland.erols.net!cs.utexas.edu!swrinde!nntp.primenet.com!news1.best.com!nntp1.best.com!shellx!ii
  2. From: FAQ Editor <faq-editor@ii.com>
  3. Newsgroups: comp.mail.misc,comp.mail.elm,comp.mail.mh,comp.mail.mush,comp.mail.pine,comp.mail.zmail,comp.answers,news.answers
  4. Subject: Filtering Mail FAQ
  5. Followup-To: comp.mail.misc
  6. Date: 4 Oct 1996 23:37:54 -0400
  7. Organization: Infinite Ink
  8. Lines: 1364
  9. Sender: ii@best.com
  10. Approved: news-answers-request@mit.edu
  11. Message-ID: <ii.844486542@shellx>
  12. Reply-To: FAQ Editor <faq-editor@ii.com>
  13. NNTP-Posting-Host: shellx.best.com
  14. X-Newsreader: NN version 6.5.0 #6 (NOV)
  15. Xref: senator-bedfellow.mit.edu comp.mail.misc:35371 comp.mail.elm:23304 comp.mail.mh:9308 comp.mail.mush:2574 comp.mail.pine:20995 comp.mail.zmail:1410 comp.answers:21568 news.answers:83562
  16.  
  17. Archive-name: mail/filtering-faq
  18. Posting-frequency: approximately monthly
  19. Last-modified: 4 October 1996
  20. Copyright: See section 7.0
  21. FAQ-launcher-URLs: http://www.jazzie.com/ii/faqs/archive/mail/filtering-faq/
  22.                    http://www.best.com/~ii/faqs/archive/mail/filtering-faq/
  23.  
  24.  All current hypertext versions of this FAQ are accessible through either
  25.  of the above two "FAQ Launcher" URLs.  If you want to link to this FAQ,
  26.  please link to these launchers rather than to only one version of the FAQ
  27.  (e.g., rather than linking to the version you are viewing right now!). 
  28.  This will give your users a choice of which version they access, e.g., a
  29.  single-file version or an index-plus-multiple-files version.  Also, please
  30.  give links to both mirrors of the launcher since sometimes one or the
  31.  other is down. 
  32.  
  33.  
  34.            _____________________________________________________
  35.   ________|                                                     |________
  36.   \       |                  FILTERING MAIL FAQ                 |       /
  37.    \      |    Copyright (c) 1994-96 Nancy McGough and others   |      /
  38.    /      |_____________________________________________________|      \
  39.   /___________)                                              (__________\
  40.  
  41.  
  42.   TABLE OF CONTENTS
  43.  
  44.   0.0 Preliminaries
  45.       0.1 Getting the Latest Version of this FAQ
  46.           0.1.1 Hypertext
  47.           0.1.2 Plain Text
  48.       0.2 Terminology
  49.       0.3 Notation
  50.   1.0 Mail Folder Strategies
  51.       1.1 Naming Incoming Mail Folders
  52.       1.2 Reading Incoming Mail Folders
  53.   2.0 Procmail
  54.       2.1 Setting Up Procmail
  55.           2.1.1 Is Procmail on Your System?
  56.           2.1.2 Setting Up Procmail for Testing
  57.           2.1.3 Testing
  58.           2.1.4 Setting Up Procmail to Filter Mailing List Messages
  59.       2.2 Troubleshooting Procmail
  60.           2.2.1 General Strategies
  61.           2.2.2 Alternate .forward files
  62.       2.3 Explanation of Test Recipe
  63.       2.4 Tracking Your Incoming Mail
  64.       2.5 Procmail References
  65.   3.0 Mailagent
  66.       3.1 Setting Up Mailagent
  67.       3.2 Tracking Your Incoming Mail
  68.       3.3 How Safe Mailagent Processing Is?
  69.       3.4 Locking Under Mailagent
  70.       3.5 Folder Types Supported
  71.       3.6 Mailagent References
  72.   4.0 Filter
  73.       4.1 Setting up Filter
  74.       4.2 Tracking Your Incoming Mail
  75.       4.3 Filter References
  76.   5.0 Mailer and Newsreader References
  77.   6.0 Contributors
  78.       6.1 Acknowledgements
  79.       6.2 Contributing to this FAQ
  80.   7.0 Copyright Notice
  81.  
  82. ----------------------------------------------------------------------
  83.  
  84. From: FAQ Editor <faq-editor@ii.com>
  85. Subject: 0.0 Preliminaries
  86.  
  87. Q: How can I have my incoming mailing-list messages automatically put
  88.    into appropriate folders?
  89.  
  90. This is one of the most frequently asked questions about email.  This
  91. FAQ provides basic instructions for Unix users to set up either
  92. procmail, mailagent, or elm's filter to filter incoming mailing-list
  93. messages.  If you have a choice, I recommend procmail which is
  94. powerful, robust, and is actively developed and supported.
  95.  
  96. All these mail processors can also be set up to filter other types of
  97. incoming messages, send automated replies, etc.  For instructions see
  98. the relevant references listed below.
  99.  
  100. ------------------------------
  101.  
  102. From: FAQ Editor <faq-editor@ii.com>
  103. Subject:     0.1 Getting the Latest Version of this FAQ
  104.  
  105. If this FAQ is over a couple months old, there may be an updated
  106. version.  Please get the latest hypertext or plain text version from
  107. one of the places listed below.
  108.  
  109. ------------------------------
  110.  
  111. From: FAQ Editor <faq-editor@ii.com>
  112. Subject:         0.1.1 Hypertext
  113.  
  114. The best way to read this FAQ (and most other FAQs too) is to view
  115. the hypertext version using a Web browser such as Cello, Lynx,
  116. Mosaic, Netscape Navigator, Microsoft Internet Explorer, OmniWeb, 
  117. SpiderWoman or WinWeb.  This will allow you to easily jump:
  118.    * between subjects in the FAQ
  119.    * to any Uniform Resource Locator (URL) in the FAQ
  120.    * to an Internet Request For Comments document (RFC)
  121.    * to some manual pages
  122.  
  123. This, and all FAQs that are crossposted to news.answers, are available at
  124. the following hypertext FAQ archives:
  125.  http://www.cs.ruu.nl/cgi-bin/faqwais/
  126.  http://www.lib.ox.ac.uk/search/search_faqs.html
  127.  http://www.smartpages.com/bngfaqs/top.html
  128.  
  129. All hypertext versions of this particular FAQ are accessible through
  130. either of these "FAQ Launcher" URLs:
  131.   http://www.jazzie.com/ii/faqs/archive/mail/filtering-faq/
  132.   http://www.best.com/~ii/faqs/archive/mail/filtering-faq/
  133.  
  134. ------------------------------
  135.  
  136. From: FAQ Editor <faq-editor@ii.com>
  137. Subject:         0.1.2 Plain Text
  138.  
  139. The plain text version is regularly posted to comp.mail.misc,
  140. comp.mail.elm, comp.mail.mh, comp.mail.mush, comp.mail.pine,
  141. comp.mail.zmail, comp.answers, and news.answers.  It's
  142. in digest format which means that you may be able to use your
  143. newsreader to easily move between digest items (e.g., nn uses G% to
  144. burst a digest and trn uses ^G to jump to the next digest item).
  145.  
  146. The plain text FAQ is also available through:
  147.  
  148. Anonymous FTP:
  149.  ftp://rtfm.mit.edu/pub/usenet/news.answers/mail/filtering-faq
  150.  
  151. Email:
  152.  Send mail to:
  153.     mail-server@rtfm.mit.edu 
  154.  
  155.  Containing the following in the body of the message:
  156.     send usenet/news.answers/mail/filtering-faq
  157.  
  158. UUCP:
  159.  uunet!/archive/usenet/news.answers/mail/filtering-faq
  160.  
  161. Hard Copy:
  162.  A printed version of this FAQ is in Chapter 25 of the book 
  163.  "Internet Secrets" by John R. Levine and Carol Baroudi; published 
  164.  1995 by IDG Books; ISBN 1-56884-452-2.
  165.  
  166. ------------------------------
  167.  
  168. From: FAQ Editor <faq-editor@ii.com>
  169. Subject:     0.2 Terminology
  170.  
  171.   Term               Meaning
  172.   ====               =======
  173.   mailer or MUA      Mail user agent such as pine or elm
  174.   pico               PIne COmposer - a user friendly editor
  175.   reader             Mailer, newsreader, or Web browser that can read 
  176.                      mail folders
  177.   regular expression Text that can include "wild cards" (such as . to
  178.                      match any single character); used for searching
  179.   ^x                 Press the Ctrl key and then, while holding down the 
  180.                      Ctrl key, press the x key
  181.   ~ or $HOME         Your home directory.  You can always get to your
  182.                      home directory by typing `cd'.
  183.  
  184. ------------------------------
  185.  
  186. From: FAQ Editor <faq-editor@ii.com>
  187. Subject:     0.3 Notation
  188.  
  189. Notation  Meaning
  190. ========  =======
  191. TextName  placeholder; replace with appropriate text
  192. <text>    placeholder; replace with appropriate text without the angle brackets
  193. `text'    text you type but without the quotes
  194. "text"    text you type including the double quotes
  195. 'text'    text you type including the single quotes
  196. [Key]     press the key, e.g., [Space], [Enter], or [Tab]
  197.  
  198. ------------------------------
  199.  
  200. From: FAQ Editor <faq-editor@ii.com>
  201. Subject: 1.0 Mail Folder Strategies
  202.  
  203. It is a good idea to come up with a system for naming and reading
  204. your mail folders.  With a good system, you will have an easier time
  205. managing the hundreds (or thousands!) of messages you will receive.
  206.  
  207. ------------------------------
  208.  
  209. From: FAQ Editor <faq-editor@ii.com>
  210. Subject:     1.1 Naming Incoming Mail Folders
  211.  
  212. For my incoming mail folders I use names that start with `IN'.  For
  213. example, I put mail sent to the procmail mailing list into a folder
  214. named IN.procmail.  This way when all my folders are listed
  215. alphabetically the incoming folders are together and near the top.
  216. They are near the top because Unix is case sensitive and upper case
  217. letters come before lower case letters in an ascii sort.
  218.  
  219. Of course, you can use any names you like for your mail folders!
  220.  
  221. ------------------------------
  222.  
  223. From: FAQ Editor <faq-editor@ii.com>
  224. Subject:     1.2 Reading Incoming Mail Folders
  225.  
  226. Here are some instructions for opening a mail folder that's in the
  227. default folder directory for some mailers and newsreaders.
  228.  
  229.          Default Folder  
  230.  Reader   Directory      Command line command  From within reader
  231.  ======  ==============  ====================  ==================
  232.  elm     ~/Mail          elm -f =folder        c =folder
  233.  pine    ~/mail          pine -if folder       G folder
  234.  mail    ~/mail          mail -f /path/folder
  235.  nn      ~/News          nn +folder            G +folder
  236.  
  237. (Please send me information for other mailers and newsreaders.)
  238.  
  239. Pine has an incoming-folder variable which you can use to list your
  240. incoming folders in a separate section of your folder list (to view
  241. your folder list in Pine, type `L').  Setting this variable also
  242. allows you to use the Tab key to step through all new messages in all
  243. your incoming folders.  For more information see the question "How
  244. can I filter messages into different incoming folders?" in the Pine
  245. FAQ:
  246.  
  247.   http://www.cac.washington.edu/pine/QandA/FAQs.html#xtocid178164
  248.  
  249.  
  250. IMPORTANT NOTE 
  251. ============== 
  252. If you are going to be editing your incoming mail folder, e.g.,
  253. deleting messages, then your filtering program and your folder reader
  254. should use locking schemes that work together.  Otherwise, if mail is
  255. delivered at the same time that you are deleting a message your
  256. folder may be corrupted.  To learn more about locking see the
  257. question "What is folder locking and how does it work?" in the Pine
  258. FAQ.  This is useful to read even if you don't use Pine as your
  259. mailer.
  260.  
  261.  http://www.cac.washington.edu/pine/QandA/sysadmins.html#xtocid7145
  262.  
  263. Most mailers, such as pine and elm, use lock a file named
  264. `folder.lock' to lock the folder named `folder'.  Note that nn does
  265. not lock folders so you probably don't want to use nn to delete
  266. messages in a folder that is receiving incoming messages.  (Please
  267. send me info about locking in other mailers and newsreaders.)
  268.  
  269. For more information about specific mailers and newsreaders, see the
  270. relevant documentation, such as man pages and Web pages.  Some
  271. pointers to documentation are listed in section 5.0.
  272.  
  273. ------------------------------
  274.  
  275. From: FAQ Editor <faq-editor@ii.com>
  276. Subject: 2.0 Procmail
  277.  
  278. Procmail is a powerful mail processor that can be used to process your
  279. mail messages either as they arrive or after they are in a mail folder.  
  280. To find out how to process an existing mail folder see the NOTES section
  281. of the procmail(1) man page.
  282.  
  283. ------------------------------
  284.  
  285. From: FAQ Editor <faq-editor@ii.com>
  286. Subject:     2.1 Setting Up Procmail
  287.  
  288. To set up and test procmail, follow the ten steps given in sections
  289. 2.1.1 through 2.1.4 below.
  290.  
  291. ------------------------------
  292.  
  293. From: FAQ Editor <faq-editor@ii.com>
  294. Subject:         2.1.1 Is Procmail on Your System?
  295.  
  296. 1]  To find out if procmail is on your system and what the full path to 
  297.     it is, type one of the following commands:
  298.  
  299.       Shell      Command
  300.       =====      =======
  301.       csh        which procmail
  302.       sh or ksh  type procmail
  303.       various    whereis procmail
  304.       various    where procmail
  305.  
  306.     Make a note of the full path to procmail because this is needed in
  307.     step 5b below.  You can find out the version by typing:
  308.  
  309.       procmail -v
  310.  
  311.    The latest released version, as of 15 April 1995, is 3.10.
  312.    Version 3.11 should be out soon.  If your system doesn't have
  313.    procmail or doesn't have the latest version, you may want to ask
  314.    your system administrator to install it.  The procmail package of
  315.    tools is at:
  316.  
  317.  ftp://ftp.informatik.rwth-aachen.de/pub/packages/procmail/procmail.tar.gz
  318.  
  319.    If your sys admin isn't able to do this, use a different mail
  320.    processor like mailagent (described in section 3 of this FAQ) or
  321.    filter (described in section 4).
  322.  
  323. ------------------------------
  324.  
  325. From: FAQ Editor <faq-editor@ii.com>
  326. Subject:         2.1.2 Setting Up Procmail for Testing
  327.  
  328. 2a] Create ~/.procmailrc.  
  329.  
  330.      cd
  331.      pico .procmailrc
  332.  
  333.     NOTE: Throughout this article I use pico for editing files.
  334.           Replace `pico' with your editor.
  335.  
  336. 2b] Enter a modified version of the following in your ~/.procmailrc.
  337.     Note that lines that begin with # are comments and are ignored by
  338.     procmail.
  339.  
  340.      #Set on when debugging
  341.      VERBOSE=off
  342.  
  343.      #Replace `mail' with your mail directory (Pine uses mail, Elm uses Mail)
  344.      MAILDIR=$HOME/mail
  345.      
  346.      #Directory for storing procmail log and rc files
  347.      PMDIR=$HOME/.procmail
  348.      
  349.      LOGFILE=$PMDIR/log
  350.      INCLUDERC=$PMDIR/rc.testing
  351.      INCLUDERC=$PMDIR/rc.maillists
  352.  
  353. 3] Create the directory where you will store your procmail log and rc files 
  354.    (this is $PMDIR that you set above).
  355.  
  356.      cd
  357.      mkdir .procmail
  358.  
  359.  
  360. 4a] Create an rc (run commands) file for testing:
  361.  
  362.      cd .procmail
  363.      pico rc.testing
  364.  
  365.  
  366. 4b] Enter the following in ~/.procmail/rc.testing:
  367.  
  368.       :0:
  369.       * ^Subject:.*test
  370.       IN.testing
  371.  
  372.     Note that the first line contains a zero (0), not the letter "oh".
  373.     For now, don't worry about the meaning of this recipe.  It is
  374.     explained in 2.3 "Explanation of Test Recipe."
  375.  
  376.  
  377. 5a] Create a ~/.forward file by typing the following. (Pico's -w flag tells 
  378.     pico not to auto wrap lines.)
  379.  
  380.      cd
  381.      pico -w .forward
  382.  
  383.  
  384.  
  385. 5b] Enter a modified version of the following in your ~/.forward:
  386.  
  387.  
  388.      "|IFS=' ' && exec /usr/local/bin/procmail -f- || exit 75 #nancym"
  389.  
  390.  
  391.     == IMPORTANT NOTES ==
  392.     * Make sure you include all the quotes, both double (") and single (').
  393.     * The vertical bar (|) is a pipe.
  394.     * Replace /usr/local/bin with the correct path for procmail (see step 1).
  395.     * Replace `nancym' with your userid.  You need to put your userid in 
  396.       your .forward so that it will be different than any other .forward file 
  397.       on your system.
  398.    
  399.     * Do NOT use ~ or environment variables, like $HOME, in your .forward
  400.       file.  If procmail resides below your home directory write out the 
  401.       *full* path.
  402.  
  403.  
  404. 5c] On many systems you need to make your .forward world 
  405.     readable and your home directory world searchable in order for the
  406.     mail transport agent to "see" it.  To do this type:
  407.    
  408.       cd
  409.       chmod 644 .forward
  410.       chmod a+x .
  411.  
  412. ------------------------------
  413.  
  414. From: FAQ Editor <faq-editor@ii.com>
  415. Subject:         2.1.3 Testing
  416.  
  417. 6] Send yourself two test messages: one with `test' in the subject
  418.    and one without `test' in the subject.
  419.  
  420.  
  421. 7] Start your mailer (pine, elm, etc.) and check that the messages
  422.    were delivered correctly.  The one with `test' in the subject
  423.    should be in the folder $MAILDIR/IN.testing and the one without 
  424.    `test' in the subject should be in your inbox.  
  425.  
  426.    If these were not delivered correctly, see section 2.2 on
  427.    "Troubleshooting Procmail" section below.
  428.  
  429. ------------------------------
  430.  
  431. From: FAQ Editor <faq-editor@ii.com>
  432. Subject:         2.1.4 Setting Up Procmail to Filter Mailing List Messages
  433.  
  434. 8a] Once you have successfully tested procmail in steps 6 and 7, create 
  435.      rc.maillists for filtering incoming mailing-list messages into mail 
  436.      folders.
  437.   
  438.       cd
  439.       cd .procmail
  440.       pico rc.maillists
  441.  
  442.  
  443. 8b] In rc.maillists, create a recipe, like the two example recipes
  444.     below, for each of your mailing lists.
  445.  
  446.      :0:
  447.      * ^TOwww-talk
  448.      IN.www-talk
  449.  
  450.      :0:
  451.      * ^TOprocmail
  452.      IN.procmail
  453.      
  454.      The first recipe filters the www-talk mailing list and the second 
  455.      recipe filters the procmail mailing lists.  The meaning of the first 
  456.      recipe is as follows:
  457.  
  458.      Notation      Meaning
  459.      ========      =======
  460.      :0            Begin a recipe
  461.        :           Use a lock file
  462.      *             Begin a condition 
  463.        ^TO         Match ``To:'' ``Cc:'' or other synonyms for To at the
  464.                    beginning of a line, followed by any or no characters,
  465.                    followed by....
  466.           www-talk  ``www-talk''
  467.      IN.www-talk   If successful match, put in folder $MAILDIR/IN.www-talk
  468.  
  469.   
  470.      IMPORTANT NOTES
  471.      ===============
  472.      * ^TO is not a normal regular expression; it is a special
  473.        procmail expression that is designed to catch any destination
  474.        specification.  For details, see the MISCELLANEOUS section of
  475.        the procmailrc(5) man pages.
  476.  
  477.      * Do not put a space between the caret (^) and the word `TO' in
  478.        `^TO'.
  479.  
  480.      * Do not put a space between the `^TO' and the text that you are
  481.        matching on; it must be `^TOtext'.
  482.  
  483.      * Both letters in `TO' must be capitalized.
  484.        
  485.  
  486. 9]  Repeat steps 6 and 7 to make sure that things are still working.
  487.  
  488.  
  489. 10]  Comment out the rc.testing line in you .procmailrc file so that it looks 
  490.      like this:
  491.           
  492.        VERBOSE=off
  493.        MAILDIR=$HOME/mail
  494.        PMDIR=$HOME/.procmail
  495.        LOGFILE=$PMDIR/log
  496.        # INCLUDERC=$PMDIR/rc.testing
  497.        INCLUDERC=$PMDIR/rc.maillists
  498.  
  499.      NOTE: Leaving the rc.testing line in your .procmailrc file is
  500.            useful for future testing.
  501.  
  502. ------------------------------
  503.  
  504. From: FAQ Editor <faq-editor@ii.com>
  505. Subject:     2.2 Troubleshooting Procmail
  506.  
  507. If messages are not delivered correctly, here are steps you can use to
  508. try to solve the problem.
  509.  
  510. ------------------------------
  511.  
  512. From: FAQ Editor <faq-editor@ii.com>
  513. Subject:         2.2.1 General Strategies
  514.  
  515. 1]    Look at your $LOGFILE (~/.procmail/log) to see if you can
  516.       determine what the problem is.
  517.  
  518. 2]    Check these three files for typos:
  519.         ~/.forward
  520.         ~/.procmailrc
  521.         ~/.procmail/rc.testing
  522.  
  523. 3]    Check the file and directory permissions of your .forward (set in 
  524.       5c in "Setting up Procmail for Testing" above).
  525.  
  526.       Type...          In order to...
  527.       -------          --------------
  528.       cd               Go to your home directory.
  529.       
  530.       ls -l .forward   Check the permission: it should say -rw-r--r--
  531.       
  532.       ls -ld .         Check permission of home dir: it should say drwx?-x?-x
  533.                        The ?'s may be r's or hyphens or one of each (i.e.,
  534.                        drwx--x--x, drwxr-xr-x, drwxr-x--x, drwx--xr-x are
  535.                        each acceptable.)
  536.       
  537.  
  538. 4]    If the above three steps do not locate the problem edit your 
  539.       ~/.procmailrc so that it contains:
  540.  
  541.         VERBOSE=on
  542.  
  543.       Test procmail by following steps 6 and 7 again.  Look at your
  544.       $LOGFILE (which will contain verbose messages) to see if you
  545.       can now determine what the problem is.
  546.  
  547.       If you are still having problems see the next section on
  548.       "Alternate .forward Files."  After you get procmail to work, 
  549.       you probably will want to set VERBOSE back to off.
  550.  
  551. ------------------------------
  552.  
  553. From: "Stephen R. van den Berg" <berg@pool.informatik.rwth-aachen.de>
  554. Subject:         2.2.2 Alternate .forward files
  555.  
  556. If the .forward template in 5b above doesn't work the following alternatives 
  557. might be helpful:
  558.  
  559. In a perfect world:
  560.     "|exec /usr/local/bin/procmail #nancym"
  561. In an almost perfect world:
  562.     "|exec /usr/local/bin/procmail USER=nancym"
  563. In another world:
  564.     "|IFS=' ';exec /usr/local/bin/procmail #nancym"
  565. In a different world:
  566.     "|IFS=' ';exec /usr/local/bin/procmail USER=nancym"
  567. In a smrsh world:
  568.     "|/usr/local/bin/procmail #nancym"
  569.  
  570. These formats can be tried in different combinations, the leading "| can
  571. be tried as |" instead, or vice versa.
  572.  
  573. NOTE
  574. ====
  575. If your system uses procmail as its local delivery agent, you do not
  576. need a .forward file; simply having a .procmailrc files suffices.  To
  577. find out if procmail is the local delivery agent, ask your system
  578. administrator.
  579.  
  580. ------------------------------
  581.  
  582. From: FAQ Editor <faq-editor@ii.com>
  583. Subject:     2.3 Explanation of Test Recipe
  584.  
  585. The recipe you used for testing is:
  586.  
  587. :0:
  588. * ^Subject:.*test
  589. IN.testing
  590.  
  591.  
  592. The meaning of this recipe is:
  593.  
  594. Notation            Meaning
  595. ========            =======
  596. :0                  Begin a recipe
  597.   :                 Use a lock file
  598. *                   Begin a condition 
  599.   ^                 Match the beginning of a line followed by....
  600.    Subject:         ``Subject:'' followed by....
  601.            .        any character (.) followed by....
  602.             *       0 or more of preceding character (any character in this 
  603.                        case) followed by....
  604.               test  ``test''
  605. IN.testing          If successful match, put in folder $MAILDIR/IN.testing
  606.  
  607. ------------------------------
  608.  
  609. From: FAQ Editor <faq-editor@ii.com>
  610. Subject:     2.4 Tracking Your Incoming Mail
  611.  
  612. You can use mailstat, a useful script that is part of the procmail
  613. package, to check your procmail log file. Check to see if it is 
  614. on your system by typing either `which mailstat' or `type mailstat'.  
  615. If it's on your system type:
  616.  
  617.   mailstat $HOME/.procmail/log
  618.  
  619. This displays a concise version of your log file and moves your log 
  620. file to log.old.  You may want to put the above line in your .login so that 
  621. each time you log in you will see a listing of how many messages you've
  622. received since the last time you ran mailstat, and what folders these
  623. messages were delivered to.
  624.  
  625. You can get a mailstat listing of log.old by using the -o flag:
  626.  
  627.   mailstat -o $HOME/.procmail/log
  628.  
  629.  
  630. If mailstat is not on your system ask your system administrator to
  631. install it.  The script is located with all the other procmail tools
  632. (see 2.1.1 above for the ftp location).
  633.  
  634. ------------------------------
  635.  
  636. From: FAQ Editor <faq-editor@ii.com>
  637. Subject:     2.5 Procmail References
  638.  
  639. Web Page: http://www.jazzie.com/ii/internet/procmail/
  640.           http://www.best.com/~ii/internet/procmail/ (mirror of above URL)
  641.  
  642. Man Pages:    procmail(1)   - autonomous mail processor
  643.               procmailrc(5) - procmail rc file
  644.               procmailex(5) - procmail rc file examples
  645.               procmailsc(5) - procmail weighted scoring techique
  646.               egrep(1)      - search file for regular expression (procmail 
  647.                               uses egrep-style regular exprssions along with 
  648.                               some of its own expressions like ^TO)
  649.               formail(1)    - mail reformatter
  650.               sendmail(8)   - send mail over the internet
  651.  
  652. Newsgroup:    comp.mail.misc
  653.  
  654. Mailing List: procmail@informatik.rwth-aachen.de
  655.            Subscribe to the procmail mailing list by sending mail:
  656.              To: procmail-request@informatik.rwth-aachen.de 
  657.              Subject: subscribe
  658.  
  659. Procmail Archives:
  660.            Get a list of files available at the procmail mail server by 
  661.            sending mail:
  662.              To: procmail-request@informatik.rwth-aachen.de 
  663.              Subject: archive ls
  664.  
  665.            Get Best of the Procmail mailing list by sending mail (you'll 
  666.            need gzip and a MIME-decoder to unpack it):
  667.              To: procmail-request@informatik.rwth-aachen.de 
  668.              Subject: archive get best_of_procmail_list*
  669.  
  670. ------------------------------
  671.  
  672. From: Raphael Manfredi <ram@hptnos02.grenoble.hp.com>
  673. Subject: 3.0 Mailagent
  674.  
  675. Mailagent is a powerful mail processing package that can be used to
  676. process your mail messages, either at arrival time via a .forward hook
  677. or later on while they are already saved in a mail folder.
  678.  
  679. Mailagent is written in Perl and hence has all the advantages of being
  680. interpreted, i.e. it is easy to enhance dynamically and to customize.
  681.  
  682. This version of the FAQ describes the basics of setting up mailagent to
  683. process incoming mail messages from within a .forward. To find out about
  684. the more advanced features of mailagent, please refer to the mailagent(1)
  685. manual page.
  686.  
  687. ------------------------------
  688.  
  689. From: Raphael Manfredi <ram@hptnos02.grenoble.hp.com>
  690. Subject:     3.1 Setting Up Mailagent
  691.  
  692. 1] First, make sure mailagent is available on your system. The easiest
  693.    way to do this is to run:
  694.  
  695.     mailagent -V
  696.  
  697.    which will print the mailagent version if it is available, or the shell
  698.    will issue an error message "mailagent: not found" or something like it.
  699.  
  700. 2a] Now you need to understand the MTA (Mail Transport Agent, the program
  701.     that delivers the mail; usually, sendmail) will NOT deliver to mailagent
  702.     directly, rather to an intermediate (small) filter program. Two versions
  703.     are available: shell or C -- refer to the mailagent(1) manpage to choose,
  704.     but I recommend you use the C version first, and move to the shell
  705.     version if you can't run a binary from your .forward file.
  706.  
  707. 2b] Locate the filter program (it will be filter or filter.sh depending on
  708.     whether you choose the C or the shell version respectively) under some
  709.     directory like /usr/local/lib/mailagent. From now on, we'll assume we
  710.     use the C filter and that it is located under /usr/local/lib/mailagent.
  711.  
  712. 3] Copy the file /usr/local/lib/mailagent/mailagent.cf as ~/.mailagent and
  713.    edit it to configure your system correctly. You will see two distinct
  714.    sections in that file and you need to set-up properly the first one, the
  715.    "Configuration section".
  716.  
  717.    If you have a version of mailagent that is recent enough (at least 3.0 PL32)
  718.    then you can create an initial configuration very easily and quickly by
  719.    running the following command:
  720.  
  721.     mailagent -I
  722.  
  723.    which will set-up an almost ready-to-use ~/.mailagent file. All you
  724.    need to do at this point is go through its configuration section
  725.    to make sure mailagent made the right choices...
  726.  
  727.    The minimal set of variables that MUST be correctly set (i.e. for which
  728.    you cannot rely on the default set in the file) are (# introduces comment
  729.    in a shell-like manner, which run up to the end of the line):
  730.  
  731.     home:  # Your HOME directory, as reported by "echo $HOME", usually.
  732.     path:  # Path to be used to locate mailagent and perl, at least.
  733.     p_xxx: # Path to be appended to "path" above when running on machine "xxx".
  734.     user:  # Your login name.
  735.     name:  # Your name.
  736.     level: # Logging level. I recommend you raise it to 20 for testing.
  737.  
  738.    The mail folder directory is ~/Mail by default, but it can be changed
  739.    only from within your rule file by putting
  740.  
  741.     maildir = ~/mail;
  742.  
  743.    at its top, for instance, to make it ~/mail. The rule file is defined as
  744.    the "rules" parameter, and is set to ~/.rules by default.
  745.  
  746. 4] Ensure the directories configured in your ~/.mailagent under "logdir" and
  747.    "spool" and "queue" do exist. If you use the standard setting, this
  748.    requires the following commands:
  749.  
  750.     cd
  751.     mkdir var
  752.     cd var
  753.     mkdir log mailagent
  754.     cd mailagent
  755.     mkdir queue
  756.  
  757. 5a] Create a rule file (named ~/.rules by default) for testing:
  758.  
  759.     cd
  760.     vi .rules
  761.  
  762. 5b] Enter the following in ~/.rules
  763.  
  764.     Subject: /test/     { SAVE testing };
  765.  
  766.     The meaning of that rule should be pretty obvious: If we receive a mail
  767.     whose subject line contains the word "test", then we save that mail in
  768.     a folder named "testing", under the default folder directory (~/Mail).
  769.  
  770. 5c] Create a ~/.forward file as follows:
  771.  
  772.     "|exec /usr/local/lib/mailagent/filter >> /export/home/ram/.bak 2>&1"
  773.  
  774.     The meaning of that line is the following: every mail should be piped
  775.     (hence the leading "|" character) onto the filter program, and any
  776.     output from that program (i.e. errors) are appended to some file in
  777.     your home directory, with stderr following stdout (2>&1) in traditional
  778.     sh syntax.
  779.  
  780.     == IMPORTANT NOTES ==
  781.     * Your .forward is always processed by sh, regardless of your login shell.
  782.     * Replace /export/home/ram with your proper login directory full path.
  783.       That's a part that makes your .forward unique (for zealous optimizing
  784.       sendmail that are dead wrong about optimizing!) and that can save
  785.       you a lot of trouble if anything goes wrong! Just look at your ~/.bak!
  786.     * Replace /usr/local/lib/mailagent/filter with the proper filter path
  787.       on your machine.
  788.  
  789. 5d] Note that on many systems, you need to ensure your .forward will be
  790.     readable by everybody, and that your home directory has the "x" bit set
  791.     for everybody (i.e. can be part of a lookup path) so that sendmail can see
  792.     and parse your .forward file. To ensure this, type:
  793.  
  794.         cd
  795.         chmod a+r .forward
  796.         chmod a+x .
  797.  
  798. 6] Send yourself two test messages: one with "test" in the subject, and one
  799.    without "test" in the subject.
  800.  
  801. 7a] Checkout your ~/.bak file: it should be empty!
  802.  
  803. 7b] Checkout your ~/var/log/agentlog file to see what really happened to your
  804.     messages. Watch out for any ERROR or WARNING logs. This assumes you have
  805.     left at least the default logging level (9) in the ~/.mailagent file (the
  806.     "level" variable). But for testing, that level should be raised to 20 to
  807.     help you diagnose what's going on.
  808.  
  809. 7c] Look out in ~/Mail/testing. You should find there the message whose Subject
  810.     line contained the word "test". Then make sure the other message has been
  811.     delivered to your regular mailbox. (Since no match occurred in your rule
  812.     file, the mail is left in your mailbox by default).
  813.  
  814. 7d] TROUBLESHOOTING
  815.     * If your mail was not properly delivered, please make sure your rule file
  816.       and configuration file are correct by issuing the following command:
  817.  
  818.         mailagent -d
  819.  
  820.     * If the previous command does not output the single rule you should have
  821.       put in ~/.rules, then please make sure step 3 and 4 above were correctly
  822.       performed (those being the crucial steps ensuring a proper configuration).
  823.     
  824.     * Check the ~/.bak file for error messages.
  825.  
  826.     * Check for typos in any of these files:
  827.         ~/.forward
  828.         ~/.mailagent
  829.         ~/.rules
  830.     
  831.     * Check the file and directory permissions of your .forward (set in step
  832.       5c above).
  833.  
  834.       Type...          In order to...
  835.       -------          --------------
  836.       cd               Go to your home directory.
  837.       
  838.       ls -l .forward   Check the permission: it should say -rw-r--r--
  839.       
  840.       ls -ld .         Check permission of home dir: it should say drwx?-x?-x
  841.                        The ?'s may be r's or hyphens or one of each (i.e.,
  842.                        drwx--x--x, drwxr-xr-x, drwxr-x--x, drwx--xr-x).
  843.       
  844.     * If none of the previous hints helped you identify problem, and you can't
  845.       figure it out from the output in ~/.bak or in the ~/var/log/agentlog file
  846.       (or whatever file you have configured for logging within your ~/.mailagent
  847.       file, variables "log" and "logdir"), then make sure your mail is not
  848.       waiting in the MTA's queue: this might be the case if the agentlog file
  849.       is empty. If you are using sendmail as MTA, you can run:
  850.  
  851.         /usr/lib/sendmail -bp
  852.     
  853.       to print out the queue.
  854.     
  855.     * As a last resort, please look at the mailagent(1) manual page under
  856.       the section "Testing Your Installation" for more tips and things
  857.       to look at.
  858.  
  859. 8] Once you have successfully tested mailagent in steps 6 and 7 above,
  860.    you're on! Mailagent is ready to process your mail. All you have to
  861.    do is extend the ~/.rules file to add more rules.
  862.  
  863.    For instance:
  864.  
  865.    To Cc: www-talk      { SAVE www-talk };
  866.    To Cc: agent-users   { SAVE agent-users };
  867.  
  868.    Those two rules filter the two mailing lists www-talk and agent-users into
  869.    their respective folders, whether the mailing list address appear in the To
  870.    OR Cc header.
  871.  
  872.    Since rules are not qualified as a pattern match (contrary to our test
  873.    above), they match on logins in the address, i.e. they will match things
  874.    like www-talk@chip.com or chip!www-talk, or a plain simple www-talk if
  875.    this is a local alias. (This implicit matching on logins works only for
  876.    some selectors like To, Cc or From which are know to contain addresses).
  877.  
  878.    If you wish to sort on patterns appearing in the Subject of messages for
  879.    instance, then you must use a pattern matching syntax, as in:
  880.  
  881.    Subject: /star trek/ { SAVE star-trek; };
  882.  
  883.    to save in a folder "star-trek" all the messages whose subject contains
  884.    the words "star trek". Case matters, but keep on reading...
  885.  
  886. 9] As an advanced topic, since mailagent is written in Perl, you have all the
  887.    power of Perl's regular expressions at your disposal. Which means you can
  888.    write things like this:
  889.  
  890.    To Cc: agent-users                    { REJECT AGENT };
  891.    <AGENT> Subject: /^\w*subscribe/i     { DELETE };
  892.    <AGENT> *                             { UNIQUE -a; SAVE agent };
  893.  
  894.    The second lines makes use of that perl extended regular expression syntax:
  895.    \w matches an alphanumeric character plus "_", while the trailing "i" option
  896.    requests a case-insensitive match.
  897.  
  898.    You also note you have a real automaton at your disposal. You can enter
  899.    a special state (AGENT in our example) and continue parsing by only
  900.    scanning for rules tagged by this mode. The first match stops the automaton,
  901.    unless you REJECT to continue processing. When not restricted by a mode list,
  902.    a rule is always taken into account. For example, assuming the automaton
  903.    is in the state "NEWS", it will not consider rules tagged <AGENT>, as in
  904.    the above example. The automaton begins in mode "INITIAL".
  905.  
  906.    The "UNIQUE -a" action followed by a SAVE ensures only one copy per
  907.    Message-ID will ever end-up in your agent folder -- no duplicates!
  908.    Also note you can have more than one action per rule, and that the last
  909.    one uses '*' to match anything, i.e. its action part between {} will
  910.    always be executed in AGENT mode, when reached by the automaton.
  911.  
  912.    Also, since in Perl regular expression syntax, \b matches a word-boundary
  913.    and \s any space or tab character, we can write our Star Trek message
  914.    sorting into a much more robust form:
  915.  
  916.    Subject: /\bstar\s+trek\b/i  { SAVE star-trek; };
  917.  
  918.    (\s+ matches one or more white spaces, while \s* would match zero or more,
  919.    see the Perl manual page for a complete description of regular expressions.)
  920.  
  921.    which will match on various subject strings like "Last Star Trek season"
  922.    or "I am addicted to Star trek", but not on "Tristar treks" -- whatever
  923.    that means :-)
  924.  
  925.    All in all, the filtering automaton syntax is pretty much intuitive and
  926.    easy to read. You have to learn which actions are possible and what they
  927.    mean, naturally.
  928.  
  929. ------------------------------
  930.  
  931. From: Raphael Manfredi <ram@hptnos02.grenoble.hp.com>
  932. Subject:     3.2 Tracking Your Incoming Mail
  933.  
  934. If you are curious about what mailagent does to your mail, you have two
  935. options:
  936.  
  937.     * Look at your "agentlog" file, with a log level set to 9.
  938.     * Get a summary of all the actions performed by running:
  939.  
  940.         mailagent -summary
  941.  
  942.       This last option is only possible if you have initialized the statistics
  943.       gathering process by creating a ~/var/mailagent/mailagent.st file (under
  944.       the default setting from ~/.mailagent).
  945.  
  946.       You will get a clear picture of your processing, by seeing which rule
  947.       match, how often, in which state, etc... You will also know how many
  948.       times you SAVE or DELETE messages for instance.
  949.  
  950.       Actually, mailagent statistics are triggered by a simple
  951.  
  952.         mailagent -s
  953.     
  954.       command, the letters given after in the {u,m,a,r,y} set being options
  955.       that alter the output given by the command.
  956.  
  957.     * Look at the ~/.bak occasionally to make sure no error is pending...
  958.  
  959. ------------------------------
  960.  
  961. From: Raphael Manfredi <ram@hptnos02.grenoble.hp.com>
  962. Subject:     3.3 How Safe Mailagent Processing Is?
  963.  
  964. As soon as the filter program has taken a hold on your message, you can rest
  965. assured the mail will get filtered one way or the other. If filter can't
  966. queue your mail, it will exit with an exit status of 75, that status
  967. being recognized by "sendmail" as a "deliver later on" hint, in which case
  968. the mail message will safely wait in sendmail's queue.
  969.  
  970. So if filter gets your message, it immediately forks and exits with a 0
  971. status for sendmail, letting it know its work is finished and releasing it
  972. to save resources. It then calls mailagent on the queued message (in mailagent's
  973. private queue) to actually process the message.
  974.  
  975. Only after successful processing will mailagent delete the queued message.
  976. Hence, under an heavily loaded system, the worst that could happen would be
  977. a duplicate processing of a message, or a bounce back when sendmail cannot
  978. fork and exec the filter program from your .forward.
  979.  
  980. Under catastrophic conditions, filter or mailagent will simply dump the message
  981. on stdout, for ~/.bak to catch, preceded by the reason why processing was
  982. aborted.
  983.  
  984. ------------------------------
  985.  
  986. From: Raphael Manfredi <ram@hptnos02.grenoble.hp.com>
  987. Subject:     3.4 Locking Under Mailagent
  988.  
  989. By default, mailagent proceeds with a fixed locking scheme (.lock extension)
  990. plus flock() if asked to do so at Configure time. However, mailagent provides
  991. support for NFS-secure locks and also can use non-standard locking procedures,
  992. configurable from within ~/.mailagent (variables "nfslock" and "mboxlock").
  993.  
  994. However, it cannot support locking on a rule basis (yet!). The author is
  995. willing to raise the priority of that item if one comes up with a legitimate
  996. need for that feature that could not be worked-around by a PERL escape. ;-)
  997.  
  998. ------------------------------
  999.  
  1000. From: Raphael Manfredi <ram@hptnos02.grenoble.hp.com>
  1001. Subject:     3.5 Folder Types Supported
  1002.  
  1003. Mailagent can deliver mail to plain UNIX folders (also known as "mbox format"),
  1004. to MMDF folders, to MH folders (with unseen sequence update built-in and using
  1005. locks, not like rcvstore which does not!) or to directories (ala MH, but
  1006. without unseen sequence support and with alternate naming possible).
  1007.  
  1008. It also supports delivery to folders with the "x" bit set, in which case
  1009. mailagent interprets those as being hooks. It either pipes the message
  1010. to the "program" or further interprets the hook to do more processing.
  1011. See the manual page mailagent(1) under the section "MAIL HOOKS" for more
  1012. details.
  1013.  
  1014. ------------------------------
  1015.  
  1016. From: Raphael Manfredi <ram@hptnos02.grenoble.hp.com>
  1017. Subject:     3.6 Mailagent References
  1018.  
  1019. Man Pages   mailagent(1) - reference manual page (about 47 pages troff'ed).
  1020.             perl(1)      - reference manual for Perl
  1021.             sendmail(8)  - send mail over the Internet
  1022.  
  1023. Examples:   agent/examples/rules - a commented rule file sample, from the
  1024.                                    distribution source tree.
  1025.  
  1026. Newsgroup: comp.mail.misc
  1027.  
  1028. Mailing List: agent-users@foretune.co.jp
  1029.  
  1030.     Subscribe to the list by sending mail:
  1031.  
  1032.       To: majordomo@foretune.co.jp
  1033.       subscribe agent-users
  1034.     
  1035. Mailagent archives:
  1036.  
  1037.     ftp://ftp.foretune.co.jp/pub/network/mail/mailagent
  1038.  
  1039.     EMAIL: Send mail to the author's mailagent:
  1040.     
  1041.       To: ram@hptnos02.grenoble.hp.com
  1042.       Subject: Command
  1043.       @SH maildist - mailagent -
  1044.  
  1045. ------------------------------
  1046.  
  1047. From: FAQ Editor <faq-editor@ii.com>
  1048. Subject: 4.0 Filter
  1049.  
  1050. Filter is part of the Elm package of tools.  Note that you can use filter
  1051. to filter your incoming mail even if you are not using Elm to read your mail.
  1052.  
  1053. IMPORTANT NOTE
  1054. ==============
  1055. If your system has both procmail and filter installed then you should use 
  1056. procmail which is *much* more robust and powerful than filter.  This 
  1057. recommendation is almost universal; even the developers of Elm and Filter
  1058. recommend procmail over filter.  IT IS POSSIBLE TO LOSE MAIL MESSAGES
  1059. WHEN USING FILTER; this is rare but it has happened.
  1060.  
  1061. ------------------------------
  1062.  
  1063. From: FAQ Editor <faq-editor@ii.com>
  1064. Subject:     4.1 Setting up Filter
  1065. Followup-To: comp.mail.elm
  1066.  
  1067. 1] Find out if filter is on your system and what the full path to it is.  
  1068.    If you are using the C shell (csh) type:
  1069.  
  1070.      which filter
  1071.  
  1072.    Or, if you are using the Korn shell (ksh) or the Bourne shell (sh) type:
  1073.  
  1074.      type filter
  1075.  
  1076.    If neither ``which'' nor ``type'' are on your system try ``where'' and
  1077.    ``whereis''.  If your system doesn't have filter ask your system 
  1078.    administrator to install it; or even better ask her to install procmail.
  1079.  
  1080.  
  1081. 2] Note the full path of your home directory by typing:
  1082.  
  1083.      cd
  1084.      pwd
  1085.  
  1086.  
  1087. 3a] Create ~/.elm/filter-rules.  (Note that throughout this article I use
  1088.     pico for editing files.  Replace ``pico'' with your editor.)
  1089.  
  1090.      cd
  1091.      mkdir .elm
  1092.      cd .elm
  1093.      pico filter-rules
  1094.  
  1095.   
  1096. 3b] Enter a modified version of the following in your ~/.elm/filter-rules
  1097.  
  1098.      if (subject contains "test") then save "/j/nancym/Mail/IN.testing"
  1099.    
  1100.    Replace /j/nancym with your home directory path (see step 2).
  1101.    Replace /Mail with the name of the directory where your mail folders are
  1102.    stored.  Pine and Berkeley Mail use /mail (lower case m) and Elm uses 
  1103.    /Mail (upper case M).
  1104.    
  1105.  
  1106. 4] To see what the filter rule will do type the following at your Unix 
  1107.    prompt:  
  1108.  
  1109.      filter -r
  1110.  
  1111.  
  1112. 5a] Create a ~/.forward file by typing the following. (Pico's -w flag tells 
  1113.     pico not to auto wrap lines.)
  1114.  
  1115.       cd
  1116.       pico -w .forward
  1117.  
  1118.  
  1119. 5b] Enter a modified version of the following in your ~/.forward:
  1120.  
  1121.  
  1122.      "|/usr/local/bin/filter -o /j/nancym/.elm/filter-errors"
  1123.  
  1124.  
  1125.     == IMPORTANT NOTES ==
  1126.     * Make sure you include the quotes (").
  1127.     * The vertical bar (|) is a pipe.
  1128.     * Replace /usr/local/bin with the correct path for filter (see step 1).
  1129.     * Replace /j/nancym with your home directory (see step 2).
  1130.    
  1131.     * Do NOT expect environment variables, like $HOME, to work in your 
  1132.       .forward file.
  1133.     * Do NOT expect ~ to mean your home directory in the .forward file.
  1134.  
  1135.  
  1136. 5c] Note that on many systems you need to make your .forward is world 
  1137.     readable and your home directory world searchable in order for the
  1138.     mail transport agent to "see" it.  To do this type:
  1139.    
  1140.       cd
  1141.       chmod 644 .forward
  1142.       chmod a+x .
  1143.  
  1144.  
  1145. 6] Send yourself two test messages: one with ``test'' in the subject
  1146.    and one without ``test'' in the subject.
  1147.  
  1148.  
  1149. 7a] Start your mailer (pine, elm, etc.) and check that the messages
  1150.     were delivered correctly.  The one with ``test'' in the subject
  1151.     should be in the folder IN.testing and the one without ``test'' 
  1152.     in the subject should be in your inbox.  If these were delivered 
  1153.     correctly go on to step 8.
  1154.  
  1155.  
  1156. 7b] TROUBLESHOOTING
  1157.     * If the two messages were not delivered correctly look at your
  1158.       ~/.elm/filter-errors to see if you can determine what the problem 
  1159.       is.  
  1160.  
  1161.     * Check these two files for typos:
  1162.         ~/.forward
  1163.         ~/.elm/filter-rules
  1164.  
  1165.     * Check the file and directory permissions of your .forward (set in 
  1166.       5c above).
  1167.  
  1168.       Type...          In order to...
  1169.       -------          --------------
  1170.       cd               Go to your home directory.
  1171.       
  1172.       ls -l .forward   Check the permission: it should say -rw-r--r--
  1173.       
  1174.       ls -ld .         Check permission of home dir: it should say drwx?-x?-x
  1175.                        The ?'s may be r's or hyphens or one of each (i.e.,
  1176.                        drwx--x--x, drwxr-xr-x, drwxr-x--x, drwx--xr-x).
  1177.       
  1178.  
  1179.     * If none of these turn up the problem edit your ~/.forward so
  1180.       that filter will be verbose with it's output (use the -vo flag).
  1181.  
  1182.         "|/usr/local/bin/filter -vo /j/nancym/.elm/filter-errors"
  1183.  
  1184.       And repeat steps 6 and 7.  After you get filter to work you 
  1185.       will probably want to change the ``-vo'' flag back to ``-o''.
  1186.  
  1187.    
  1188. 8]  After you have successfully tested filter in steps 6 and 7, edit
  1189.     ~/.elm/filter-rules so that it contains a modified version of the
  1190.     following:
  1191.  
  1192.      # if (subject contains "test") then save "/j/nancym/Mail/IN.testing"
  1193.      if (to contains "www-talk") then save "/j/nancym/Mail/IN.www-talk"
  1194.      if (to contains "hopos-l") then save "/j/nancym/Mail/IN.hopos"
  1195.  
  1196.      Replace /j/nancym with your home directory path and
  1197.      /Mail with the name of your mail directory.  Replace the mailing 
  1198.      list string (e.g., "www-talk") and the name of the mail folder
  1199.      (e.g., IN.www-talk) with text for your mailing lists.
  1200.  
  1201.      Note that ``to contains...'' means either the To or Cc header contains...
  1202.  
  1203.      Rather than deleting the test line, it's useful to just turn it
  1204.      into a comment (by preceding it with #) so that you can easily
  1205.      use it for future testing.
  1206.  
  1207. ------------------------------
  1208.  
  1209. From: FAQ Editor <faq-editor@ii.com>
  1210. Subject:     4.2 Tracking Your Incoming Mail
  1211. Followup-To: comp.mail.elm
  1212.  
  1213. You can get a short summary of filter's activity by typing:
  1214.  
  1215.     filter -s
  1216.  
  1217. For a longer summary type:
  1218.  
  1219.     filter -S
  1220.  
  1221. Or you can look at the log file itself, ~/.elm/filterlog.
  1222.  
  1223. You should regularly look at ~/.elm/filter-errors to make sure things 
  1224. are working.  You can automatically check filter-errors each time you
  1225. log in by putting the following in your .login:
  1226.  
  1227.     tail ~/.elm/filter-errors
  1228.  
  1229. Also you probably want to regularly delete filterlog and filter-errors so 
  1230. they don't fill up your disk space.  To get a summary of the filter log and 
  1231. clear it type:
  1232.  
  1233.     filter -cs
  1234.  
  1235. ------------------------------
  1236.  
  1237. From: FAQ Editor <faq-editor@ii.com>
  1238. Subject:     4.3 Filter References
  1239. Followup-To: comp.mail.elm
  1240.  
  1241. Web Pages: http://www.myxa.com/elm.html
  1242.            http://www.math.fu-berlin.de/~guckes/elm/elm.filter.html
  1243. Man Pages: filter(1)
  1244. Newsgroup: comp.mail.elm
  1245.  
  1246. ------------------------------
  1247.  
  1248. From: FAQ Editor <faq-editor@ii.com>
  1249. Subject: 5.0 Mailer and Newsreader References
  1250.  
  1251. PINE
  1252. ====
  1253. Web Pages: http://www.cac.washington.edu/pine/
  1254.            http://www.jazzie.com/ii/internet/pine/
  1255.            http://www.best.com/~ii/internet/pine/ (mirror of above URL)
  1256. Man Pages: pine(1), pico(1), pilot(1)
  1257. Newsgroup: comp.mail.pine (linked to Pine mailing list)
  1258. Mailing List: pine-info@cac.washington.edu (linked to Pine newsgroup)
  1259.            Subscribe to the pine-info mailing list by sending mail to:
  1260.                      majordomo@cac.washington.edu
  1261.            With...
  1262.                      subscribe pine-info
  1263.            in the body of the message.
  1264.  
  1265. ELM
  1266. ===
  1267. Web Pages: http://www.myxa.com/elm.html
  1268.            http://www.math.fu-berlin.de/~guckes/elm/
  1269. Man Pages: elm(1)
  1270. Newsgroup: comp.mail.elm
  1271.  
  1272. Emacs Mail Mode
  1273. ===============
  1274. Newsgroups: gnu.emacs.help and comp.emacs
  1275.  
  1276. MH
  1277. ==
  1278. Man Pages: mh(1)
  1279. Newsgroup: comp.mail.mh
  1280.  
  1281. MAIL
  1282. ====
  1283. Man Pages: mail(1)
  1284. Newsgroup: comp.mail.misc
  1285.  
  1286. NN
  1287. ==
  1288. Web Pages: http://www.jazzie.com/ii/internet/nn/
  1289.            http://www.best.com/~ii/internet/nn/ (mirror of above URL)
  1290. Man Pages: nn(1)
  1291. Newsgroup: news.software.nn
  1292.  
  1293.  
  1294. Please send me pointers to other mailer and newsreader references
  1295. and let me know what newsreaders can read mail folders.
  1296.  
  1297. ------------------------------
  1298.  
  1299. From: FAQ Editor <faq-editor@ii.com>
  1300. Subject: 6.0 Contributors
  1301.  
  1302. This FAQ, like many others, is a collaborative effort.  I learned a
  1303. lot of the information in newsgroups and mailing lists, especially:
  1304.   comp.mail.*
  1305.   procmail mailing list
  1306.  
  1307. Also, lots of people have mailed me information and I've tried to
  1308. acknowledge them below.
  1309.  
  1310. ------------------------------
  1311.  
  1312. From: FAQ Editor <faq-editor@ii.com>
  1313. Subject:     6.1 Acknowledgements
  1314.  
  1315. Thanks to these people who sent suggestions:
  1316.    David L. Miller <dlm@cac.washington.edu>
  1317.    Cookie Monster <kmanley@bits.fc.hp.com>
  1318.    Jim Showalter <gamma@mintaka.disa.mil>
  1319.    David W. Tamkin <dattier@mcs.com>
  1320.    Rick Troxel <rick@helix.nih.gov>
  1321.    Stephen R. van den Berg <berg@pool.informatik.rwth-aachen.de>
  1322.    Syd Weinstein <syd@dsinc.myxa.com>
  1323.  
  1324. Special thanks to:
  1325.    Thomas A. Fine <fine@cis.ohio-state.edu> for setting up and
  1326.    maintaining the hypertext archive of FAQs.  Congratulations
  1327.    to him for winning O'Reilly and Associates' "The Best of the
  1328.    Net" award!
  1329.  
  1330. Please let me know if I've left you, or anyone else, out of this list.
  1331.  
  1332. ------------------------------
  1333.  
  1334. From: FAQ Editor <faq-editor@ii.com>
  1335. Subject:     6.2 Contributing to this FAQ
  1336.  
  1337. If you have any corrections, suggestions, or new digest items to
  1338. contribute to this FAQ please send them to faq-editor@ii.com.  If your
  1339. reader understands the following URL, you can use it to send me mail:
  1340.  
  1341.   mailto:faq-editor@ii.com.  
  1342.  
  1343. Things I'm especially interested in are:
  1344.  * a comparison of mail filtering tools
  1345.  * what newsreaders can read mail folders
  1346.  * instructions for opening a specific folder in various readers
  1347.  * lock scheme and files used by various readers
  1348.  * other Unix filtering tools, like deliver
  1349.  * filtering tools for other operating systems like the Mac and DOS/Windows
  1350.  
  1351. ------------------------------
  1352.  
  1353. From: FAQ Editor <faq-editor@ii.com>
  1354. Subject: 7.0 Copyright Notice
  1355.  
  1356. This FAQ is Copyright (c) 1994-96 Nancy McGough, except sections 2.2.2 and
  1357. 3.0 through 3.6 which are Copyright (c) 1994-96 by the authors named in
  1358. those sections. 
  1359.  
  1360. No portion of this work may be sold or put to commercial use without
  1361. express written consent of the authors.  This restriction covers
  1362. publication in any form, or distribution by any method, which permits this
  1363. work to be visually perceived, either directly or with the aid of any
  1364. machine or device.  Permission is granted to republish or redistribute
  1365. this article in its entirety for noncommercial use if this copyright
  1366. notice is not removed or altered.  For more information, see Infinite
  1367. Ink's Legal Notice, which is available at: 
  1368.  
  1369.   http://www.jazzie.com/ii/legalese/
  1370.   http://www.best.com/~ii/legalese/  (mirror of above URL)
  1371.  
  1372.  
  1373. End of Filtering Mail FAQ Digest
  1374. ********************************
  1375.  
  1376. -- 
  1377. <*<*<*<*<*<*<*<*<*<*<*<*<*<*<*<*<*<*<*<*<*<*<*<*<*<*<*<*<*<*<*<*<*<*<
  1378.             @..@            Nancy McGough           /\_/\
  1379.            (----)           Infinite Ink           ( o.o )
  1380.           ( >__< )    http://www.jazzie.com/ii/     > ~ <
  1381.