------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=830
           Summary: manualroute fake MXs being lost in hosts_find_bydns
           Product: Exim
           Version: 4.69
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: bug
          Priority: medium
         Component: Routing
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]


Created an attachment (id=308)
 --> (http://bugs.exim.org/attachment.cgi?id=308)
A patch to rf_lookup_hostslists to retain the fake mx assignments.

Config snippet:

mua_wrapper = true
begin routers
smarthost:
  driver = manualroute
  debug_print = true
  hosts_randomize = true
  route_list = * "</ foohost1.domain.com:15600 / foohost2.domain.com:15600"
  transport = remote_smtp
  no_more
begin transports
remote_smtp:
  driver = smtp

Test it with something like:

./exim -C $PWD/exim.config -d -N -bm -f [email protected] [email protected]
[email protected] < msg

And you'll about 50% of the time receive an error in your logs:

2009-03-25 16:16:34 [6591] 1LmUqI-0001iJ-L6 <= [email protected] U=eandres P=local
S=322 from <[email protected]> for [email protected] [email protected]
2009-03-25 16:16:34 [6593] 1LmUqI-0001iJ-L6 ** mua_wrapper is set but
recipients cannot all be delivered in one transaction
2009-03-25 16:16:34 [6593] 1LmUqI-0001iJ-L6 Completed QT=0s

This only happens if:
  - you use mua_wrapper
  - you use hosts_randomize
  - you have more than one host in a hostgroup in the route_list
  - your hosts do not have MX records of their own defined

The debug info tells the tale:

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
routing [email protected]
--------> smarthost router <--------
local_part=quux domain=google.com
true
calling smarthost router
smarthost router called for [email protected]
  domain = google.com
route_item = * "</ foohost1.domain.com:15600 / foohost2.domain.com:15600"
google.com in "*"? yes (matched "*")
original list of hosts = "</ foohost1.domain.com:15600 /
foohost2.domain.com:15600" options = 
expanded list of hosts = "</ foohost1.domain.com:15600 /
foohost2.domain.com:15600" options = 
set transport remote_smtp
finding IP address for foohost2.domain.com:15600
host=foohost2.domain.com port=15600
doing DNS lookup
DNS lookup of foohost2.domain.com (A) succeeded
fully qualified name = foohost2.domain.com
foohost2.domain.com 10.241.243.39 mx=-1 sort=-462 
finding IP address for foohost1.domain.com:15600
host=foohost1.domain.com port=15600
doing DNS lookup
DNS lookup of foohost1.domain.com (A) succeeded
fully qualified name = foohost1.domain.com
foohost1.domain.com 10.241.243.96 mx=-1 sort=-462 
queued for remote_smtp transport: local_part = quux
domain = google.com
  errors_to=NULL
  domain_data=NULL localpart_data=NULL
routed by smarthost router
  envelope to: [email protected]
  transport: remote_smtp
  host foohost2.domain.com [10.241.243.39] port=15600
  host foohost1.domain.com [10.241.243.96] port=15600
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
routing [email protected]
--------> smarthost router <--------
local_part=bar domain=google.com
true
calling smarthost router
smarthost router called for [email protected]
  domain = google.com
route_item = * "</ foohost1.domain.com:15600 / foohost2.domain.com:15600"
google.com in "*"? yes (matched "*")
original list of hosts = "</ foohost1.domain.com:15600 /
foohost2.domain.com:15600" options = 
expanded list of hosts = "</ foohost1.domain.com:15600 /
foohost2.domain.com:15600" options = 
finding IP address for foohost1.domain.com:15600
host=foohost1.domain.com port=15600
doing DNS lookup
DNS lookup of foohost1.domain.com (A) succeeded
fully qualified name = foohost1.domain.com
foohost1.domain.com 10.241.243.96 mx=-1 sort=-28 
finding IP address for foohost2.domain.com:15600
host=foohost2.domain.com port=15600
doing DNS lookup
DNS lookup of foohost2.domain.com (A) succeeded
fully qualified name = foohost2.domain.com
foohost2.domain.com 10.241.243.39 mx=-1 sort=-316 
queued for remote_smtp transport: local_part = bar
domain = google.com
  errors_to=NULL
  domain_data=NULL localpart_data=NULL
routed by smarthost router
  envelope to: [email protected]
  transport: remote_smtp
  host foohost1.domain.com [10.241.243.96] port=15600
  host foohost2.domain.com [10.241.243.39] port=15600
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
After routing:
  Local deliveries:
  Remote deliveries:
    [email protected]
    [email protected]
  Failed addresses:
  Deferred addresses:
search_tidyup called

You'll notice that the 'routed by smarthost router' bit lists the hosts, but
there's no 'mx' displayed for each host. This is because it was stripped in the
hosts_find_bydns method, which makes the assumption that no MX was previously
set, and that it should set it via an MX lookup.

I solved this with a small patch to retain the mx and sort_key parts within
rf_lookup_hostlist.cc, much like the port is already handled, because it was
the most obvious solution. A fix to hosts_find_bydns might be a more clean
approach.

The patch is attached.


-- 
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email

-- 
## List details at http://lists.exim.org/mailman/listinfo/exim-dev Exim details 
at http://www.exim.org/ ##

Reply via email to