procmail
[Top] [All Lists]

Re: How to record the score?

1997-09-24 07:57:47
Stephane Bortzmeyer <bortzmeyer(_at_)pasteur(_dot_)fr> writes:
...
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).

Actually, an action of:

        | formail -A "X-score: $="

_should_ work.  The limit is that pseudo-variables like $=, $-, $_, etc
have to expanded by procmail to work.  If procmail decides to pass off
the entire action line to the shell because of the presence of a
character in the action that's also in $SHELLMETAS, then those
variables won't be availible.  Since the action above has no
shellmetas, it should work.

If you don't want to depend on that, you can do the safer, guaranteed-to-work
version:

        SCORE = $=
        :0 f
        | formail -A"X-Score: $SCORE"

Pseudo-variables are always availible in simple assignments.

Philip Guenther

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