Subject: Re: rules format

From: [email-masked] (David W. Tamkin)
Date: Fri, 20 Jan 1995 15:46:58 -0600 (CST)

Zhiliang Hu asked,

| I wonder why the rules:
| 
| -----------------------------
| MAILDIR  = $HOME/mail
| 
| :0
| * ^From +(FROM_DAEMON|DEAD-LETTER|-errors|EARNGATE|Delivr|Deliver|DEADMAIL| \
|            LISTSERV|SMTP20|LISTPROC|server)
| $MAILDIR/mail-errors
| -----------------------------
| 
| did not pick up the mail for depositing into a file called "mail-errors" in
| $MAILDIR ?  Could someone point out possible format mistakes in "*" line?

For one thing, you had a number of trailing spaces after the backslash, so
procmail didn't see the rest of the expression as part of the same line.  The
backslash escaped the first space after it instead of escaping the line break.
The space before the backslash also got in the way.

Second, you can't separate the caret from the rest of "^FROM_DAEMON" and
still get procmail to expand it.  (^FROM_DAEMON already includes "listserv"
and "server".)  

Third, you're requiring that the strings you list be separated from "From"
only by spaces.  (` +' means `one or more spaces.')  If the sending system
uses bang notation in the From_ header, that won't work, and it will never
work with the string `-errors'.

Also it could use a local lockfile, and you don't need to specify $MAILDIR
because procmail cd's to $MAILDIR whenever you define or change that variable.

Try this:

 MAILDIR  = $HOME/mail
 :0:
 * ^FROM_DAEMON|^From .*(DEAD(-LETTER|MAIL)|-errors|EARNGATE|Delive?r|\
            SMTP20|LISTPROC)
 mail-errors

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

---

From: [email-masked] (Philip Kizer)
Date: Sat, 21 Jan 1995 11:40:31 -0600

* !^Precedence:.*(list|bulk) 

>  But I am afraid it is too "perfect" :-) that many of my mails from some
>  mailing lists also got into this folder (This procmail discussion group's
>  mails were among them).  I guess this rule recognized some common things
>  in the mail header of those mails.  Now the question is, how can I let it
>  differentiate normal mails from nounced 'error' notices?

Agreed...You can either add a line like:

* !^Precedence:.*list

or make sure your mailing lists are before your handling of daemon mails...

The latter is better since many majordomo's deliver with 'bulk' precedence,
and you cannot filter out 'bulk' since bounce messages are likely to have it.

-philip

____________________________________________________________ Philip Kizer ___
Texas A&M CIS Operating Systems Group, Unix ( 409.862.4120 ) [email-masked]

"Relying on the government to protect your privacy is like asking a peeping
tom to install your window blinds." -John Perry Barlow, EFF co-founder