diff options
author | Philip Hazel <ph10@hermes.cam.ac.uk> | 2006-04-04 11:18:30 +0000 |
---|---|---|
committer | Philip Hazel <ph10@hermes.cam.ac.uk> | 2006-04-04 11:18:30 +0000 |
commit | 9b8fadde9b0b4b04124f69996c378958fd5b0127 (patch) | |
tree | 338655276d4eb9757f5ff63c9fe8c7261c06e539 /src | |
parent | 953a9f896e50fb554a2f5cc702c606e053209026 (diff) |
Make dns_again_means_nonexist apply to gethostbyname lookups as well.
Diffstat (limited to 'src')
-rw-r--r-- | src/src/host.c | 32 | ||||
-rw-r--r-- | src/src/verify.c | 3 |
2 files changed, 29 insertions, 6 deletions
diff --git a/src/src/host.c b/src/src/host.c index 01191f454..4d637fb51 100644 --- a/src/src/host.c +++ b/src/src/host.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/host.c,v 1.23 2006/03/17 16:51:45 ph10 Exp $ */ +/* $Cambridge: exim/src/src/host.c,v 1.24 2006/04/04 11:18:31 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -1890,13 +1890,13 @@ int af; #endif /* If we are in the test harness, a name ending in .test.again.dns always -forces a temporary error response. */ +forces a temporary error response, unless the name is in +dns_again_means_nonexist. */ if (running_in_test_harness) { uschar *endname = host->name + Ustrlen(host->name); - if (Ustrcmp(endname - 14, "test.again.dns") == 0) - return HOST_FIND_AGAIN; + if (Ustrcmp(endname - 14, "test.again.dns") == 0) goto RETURN_AGAIN; } /* In an IPv6 world, unless IPv6 has been disabled, we need to scan for both @@ -2071,7 +2071,7 @@ if (host->address == NULL) string_sprintf("no IP address found for host %s", host->name); HDEBUG(D_host_lookup) debug_printf("%s\n", msg); - if (temp_error) return HOST_FIND_AGAIN; + if (temp_error) goto RETURN_AGAIN; if (host_checking || !log_testing_mode) log_write(L_host_lookup_failed, LOG_MAIN, "%s", msg); return HOST_FIND_FAILED; @@ -2108,6 +2108,28 @@ HDEBUG(D_host_lookup) /* Return the found status. */ return yield; + +/* Handle the case when there is a temporary error. If the name matches +dns_again_means_nonexist, return permanent rather than temporary failure. */ + +RETURN_AGAIN: + { + #ifndef STAND_ALONE + int rc; + uschar *save = deliver_domain; + deliver_domain = host->name; /* set $domain */ + rc = match_isinlist(host->name, &dns_again_means_nonexist, 0, NULL, NULL, + MCL_DOMAIN, TRUE, NULL); + deliver_domain = save; + if (rc == OK) + { + DEBUG(D_host_lookup) debug_printf("%s is in dns_again_means_nonexist: " + "returning HOST_FIND_FAILED\n", host->name); + return HOST_FIND_FAILED; + } + #endif + return HOST_FIND_AGAIN; + } } diff --git a/src/src/verify.c b/src/src/verify.c index 8776700a0..93d9f582d 100644 --- a/src/src/verify.c +++ b/src/src/verify.c @@ -1,4 +1,4 @@ -/* $Cambridge: exim/src/src/verify.c,v 1.35 2006/03/16 12:07:55 ph10 Exp $ */ +/* $Cambridge: exim/src/src/verify.c,v 1.36 2006/04/04 11:18:31 ph10 Exp $ */ /************************************************* * Exim - an Internet mail transport agent * @@ -2125,6 +2125,7 @@ if (*t == 0) h.name = ss; h.address = NULL; h.mx = MX_NONE; + rc = host_find_byname(&h, NULL, NULL, FALSE); if (rc == HOST_FOUND || rc == HOST_FOUND_LOCAL) { |