Re: environment passed from sendmail?

wolfgang <[email protected]> Sun, 09 Aug 2015 17:05:35 +0200
Newsgroups gmane.mail.procmail
Message-ID <[email protected]>
I use the following to extract the envelope sender et al.:

# Catch SMTP Envelope Sender
# and write it into X-$HOSTNAME-Fromenvelope header
:0fh
{
   SUBJECT="`/usr/bin/formail -xSubject:`"
   FROM="`/usr/bin/formail -XFrom | head -1`"
   SENDER="`/bin/echo $FROM | cut -d' ' -f2`"
   FULLSENDER='<'"$SENDER"'>'
   :0fh
   |/usr/bin/formail -f -i "X-${HOST}-Envelope-From: ${SENDER}"
}

Hope this helps,

wolfgang