procmail
[Top] [All Lists]

Re: pipes, exit codes, and "else" recipes

2004-01-12 03:45:46
On Mon, Jan 12, 2004 at 12:36:04AM -0500, Allister MacLeod wrote:
Hi, I'm having some trouble getting an "else-clause" recipe to execute
when a program in a pipe action line returns a nonzero exit code.  For
instance:

:0
| $HOME/bin/deliver-ssh

:0e
$DEFAULT

...where deliver-ssh will use a nonzero exit code when something bad
happens (e.g. the destination host is unreachable by SSH.)

The reason it isn't working is that procmail needs to be told to
wait for the exit code.  See "man procmailrc" regarding the "w" and "W"
flags.

This should work:

  :0 w
  | $HOME/bin/deliver-ssh
  
  :0e
  $DEFAULT
  

-- 
dman

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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