Gitweb:
https://git.exim.org/exim.git/commitdiff/c5040dfdb523ce2a14efbdfa0d3eb69d3afef65a
Commit: c5040dfdb523ce2a14efbdfa0d3eb69d3afef65a
Parent: d48326c00b228279a957da7f58b48a55f4b7823b
Author: Jeremy Harris <jgh146exb@???>
AuthorDate: Sat Oct 19 22:25:27 2019 +0100
Committer: Jeremy Harris <jgh146exb@???>
CommitDate: Sat Oct 19 22:25:27 2019 +0100
CHUNKING: fix all-RCPTs-rejected, non-pipelined. Bug 2454
---
doc/doc-txt/ChangeLog | 5 +++++
src/src/transports/smtp.c | 3 ++-
test/log/0904 | 52 ++++++++++++++++++++++++--------------------
test/scripts/0000-Basic/0904 | 25 +++++++++++++++++++++
test/stdout/0904 | 12 ++++++++++
5 files changed, 72 insertions(+), 25 deletions(-)
diff --git a/doc/doc-txt/ChangeLog b/doc/doc-txt/ChangeLog
index d4eac4e..9be52ce 100644
--- a/doc/doc-txt/ChangeLog
+++ b/doc/doc-txt/ChangeLog
@@ -192,6 +192,11 @@ JH/41 With GnuTLS 3.6.0 (and later) do not attempt to manage Diffie-Hellman
HS/06 Change the default of dnssec_request_domains to "*"
+JH/42 Bug 2545: Fix CHUNKING for all RCPT commands rejected. Previously we
+ carried on and emitted a BDAT command, even when PIPELINING was not
+ active.
+
+
Exim version 4.92
-----------------
diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c
index fe28d86..bf81915 100644
--- a/src/src/transports/smtp.c
+++ b/src/src/transports/smtp.c
@@ -3642,7 +3642,8 @@ for handling the SMTP dot-handling protocol, flagging to apply to headers as
well as body. Set the appropriate timeout value to be used for each chunk.
(Haven't been able to make it work using select() for writing yet.) */
-if (!(sx.peer_offered & OPTION_CHUNKING) && !sx.ok)
+if ( !sx.ok
+ && (!(sx.peer_offered & OPTION_CHUNKING) || !pipelining_active))
{
/* Save the first address of the next batch. */
sx.first_addr = sx.next_addr;
diff --git a/test/log/0904 b/test/log/0904
index 28c972b..0ca8720 100644
--- a/test/log/0904
+++ b/test/log/0904
@@ -14,30 +14,34 @@
1999-03-02 09:44:33 10HmbB-0005vi-00 <= sender@??? U=root P=local-bsmtp S=sss for e@???
1999-03-02 09:44:33 10HmbB-0005vi-00 H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after end of data: 400 not right now
1999-03-02 09:44:33 10HmbB-0005vi-00 == e@??? R=to_server T=remote_smtp defer (-46) H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after end of data: 400 not right now
-1999-03-02 09:44:33 10HmbC-0005vi-00 <= sender@??? U=root P=local-bsmtp S=sss for p@???
-1999-03-02 09:44:33 10HmbC-0005vi-00 => p@??? R=to_server T=remote_smtp H=127.0.0.1 [127.0.0.1] K C="250 OK bdat"
+1999-03-02 09:44:33 10HmbC-0005vi-00 <= sender@??? U=root P=local-bsmtp S=sss for ebad@???
+1999-03-02 09:44:33 10HmbC-0005vi-00 ** ebad@??? R=to_server T=remote_smtp H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after RCPT TO:<ebad@???>: 550 sorry, no
+1999-03-02 09:44:33 10HmbC-0005vi-00 ebad@???: error ignored
1999-03-02 09:44:33 10HmbC-0005vi-00 Completed
-1999-03-02 09:44:33 10HmbD-0005vi-00 <= sender@??? U=root P=local-bsmtp S=sss for q@???
-1999-03-02 09:44:33 10HmbD-0005vi-00 H=127.0.0.1 [127.0.0.1]: SMTP timeout after pipelined end of data (ddd bytes written): Connection timed out
-1999-03-02 09:44:33 10HmbD-0005vi-00 == q@??? R=to_server T=remote_smtp defer (dd): Connection timed out H=127.0.0.1 [127.0.0.1]: SMTP timeout after pipelined end of data (ddd bytes written)
-1999-03-02 09:44:33 10HmbE-0005vi-00 <= sender@??? U=root P=local-bsmtp S=sss for r@???
-1999-03-02 09:44:33 10HmbE-0005vi-00 => r@??? R=to_server T=remote_smtp H=127.0.0.1 [127.0.0.1] K C="250 OK bdat"
-1999-03-02 09:44:33 10HmbE-0005vi-00 Completed
-1999-03-02 09:44:33 10HmbF-0005vi-00 <= sender@??? U=root P=local-bsmtp S=sss for s@???
-1999-03-02 09:44:33 10HmbF-0005vi-00 ** s@??? R=to_server T=remote_smtp H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after pipelined end of data: 550 unacceptable mail-from
-1999-03-02 09:44:33 10HmbF-0005vi-00 s@???: error ignored
+1999-03-02 09:44:33 10HmbD-0005vi-00 <= sender@??? U=root P=local-bsmtp S=sss for p@???
+1999-03-02 09:44:33 10HmbD-0005vi-00 => p@??? R=to_server T=remote_smtp H=127.0.0.1 [127.0.0.1] K C="250 OK bdat"
+1999-03-02 09:44:33 10HmbD-0005vi-00 Completed
+1999-03-02 09:44:33 10HmbE-0005vi-00 <= sender@??? U=root P=local-bsmtp S=sss for q@???
+1999-03-02 09:44:33 10HmbE-0005vi-00 H=127.0.0.1 [127.0.0.1]: SMTP timeout after pipelined end of data (ddd bytes written): Connection timed out
+1999-03-02 09:44:33 10HmbE-0005vi-00 == q@??? R=to_server T=remote_smtp defer (dd): Connection timed out H=127.0.0.1 [127.0.0.1]: SMTP timeout after pipelined end of data (ddd bytes written)
+1999-03-02 09:44:33 10HmbF-0005vi-00 <= sender@??? U=root P=local-bsmtp S=sss for r@???
+1999-03-02 09:44:33 10HmbF-0005vi-00 => r@??? R=to_server T=remote_smtp H=127.0.0.1 [127.0.0.1] K C="250 OK bdat"
1999-03-02 09:44:33 10HmbF-0005vi-00 Completed
-1999-03-02 09:44:33 10HmbG-0005vi-00 <= sender@??? U=root P=local-bsmtp S=sss for s1@???
-1999-03-02 09:44:33 10HmbG-0005vi-00 H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after pipelined end of data: 450 greylisted mail-from
-1999-03-02 09:44:33 10HmbG-0005vi-00 == s1@??? R=to_server T=remote_smtp defer (-45) H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after pipelined end of data: 450 greylisted mail-from
-1999-03-02 09:44:33 10HmbH-0005vi-00 <= sender@??? U=root P=local-bsmtp S=sss for t@???
-1999-03-02 09:44:33 10HmbH-0005vi-00 ** t@??? R=to_server T=remote_smtp H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after RCPT TO:<t@???>: 550 no such recipient
-1999-03-02 09:44:33 10HmbH-0005vi-00 t@???: error ignored
-1999-03-02 09:44:33 10HmbH-0005vi-00 Completed
-1999-03-02 09:44:33 10HmbI-0005vi-00 <= sender@??? U=root P=local-bsmtp S=sss for u@???
-1999-03-02 09:44:33 10HmbI-0005vi-00 ** u@??? R=to_server T=remote_smtp H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after pipelined end of data: 500 oops bdat
-1999-03-02 09:44:33 10HmbI-0005vi-00 u@???: error ignored
+1999-03-02 09:44:33 10HmbG-0005vi-00 <= sender@??? U=root P=local-bsmtp S=sss for s@???
+1999-03-02 09:44:33 10HmbG-0005vi-00 ** s@??? R=to_server T=remote_smtp H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after pipelined end of data: 550 unacceptable mail-from
+1999-03-02 09:44:33 10HmbG-0005vi-00 s@???: error ignored
+1999-03-02 09:44:33 10HmbG-0005vi-00 Completed
+1999-03-02 09:44:33 10HmbH-0005vi-00 <= sender@??? U=root P=local-bsmtp S=sss for s1@???
+1999-03-02 09:44:33 10HmbH-0005vi-00 H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after pipelined end of data: 450 greylisted mail-from
+1999-03-02 09:44:33 10HmbH-0005vi-00 == s1@??? R=to_server T=remote_smtp defer (-45) H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after pipelined end of data: 450 greylisted mail-from
+1999-03-02 09:44:33 10HmbI-0005vi-00 <= sender@??? U=root P=local-bsmtp S=sss for t@???
+1999-03-02 09:44:33 10HmbI-0005vi-00 ** t@??? R=to_server T=remote_smtp H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after RCPT TO:<t@???>: 550 no such recipient
+1999-03-02 09:44:33 10HmbI-0005vi-00 t@???: error ignored
1999-03-02 09:44:33 10HmbI-0005vi-00 Completed
-1999-03-02 09:44:33 10HmbJ-0005vi-00 <= sender@??? U=root P=local-bsmtp S=sss for v@???
-1999-03-02 09:44:33 10HmbJ-0005vi-00 H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after pipelined end of data: 400 not right now bdat
-1999-03-02 09:44:33 10HmbJ-0005vi-00 == v@??? R=to_server T=remote_smtp defer (-46) H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after pipelined end of data: 400 not right now bdat
+1999-03-02 09:44:33 10HmbJ-0005vi-00 <= sender@??? U=root P=local-bsmtp S=sss for u@???
+1999-03-02 09:44:33 10HmbJ-0005vi-00 ** u@??? R=to_server T=remote_smtp H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after pipelined end of data: 500 oops bdat
+1999-03-02 09:44:33 10HmbJ-0005vi-00 u@???: error ignored
+1999-03-02 09:44:33 10HmbJ-0005vi-00 Completed
+1999-03-02 09:44:33 10HmbK-0005vi-00 <= sender@??? U=root P=local-bsmtp S=sss for v@???
+1999-03-02 09:44:33 10HmbK-0005vi-00 H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after pipelined end of data: 400 not right now bdat
+1999-03-02 09:44:33 10HmbK-0005vi-00 == v@??? R=to_server T=remote_smtp defer (-46) H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after pipelined end of data: 400 not right now bdat
diff --git a/test/scripts/0000-Basic/0904 b/test/scripts/0000-Basic/0904
index 2157e61..fa72256 100644
--- a/test/scripts/0000-Basic/0904
+++ b/test/scripts/0000-Basic/0904
@@ -146,6 +146,31 @@ QUIT
****
#
#
+# Server rejects RCPT. Client should not proceed to BDAT.
+server PORT_S
+220 Greetings
+EHLO
+250-Hello there
+250 CHUNKING
+MAIL FROM
+250 OK
+RCPT TO
+550 sorry, no
+QUIT
+****
+sudo exim -odf -bS
+EHLO test
+MAIL FROM:<sender@???>
+RCPT TO:<ebad@???>
+DATA
+Subject: foo
+
+data
+.
+QUIT
+****
+#
+#
###################################################
#
# Pipelined cases
diff --git a/test/stdout/0904 b/test/stdout/0904
index dc62094..8875566 100644
--- a/test/stdout/0904
+++ b/test/stdout/0904
@@ -78,6 +78,18 @@ Connection request from [127.0.0.1]
220 Greetings
EHLO testhost.test.ex
250-Hello there
+250 CHUNKING
+MAIL FROM:<>
+250 OK
+RCPT TO:<ebad@???>
+550 sorry, no
+QUIT
+End of script
+Listening on port 1224 ...
+Connection request from [127.0.0.1]
+220 Greetings
+EHLO testhost.test.ex
+250-Hello there
250-PIPELINING
250 CHUNKING
MAIL FROM:<>