In DNS, we have entries like:
@ IN MX 0 mail
IN MX 10 mx1
IN MX 10 mx2
When mx1 or mx2 receive a message that cannot be relayed to 'mail', they deliver to themselves and to each other instead, eventually resulting in a 'Too many "Received" headers - suspected mail loop' error. The Exim main log shows "R=dnslookup" with deliveries not only between mx1 and mx2 but also between mx1 and itself and between mx2 and itself.
My understanding is that a MTA should never deliver to itself or an equal-preference MX. So when 'mail' is not available, mx1 and mx2 should simply queue the message. Instead, they deliver to each other and to themselves.
The routers config has:
dnslookup:
driver = dnslookup
domains = ! +local_domains
transport = remote_smtp
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8
no_more
The 'local_domains' lists have @, @[] and every name by which the local host might be known.
What might be causing this strange looping behavior?