procmail
[Top] [All Lists]

Re: Need example: filter outgoing smtp mail inside sendmail

1997-06-11 08:10:00
Ingo Renner writes on 11 June 1997 at 10:52:41
I have a little problem because my reply(from) address depends on the
recipient. If I write to you, the mail goes over my ISP using a uucp relay.
[...]

I've played around with a simple "sendmail" wrapper like the
following.  You either need to tell your MUA to use a non-standard
"sendmail" or replace your existing one.  Note, that I don't (yet) use
this on a regular basis, so it's not well tested.

   Dan
------------------- message is author's opinion only ------------------
J. Daniel Smith <DanS(_at_)bristol(_dot_)com>        
http://www.bristol.com/~DanS
Bristol Technology B.V.                   +31 33 450 50 50, ...51 (FAX)
Amersfoort, The Netherlands               {info,jobs}(_at_)bristol(_dot_)com
-----
#!/bin/sh
if [ "$1" = "-bd" ]; then
  exec /usr/lib/sendmail "$@"
else
  PATH=$PATH:/bin
  tmpd=${TMPDIR:-/tmp}
  me=`basename $0`
  tmpf=$tmpd/$me$$.rc
  cat <<\EOF > $tmpf
PATH=/bin:/usr/bin:/usr/local/bin
SHELL=/bin/sh

DEFAULT=|

# if this message is going off-site, send replies to my PlanetAll
# address (which gets them forwarded back to me) - but at least people
# aren't saving away a work address).  Of course, don't over-ride a
# Reply-To: header that may already be there.
:0hf
* !^TO.*bristol\.com
| formail -a"Reply-To: J_Daniel_Smith(_at_)PlanetAll(_dot_)com"
EOF
  /usr/local/bin/procmail $tmpf | \
  /usr/lib/sendmail "$@"
  stat=$?
  rm -f $tmpf
  exit $stat
fi


<Prev in Thread] Current Thread [Next in Thread>