procmail
[Top] [All Lists]

Re: match only TO_

2002-04-07 14:51:31
Michael Helm asked,

| The TO_ macro does a good job of matching any of the possible
| ways a mailbox (an address) appears in headers.  Is there a way of testing
| whether the address is the only match?
|
| The problem I want to solve is: I want to save everything
| sent to  mailing list MFOO(_at_)foo in folder MFOO.
| But many things sent to MFOO(_at_)foo are also sent to mailing
| list MBAR(_at_)bar,  some are sent to MBAZ(_at_)baz &c.   Have
| folders for these lists too & don't want to lose context.

Perhaps the best fix for that is an entirely different approach: identify
mail that you get through lists by something that the list software does, not
by what the person who wrote the post did.  For example, identifying a list's
mail with ^TO_ will miss posts that are blind-carboned to the list; for
another, if someone responds to an article of yours by writing to both you
and the list, the copy mailed directly to you will match ^TO_list and go into
the list's folder (most of us prefer to have those separate from the
list-distributed copy).

If your recipes look for something that identifies list processing -- ideally
a List-Id: or Mailing-List: or X-Mailing-List: header; for some lists the
best thing available is Sender: or Resent-Sender: or even 'From ', but you
should always be able to find one -- then you'll also solve the problem you
asked about: if an article is cross-posted to the mfoo and mbar lists and you
subscribe to both, the copy you get through the mfoo list will go to the mfoo
folder and the copy you get through the mbar list will go to the mbar folder.

To go back to your original perspective: suppose the list's address isn't the
only one that can give a ^TO_ match.  Then what should procmail do?  Put it
into both folders and then put the copy from the other list into both
folders?  Maybe the other addressees are lists to which you don't belong, or
they're individuals, and you will not be getting any other copies.

My suggestion is not to use ^TO_ to identify mail from lists, at least not
discussion lists.  For newsletters or other announce-only lists it doesn't do
so bad a job and you can get away with it, but even there it's not the best.





_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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