procmail
[Top] [All Lists]

Re: procmail scoring

2006-02-09 13:25:54
At 11:58 2006-02-09 -0600, Mr Duck did say:
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.

   Keeping this in mind, you gave an example establishing 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)

   If the score for a match is determined by multiplying the
weight by the mult. amount, why not simply put:

Answer the question for yourself.  What's the score if you have ONE match 
on each of the following:

* 60^2 SUBJECT ?? (mortage|loan|application)

* 120^1 SUBJECT ?? (mortage|loan|application)

60, and 120.

three matches?

procmail: Score:     420     420 "(mortage|loan|application)"

procmail: Score:     360     360 "(mortage|loan|application)"

ten matches?

procmail: Score:   61380   61380 "(mortage|loan|application)"

procmail: Score:    1200    1200 "(mortage|loan|application)"

Whoa there, what happened to that first score - it just ran away...  That's 
the point.  You can take a fair number of mundane words and score them low 
but with a high exponent - if a message refers to one or two, no 
problem.  If it refers to them a bunch though, the score will skyrocket.

Enable verbose logging, and write a simple filter to execute within a sandbox.


By using a larger exponent, each subsequent time it matches, the match is 
worth more points than the previous match:

60 mortgage

180 loan application (or mortage loan, or mortgage application, etc)

180 = (60 + 60*2)

420 = (60 + 60*2 + 60*(2*2))

I suepect I outlined the exponential math incorrectly to you in by 
summary.  I've got a number if distractions right now...


While not often used, negative exponents have application as well.

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