procmail
[Top] [All Lists]

Re: TRAP, exit codes, etc.

2004-04-14 08:27:25
Dallman Ross wrote:

Here's an includerc that calls another includerc.  Now
I test to see if the called includerc actually ran.
If it didn't, I bail out of what I was going to do.

That's all simple enough.  But I don't really want to quit
with EXITCODE = 0, the default.  I am sending a message
to the log that we were fubar; and I think an exit code
that is non-zero is an appropriate thing to have showing the
same thing -- just for canonical programming style if for
no other reason.  But I don't want the MTA to do anything
untoward (like bouncing the message) -- the message hasn't
been harmed, and it can just got do $DEFAULT now or wherever
it was going to go after we bail from the failed stab at
something.

Here's a thought:

INCLUDERC=wherever
exitcode=$?

:0
* $ $exitcode^0
{ LOG = "${NL}EXITCODE of $INCLUDERC was $exitcode.$NL" }

and don't mess with the real $EXITCODE at all.


_______________________________________________
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>