procmail
[Top] [All Lists]

Re: efficiency q: multiple addressees

2002-01-16 15:53:36
Martin suggested,

| In that case, you might want to *not* use ^TO_ or ^TO since they have
| the "(.*[^-a-zA-Z0-9_.])?" and "(.*[^a-zA-Z])?)" which isn't useful for
| how you're using it.  Also, the "Original-" or "Resent-" variations of
| the ^TO(_) regexes might not be much use to you (??) in which case you
| could pare the condition down to something like:
|
|   :0:
|   * ^((Apparently-)?To|Cc|Bcc|X-Envelope):.*(,|(^.+)*\
|     ^((Apparently-)?To|Cc|Bcc|X-Envelope):)
|   multiples
|
| And that might save you a little bit.

Good point.  In fa*t, I can drop "Bcc" and "X-Envelope" from there because I
never get such headers on either of the sites where I want to use the code.
But, though it does slow procmail down, if I'm going to use my own set of
headers instead of a precompiled token, I'll need to keep it in a variable.
However, it occurs to me that I'll need to cover multiple Resent-(To|Cc) or
commas in Resent-(To|Cc) as well.

 USNS="^((Apparently-)?To|Cc):"
 RUSNS="^((Apparently-)?Resent-To|Resent-Cc):"

 :0:
 * 2147483647^0 $ $USNS.*(,|(^.+)*$USNS)
 * 1^0 $ $RUSNS.*(,|(^.+)*$RUSNS)
 multiples

Maybe I could cut that down for messages with only one visible addressee and
no Resent- headers, which are very much more common in my mail than messages
with Resent- headers:

 :0:
 * 2147483647^0 $ $USNS.*(,|(^.+)*$USNS)
 * -2147483647^0 ! ^Resent-
 * 1^0 $ $RUSNS.*(,|(^.+)*$RUSNS)
 multiples

It ought to be far quicker to search for the absence of ^Resent- than for
the regexp in the third condition.



_______________________________________________
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>