procmail
[Top] [All Lists]

Re: Procmail handling of spawn_process exit code

2000-02-29 07:08:08
Federico Tesei <f(_dot_)tesei(_at_)tecsiel(_dot_)it> writes:
...
       thanks for your sharp and clean remarks on the topic
but perhaps I still miss a piece of knowledge here on 'c' flag.

I try to clarify what I would like to perform:

1 - all incoming messages delivered to the standard mailbox
   ( e.g. /var/spool/mail/$LOGNAME ) 
2 - messages that have the special application tag X-Application-Tag
   both delivered to standard mailbox and passed to the filter
   program granting that the program filter exit code be passed
   back by procmail to sendmail

This recipe ( could be  the actual one ) seems to work fine ...

:0
* ^From.*
* ^X-Application-Tag:.*
{
       :0 wr
       | $TEST
EXITCODE = $?
}

but when the 'filter' returns EX_OK the message in not delivered
to the standard mailbox.

Right: the nested recipe is a delivering recipe without the 'c' flag,
so when it's successfull, procmail is done.


So the way I' ve found to accomplish the aforementioned task 
is  this recipe:

:0
* ^From.*
* ^X-Application-Tag:.*
{
       :0 cwr
       | $TEST
EXITCODE = $?
}

Is that in your opinion a 'safe' recipe to do this task ?

Bingo!  The 'c' tells procmail to just deliver a copy of the message
to the program, so it keep going after that, whether or not the action
was successfull.  Mean while, the nested block keeps messages without
the X-Application-Tag: header field from having EXITCODE set.

That "* ^From.*" condition is still pointless, so I would suggest
removing it.

Philip Guenther

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