procmail
[Top] [All Lists]

Re: scoring

1997-06-07 12:02:00
On Sat, 7 Jun 1997 19:53:44 +0200,
Vincent Lefevre <Vincent(_dot_)Lefevre(_at_)ens-lyon(_dot_)fr> wrote:
On Mon, Jun 02, 1997 at 11:26:24AM -0500, Philip Guenther wrote:
[snip]
The procmailsc(5) manpage is a good start.
Thanks. But it doesn't explain how to accumulate scores between recipes.
For instance, I have a recipe for the header and a recipe for the body,
and I'd like to perform some operation if the sum of both scores is
positive.

You can just store the result from the first scoring in a variable,
and then reuse it later. 

    :0
    * ^123^2 things to score on for header ...
    { }
    HEADSCORE=$=

    :0B
    * ^45^1 body scoring stuff
    { }
    BODYSCORE=$=

If you don't intend to do anything unless both are positive, you can
simplify things somewhat:

    :0
    * ^123^2 header scoring stuff ...
    {
        :0B
        * ^45^1 things to score on in body ...
        {
            # stuff you do when both matched
        }
    }

If this is not the case, you can "reuse" the scores accumulated so far
in some fashion. 

What I do when I score spam is that I gather a simple score from
Subject line matches ("FREE", "awesome", "could be yours", "MLM", etc)
and then use that as a component in subsequent recipes, like so:

    # SPAM contains Subject header score, i.e. $= after Subject scoring

    :0
    * 2^1 ^Received: something ...
    * $ $SPAM^0
    spamfolder

This will permit the message to have the Received: stuff if its
Subject score stayed slightly on the negative side. But if the value
of SPAM is bigger than -2, it fires.

Hope this helps,

/* era */

-- 
Defin-i-t-e-ly. Sep-a-r-a-te. Gram-m-a-r.  <http://www.iki.fi/~era/>
 * Enjoy receiving spam? Register at <http://www.iki.fi/~era/spam.html>

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