From 9d74d5e01f4d61fa65e419a3b7ba027a2fe32470 Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Tue, 18 Jul 2017 23:10:33 +0100 Subject: [PATCH] Fix cache-cold random callout verify. Bug 2147 --- doc/doc-txt/ChangeLog | 5 +++++ src/src/verify.c | 4 +++- test/log/0376 | 4 ---- test/log/0578 | 4 ---- test/rejectlog/0376 | 4 ---- test/rejectlog/0578 | 4 ---- test/stderr/0376 | 8 -------- test/stderr/0578 | 8 -------- test/stdout/0376 | 4 ++-- test/stdout/0578 | 4 ++-- 10 files changed, 12 insertions(+), 37 deletions(-) diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index d74a18dd6..af7571fd4 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -30,6 +30,11 @@ JH/19 Bug 2141: Use the full-complex API for Berkeley DB rather than the legacy- file in the working directory redirecting the DB files, possibly correpting some existing file. +JH/20 Bug 2147: Do not defer for a verify-with-callout-and-random which is not + cache-hot. Previously, although the result was properly cached, the + initial verify call returned a defer. + + Exim version 4.89 ----------------- diff --git a/src/src/verify.c b/src/src/verify.c index 9c4776b31..ba5e84d15 100644 --- a/src/src/verify.c +++ b/src/src/verify.c @@ -789,7 +789,9 @@ tls_retry_connection: { case PENDING_OK: new_domain_record.random_result = ccache_accept; - break; + yield = OK; /* Only usable result we can return */ + done = TRUE; + goto no_conn; case FAIL: new_domain_record.random_result = ccache_reject; diff --git a/test/log/0376 b/test/log/0376 index 0e2f661ac..fa191bcd5 100644 --- a/test/log/0376 +++ b/test/log/0376 @@ -12,10 +12,6 @@ 1999-03-02 09:44:33 H=[V4NET.0.0.2] U=root F= rejected RCPT : Sender verify failed 1999-03-02 09:44:33 H=[V4NET.0.0.2] U=root sender verify fail for 1999-03-02 09:44:33 H=[V4NET.0.0.2] U=root F= rejected RCPT : Sender verify failed -1999-03-02 09:44:33 H=[V4NET.0.0.3] U=root sender verify defer for : Could not complete sender verify callout: 127.0.0.1 [127.0.0.1] : response to "RCPT TO:" was: 250 OK -1999-03-02 09:44:33 H=[V4NET.0.0.3] U=root F= temporarily rejected RCPT : Could not complete sender verify callout -1999-03-02 09:44:33 H=[V4NET.0.0.4] U=root sender verify defer for : Could not complete sender verify callout: 127.0.0.1 [127.0.0.1] : response to "RCPT TO:" was: 250 OK -1999-03-02 09:44:33 H=[V4NET.0.0.4] U=root F= temporarily rejected RCPT : Could not complete sender verify callout 1999-03-02 09:44:33 H=[V4NET.0.0.5] U=root sender verify defer for : Could not complete sender verify callout: 127.0.0.1 [127.0.0.1] : SMTP timeout after RCPT TO: 1999-03-02 09:44:33 H=[V4NET.0.0.5] U=root F= temporarily rejected RCPT : Could not complete sender verify callout 1999-03-02 09:44:33 10HmaX-0005vi-00 <= ok7@otherhost53 H=[V4NET.0.0.7] U=root P=smtp S=sss diff --git a/test/log/0578 b/test/log/0578 index 7c38e638c..60ddf3c13 100644 --- a/test/log/0578 +++ b/test/log/0578 @@ -12,10 +12,6 @@ 1999-03-02 09:44:33 H=[V4NET.0.0.2] U=root F= rejected RCPT : Sender verify failed 1999-03-02 09:44:33 H=[V4NET.0.0.2] U=root sender verify fail for 1999-03-02 09:44:33 H=[V4NET.0.0.2] U=root F= rejected RCPT : Sender verify failed -1999-03-02 09:44:33 H=[V4NET.0.0.3] U=root sender verify defer for : Could not complete sender verify callout: 127.0.0.1 [127.0.0.1] : response to "RCPT TO:" was: 250 OK accepting that random recipient -1999-03-02 09:44:33 H=[V4NET.0.0.3] U=root F= temporarily rejected RCPT : Could not complete sender verify callout -1999-03-02 09:44:33 H=[V4NET.0.0.4] U=root sender verify defer for : Could not complete sender verify callout: 127.0.0.1 [127.0.0.1] : response to "RCPT TO:" was: 250 OK -1999-03-02 09:44:33 H=[V4NET.0.0.4] U=root F= temporarily rejected RCPT : Could not complete sender verify callout 1999-03-02 09:44:33 H=[V4NET.0.0.5] U=root sender verify defer for : Could not complete sender verify callout: 127.0.0.1 [127.0.0.1] : SMTP timeout after RCPT TO: 1999-03-02 09:44:33 H=[V4NET.0.0.5] U=root F= temporarily rejected RCPT : Could not complete sender verify callout 1999-03-02 09:44:33 10HmaX-0005vi-00 <= ok7@otherhost53 H=[V4NET.0.0.7] U=root P=smtp S=sss diff --git a/test/rejectlog/0376 b/test/rejectlog/0376 index 47ad1638d..1702cec04 100644 --- a/test/rejectlog/0376 +++ b/test/rejectlog/0376 @@ -12,9 +12,5 @@ 1999-03-02 09:44:33 H=[V4NET.0.0.2] U=root F= rejected RCPT : Sender verify failed 1999-03-02 09:44:33 H=[V4NET.0.0.2] U=root sender verify fail for 1999-03-02 09:44:33 H=[V4NET.0.0.2] U=root F= rejected RCPT : Sender verify failed -1999-03-02 09:44:33 H=[V4NET.0.0.3] U=root sender verify defer for : Could not complete sender verify callout: 127.0.0.1 [127.0.0.1] : response to "RCPT TO:" was: 250 OK -1999-03-02 09:44:33 H=[V4NET.0.0.3] U=root F= temporarily rejected RCPT : Could not complete sender verify callout -1999-03-02 09:44:33 H=[V4NET.0.0.4] U=root sender verify defer for : Could not complete sender verify callout: 127.0.0.1 [127.0.0.1] : response to "RCPT TO:" was: 250 OK -1999-03-02 09:44:33 H=[V4NET.0.0.4] U=root F= temporarily rejected RCPT : Could not complete sender verify callout 1999-03-02 09:44:33 H=[V4NET.0.0.5] U=root sender verify defer for : Could not complete sender verify callout: 127.0.0.1 [127.0.0.1] : SMTP timeout after RCPT TO: 1999-03-02 09:44:33 H=[V4NET.0.0.5] U=root F= temporarily rejected RCPT : Could not complete sender verify callout diff --git a/test/rejectlog/0578 b/test/rejectlog/0578 index db94a4d6e..bf20a240d 100644 --- a/test/rejectlog/0578 +++ b/test/rejectlog/0578 @@ -12,9 +12,5 @@ 1999-03-02 09:44:33 H=[V4NET.0.0.2] U=root F= rejected RCPT : Sender verify failed 1999-03-02 09:44:33 H=[V4NET.0.0.2] U=root sender verify fail for 1999-03-02 09:44:33 H=[V4NET.0.0.2] U=root F= rejected RCPT : Sender verify failed -1999-03-02 09:44:33 H=[V4NET.0.0.3] U=root sender verify defer for : Could not complete sender verify callout: 127.0.0.1 [127.0.0.1] : response to "RCPT TO:" was: 250 OK accepting that random recipient -1999-03-02 09:44:33 H=[V4NET.0.0.3] U=root F= temporarily rejected RCPT : Could not complete sender verify callout -1999-03-02 09:44:33 H=[V4NET.0.0.4] U=root sender verify defer for : Could not complete sender verify callout: 127.0.0.1 [127.0.0.1] : response to "RCPT TO:" was: 250 OK -1999-03-02 09:44:33 H=[V4NET.0.0.4] U=root F= temporarily rejected RCPT : Could not complete sender verify callout 1999-03-02 09:44:33 H=[V4NET.0.0.5] U=root sender verify defer for : Could not complete sender verify callout: 127.0.0.1 [127.0.0.1] : SMTP timeout after RCPT TO: 1999-03-02 09:44:33 H=[V4NET.0.0.5] U=root F= temporarily rejected RCPT : Could not complete sender verify callout diff --git a/test/stderr/0376 b/test/stderr/0376 index bcddefdfa..abd462b01 100644 --- a/test/stderr/0376 +++ b/test/stderr/0376 @@ -323,10 +323,6 @@ Connecting to 127.0.0.1 [127.0.0.1]:1224 ... connected SMTP(close)>> wrote callout cache domain record for otherhost3: result=1 postmaster=0 random=1 -LOG: MAIN REJECT - H=[V4NET.0.0.3] U=root sender verify defer for : Could not complete sender verify callout: 127.0.0.1 [127.0.0.1] : response to "RCPT TO:" was: 250 OK -LOG: MAIN REJECT - H=[V4NET.0.0.3] U=root F= temporarily rejected RCPT : Could not complete sender verify callout LOG: smtp_connection MAIN SMTP connection from root closed by QUIT >>>>>>>>>>>>>>>> Exim pid=pppp terminating with rc=0 >>>>>>>>>>>>>>>> @@ -373,10 +369,6 @@ Connecting to 127.0.0.1 [127.0.0.1]:1224 ... connected SMTP(close)>> wrote callout cache domain record for otherhost4: result=1 postmaster=0 random=1 -LOG: MAIN REJECT - H=[V4NET.0.0.4] U=root sender verify defer for : Could not complete sender verify callout: 127.0.0.1 [127.0.0.1] : response to "RCPT TO:" was: 250 OK -LOG: MAIN REJECT - H=[V4NET.0.0.4] U=root F= temporarily rejected RCPT : Could not complete sender verify callout LOG: smtp_connection MAIN SMTP connection from root closed by QUIT >>>>>>>>>>>>>>>> Exim pid=pppp terminating with rc=0 >>>>>>>>>>>>>>>> diff --git a/test/stderr/0578 b/test/stderr/0578 index 74581fd9c..9f634c8c4 100644 --- a/test/stderr/0578 +++ b/test/stderr/0578 @@ -337,10 +337,6 @@ Connecting to 127.0.0.1 [127.0.0.1]:1224 ... connected SMTP(close)>> wrote callout cache domain record for otherhost3: result=1 postmaster=0 random=1 -LOG: MAIN REJECT - H=[V4NET.0.0.3] U=root sender verify defer for : Could not complete sender verify callout: 127.0.0.1 [127.0.0.1] : response to "RCPT TO:" was: 250 OK accepting that random recipient -LOG: MAIN REJECT - H=[V4NET.0.0.3] U=root F= temporarily rejected RCPT : Could not complete sender verify callout LOG: smtp_connection MAIN SMTP connection from root closed by QUIT >>>>>>>>>>>>>>>> Exim pid=pppp terminating with rc=0 >>>>>>>>>>>>>>>> @@ -389,10 +385,6 @@ Connecting to 127.0.0.1 [127.0.0.1]:1224 ... connected SMTP(close)>> wrote callout cache domain record for otherhost4: result=1 postmaster=0 random=1 -LOG: MAIN REJECT - H=[V4NET.0.0.4] U=root sender verify defer for : Could not complete sender verify callout: 127.0.0.1 [127.0.0.1] : response to "RCPT TO:" was: 250 OK -LOG: MAIN REJECT - H=[V4NET.0.0.4] U=root F= temporarily rejected RCPT : Could not complete sender verify callout LOG: smtp_connection MAIN SMTP connection from root closed by QUIT >>>>>>>>>>>>>>>> Exim pid=pppp terminating with rc=0 >>>>>>>>>>>>>>>> diff --git a/test/stdout/0376 b/test/stdout/0376 index 8c2b9685c..a0af2cb92 100644 --- a/test/stdout/0376 +++ b/test/stdout/0376 @@ -78,7 +78,7 @@ 221 myhost.test.ex closing connection 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 250 OK -451 Could not complete sender verify callout +250 Accepted 221 myhost.test.ex closing connection 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 250 OK @@ -86,7 +86,7 @@ 221 myhost.test.ex closing connection 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 250 OK -451 Could not complete sender verify callout +250 Accepted 221 myhost.test.ex closing connection 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 250 OK diff --git a/test/stdout/0578 b/test/stdout/0578 index 40b265041..d3089e7e4 100644 --- a/test/stdout/0578 +++ b/test/stdout/0578 @@ -78,7 +78,7 @@ 221 myhost.test.ex closing connection 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 250 OK -451 Could not complete sender verify callout +250 Accepted 221 myhost.test.ex closing connection 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 250 OK @@ -86,7 +86,7 @@ 221 myhost.test.ex closing connection 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 250 OK -451 Could not complete sender verify callout +250 Accepted 221 myhost.test.ex closing connection 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 250 OK -- 2.30.2