From: Jeremy Harris Date: Mon, 26 Mar 2018 15:59:29 +0000 (+0100) Subject: Cutthrough: for an onward finaldot timeout, generate an initator 450 in defer=pass... X-Git-Tag: exim-4_91_RC3~10 X-Git-Url: https://git.exim.org/users/heiko/exim.git/commitdiff_plain/c85476e9d9f9002927fc3e2a6a12005423359ff1?ds=inline Cutthrough: for an onward finaldot timeout, generate an initator 450 in defer=pass mode --- diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog index cbc7f2baa..201e21207 100644 --- a/doc/doc-txt/ChangeLog +++ b/doc/doc-txt/ChangeLog @@ -183,6 +183,10 @@ JH/34 Re-introduce enforcement of no cutthrough delivery on transports having consolidation of verify-callout and delivery SMTP handling. Extend the restriction to also cover ARC-signing. +JH/35 Cutthrough: for a final-dot response timeout (and nonunderstood responses) + in defer=pass mode supply a 450 to the initiator. Previously the message + would be spooled. + Exim version 4.90 ----------------- diff --git a/src/src/receive.c b/src/src/receive.c index 4cc43eb3a..4e1dca5c5 100644 --- a/src/src/receive.c +++ b/src/src/receive.c @@ -4157,9 +4157,11 @@ if(cutthrough.fd >= 0 && cutthrough.delivery) case '4': /* Temp-reject. Keep spoolfiles and accept, unless defer-pass mode. ... for which, pass back the exact error */ if (cutthrough.defer_pass) smtp_reply = string_copy_malloc(msg); - /*FALLTRHOUGH*/ + cutthrough_done = TMP_REJ; /* Avoid the usual immediate delivery attempt */ + break; /* message_id needed for SMTP accept below */ default: /* Unknown response, or error. Treat as temp-reject. */ + if (cutthrough.defer_pass) smtp_reply = US"450 Onward transmission not accepted"; cutthrough_done = TMP_REJ; /* Avoid the usual immediate delivery attempt */ break; /* message_id needed for SMTP accept below */ diff --git a/test/log/5405 b/test/log/5405 index 901add1c3..feb4052f4 100644 --- a/test/log/5405 +++ b/test/log/5405 @@ -16,6 +16,7 @@ 1999-03-02 09:44:33 10HmbB-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss for userf@domain.com 1999-03-02 09:44:33 rcpt for userg@domain.com 1999-03-02 09:44:33 10HmbC-0005vi-00 U=CALLER userg@domain.com F= tmp-reject from cutthrough after DATA: R=all T=smtp H=127.0.0.1 [127.0.0.1] C="459 content reject" +1999-03-02 09:44:33 rcpt for userj@domain.com 1999-03-02 09:44:33 rcpt for userh@domain.com 1999-03-02 09:44:33 10HmbD-0005vi-00 >> userh@domain.com R=all T=smtp H=127.0.0.1 [127.0.0.1] C="250 OK" 1999-03-02 09:44:33 10HmbD-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local-esmtp S=sss for userh@domain.com diff --git a/test/scripts/5400-cutthrough/5405 b/test/scripts/5400-cutthrough/5405 index 2e7a33388..2de0f5c58 100644 --- a/test/scripts/5400-cutthrough/5405 +++ b/test/scripts/5400-cutthrough/5405 @@ -170,6 +170,30 @@ MAIL FROM: RCPT TO: DATA +. +QUIT +**** +# +# conn-drop (at DATA-dot), option "pass". Should tmp-rej source, at DATA. +server PORT_S +220 ESMTP +EHLO +250 OK +MAIL FROM: +250 Sender OK +RCPT TO: +250 good rcpt +DATA +354 Send data +. +>*eof +**** +exim -DCONTROL=/defer=pass -bs +EHLO myhost.test.ex +MAIL FROM: +RCPT TO: +DATA + . QUIT **** diff --git a/test/stdout/5405 b/test/stdout/5405 index 14bfdabdd..ef39477d5 100644 --- a/test/stdout/5405 +++ b/test/stdout/5405 @@ -82,6 +82,17 @@ 250 OK 250 Accepted 354 Enter message, ending with "." on a line by itself +450 Onward transmission not accepted +221 myhost.test.ex closing connection +220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 +250-myhost.test.ex Hello CALLER at myhost.test.ex +250-SIZE 52428800 +250-8BITMIME +250-PIPELINING +250 HELP +250 OK +250 Accepted +354 Enter message, ending with "." on a line by itself 250 OK id=10HmbD-0005vi-00 221 myhost.test.ex closing connection 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 @@ -247,6 +258,30 @@ EHLO myhost.test.ex 250 OK MAIL FROM: 250 Sender OK +RCPT TO: +250 good rcpt +DATA +354 Send data +Received: from CALLER (helo=myhost.test.ex) + by myhost.test.ex with local-esmtp (Exim x.yz) + (envelope-from ) + id 10HmbE-0005vi-00 + for userj@domain.com; Tue, 2 Mar 1999 09:44:33 +0000 +Message-Id: +From: CALLER_NAME +Date: Tue, 2 Mar 1999 09:44:33 +0000 +X-hdr-rtr-new: +++ + +. +>*eof +End of script +Listening on port 1224 ... +Connection request from [ip4.ip4.ip4.ip4] +220 ESMTP +EHLO myhost.test.ex +250 OK +MAIL FROM: +250 Sender OK RCPT TO: 250 Recipient OK DATA