diff options
author | Jeremy Harris <jgh146exb@wizmail.org> | 2015-05-05 22:50:56 +0100 |
---|---|---|
committer | Jeremy Harris <jgh146exb@wizmail.org> | 2015-05-06 15:22:45 +0100 |
commit | 4a452c432a063c45bca4079acb5f654cb0ec5d6d (patch) | |
tree | 4f013b992ace416dc95e0e54b50fec9443916f34 /src | |
parent | a753aaff0ec5ca168a10a8033bbb51a7324db6d8 (diff) |
Log reason for defer, on a hostlist dns-lookup temporary error. Bug 1328
Diffstat (limited to 'src')
-rw-r--r-- | src/src/acl.c | 6 | ||||
-rw-r--r-- | src/src/host.c | 8 | ||||
-rw-r--r-- | src/src/match.c | 3 |
3 files changed, 9 insertions, 8 deletions
diff --git a/src/src/acl.c b/src/src/acl.c index aa9f58f2c..b42492d88 100644 --- a/src/src/acl.c +++ b/src/src/acl.c @@ -3582,7 +3582,8 @@ for (; cb != NULL; cb = cb->next) rc = verify_check_this_host(&arg, sender_host_cache, NULL, (sender_host_address == NULL)? US"" : sender_host_address, CUSS &host_data); - if (host_data != NULL) host_data = string_copy_malloc(host_data); + if (rc == DEFER) *log_msgptr = search_error_message; + if (host_data) host_data = string_copy_malloc(host_data); break; case ACLC_LOCAL_PARTS: @@ -3597,8 +3598,7 @@ for (; cb != NULL; cb = cb->next) int sep = 0; const uschar *s = arg; uschar *ss; - while ((ss = string_nextinlist(&s, &sep, big_buffer, big_buffer_size)) - != NULL) + while ((ss = string_nextinlist(&s, &sep, big_buffer, big_buffer_size))) { if (Ustrcmp(ss, "main") == 0) logbits |= LOG_MAIN; else if (Ustrcmp(ss, "panic") == 0) logbits |= LOG_PANIC; diff --git a/src/src/host.c b/src/src/host.c index f6c8faac7..4d76fc4a3 100644 --- a/src/src/host.c +++ b/src/src/host.c @@ -1995,11 +1995,11 @@ for (i = 1; i <= times; switch (error_num) { case HOST_NOT_FOUND: error = US"HOST_NOT_FOUND"; break; - case TRY_AGAIN: error = US"TRY_AGAIN"; break; - case NO_RECOVERY: error = US"NO_RECOVERY"; break; - case NO_DATA: error = US"NO_DATA"; break; + case TRY_AGAIN: error = US"TRY_AGAIN"; break; + case NO_RECOVERY: error = US"NO_RECOVERY"; break; + case NO_DATA: error = US"NO_DATA"; break; #if NO_DATA != NO_ADDRESS - case NO_ADDRESS: error = US"NO_ADDRESS"; break; + case NO_ADDRESS: error = US"NO_ADDRESS"; break; #endif default: error = US"?"; break; } diff --git a/src/src/match.c b/src/src/match.c index 5bf4ef5d8..893ff4863 100644 --- a/src/src/match.c +++ b/src/src/match.c @@ -740,7 +740,7 @@ while ((sss = string_nextinlist(&list, &sep, buffer, sizeof(buffer))) != NULL) case DEFER: if (error == NULL) - error = string_sprintf("DNS lookup of %s deferred", ss); + error = string_sprintf("DNS lookup of \"%s\" deferred", ss); if (ignore_defer) { HDEBUG(D_lists) debug_printf("%s: item ignored by +ignore_defer\n", @@ -752,6 +752,7 @@ while ((sss = string_nextinlist(&list, &sep, buffer, sizeof(buffer))) != NULL) log_write(0, LOG_MAIN, "%s: accepted by +include_defer", error); return OK; } + if (!search_error_message) search_error_message = error; goto DEFER_RETURN; /* The ERROR return occurs when checking hosts, when either a forward |