procmail
[Top] [All Lists]

Re: scoring

1997-06-07 12:52:00
Vincent Lefevre <Vincent(_dot_)Lefevre(_at_)ens-lyon(_dot_)fr> writes:
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.

Two solutions:

1) You may be able to combine the two recipes by using the "B ??" condition
special:

        :0
        * 5^7 regexp against the header
        * 6^7 B ?? regexp against the body
        {
            ...
        }

2) The score of a recipe is availible as $=.  You can interpolate it's
value into a scoring condition using the '$' special:

        # A scoring recipe
        :0
        * 10^1 jfksjfjksd
        {
            ...
        }

        # Another scoring recipe to be started at the value where the
        # last one left off
        :0
        * $ $=^0
        * 100^1 more scoring conditions
        {
            ...
        }


Philip Guenther

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