* "kari" == kari <kari.ruohonen@???> wrote:
kari> However, this rewrites also the addresses for local deliveries
kari> in my LAN, which causes local replies to be unnecessarily routed
kari> via ISP. Is there a way to distinguish between local and remote
kari> deliveries and use this for rewriting rules in exim.conf?
I use the following:
# This transport is used for delivering messages over SMTP connections.
remote_smtp:
driver = smtp
headers_remove = "sender:from"
headers_add = "Sender: ${lookup{$sender_ident}lsearch*{/etc/exim/addresses}\
{$value}{$local_part}}\n\
From: ${lookup{$sender_ident}lsearch*{/etc/exim/addresses}\
{$value}{$local_part}}"
And rewrite the SMTP envelope with
*@*.martin.home martin@??? F
/etc/exim/addresses has "localuser emailaddress" pairs and a "*
defaultaddress" line.
Note that this forces a emailaddress on the users.
Maybe this could be modified somehow (maybe using a transport filter)
to only change the internal addresses, but I did not look into that.
Ciao,
Martin