procmail
[Top] [All Lists]

Re: How to record the score?

1997-09-24 07:55:44
Stephane Bortzmeyer <bortzmeyer(_at_)pasteur(_dot_)fr> wrote:
To tune it, I would like to know the score that was obtained by a 
message. I would like to have something like that:

      :0f
      | formail -A "X-score: $SCORE"

But I cannot find such a variable ($=, which is documented in 
procmailsc's page can be used only in conditions, not in actions).

This is slightly tricky to do, because you must grab the score
immediately after the scoring recipe.

        # WRONG: $SCORE only gets set for positive values
        :0
        *  1^1 foo
        * -2^1 bar
        { SCORE = $= }

        # WRONG: $SCORE only gets set for positive values
        :0
        *  1^1 foo
        * -2^1 bar
        SCORE |= $=

        # WRONG: $SCORE will always be set to zero
        :0
        *  1^1 foo
        * -2^1 bar
        { }
        :0a
        * qux
        { SCORE = $= }

        # Right: $SCORE will be set for all scores
        :0
        *  1^1 foo
        * -2^1 bar
        { }
        SCORE = $=

Elijah
------
I /dev/null dupes, no need to CC list posts.  It is not my responsibility to
prove to you my mail is not spam, if mail to you bounces it will not be resent.

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