procmail
[Top] [All Lists]

Re: Procmail fractional scoring screwed up.

2003-06-04 03:23:22
On Wed, Jun 04, 2003 at 01:04:57AM -0700, Bart Schaefer wrote:

I just encountered an obscure bug with the w^x > y scoring.

* $ $SIZE^0 > $SIZE
is true (in fact, has value supremum) when $SIZE is zero.

Weird, is all I can think of to say.  But I do need more coffee.

Unrelated, except that this reminded me of some scoring experimenting
I did two nights ago, I'll pass on the following tip I conjured.  (Not
a bug.)  I wanted a way to check for something such that one copy
did not add to any positive score, while two (or more) immediately
short-circuited to the action.  For example, a clever spammer spoofed
hotmail really well (enough to fool my spoof checker), but had two
X-Originating-IP: headers, one of which obviously was faked.  Well,
a non-scoring way that works is this:

        :0
        * ^X-Originating-IP:.*$(.*$)*X-Originating-IP:
        { if we're here, there were two or more X-O-IPs }

And that's okay, but I wanted something better for a scoring recipe:

        * -1^-9876543210  ^X-Originating-IP:

That gives us negative-one if one exists, but (positive) infinity
if a second one is found -- at which we skip right to the action
line, assuming there were no unweighted conditions left to evaluate
in the recipe.

-- 
dman

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