Subject: Re: PROCMAIL vs FILTER ???

From: Robert Nicholson <[email-masked]>
Date: Sun, 24 Apr 94 23:21 BST

[email-masked] (Michael Faklis) wrote in netcom.mail,comp.mail.elm
>I currently use FILTER, but I am considering converting to PROCMAIL.

A smart individual.... 

If you are prepared to read some documentation then procmail is a much
much more functional set of filtering tools providing more powerful
ways of expression filtering criteria.

Filter is for people who want basic filtering and cannot or do not
want to adopt anything else.  

IMHO: All filter users should convert to procmail. 

>My questions concern "how do I do this FILTER rule with PROCMAIL?".
>
>I've read (what I believe to be) all the PROCMAIL documentation (man
>PROCMAIL, and all documents referenced from there).
>
>1)  always leave
>How do I tell procmail to leave everything else in my original mail
>box?

I assume you want

in .procmailrc define

DEFAULT=pathnamenameoforiginalmailbox

>
>2)  forwardc and/or executec
>How can I keep a copy of the incomiung note in my original mail box if
>I forward it or store it into a mail folder?

Easy, use a compound rule. You sure you read the documentation?
(Specifically man procmailex)

>From "man procmailex"

  Forward all mail from peter about compilers to william  (and
     keep a copy of it here in petcompil).

          :0 * ^From.*peter * ^Subject:.*compilers {
             :0 c
             ! [email-masked]

             :0
             petcompil }

>
>3)  save .../mbox.%y%m%d
>I had been saving some mail in a date-time stamped folder name.  I
>didn't see any variables for the date/time as provided by filter.

use formail to get the date or `date` depending on what you are
referring to and process with either sed/awk/perl etc

I'm going to cc this to the procmail mailing list.

[email-masked]

subscribe requests to

[email-masked]

---

From: [email-masked] (David W. Tamkin)
Date: Sun, 24 Apr 1994 18:37:21 -0500 (CDT)

Michael Faklis was asking and Robert Nicholson was answering,

F> My questions concern "how do I do this FILTER rule with PROCMAIL?".
F> 
F> I've read (what I believe to be) all the PROCMAIL documentation (man
F> PROCMAIL, and all documents referenced from there).
F> 
F> 1)  always leave
F> How do I tell procmail to leave everything else in my original mail
F> box?

| in .procmailrc define
| 
| DEFAULT=pathnamenameoforiginalmailbox

Define nothing.  procmail starts out with DEFAULT = $ORGMAIL preset (it
assumes that if you want "everything else" as Michael put it into your
original mailbox), so unless you assign $DEFAULT to be somewhere *other*
than your original mailbox (where filter's "leave" instruction would file
mail), just say nothing.  Just as filter assumes "always leave" if a letter
gets to the bottom of your filter-rules file, procmail assumes this:

 :0:
 $DEFAULT

which, if $DEFAULT is the same as $ORGMAIL (the default $DEFAULT), is the 
same as "always leave" in filter.

| From "man procmailex"
| 
|   Forward all mail from peter about compilers to william  (and
|      keep a copy of it here in petcompil).
| 
|           :0 * ^From.*peter * ^Subject:.*compilers {
|              :0 c
|              ! [email-masked]
| 
|              :0
|              petcompil }

Oh, ick, major formatting problem with Robert's *roff!

      :0
      * ^From.*peter
      * ^Subject:.*compilers
      { 
       :0c
       ! [email-masked]

       :0: # should have a second colon for a local lockfile
       petcompil
      }

David W. Tamkin  P. O. Box 3284  Skokie IL  60076-6284
[email-masked]   MCI Mail: 426-1818   +1 312 714 5610