procmail
[Top] [All Lists]

Re: environment passed from sendmail?

2015-08-09 14:18:47

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
____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail