Skip to content
Jason Knight edited this page Sep 19, 2016 · 6 revisions

Q0301

Question

What do lowest numbered MX record points to local host and remote host address is the local host mean?

Answer

They mean exactly what they say. Exim expected to route an address to a remote host, but the IP address it obtained from a router was for the local host. If you really do want to send over TCP/IP to the local host (to a different version of Exim or another MTA, for example), see Q0206.

Generally these errors arise when Exim thinks it is routing some foreign domain, instead of a local domain.

For example, the router configuration causes Exim to look up the domain in the DNS, but when Exim examines the DNS output, either the lowest numbered MX record points at the local host, or there are no MX records, and the address record for the domain contains an IP address that belongs to the local host.

There has been a rash of instances of domains being deliberately set up with MX records pointing to localhost (or other names with A records that specify 127.0.0.1), which causes this behaviour. You can use the ignore_target_hosts option to get Exim to ignore these records. The default contiguration does this. For more discussion, see Q0319. For other cases:

  1. If the domain is meant to be handled as a local domain, there is a problem with the configuration, because it should not then have been looked up in the DNS. Check the domains settings on your routers.

  2. If the domain is one for which the local host is providing a relaying service (called mail hubbing), possibly as part of a firewall, you need to set up a router to tell Exim where to send messages addressed to this domain, because the DNS directs them to the local host. You should put a router like this one before the one that does DNS lookups:

hubbed_hosts:
  driver = manualroute
  transport = remote_smtp
  route_list = see discussion below

The contents of the route_list option depend on how many hosts you are hubbing for, and how their names are related to the domain name. Suppose the local host is a firewall, and all the domains in *.foo.bar have MX records pointing to it, and each domain corresponds to a host of the same name. Then the setting could be

route_list = *.foo.bar $domain

If there isn't a convenient relationship between the domain names and the host names, you either have to list each domain separately, or use a lookup expansion to look up the host from the domain, or put the routing information in a file and use the route_data option with a lookup expansion.

  1. If neither (1) nor (2) is the case, the lowest numbered MX record or the address record for the domain should not be pointing to your host. You should arrange to get the DNS mended.

Clone this wiki locally