4 messages in net.sourceforge.lists.courier-users[courier-users] Found small bug in rf...
FromSent OnAttachments
Matthias WimmerNov 27, 2007 6:14 pm 
Sam VarshavchikNov 27, 2007 6:48 pm 
Arturo 'Buanzo' BusleimanNov 28, 2007 2:33 am 
Matthias WimmerNov 28, 2007 3:02 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[courier-users] Found small bug in rfc1035/rfc1035mxlist.cActions...
From:Matthias Wimmer (m@tthias.eu)
Date:Nov 27, 2007 6:14:49 pm
List:net.sourceforge.lists.courier-users

Hi!

I found a small bug in the file rfc1035/rfc1035mxlist.c.

The bug is in the addrecord() function:

while ( *list && (*list)->priority < mxpreference ) list= &(*list)->next;

should get changed to:

while ( *list && (*list)->priority <= mxpreference ) list= &(*list)->next;

The reason for this is that the original code reverses the order of the address records for an MX preference level. When add_arecords first calls harvest_records for AAAA records and after that calls harvest_records for A records, this results in IPv4 addresses tried before IPv6 addresses which is incorrect according to RFC 3974 section 3.

And alternative solution to fix the problem would be to change the order of the harvest_records() calls for AAAA and A records within the add_arecords() function, but in that case also the code for processing the HARVEST_NODUPE flag would have to be modified, as this flag would have to be used with the AAAA record call in that case.

Without the patch "testmxlookup tthias.eu" shows the addresses in the incorrect order:

# testmxlookup tthias.eu Domain tthias.eu: Relay: mailin.amessage.eu, Priority: 10, Address: ::ffff:212.112.238.55 [ LOCAL ] Relay: mailin.amessage.eu, Priority: 10, Address: 2001:6f8:900:10d::2 [ LOCAL ]

After fixing the bug textmxlookup returns the addresses in the correct order:

# testmxlookup tthias.eu Domain tthias.eu: Relay: mailin.amessage.eu, Priority: 10, Address: 2001:6f8:900:10d::2 [ LOCAL ] Relay: mailin.amessage.eu, Priority: 10, Address: ::ffff:212.112.238.55 [ LOCAL ]

Matthias