which naturally failed, giving a failed delivery and bloating the retry
database. Investigation and fix prototype from Wolfgang Breyha.
+JH/12 Fix check on SMTP command input synchronisation. Previously there were
+ false-negatives in the check that the sender had not preempted a response
+ or prompt from Exim (running as a server), due to that code's lack of
+ awareness of the SMTP input buferring.
+
Exim version 4.89
-----------------
sender_host_notsocket || tls_in.active >= 0)
return TRUE;
+if (smtp_inptr < smtp_inend)
+ return FALSE;
+
fd = fileno(smtp_in);
FD_ZERO(&fds);
FD_SET(fd, &fds);
if (!pipelining_advertised && !check_sync())
{
+ unsigned n = smtp_inend - smtp_inptr;
+ if (n > 32) n = 32;
+
incomplete_transaction_log(US"sync failure");
log_write(0, LOG_MAIN|LOG_REJECT, "SMTP protocol synchronization error "
"(next input sent too soon: pipelining was not advertised): "
"rejected \"%s\" %s next input=\"%s\"",
smtp_cmd_buffer, host_and_ident(TRUE),
- string_printing(smtp_inptr));
+ string_printing(string_copyn(smtp_inptr, n)));
(void) synprot_error(L_smtp_protocol_error, 554, NULL,
US"SMTP synchronization error");
goto repeat_until_rset;
if (!check_sync())
{
+ unsigned n = smtp_inend - smtp_inptr;
+ if (n > 32) n = 32;
+
log_write(0, LOG_MAIN|LOG_REJECT, "SMTP protocol "
"synchronization error (input sent without waiting for greeting): "
"rejected connection from %s input=\"%s\"", host_and_ident(TRUE),
- string_printing(smtp_inptr));
+ string_printing(string_copyn(smtp_inptr, n)));
smtp_printf("554 SMTP synchronization error\r\n");
return FALSE;
}
1999-03-02 09:44:33 SMTP connection from (tester) [127.0.0.1] lost while reading message data
1999-03-02 09:44:33 SMTP connection from (tester) [127.0.0.1] lost while reading message data
1999-03-02 09:44:33 10HmbD-0005vi-00 <= someone8@some.domain H=(tester) [127.0.0.1] P=esmtp K S=sss for CALLER@test.ex
-1999-03-02 09:44:33 SMTP protocol synchronization error (next input sent too soon: pipelining was not advertised): rejected "bdat 1" H=(tester) [127.0.0.1] next input="bdat 87 last\r\n"
+1999-03-02 09:44:33 SMTP protocol synchronization error (next input sent too soon: pipelining was not advertised): rejected "BDAT 1" H=(tester) [127.0.0.1] next input="BDAT 87 last\r\n"
1999-03-02 09:44:33 SMTP call from (tester) [127.0.0.1] dropped: too many syntax or protocol errors (last command was "From: Sam@random.com")
1999-03-02 09:44:33 SMTP connection from (tester) [127.0.0.1] lost while reading message data (header)
******** SERVER ********
-1999-03-02 09:44:33 SMTP protocol synchronization error (next input sent too soon: pipelining was not advertised): rejected "bdat 1" H=(tester) [127.0.0.1] next input="bdat 87 last\r\n"
+1999-03-02 09:44:33 SMTP protocol synchronization error (next input sent too soon: pipelining was not advertised): rejected "BDAT 1" H=(tester) [127.0.0.1] next input="BDAT 87 last\r\n"
Envelope-from: <someone9@some.domain>
Envelope-to: <CALLER@test.ex>
1999-03-02 09:44:33 SMTP call from (tester) [127.0.0.1] dropped: too many syntax or protocol errors (last command was "From: Sam@random.com")
??? 250-8BITMIME
??? 250-CHUNKING
??? 250 HELP
-mail from:someone9@some.domain
+MAIL FROM:someone9@some.domain
??? 250
-rcpt to:CALLER@test.ex
+RCPT TO:CALLER@test.ex
??? 250
-bdat 1\r\nTbdat 87 last
-To: Susan@random.com
+BDAT 1\r\nTBDAT 87 last
+o: Susan@random.com
From: Sam@random.com
Subject: This is a bodyless test message
exim CALLER@test.ex
Test message.
****
-millisleep 500
+millisleep 700
#
#
# Extended: server uses SNI to choose certificate
exim abcd@test.ex
Test message.
****
-millisleep 500
+millisleep 700
#
#
killdaemon
exim norequire@test.ex
test message.
****
-millisleep 500
+millisleep 700
#
#
#
exim nostaple@test.ex
test message.
****
-millisleep 500
+millisleep 700
#
#
#
<<< 250-CHUNKING
??? 250 HELP
<<< 250 HELP
->>> mail from:someone9@some.domain
+>>> MAIL FROM:someone9@some.domain
??? 250
<<< 250 OK
->>> rcpt to:CALLER@test.ex
+>>> RCPT TO:CALLER@test.ex
??? 250
<<< 250 Accepted
->>> bdat 1\r\nTbdat 87 last
->>> To: Susan@random.com
+>>> BDAT 1\r\nTBDAT 87 last
+>>> o: Susan@random.com
>>> From: Sam@random.com
>>> Subject: This is a bodyless test message
>>>