procmail
[Top] [All Lists]

Re: Help figuring out SCORE-ing

1998-01-22 02:58:29
Tue 98-01-20 Walter Dnes <waltdnes(_at_)interlog(_dot_)com> list.procmail
| (No, not the type they talk about in SPAM's<g>).  I've read
| the "self-explanatory" FAQ's, and still have problems.  Here's an
| example.  I'll walk through it, and say how I interpret each step.


Hi Walter, thank you for the feedback (pm-tips.txt).
I rewrote the example so that it would easier to understand.
Does this answer to all your questions?

jari


11.0 Scoring

    11.1 Using scores by an example

        See example below which should be self explanatory. First make
        all the needed matches and let the *score* value to be set.
        Examine the score after the final value has been calculated.
        Given the following subject:

            "Great opportunity for free sex; no money required!!!"

        procmail scores it this way: ! was found 4 times (200/50),
        "free|sex..." regexp matched 4 times (400/100).

                      condition score   Total sum so far
                                ----    ----------------
            procmail: Score:    -250    -250 ""
            procmail: Score:     200     -50 "^Subject:.*\!"
            procmail: Score:     400     350 "^Subject:.*\<free|sex...
            >"
            procmail: Score:       0     350 "^Subject:.*\$"
            procmail: Score:       0     350 "^Subject: *Re:"
            procmail: Score:       0     350 "^Subject: *Fwd:"
            procmail: Score:       0     350 "\!\!\!"
            procmail: Assigning "SCORE=350"

        And here is the recipe

            # Idea by 26 Sep 97 Stephane Bortzmeyer 
<bortzmeyer(_at_)pasteur(_dot_)fr>
            #
            # - Start with some threshold (-250).
            #   Add 50 for each match of "!", notice the "^1": if it read
            #   "^0", only one 50 would be added for "!!!!", now that counts
            #   as 4 x 50 = 200. See procmailsc(1) for "^N" syntax.
            # - Any dollar sign is likely spam
            # - And a negative one for replies.
            #   Usually spam doesn't seem to have Re: in subject field.
            #   (but don't rely on this, spammers have started to use "re:")
            # - letters such as !!!! frequently found from body are usually
            #   indication of spam, add 100 for each match
            :0
            *     -250^0
            *      200^1   ^Subject:.*\!
            *      100^1   ^Subject:.*\<free|sex|opportunity|money|great\>
            *      100^0   ^Subject:.*\$
            *     -250^0   ^Subject: *Re:
            *     -250^0   ^Subject: *Fwd:
            * B ?? 100^0    \!\!\!
            { }             # official procmail no-op

            SCORE = $=

            :0 fhw
            | formail -i "X-Spam-Score: scored $SCORE"

            #   If score had positive value, sink message
            #
            :0:
            *$ $SCORE^0
            junk.spam.mbox

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