Re: environment passed from sendmail?

"Ruud H.G. van Tol" <[email protected]> Sun, 9 Aug 2015 21:10:21 +0200
Newsgroups gmane.mail.procmail
Message-ID <[email protected]>
On 2015-08-09 17:05, wolfgang wrote:

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

Alternatively, most of this can be done in pure procmail.

Some examples here: http://rvtol.home.xs4all.nl/procmail/basic/pm/

-- 
Ruud