procmail
[Top] [All Lists]

Re: Checking the exitcode of a program

2001-01-22 21:24:33
Sorry if this message gets twice, my mailserver has been acting weird these 
days so i have to resend the messages at least once...

except that you want to save the stdout.  So let's try this:

 :0w
 VPOPMAILOUTPUT=| vpopmail -opts args

 EXITSTATUS = $?

After that point I don't know what the code should read, as I don't know 

what
you want to do with the stdout from vpopmail.


what i want is procmail exiting with exitcode 100 right then, and spew out 
the output from the program so that qmail knows what to include in the 
errormessage bounced back at the sender, so i tried:
:0w
VPOPMAILOUTPUT=| vdelivermail '' bounce-no-mailbox
EXITSTATUS = $?

:0
* EXITSTATUS ?? 100
{
  EXITCODE = 100
  TRAP = "echo ${VPOPMAILOUTPUT};"
  :0
   /dev/null           # so that it discards what it has and stop
}
 but it continues the execution smashing against the next rule (that 
shouldn't be executed unless some other rules are true as this block is 
nested in another), and executes "echo ;" at the end, not exactly helpful.

What i want to happen is that procmail calls the program, captures the 
exitcode and the output, and spews out both stopping the processing there.

So, ideas?
_______________________________________________
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>