procmail
[Top] [All Lists]

Re: capturing the OR that succeeds ???

2004-05-13 19:49:45
Dallman Ross suggested to Michael Schleif,

     MATCH  # unset this first to avoid contamination from earlier recipes
     :0 BD

Presumably that should be  :0 BD fw  like the next.

     * 9876543210^0 ()\/aaa
     * 9876543210^0 ()\/bbb
     * 9876543210^0 ()\/ccc
     * 9876543210^0 ()\/ddd
     * 9876543210^0 ()\/eee

Likewise, I'm assuming that

       | formail -I "X-Procmail: alphabet soup: $MATCH"

would appear here.

However, you're still running body greps up to five times on "hit" messages
and all of five times on non-triggering messages.  You can have the same
effect with one pass like so:

  MATCH
  :0 D fw
  * B ?? ()\/(aaa|bbb|ccc|ddd|eee)
  | formail -I "X-Procmail: alphabet soup: $MATCH"

No, the effect is not the same.

The first will match on the first string that it tests for and finds. The second will match on the earliest of the five strings to appear in the text.

For example, if bbb and eee are in the body while the other three are not, but an appearance of eee precedes the first appearance of bbb, the first recipe will assign MATCH=bbb, while the second will assign MATCH=eee.

The question is how Michael wants to handle a case where more than one of the strings are in the body.


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