procmail
[Top] [All Lists]

How do I get procmail to output an error message?

2002-07-20 19:17:01
Hi,

Is is possible to get procmail to output something - not to the LOG file, but to stdout/stderr? I need it to get sendmail to generate a custom error message when doing a bounce. Currently I have to set up sendmail to call a special procmail wrapper script instead of calling procmail directly and the wrapper script does the following:

------
#!/bin/sh
MSG=`mktemp /var/tmp/procmail.wrpr.XXXXXX`
cat - > $MSG
/usr/bin/procmail "$@" < $MSG
EXITVAL=$?
if [ $EXITVAL = 77 ]; then
        echo "Your e-mail went through a blacklisted server:"
        .../scripts/generate-rbl-details < $MSG
        echo ""
        echo "Because of that our system decided to reject your e-mail."
echo "If you believe this was a mistake, please resend your message"
        echo 'with "please read" added to the Subject field.'
        echo ""
fi
rm -f $MSG
exit $EXITVAL
------

But this is pretty ugly - is there a way to do this via procmailrc without having to modify sendmail.cf and utilize a separate wrapper script?

P.S. EXITVAL 77 is "Insufficient permissions" in sendmail...

--
Aleksey Nogin

Home Page: http://nogin.org/
E-Mail: nogin(_at_)cs(_dot_)cornell(_dot_)edu (office), 
ayn2(_at_)cornell(_dot_)edu (home)
Office: Upson 4139, tel: 1-607-255-4934

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