procmail
[Top] [All Lists]

Re: Checking the exitcode of a program

2001-01-22 22:56:33
Jaime followed up,

| ... so i tried:
| :0w
| VPOPMAILOUTPUT=| vdelivermail '' bounce-no-mailbox
| EXITSTATUS = $?
| 
| :0
| * EXITSTATUS ?? 100
| {
|   EXITCODE = 100
|   TRAP = "echo ${VPOPMAILOUTPUT};"
|    /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.

You can't just throw the name "/dev/null" in there.  To drop mail into
/dev/null, you need a full recipe for it:

 :0
 /dev/null

Your logfile should show an error message for the way you were trying to do
it.

If there are no more rcfiles on procmail's command line, you can also make
procmail lose the message, run the trap, and exit by trying to unset HOST:

 :0
 * EXITSTATUS ?? ^^100^^
 {
  EXITCODE=100 # or EXITCODE=$EXITSTATUS if you want to extend to other values
  TRAP="echo $VPOPMAILOUTPUT;" 
  HOST
 }

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