Our dnslookup router is:
dnslookup:
driver = dnslookup
domains = !+local_domains
ignore_target_hosts = +bad_hosts
mx_domains = *.cam.ac.uk
widen_domains = cam.ac.uk : ac.uk
same_domain_copy_routing
no_more
cannot_route_message = Invalid domain part in email address
transport = smtp
We have for very many years supported abbreviated email addresses and they
are still fairly frequently used. However the above router only really
works for recipient addresses. The crucial point is the (invisible)
rewrite_headers setting. If I send email to ph10@cam, then
widen_domains will turn the address into ph10@???, and will then go
through the message header and make the same change to any copies of the
address that appear there.
This change is ephemeral: only the copy of the header in RAM is changed.
If the message is delayed then the change is re-done when the message is
re-routed during the re-try. A corollary is that the rewrite_headers
feature has no effect during address verification. This is fine for
recipient addresses, because they will be fixed-up later. However, sender
addresses are not passed through the routers at message transport time, so
widen_domains and rewrite_headers don't get a chance to do their thing!
This is an unpleasant loop-hole which I would like to fix. The only
solution I can think of is to use two copies of the dnslookup router, one
with widen_domains and one without. However this is a relatively ugly
work-around; perhaps Exim should be hard-coded so that widen_domains only
works for recipient addresses.
Any opinions?
Tony.
--
<fanf@???> <dot@???>
http://dotat.at/ ${sg{\N${sg{\
N\}{([^N]*)(.)(.)(.*)}{\$1\$3\$2\$1\$3\n\$2\$3\$4\$3\n\$3\$2\$4}}\
\N}{([^N]*)(.)(.)(.*)}{\$1\$3\$2\$1\$3\n\$2\$3\$4\$3\n\$3\$2\$4}}