procmail
[Top] [All Lists]

Re: errormessage back to sendmail

2001-11-28 15:30:12
thnx - this is almost exactely what I was looking for. While I know
how to use EXITCODE in procmail I've no idea how to fetch the exitcode
of an pipe and pass it to EXITCODE.

---
:0 w
| /usr/local/sbin/scripts/mailtest.pl $1 $2
 
# if the previous script fails return 1 which means the mail was not delivered
EXITCODE=67;
---

Instead of always 67 I would prefer to return the exitcode of my
mailtest.pl-script instead.
Is this possible ?

A second problem might be, that perl actually would not return 67, but
67*256 (bitshift 8) ...

thnx,
peter


On Wed, Nov 28, 2001 at 09:40:13AM -0800, Professional Software Engineering 
wrote:
At 17:46 2001-11-28 +0100, Peter Pilsl wrote:
If the perlscript fails or decides not to accept the mail it returns
exitstatus 1. procmail checks for this exitstatus and returns 1 itself to
sendmail and so the  mail is sent back to the original sender.

It's a good idea to use EXITCODEs which are understood by the calling program.

         see: /usr/include/sysexits.h

It is likely that you want to use EX_NOUSER (you'll need to use the 
numeric, which is 67).  The MTA will use it's own message.

---
  Sean B. Straw / Professional Software Engineering

  Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
  Please DO NOT carbon me on list replies.  I'll get my copy from the list.

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


-- 
mag. peter pilsl

phone: +43 676 3574035
fax  : +43 676 3546512
email: pilsl(_at_)goldfisch(_dot_)at
sms  : pilsl(_at_)max(_dot_)mail(_dot_)at

pgp-key available
_______________________________________________
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>