procmail
[Top] [All Lists]

Re: procmail scoring

2006-02-08 14:14:38
At 13:45 2006-02-08 -0600, Mr Duck wrote:
One aspect of procmail that I just can't seem to wrap my
brain around is scoring.

Is your brain firm or mushy when you do this?  IOW, consistency of 
playdough or tapioca?  I try not to wrap my brain around too many things, 
since it's uncomfortable opening up my skull.

I've read through all the manuals and done google lookups to locate 
information and I still don't understand it.

Try "follow by example".

I would be delighted if someone would be so kind as to
explain how:

Professional Software Engineering wrote:
* 9876543210^0 B ?? online pharmacy

   That works?
   What does the "9876543210^0" mean?

It is a numeric value assigned to a match.  "man procmailsc" explains the 
syntax in full.

9876543210 is a number which exceeds the 2^31 value which is "maximal" for 
scoring (2^31 instead of 2^32, because the score is _signed_, so there's an 
equal NEGATIVE component as well).  That's approx 2 billion.  9876543210 is 
MUCH easier to remember than 2147483647.  The ^0 component says "if it 
matches, match just ONCE and you're done".  If the ^ component is non-zero, 
then the match is special - procmail will continue to search for a regexp 
match and multiply the weight (the number before the ^), by the exponent 
(the number after the ^), each time there is a match.

For simple or-or-or-or-or condition lists, a maximal ^0 match is commonly 
used.  For other things though, you can match for multiple words, and get 
the score to shoot up quicky when many matches occur.  I like to use it for 
matching abuses of punctuation in subjects:

Subject: help!!!!!!!!!!!!!!!!!

(as if I'm going to waste my time reading a message when some turd thinks a 
pile of exclamation points is going to make his message important).

* 22^1.3 SUBJECT ?? [!]
* 18^1.2 SUBJECT ?? [?]

The specific values I've arrived at for my own thresholds - they're not 
especially meaningful outside of my own context.

! = 22 * 1.3
!! = 22 * 1.3 * 1.3
!!! = 22 * 1.3 * 1.3 * 1.3
!!!!!!!! = 179.46
(etc)


With scoring, if the end scored value is more than zero, the message is 
handled as if the conditions were TRUE.  If they're zero or less 
(negative), it's FALSE.  You can add (or subtract) arbitrary values as 
well, allowing you to establish a threshold:

:0
* -135^0
* 90^1 SUBJECT ?? (check\>+out\>+this\>+site)
* 60^2 SUBJECT ?? (mortage|loan|application)
* 200^2 SUBJECT ?? (aphrodisiac|pheromone|androstendione|androstenedione|\
         dhea|sexual power|steroid|enlargement|impotency|instant sex appeal)


Your recipe can make use of the actual scored value (useful for counting 
items, such as headers, recipients, lines, funky symbols, etc).


Please consider hitting the list archives - you're not the first person to 
express that they fail to comprehend scoring.  It has been explained many 
times over to some people fortunate enough to breathe, so there should be 
plenty of explanation to review.

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