procmail
[Top] [All Lists]

RE: TRAP, exit codes, etc.

2004-04-14 07:53:21
Dallman Ross wrote:

 > Speaking of TRAP, exit codes, etc., if I set an exit code 
 > of, say, 1 for a certain condition, would that exit code 
 > not bounce mail (under anybody's mail system)?  I do not 
 > wish to bounce the message in the scenario I have in mind, 
 > but I do wish to set exit code, either via TRAP, or via 
 > EXITCODE in procmail, to non-zero in a certain case.


I wonder what would happen if the exit code is less than 64.

In any case, the question is incomplete: what are you trying 
to do with the non-zero exit code?  Just log it?  Report it 
back to the shell when you're invoking procmail interactively?  
Can you set it in a clone procmail so that it goes back only 
to the parent procmail and not to the MTA?

I could probably do the latter, but it's way more trouble
than it's worth for what I have in mind.  Let me explain.

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.

 > (And what about negative numbers?)

I think exit codes are unsigned eight-bit values.

Hmm, okay.

 


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