Exim smarthost recipient DNS lookups
Exim version: 4.94-2.cp1194
WHM 94.05, Centos 7
Hi, I've setup Exim to send some emails (those which include a special header) via a smarthost. This is the router setup:
===========================================
send_via_smarthost:
driver = manualroute
domains = ! +local_domains
condition = ${if def:header_X-xsMailingId:{true}{}}
transport = smarthost_smtp
route_list = "* smtp.smarthost.com::587 byname"
host_find_failed = defer
no_more
===========================================
This all works fine, but Exim is still doing a DNS lookup for each recipient domain. I assumed that in this case, Exim would just route the email to the smarthost and it would be the smarthost which would do the MX lookups. Is my assumption correct? If this is Exim's intended behaviour, is there a setting to tell Exim to skip DNS lookups for the recipient in this case?
I know that it's doing a lookup on the recipient because I see lines like this in the log:
====
temporarily rejected RCPT : host lookup did not complete
====
The reason I want to skip DNS lookups when routing via a smarthost is to speed up my scripts. With thousands of recipients, many of them with custom domains, even with a local caching name server, lookups to these domains can take tens, or sometimes hundreds, of miliseconds.
Many thanks for any help or advice anyone can give me.
-
Howdy, RVI! Indeed that is intended behavior. However, it can be configured to skip dns. To quote exim documentation: 20. The manualroute router [QUOTE] Addresses with the same domain are normally routed by the manualroute router to the same list of hosts. However, this cannot be presumed, because the router options and preconditions may refer to the local part of the address. By default, therefore, Exim routes each address in a message independently. DNS servers run caches, so repeated DNS lookups are not normally expensive, and in any case, personal messages rarely have more than a few recipients.
For more information about dnslookup: 51. Some common configuration settings0 -
Hi David. Thanks very much. Is it the " same_domain_copy_routing" setting that you're referring to? I understood that to mean that the first time that Exim comes across a domain, it will do a DNS lookup, then if same_domain_copy_routing is set, it will skip subsequent lookups to the same domain. But it will always do one lookup per domain. If message delivery is via another host, then there shouldn't be a need to do even one lookup on the recipient's domain since Exim won't be handling delivery of the message - it'll be the smarthost that does this. Doing this lookup is wasted effort as far as I can see. I couldn't find a setting which tells Exim to skip DNS lookup of the recipient altogether. 0
Please sign in to leave a comment.
Comments
3 comments