procmail
[Top] [All Lists]

Re: How do I get procmail to output an error message?

2002-07-21 07:36:01
On 07/21/2002 07:12 AM, Udi Mottelo wrote:
On Sat, 20 Jul 2002, Aleksey Nogin wrote:


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



        I do not understand why do you need the stderr?  I guess that you
        want to send a message when you find that "e-mail went through a
        blacklisted server".  So, why don't you do it instead of set
        the $EXITVAL?

Well, with my wrapper script, I get sendmail to send a "full-fledged" bounce message telling "Insufficient permissions" and giving the script output as additional information. I could do it myself, but it's much easier to let sendmail deal with it...

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