procmail
[Top] [All Lists]

Re: PLEASE HELP! - Procmail Recipies

1997-05-29 13:17:00
Also.. I am subscribed to the IP Masqurading list. This puts [masq] at the 
start of the subject line. How can i check for this in a recipe, I tried:
:0:
* ^Subject:.[masq]

.. but it does not work...?

I think I know this one....

You need to put \ in front of the [ and the ]

Don't know enough to suggest the best path for the other stuff...

Not quite enough... that "." after the ":" is a red herring (it means
any one (exactly one) character).  Most lists that do Subject munging like 
that will end up with other posts such as:
        Subject:  Re: [masq] original-subject
(to put the Re: after [masq] would screw up many mail clients that can sort
by subject and handle "Re:" at the beginning) so one might want to grab
anything with '[masq]' anywhere in the subject:
        * ^Subject:.*\[masq\]
(I think the second \ isn't needed but it's prettier!  :)

More reliable mailing list recognition can be had by using other headers;
if someone sends you a private response to a Masquerading list post you
had made, they may keep the subject with '[masq]' in it; thus, even
though it's not a list post, you'd file it that way.

I generally use "From " (no colon) to identify mailing lists I'm on.
"Return-Path" is good if your MDA adds it (actually, I believe it should
be the same as "From ").  Other lists are now adding things such as
"X-Mailing-List:" which you can use.

Less reliable headers to identify lists are any of the "To:" family.
Some lists can be Bcc'd and the list name may not appear in To: or Cc:
at all.  Other lists rewrite the "To:" header to always have the listname
in it (usually copying original To and Cc into other headers); this,
for example, is configurable by the list owner in LISTSERV lists.

Usually, there's some header that each list *always* has and that *nothing
else* has, and that's the best recognition.  (For procmail, I use
        * ^From .*procmail-request@
for example; that's caught everything with no false matches to date.)

Cheers,
Stan

<Prev in Thread] Current Thread [Next in Thread>