procmail
[Top] [All Lists]

Re: Multiple sort lines problem

2009-05-28 14:28:41
At 19:05 2009-05-28 +0200, Holger Wahlen wrote:
> I had never come across scoring before today.
> Can you explain the significance of 9876543210 in your recipe vs the 1
> in mine?

He did, see the quoted passage. Normally procmail goes through all the
scoring lines in a recipe, adds up the scores and only takes the
specified action as soon as the result is positive - keep in mind that
you could have negative scores for certain conditions too. But if the
value reaches procmail's idea of "plus infinity" in between already, the
result is considered positive regardless of any remaining conditions,

Any remaining _scored_ conditions. All of the unscored conditions should still be evaluated, and a FALSE on any of them will evaluate the recipe condition set as FALSE.

:0
* 9876543210^0 matches
* never_matches
action

action will never take place, because the UNSCORED never_matches condition would prevent it.

:0
* 1^0 matches
* -1^0 matches
action

Also would not execute the action, because the scored result would be 0 (non-positive). Both conditions would have been evaluated.

:0
* 9876543210^0 matches
* -1000000000^100 matches_multiple times
action

This case - where the second condition has a progressive scoring - each time it matches, the value increases - won't even evaluate the second condition because the first was maximal. However, if not for the maximal value on the first, this second condition would completely negate the first score, and cause the recipe conditions to evaluate as FALSE.

A couple of header evaluations isn't particularly costly for a non-maximal scored OR operation. However, when you're scanning a message body for a bunch of strings, you often want to stop and bail evaluation just as soon as you have a match on one of your conditions.

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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