Path: utzoo!attcan!uunet!mcvax!ukc!stl!concurrent!awy From: awy@concurrent.co.uk (Alan Young) Newsgroups: comp.mail.elm Subject: Re: using Elm with mmdf Message-ID: <763@sl10c.concurrent.co.uk> Date: 1 Aug 88 09:34:48 GMT References: <551@sequent.cs.qmc.ac.uk> Organization: $LIBDIR/organization Lines: 44 I too use the mmdf sendmail substitute, but with some changes. First I fixed mmdf's sendmail to return proper exit status codes. And second, because of the dumb way in which elm calls sendmail (always presuming that it worked because of the "-em" flag), I actually call the following shell script from elm: umask 0077 tmp=/tmp/$$tmp log=/tmp/$$log trap "rm -f $tmp $log; exit 1" 1 2 15 calltext=/usr/lib/sendmail em=0 while [ $# -gt 0 ] do if [ "$1" = "-em" ] then em=1 fi calltext="$calltext \"$1\"" shift done if [ $em -eq 1 ] then tee $tmp | eval $calltext >$log 2>&1 result=$? if [ $result -ne 0 ] then ( echo "Your mail was not delivered for the following reason(s)\n" cat $log echo "\n Returned message\n----------------\n" cat $tmp ) | /usr/local/mmdf/v6mail $LOGNAME -s "Failed Mail" \ -f "mmdf (Mail Submission System)" --qz fi else eval $calltext result=$? fi rm -f $tmp $log exit $result