summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Arlott <bugzilla.exim.simon@arlott.org>2019-09-22 18:45:18 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2019-09-22 18:45:18 +0100
commit6219e0ec4a59a06b84eaabb6b3ae5d9e8f166672 (patch)
tree0e3588d3a332c240ea0fe14a480228f9c793903b /src
parent1a2e76e1676bf405a464a233950a95012533c227 (diff)
DNS: do not skip initial two components of SRV & TLSA lookups before checking name syntax.
The introduction of DKIM added _ to the permitted chars, so those components will pass.
Diffstat (limited to 'src')
-rw-r--r--src/src/dns.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/src/src/dns.c b/src/src/dns.c
index 44654353c..4750f1b52 100644
--- a/src/src/dns.c
+++ b/src/src/dns.c
@@ -818,34 +818,17 @@ regex has substrings that are used - the default uses a conditional.
This test is omitted for PTR records. These occur only in calls from the dnsdb
lookup, which constructs the names itself, so they should be OK. Besides,
-bitstring labels don't conform to normal name syntax. (But the aren't used any
-more.)
-
-For SRV records, we omit the initial _smtp._tcp. components at the start.
-The check has been seen to bite on the destination of a SRV lookup that
-initiall hit a CNAME, for which the next name had only two components.
-RFC2782 makes no mention of the possibiility of CNAMES, but the Wikipedia
-article on SRV says they are not a valid configuration. */
+bitstring labels don't conform to normal name syntax. (But they aren't used any
+more.) */
#ifndef STAND_ALONE /* Omit this for stand-alone tests */
if (check_dns_names_pattern[0] != 0 && type != T_PTR && type != T_TXT)
{
- const uschar *checkname = name;
int ovector[3*(EXPAND_MAXN+1)];
dns_pattern_init();
-
- /* For an SRV lookup, skip over the first two components (the service and
- protocol names, which both start with an underscore). */
-
- if (type == T_SRV || type == T_TLSA)
- {
- while (*checkname && *checkname++ != '.') ;
- while (*checkname && *checkname++ != '.') ;
- }
-
- if (pcre_exec(regex_check_dns_names, NULL, CCS checkname, Ustrlen(checkname),
+ if (pcre_exec(regex_check_dns_names, NULL, CCS name, Ustrlen(name),
0, PCRE_EOPT, ovector, nelem(ovector)) < 0)
{
DEBUG(D_dns)