[exim] dnsdb PTR lookup for hostnames.

Top Page
Delete this message
Reply to this message
Author: David Woodhouse
Date:  
To: 'exim-users@exim.org'
Subject: [exim] dnsdb PTR lookup for hostnames.
Some experimental protocols use PTR records for real hostnames:
http://www.ietf.org/internet-drafts/draft-ietf-marid-csv-dna-01.txt

Unfortunately Exim insists on attempting to reverse the hostnames and
appending 'in-addr.arpa' to them...

database lookup required for ptr=baythorne.infradead.org
dnsdb key: org.infradead.baythorne..in-addr.arpa
DNS lookup of org.infradead.baythorne..in-addr.arpa (PTR) gave NO_RECOVERY

We should do this only if the input is actually an IP address. I tested
this patch with IPv4 and IPv4 input strings as well as normal hostnames,
and all seem to behave correctly now. I can't imagine any case where the
current behaviour is desired for non-numeric input...

--- src/lookups/dnsdb.c~    2004-10-05 09:32:08.000000000 +0100
+++ src/lookups/dnsdb.c    2004-12-13 16:00:42.000000000 +0000
@@ -125,7 +125,7 @@
 /* If the type is PTR, we have to construct the relevant magic lookup
 key. This code is now in a separate function. */


-if (type == T_PTR)
+if (type == T_PTR && string_is_ip_address(keystring, NULL))
{
dns_build_reverse(keystring, buffer);
keystring = buffer;


--
dwmw2