procmail
[Top] [All Lists]

Re: Scoring and $=

1997-12-18 23:09:53
"Richard B. Ernst" <rbernst(_at_)wizard(_dot_)com> writes:
...
The procmail recipes are working exactly as expected, with the exception of
the "$=" variable.

If I do something like:
  :0
  * -50^0
  * 1^1 condition1
  * 1^2 condition2
    {
    LOG="SPAM Score: $="
    :0: spamcheck
    spamfolder
    }
...
Following that recipe, though, I have:
  LOG="Mail sent.  SPAM score was: $="

No matter what the score is, I always get: SPAM score was: 0
With VERBOSE=on, the log shows scores between -50 and 0.

It looks like $= is getting set back to 0 outside of the recipe.
The manpage, though, seems to at least imply that it will keep it's value
until the next recipe.

The nested the recipe _is_ the next recipe, that it's reset while processing
the recipe that delivers to "spamfolder".  If you need it beyond then,
save it's value in another variable:

        :0
        * -50^0
        *   1^1 condition1
        *   1^2 condition2
        {
            LOG = "SPAM Score: $="
            SCORE = $=
            :0: spamcheck
            spamfolder
        }

        # ...

        LOG="Mail sent.  SPAM score was: $SCORE"


Philip Guenther

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