Having just spent a half-hour studying the differences between your lookuphost router and mine...
bold represents your additions:
Code:
lookuphost:
driver = dnslookup
[b]# domains = ! +local_domains[/b]
ignore_target_hosts = 127.0.0.0/8
condition = "${perl{check_limits}}"
[b]self = pass[/b]
[b]same_domain_copy_routing = true[/b]
transport = remote_smtp
no_more
First let's look at the line you commented out...
By commenting out the line beginning with
domains you've effectively told this router to route all domains, whether or not they're local. So far so good.
By adding the line
self = pass you've changed the default routing.
According to the book:
exim: The Exim SMTP Mail Server, written by Philip Hazel, the author of exim:
After Exim has routed an address to a list of remote hosts, it checks to see if the first host on the list is the local host. Usually, this indicates some kind of configuration error, and by default Exim treats it as such. However there are types of configuration where this is legitimate, and for these cases the self option is used to specifiy what is to be done.
--Page 44, Section 3.10.4
So let's now look at the action specified by the
pass setting for
self:
If self is set to pass, the router returns "pass", which means that the address is passed to the following router
--Page 113, Section 6.5.2
Here's where it gets a bit complicated. If your DNS lookup returns your local host, then the
self = pass line would simply undo your commenting out of the
domains = ! +local_domains line. If your DNS lookup returns a different host (as it would if you used a different server for DNS lookups than the one you run on your local server), then this router would work as you'd expect.
So...
as long as /etc/resolv.conf doesn't list your nameserver at all, not as localhost, or by IP#), you can expect your code to work under
most circumstances.
Except...
What about the circumstance where your client's domain uses something like the
Junk Email Filter described
here?
Under this circumstance local_domains wouldn't be checked, and the email would be routed to the lowest cost MX server, which would be the one at the filter company. They'd preprocess the email and send it back to your server. Since local_domains isn't being checked, the email would be sent back to them, creating a loop
If you haven't seen a loop, my guess is that's because you haven't seen this scenario. We have, so we understand the problem.
To complete our analysis of your lookuphost router:
Setting
same_domain_copy_routing = true simply avoids duplicate DNS lookups when multiple addresses for a given email have the same domain name. (ibid., page 122)
This saves time if you're hosting mailing lists with lots of email going to the same domain, but it doesn't change the actions.
If you disagree with the points I've made, then please comment; it's not my intent to mislead. If I'm wrong, I'd like to know it.
Jeff