procmail
[Top] [All Lists]

Re: limiting a score's growth

1997-09-28 09:05:05
J. Daniel Smith writes on 28 September 1997 at 15:49:48
I'm trying to figure out how to code a scoring recipe of "each match
adds $weight, the score will not exceed $max".  If I understand the
procmailsc man page correctly, I have to compute x each time from $max
and $weight (x = 1 - (w/m)).  Is there an easier/better way?

Sorry for following up to my own message...I solved this by
pre-computing w for a handful of m and x values.  If there's a better
way, I'm still interested.

   Dan
------------------- message is author's opinion only ------------------
J. Daniel Smith <DanS(_at_)bristol(_dot_)com>        
http://www.bristol.com/~DanS
Bristol Technology B.V.                   +31 33 450 50 50, ...51 (FAX)
Amersfoort, The Netherlands               {info,jobs}(_at_)bristol(_dot_)com
----
SPAMCHECK_50= 1073741825

# These macros are used with procmail's scoring; here's how:  The
# first number in the macro is the desired maxiumum score (from the list
# above), the second value is the exponet (*100) which should be used to
# obtain that score with the macro.
#
# For example, if you wanted a maximum of $SPAMCHECK_50 with a growth
# of 0.33, you'd use
#   :0
#   * $${SPAMCHECK_50_33}^0.33 <regexp>
# With this, the score will never grow larger than $SPAMCHECK_50
# Values computed by w = m * (1 - x), see procmailsc for details.
# with exponents of x = {0.01, 0.1, 0.25, 0.33, 0.5, 0.67, 0.75, 0.9, 0.99}
SPAMCHECK_50_01 =       1063004406
SPAMCHECK_50_10 =       966367642
SPAMCHECK_50_25 =       805306368
SPAMCHECK_50_33 =       719407022
SPAMCHECK_50_50 =       536870912
SPAMCHECK_50_67 =       354334802
SPAMCHECK_50_75 =       268435456
SPAMCHECK_50_90 =       107374182
SPAMCHECK_50_99 =       10737418

<Prev in Thread] Current Thread [Next in Thread>