Ross Boylan wrote:
On Sat, Sep 27, 2003 at 03:43:13PM +1000, Russell Shaw wrote: ...all From and Reply-To headers only on mail that is sent out the smtp transport to my dialup isp. However, exim3 doesn't let you rewrite envelope addresses on per-transport rewrites. The only other option is to use the rewrite rule in the "generic" section of exim.conf. This applies the rule to every local message floating around the system, so its effects are too undefined for my liking. Does exim4 allow envelope rewriting on only an smtp outgoing mail transport?Yes. I use this feature ini an exim4 installation. But I see it described in the exim3 book on p 177: "a new generic transport option called headers_rewrite was added to Exim for release 3.20."
There is more detail on P.342.
I have this in exim.conf:
remote_smtp:
driver = smtp
headers_rewrite = russell@main.mypc.com.au rjshaw@iprimus.com.au
Then test with:
mail -s test user@remote
Another test
^D
The response shows that russell@main.mypc.com.au hasn't been
replaced with rjshaw@iprimus.com.au.
Message 1:
From MAILER-DAEMON Sat Sep 27 19:08:21 2003
Envelope-to: russell@main.mypc.com.au
X-Failed-Recipients: user@remote
From: Mail Delivery System <Mailer-Daemon@main.mypc.com.au>
To: russell@main.mypc.com.au
Subject: Mail delivery failed: returning message to sender
Date: Sat, 27 Sep 2003 19:08:21 +1000
This message was created automatically by mail delivery software (Exim).
A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:
user@remote
SMTP error from remote mailer after MAIL FROM:<russell@main.mypc.com.au> SIZE=1364:
host smtp.iprimus.com.au [203.134.152.42]: 553 <russell@main.mypc.com.au> unable to verify address
------ This is a copy of the message, including all the headers. ------
Return-path: <russell@main.mypc.com.au>
Received: from russell by main.mypc.com.au with local (Exim 3.36 #1 (Debian))
id 1A3B3s-0001Or-00
for <user@remote>; Sat, 27 Sep 2003 19:08:20 +1000
To: user@remote
Subject: test
Message-Id: <E1A3B3s-0001Or-00@main.mypc.com.au>
From: Russell Shaw <russell@main.mypc.com.au>
Date: Sat, 27 Sep 2003 19:08:20 +1000
Another test