procmail
[Top] [All Lists]

Re: checking return value of program called by procmail

1997-10-08 07:32:37
On Wed, 8 Oct 1997 15:00:59 +0200 (MET DST),
"Denis B. Roegel" <Denis(_dot_)Roegel(_at_)loria(_dot_)fr> wrote:
:0:
RESULT=| ( formail -XFrom: -XTo: -XCc: ; echo "Found: $FOUND" ) | \
        filterheaders
Now, filterheaders returns 0 or 1 (with return(0) or return(1) in C)
and I want that if the result is 1, the current message
is copied to the `my-default' folder.

:0:
* ? ( formail -XFrom: -XTo: -XCc: ; echo "Found: $FOUND" ) | filterheaders
my-default

# otherwise, processing continues here

This will not save the output in RESULT anymore, do you need that?
Like I said before, you can get the output written to your Procmail
log by writing or redirecting it to standard error.

Hope this helps,

/* era */

-- 
 Paparazzi of the Net: No matter what you do to protect your privacy,
  they'll hunt you down and spam you. <http://www.iki.fi/~era/spam/>

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