summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2018-06-07 18:08:22 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2018-06-07 18:08:22 +0100
commitd8d9f9301c9a31c826635bbdd334bb4be99ea05a (patch)
tree1bfd0accaea8555d5eea9333fc56903de8b050a1 /src
parent7b9822bffe67da2a43a82d12caf5db00a3ed71c2 (diff)
Follow CNAME chains only one step. Bug 2264
Diffstat (limited to 'src')
-rw-r--r--src/README.UPDATING8
-rw-r--r--src/src/dns.c19
-rw-r--r--src/src/globals.c1
-rw-r--r--src/src/globals.h1
-rw-r--r--src/src/readconf.c1
-rw-r--r--src/src/verify.c5
6 files changed, 26 insertions, 9 deletions
diff --git a/src/README.UPDATING b/src/README.UPDATING
index 73b52e4a0..2438cc953 100644
--- a/src/README.UPDATING
+++ b/src/README.UPDATING
@@ -26,6 +26,14 @@ The rest of this document contains information about changes in 4.xx releases
that might affect a running system.
+Exim version 4.92
+-----------------
+
+ * Exim used to manually follow CNAME chains, to a limited depth. In this
+ day-and-age we expect the resolver to be doing this for us, so the loop
+ is limited to one retry unless the (new) config option dns_cname_loops
+ is changed.
+
Exim version 4.91
-----------------
diff --git a/src/src/dns.c b/src/src/dns.c
index 83de7c266..cb1766618 100644
--- a/src/src/dns.c
+++ b/src/src/dns.c
@@ -674,10 +674,10 @@ if ((previous = tree_search(tree_dns_fails, node_name)))
{
DEBUG(D_dns) debug_printf("DNS lookup of %.255s-%s: using cached value %s\n",
name, dns_text_type(type),
- (previous->data.val == DNS_NOMATCH)? "DNS_NOMATCH" :
- (previous->data.val == DNS_NODATA)? "DNS_NODATA" :
- (previous->data.val == DNS_AGAIN)? "DNS_AGAIN" :
- (previous->data.val == DNS_FAIL)? "DNS_FAIL" : "??");
+ previous->data.val == DNS_NOMATCH ? "DNS_NOMATCH" :
+ previous->data.val == DNS_NODATA ? "DNS_NODATA" :
+ previous->data.val == DNS_AGAIN ? "DNS_AGAIN" :
+ previous->data.val == DNS_FAIL ? "DNS_FAIL" : "??");
return previous->data.val;
}
@@ -836,6 +836,8 @@ return DNS_SUCCEED;
/* Look up the given domain name, using the given type. Follow CNAMEs if
necessary, but only so many times. There aren't supposed to be CNAME chains in
the DNS, but you are supposed to cope with them if you find them.
+By default, follow one CNAME since a resolver has been seen, faced with
+an MX request and a CNAME (to an A) but no MX present, returning the CNAME.
The assumption is made that if the resolver gives back records of the
requested type *and* a CNAME, we don't need to make another call to look up
@@ -871,9 +873,14 @@ int i;
const uschar *orig_name = name;
BOOL secure_so_far = TRUE;
-/* Loop to follow CNAME chains so far, but no further... */
+/* By default, assume the resolver follows CNAME chains (and returns NODATA for
+an unterminated one). If it also does that for a CNAME loop, fine; if it returns
+a CNAME (maybe the last?) whine about it. However, retain the coding for dumb
+resolvers hiding behind a config variable. Loop to follow CNAME chains so far,
+but no further... The testsuite tests the latter case, mostly assuming that the
+former will work. */
-for (i = 0; i < 10; i++)
+for (i = 0; i <= dns_cname_loops; i++)
{
uschar * data;
dns_record *rr, cname_rr, type_rr;
diff --git a/src/src/globals.c b/src/src/globals.c
index ec948151f..138a29e8a 100644
--- a/src/src/globals.c
+++ b/src/src/globals.c
@@ -698,6 +698,7 @@ BOOL dmarc_enable_forensic = FALSE;
uschar *dns_again_means_nonexist = NULL;
int dns_csa_search_limit = 5;
BOOL dns_csa_use_reverse = TRUE;
+int dns_cname_loops = 1;
#ifdef SUPPORT_DANE
int dns_dane_ok = -1;
#endif
diff --git a/src/src/globals.h b/src/src/globals.h
index 9c7d8ccd9..f9be8b832 100644
--- a/src/src/globals.h
+++ b/src/src/globals.h
@@ -421,6 +421,7 @@ extern BOOL dmarc_enable_forensic; /* Set via ACL control statement. When se
extern uschar *dns_again_means_nonexist; /* Domains that are badly set up */
extern int dns_csa_search_limit; /* How deep to search for CSA SRV records */
extern BOOL dns_csa_use_reverse; /* Check CSA in reverse DNS? (non-standard) */
+extern int dns_cname_loops; /* Follow CNAMEs returned by resolver to this depth */
extern uschar *dns_ipv4_lookup; /* For these domains, don't look for AAAA (or A6) */
#ifdef SUPPORT_DANE
extern int dns_dane_ok; /* Ok to use DANE when checking TLS authenticity */
diff --git a/src/src/readconf.c b/src/src/readconf.c
index 919fbc215..3f307fd5c 100644
--- a/src/src/readconf.c
+++ b/src/src/readconf.c
@@ -123,6 +123,7 @@ static optionlist optionlist_config[] = {
#endif
{ "dns_again_means_nonexist", opt_stringptr, &dns_again_means_nonexist },
{ "dns_check_names_pattern", opt_stringptr, &check_dns_names_pattern },
+ { "dns_cname_loops", opt_int, &dns_cname_loops },
{ "dns_csa_search_limit", opt_int, &dns_csa_search_limit },
{ "dns_csa_use_reverse", opt_bool, &dns_csa_use_reverse },
{ "dns_dnssec_ok", opt_int, &dns_dnssec_ok },
diff --git a/src/src/verify.c b/src/src/verify.c
index 95876d1cd..5d0551e89 100644
--- a/src/src/verify.c
+++ b/src/src/verify.c
@@ -3411,9 +3411,8 @@ else
/* If the lookup succeeded, cache the RHS address. The code allows for
more than one address - this was for complete generality and the possible
- use of A6 records. However, A6 records have been reduced to experimental
- status (August 2001) and may die out. So they may never get used at all,
- let alone in dnsbl records. However, leave the code here, just in case.
+ use of A6 records. However, A6 records are no longer supported. Leave the code
+ here, just in case.
Quite apart from one A6 RR generating multiple addresses, there are DNS
lists that return more than one A record, so we must handle multiple