procmail
[Top] [All Lists]

Re: Avoiding unnecessary call

2001-01-06 16:36:42
"Dallman Ross" <dman(_at_)nomotek(_dot_)com> writes:
...
** Infinity == 2147483647.0

I keep in my .procmailrc:

 INFINITY = 2147483647.0       # "magic" number limit for procmail scoring

Actually, I just added the ".0" at the end after your mail.  Not sure
if it's necessary.

Nah.  Procmail stores scores internally as floating point numbers, but
there's no need to include that when writing recipes.


But anyway, I did see some logs that implied that conditions kept
going, kept being checked, even after an "$INFINITY" one had
been triggered in a scored recipe.  Weird.

Several things may be going on:

1) Procmail skips the rest of the _scoring_ conditions when it hits
   positive infinity.  Non-scoring conditions will still be checked
   (until one fails)
2) It only skips when the cumulative score is infinite.  If the score
   was negative when you added $INFINITY then the sum will be
   insufficient to cause skipping
3) Something might have been rounded slightly when converted from floating
   point to integer or vice versa (this is unlikely to be the problem)
4) With procmail versions before 3.15, if you're on a platform where
   'long' is 64bits (e.g., alpha) then infinity is really
   9223372036854775807.


(And why do some people use 987654321?)

Actually, they use 9876543210; without the zero it's too small.  Why
use it?  It's easier to remember and type.  It also eliminates rounding
problems and probably takes care of case (2) above.


Philip Guenther
Procmail Maintainer
_______________________________________________
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>