procmail
[Top] [All Lists]

Re: RES: Mail subject recipe

2001-03-14 07:47:48
On 14 Mar, Carlos Eduardo R. L. de Miranda wrote:
| Hello Don,
| 
| Could you please explain the numbers "2147483647" you have on your recipe
| below? If you can point me to any source where I can read about it I
| appreciate.
| 
| Thank you,
| Carlos
| 
| 
| > :0 c:
| > * 2147483647^0 ^Subject:.*\<apache\>
| > * B ?? 2147483647^0 apache
| > apache
| [...]

Sure, this is using procmail's scoring capability. If you're familiar
with scoring and the question is simply regarding how the value
2147483647 was picked above, it's procmail's notion of infinity. It's
also sometimes referred to as supremum (and it's negated counterpart
infemum). Once the cumulative score reaches supremum, procmail skips
remaining scoring conditions. The idea in this case is to prevent an
unnecessary (and more costly) body search if "apache" has already been
matched in the Subject:. There's a clear and concise explanation of
suprmeum and infemum in the archive:

<http://www.xray.mpe.mpg.de/mailing-lists/procmail/2001-01/msg00029.html>

If the question is about scoring in general, the place to read more is
'man procmailsc'. There are certainly others more capable than me to
explain, but this is what I'd say. Basically, it allows you to assign
a weighted score to conditions, and if the cumulative total is
positive the recipe is a match.  I have used it for things like
searching for tell-tale signs of spam in the body of messages where some
things don't deserve the same weight as others. For example, I wouldn't
mark something as spam because it is html, or because it has an 800
number in it, but either one of those have some value in identifying
spam if found with enough other signs. For example:

  :0 B
  *  1^0 8[078][078]-[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9]
  *  1^0 ()<html>
  *  1^0 http://
  *  1^0 @mailcity\.com
  *  2^0 mailto:(_dot_)*(_at_)bigfoot(_dot_)com
  * -3^0

requires all of the first 4 conditions to be met, or the "bigfoot"
condition and any 2 of the first 4. This is *way* over-simplified and,
again, 'man procmailsc' is the place to learn more.

My unscientific observation from some years lurking on the list is that
scoring seems lesser known and used than procmail's traditional
true|false conditions. I do recall thinking this looked like a foreign
language to me when I first saw it. And still does to a certain extent.

-- 
                         /"\
Don Hammond              \ /     ASCII RIBBON CAMPAIGN
Raleigh, NC US            X        AGAINST HTML MAIL,
                         / \      AND NEWS TOO

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