diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2016-08-06 18:28:18 +0100 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2016-08-06 21:51:20 +0100 |
commit | 1435d4b244871b65c6bb07878ddd2241ae8d2545 (patch) | |
tree | d59a3578589ef7f99d60557307fbceb37d62b7b7 /src | |
parent | 9960d1e59f08254a951283981d4a32c73ca7d3ad (diff) |
Routing: in a dnslookup, fix fail_defer_domains to defer on missing MX record. Bug 1867
Diffstat (limited to 'src')
-rw-r--r-- | src/src/routers/dnslookup.c | 32 | ||||
-rw-r--r-- | src/src/utf8.c | 2 |
2 files changed, 17 insertions, 17 deletions
diff --git a/src/src/routers/dnslookup.c b/src/src/routers/dnslookup.c index 83ba5f689..d2be40e0f 100644 --- a/src/src/routers/dnslookup.c +++ b/src/src/routers/dnslookup.c @@ -305,6 +305,22 @@ for (;;) if (rc != HOST_FIND_FAILED) break; + if (ob->fail_defer_domains) + switch(match_isinlist(fully_qualified_name, + CUSS &ob->fail_defer_domains, 0, + &domainlist_anchor, addr->domain_cache, MCL_DOMAIN, TRUE, NULL)) + { + case DEFER: + addr->message = US"lookup defer for fail_defer_domains option"; + return DEFER; + + case OK: + DEBUG(D_route) debug_printf("%s router: matched fail_defer_domains\n", + rblock->name); + addr->message = US"missing MX, or all MXs point to missing A records," + " and defer requested"; + return DEFER; + } /* Check to see if the failure is the result of MX records pointing to non-existent domains, and if so, set an appropriate error message; the case of an MX or SRV record pointing to "." is another special case that we can @@ -335,22 +351,6 @@ for (;;) addr->message); } } - if (ob->fail_defer_domains) - { - switch(match_isinlist(fully_qualified_name, - CUSS &ob->fail_defer_domains, 0, - &domainlist_anchor, addr->domain_cache, MCL_DOMAIN, TRUE, NULL)) - { - case DEFER: - addr->message = US"lookup defer for fail_defer_domains"; - return DEFER; - - case OK: - DEBUG(D_route) debug_printf("%s router: matched fail_defer_domains\n", - rblock->name); - return DEFER; - } - } return DECLINE; } diff --git a/src/src/utf8.c b/src/src/utf8.c index 84ad1dc18..e394db0a8 100644 --- a/src/src/utf8.c +++ b/src/src/utf8.c @@ -18,7 +18,7 @@ BOOL string_is_utf8(const uschar * s) { uschar c; -while ((c = *s++)) if (c & 0x80) return TRUE; +if (s) while ((c = *s++)) if (c & 0x80) return TRUE; return FALSE; } |