procmail
[Top] [All Lists]

Re: procmail testing return codes

1997-05-28 01:35:00
On Mon, 26 May 1997 23:29:35 +0100,
Antonomasia <ant(_at_)notatla(_dot_)demon(_dot_)co(_dot_)uk> wrote:
I'm trying to build a .procmailrc file where return codes
decide delivery addresses.  I have read the man pages, and
experimented a bit, and not really got anywhere.

This fairly innocent looking pair of paragraphs in man procmailsc:

    Weighted program conditions

      If the program returns an exitcode of EXIT_SUCCESS (=0), then
      the total added score will be w. If it returns any other
      exitcode (indicating failure), the total added score will be x.

      If the exitcode of the program is negated, then, the exitcode
      will be con- sidered as if it were a virtual number of matches.
      Calculation of the added score then proceeds as if it had been a
      normal regular expression with n=`exitcode' matches.

... means that 

    :0
    * 1^1 ! ? hashcash
    { SCORE=$= }

will actually put the exit code of hashcash in the variable SCORE
which you can then peruse as you see fit. (You can't do actual tests
directly on $= so in practice you have to copy it to a "real" variable
if you want to use it in subsequent rules.)

There was a long and painful thread about this on the list back in
February. I think this is yet another example of something that should
probably be elaborated in TFM. (Again Cc:ed to Stephen. He will soon
start filtering my mail, I'm sure. :-)

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>