From: Jeremy Harris Date: Sun, 7 Aug 2016 14:14:59 +0000 (+0100) Subject: CHUNKING: fix transmit with long headers X-Git-Tag: exim-4_88_RC1~48 X-Git-Url: https://git.exim.org/users/jgh/exim.git/commitdiff_plain/58fc5fb2eec65bc0b1c7f5e571e3c534cf008b88 CHUNKING: fix transmit with long headers When the buffer used for SMTP commands and message headers filled to flush point, protocol sequencing was wrong. --- diff --git a/src/src/smtp_out.c b/src/src/smtp_out.c index 76181b5f1..5ab15cb5f 100644 --- a/src/src/smtp_out.c +++ b/src/src/smtp_out.c @@ -324,14 +324,16 @@ static BOOL flush_buffer(smtp_outblock *outblock) { int rc; +int n = outblock->ptr - outblock->buffer; +HDEBUG(D_transport|D_acl) debug_printf("cmd buf flush %d bytes\n", n); #ifdef SUPPORT_TLS if (tls_out.active == outblock->sock) - rc = tls_write(FALSE, outblock->buffer, outblock->ptr - outblock->buffer); + rc = tls_write(FALSE, outblock->buffer, n); else #endif + rc = send(outblock->sock, outblock->buffer, n, 0); -rc = send(outblock->sock, outblock->buffer, outblock->ptr - outblock->buffer, 0); if (rc <= 0) { HDEBUG(D_transport|D_acl) debug_printf("send failed: %s\n", strerror(errno)); diff --git a/src/src/structs.h b/src/src/structs.h index ffbc899a5..23c40ea3d 100644 --- a/src/src/structs.h +++ b/src/src/structs.h @@ -226,8 +226,7 @@ typedef struct transport_info { /* smtp transport datachunk callback */ #define tc_reap_prev BIT(0) /* Flags: reap previous SMTP cmd responses */ -#define tc_reap_one BIT(1) /* reap one SMTP response */ -#define tc_chunk_last BIT(2) /* annotate chunk SMTP cmd as LAST */ +#define tc_chunk_last BIT(1) /* annotate chunk SMTP cmd as LAST */ struct transport_context; typedef int (*tpt_chunk_cmd_cb)(int fd, struct transport_context * tctx, diff --git a/src/src/transport.c b/src/src/transport.c index a68c22f29..fdd97822a 100644 --- a/src/src/transport.c +++ b/src/src/transport.c @@ -418,15 +418,22 @@ for (ptr = start; ptr < end; ptr++) if ((len = chunk_ptr - deliver_out_buffer) > mlen) { + DEBUG(D_transport) debug_printf("flushing headers buffer\n"); + /* If CHUNKING, prefix with BDAT (size) NON-LAST. Also, reap responses from previous SMTP commands. */ if (tctx && tctx->options & topt_use_bdat && tctx->chunk_cb) - if (tctx->chunk_cb(fd, tctx, (unsigned)len, tc_reap_prev|tc_reap_one) != OK) + { + if ( tctx->chunk_cb(fd, tctx, (unsigned)len, 0) != OK + || !transport_write_block(fd, deliver_out_buffer, len) + || tctx->chunk_cb(fd, tctx, 0, tc_reap_prev) != OK + ) + return FALSE; + } + else + if (!transport_write_block(fd, deliver_out_buffer, len)) return FALSE; - - if (!transport_write_block(fd, deliver_out_buffer, len)) - return FALSE; chunk_ptr = deliver_out_buffer; } @@ -922,11 +929,11 @@ if (!(tctx->options & topt_no_headers)) return FALSE; } -/* When doing RFC3030 CHUNKING output, work out how much data will be in the -last BDAT, consisting of the current write_chunk() output buffer fill +/* When doing RFC3030 CHUNKING output, work out how much data would be in a +last-BDAT, consisting of the current write_chunk() output buffer fill (optimally, all of the headers - but it does not matter if we already had to flush that buffer with non-last BDAT prependix) plus the amount of body data -(as expanded for CRLF lines). Then create and write the BDAT, and ensure +(as expanded for CRLF lines). Then create and write BDAT(s), and ensure that further use of write_chunk() will not prepend BDATs. The first BDAT written will also first flush any outstanding MAIL and RCPT commands which were buffered thans to PIPELINING. @@ -960,6 +967,8 @@ if (tctx->options & topt_use_bdat) if (size > DELIVER_OUT_BUFFER_SIZE && hsize > 0) { + DEBUG(D_transport) + debug_printf("sending small initial BDAT; hssize=%d\n", hsize); if ( tctx->chunk_cb(fd, tctx, hsize, 0) != OK || !transport_write_block(fd, deliver_out_buffer, hsize) || tctx->chunk_cb(fd, tctx, 0, tc_reap_prev) != OK diff --git a/src/src/transports/smtp.c b/src/src/transports/smtp.c index 52b2b913f..416ea6297 100644 --- a/src/src/transports/smtp.c +++ b/src/src/transports/smtp.c @@ -1402,6 +1402,8 @@ if (tctx->pending_BDAT) if (flags & tc_reap_prev && prev_cmd_count > 0) { + DEBUG(D_transport) debug_printf("look for %d responses" + " for previous pipelined cmds\n", prev_cmd_count); switch(sync_responses(tctx->first_addr, tctx->tblock->rcpt_include_affixes, tctx->sync_addr, tctx->host, prev_cmd_count, @@ -1424,10 +1426,12 @@ if (flags & tc_reap_prev && prev_cmd_count > 0) pipelining_active = FALSE; } -/* Reap response for the cmd we just emitted, or an outstanding BDAT */ +/* Reap response for an outstanding BDAT */ -if (flags & tc_reap_one || tctx->pending_BDAT) +if (tctx->pending_BDAT) { + DEBUG(D_transport) debug_printf("look for one response for BDAT\n"); + if (!smtp_read_response(tctx->inblock, buffer, DELIVER_BUFFER_SIZE, '2', ob->command_timeout)) { diff --git a/test/log/0902 b/test/log/0902 index 63e180185..24eb7a951 100644 --- a/test/log/0902 +++ b/test/log/0902 @@ -29,3 +29,6 @@ 1999-03-02 09:44:33 10HmbE-0005vi-00 ** v@test.ex R=to_server T=remote_smtp H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after end of data: 500 oops bdat 1999-03-02 09:44:33 10HmbE-0005vi-00 v@test.ex: error ignored 1999-03-02 09:44:33 10HmbE-0005vi-00 Completed +1999-03-02 09:44:33 10HmbF-0005vi-00 <= CALLER@the.local.host.name U=CALLER P=local S=sss for p@test.ex +1999-03-02 09:44:33 10HmbF-0005vi-00 => p@test.ex 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 diff --git a/test/scripts/0000-Basic/0902 b/test/scripts/0000-Basic/0902 index a1c4de4e1..9c719e1d1 100644 --- a/test/scripts/0000-Basic/0902 +++ b/test/scripts/0000-Basic/0902 @@ -917,6 +917,126 @@ Subject: foo 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 +1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 +**** +# +# message with long headers +server PORT_S +220 Greetings +EHLO +250-Hello there +250-PIPELINING +250 CHUNKING +MAIL FROM +RCPT TO +BDAT 8191 +250 OK mail +250 OK rcpt +*data 8191 +250 OK nonlast bdat +BDAT 829 LAST +*data 829 +250 OK bdat +QUIT +225 OK +*eof +**** +exim -odf p@test.ex +Subject: foo +X-long_hdr: 0 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 2 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 3 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 4 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 5 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 6 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 7 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 8 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 + +body 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 **** diff --git a/test/stderr/0143 b/test/stderr/0143 index e0fe9dc93..06370ba40 100644 --- a/test/stderr/0143 +++ b/test/stderr/0143 @@ -20,16 +20,20 @@ delivering 10HmaX-0005vi-00 to 127.0.0.1 [127.0.0.1] (userx@domain.com) Connecting to 127.0.0.1 [127.0.0.1]:1224 from ip4.ip4.ip4.ip4 ... connected SMTP<< 220 ESMTP SMTP>> EHLO myhost.test.ex +cmd buf flush 21 bytes SMTP<< 250-OK 250-HELP 250 AUTH LOGIN not using PIPELINING not using DSN SMTP>> MAIL FROM: +cmd buf flush 37 bytes SMTP<< 250 Sender OK SMTP>> RCPT TO: +cmd buf flush 28 bytes SMTP<< 250 Recipient OK SMTP>> DATA +cmd buf flush 6 bytes SMTP<< 354 Send data SMTP>> writing message and terminating "." writing data block fd=dddd size=sss timeout=300 @@ -39,6 +43,7 @@ transport_check_waiting entered sequence=1 local_max=500 global_max=-1 no messages waiting for 127.0.0.1 SMTP>> QUIT +cmd buf flush 6 bytes SMTP(close)>> Leaving my_smtp transport LOG: MAIN diff --git a/test/stderr/0388 b/test/stderr/0388 index d45a21121..e8269e035 100644 --- a/test/stderr/0388 +++ b/test/stderr/0388 @@ -85,16 +85,20 @@ Connecting to 127.0.0.1 [127.0.0.1]:1224 ... connected SMTP<< 220 Server ready 127.0.0.1 in hosts_avoid_esmtp? no (option unset) SMTP>> EHLO myhost.test.ex +cmd buf flush 21 bytes SMTP<< 250 OK 127.0.0.1 in hosts_require_auth? no (option unset) SMTP>> MAIL FROM: +cmd buf flush 37 bytes SMTP<< 250 OK SMTP>> RCPT TO: +cmd buf flush 15 bytes SMTP<< 451 Temporary error LOG: MAIN H=127.0.0.1 [127.0.0.1]: SMTP error from remote mail server after RCPT TO:: 451 Temporary error added retry item for R:x@y: errno=-44 more_errno=dd,A flags=0 SMTP>> QUIT +cmd buf flush 6 bytes SMTP(close)>> set_process_info: pppp delivering 10HmaX-0005vi-00: just tried 127.0.0.1 [127.0.0.1] for x@y: result OK address match test: subject=*@127.0.0.1 pattern=* diff --git a/test/stderr/0398 b/test/stderr/0398 index 0a4d1fe23..c11dd6f86 100644 --- a/test/stderr/0398 +++ b/test/stderr/0398 @@ -130,13 +130,17 @@ Connecting to 127.0.0.1 [127.0.0.1]:1224 ... connected SMTP<< 220 Server ready 127.0.0.1 in hosts_avoid_esmtp? no (option unset) SMTP>> EHLO mail.test.ex +cmd buf flush 19 bytes SMTP<< 250 OK 127.0.0.1 in hosts_require_auth? no (option unset) SMTP>> MAIL FROM:<> +cmd buf flush 14 bytes SMTP<< 250 OK SMTP>> RCPT TO: +cmd buf flush 21 bytes SMTP<< 550 Unknown SMTP>> QUIT +cmd buf flush 6 bytes locking TESTSUITE/spool/db/callout.lockfile locked TESTSUITE/spool/db/callout.lockfile EXIM_DBOPEN(TESTSUITE/spool/db/callout) diff --git a/test/stderr/0404 b/test/stderr/0404 index f1c32cf94..e8746d9c5 100644 --- a/test/stderr/0404 +++ b/test/stderr/0404 @@ -17998,6 +17998,7 @@ lock file created mailbox TESTSUITE/test-mail/sender is locked writing to file TESTSUITE/test-mail/sender writing data block fd=dddd size=sss timeout=0 +flushing headers buffer writing data block fd=dddd size=sss timeout=0 writing data block fd=dddd size=sss timeout=0 writing data block fd=dddd size=sss timeout=0 diff --git a/test/stderr/0432 b/test/stderr/0432 index 95a24a9eb..54b9593bd 100644 --- a/test/stderr/0432 +++ b/test/stderr/0432 @@ -91,13 +91,17 @@ Connecting to 127.0.0.1 [127.0.0.1]:1224 ... connected SMTP<< 220 server ready 127.0.0.1 in hosts_avoid_esmtp? no (option unset) SMTP>> EHLO myhost.test.ex +cmd buf flush 21 bytes SMTP<< 250 OK 127.0.0.1 in hosts_require_auth? no (option unset) SMTP>> MAIL FROM:<> +cmd buf flush 14 bytes SMTP<< 250 OK SMTP>> RCPT TO: +cmd buf flush 15 bytes SMTP<< 250 OK SMTP>> QUIT +cmd buf flush 6 bytes locking TESTSUITE/spool/db/callout.lockfile locked TESTSUITE/spool/db/callout.lockfile EXIM_DBOPEN(TESTSUITE/spool/db/callout) @@ -247,13 +251,17 @@ MUNGED: ::1 will be omitted in what follows >>> SMTP<< 220 server ready >>> 127.0.0.1 in hosts_avoid_esmtp? no (option unset) >>> SMTP>> EHLO myhost.test.ex +>>> cmd buf flush 21 bytes >>> SMTP<< 250 OK >>> 127.0.0.1 in hosts_require_auth? no (option unset) >>> SMTP>> MAIL FROM:<> +>>> cmd buf flush 14 bytes >>> SMTP<< 250 OK >>> SMTP>> RCPT TO: +>>> cmd buf flush 15 bytes >>> SMTP<< 250 OK >>> SMTP>> QUIT +>>> cmd buf flush 6 bytes >>> wrote callout cache domain record for b: >>> result=1 postmaster=0 random=0 >>> wrote positive callout cache address record for a@b @@ -287,6 +295,7 @@ MUNGED: ::1 will be omitted in what follows >>> SMTP<< 220 server ready >>> 127.0.0.1 in hosts_avoid_esmtp? no (option unset) >>> SMTP>> EHLO myhost.test.ex +>>> cmd buf flush 21 bytes >>> SMTP timeout >>> ----------- end verify ------------ >>> accept: condition test deferred in ACL "mail" diff --git a/test/stderr/0476 b/test/stderr/0476 index 29b9c3ebb..695557676 100644 --- a/test/stderr/0476 +++ b/test/stderr/0476 @@ -19,6 +19,7 @@ set_process_info: pppp delivering 10HmaX-0005vi-00 to 127.0.0.1 [127.0.0.1] (use Connecting to 127.0.0.1 [127.0.0.1]:1224 ... connected SMTP<< 220 Server ready SMTP>> EHLO the.local.host.name +cmd buf flush 18 bytes SMTP<< 250-server id 250-PIPELINING 250 OK @@ -27,6 +28,7 @@ not using DSN SMTP>> MAIL FROM: SMTP>> RCPT TO: SMTP>> DATA +cmd buf flush 65 bytes SMTP<< 250 OK SMTP<< 550 NO Remote host closed connection in response to pipelined DATA @@ -35,6 +37,7 @@ ok=1 send_quit=1 send_rset=1 continue_more=0 yield=0 first_address is NULL transport_check_waiting entered sequence=1 local_max=500 global_max=-1 SMTP>> RSET +cmd buf flush 6 bytes H=127.0.0.1 [127.0.0.1] Remote host closed connection in response to RSET SMTP(close)>> set_process_info: pppp delivering 10HmaX-0005vi-00: just tried 127.0.0.1 [127.0.0.1] for userx@test.ex: result OK diff --git a/test/stderr/2013 b/test/stderr/2013 index 11e165c61..459f75027 100644 --- a/test/stderr/2013 +++ b/test/stderr/2013 @@ -6,6 +6,7 @@ LOG: queue_run MAIN Connecting to 127.0.0.1 [127.0.0.1]:1225 ... connected SMTP<< 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 SMTP>> EHLO myhost.test.ex +cmd buf flush 21 bytes SMTP<< 250-myhost.test.ex Hello localhost [127.0.0.1] 250-SIZE 52428800 250-8BITMIME @@ -13,8 +14,10 @@ Connecting to 127.0.0.1 [127.0.0.1]:1225 ... connected 250-STARTTLS 250 HELP SMTP>> STARTTLS +cmd buf flush 10 bytes SMTP<< 220 TLS go ahead SMTP>> EHLO myhost.test.ex +cmd buf flush 21 bytes SMTP<< 250-myhost.test.ex Hello localhost [127.0.0.1] 250-SIZE 52428800 250-8BITMIME @@ -23,11 +26,13 @@ Connecting to 127.0.0.1 [127.0.0.1]:1225 ... connected SMTP>> MAIL FROM: SIZE=ssss SMTP>> RCPT TO: SMTP>> DATA +cmd buf flush 78 bytes SMTP<< 250 OK SMTP<< 250 Accepted SMTP<< 354 Enter message, ending with "." on a line by itself SMTP<< 250 OK id=10HmaZ-0005vi-00 SMTP>> EHLO myhost.test.ex +cmd buf flush 21 bytes SMTP<< 250-myhost.test.ex Hello localhost [127.0.0.1] 250-SIZE 52428800 250-8BITMIME @@ -44,8 +49,10 @@ configuration file is TESTSUITE/test-config trusted user admin user SMTP>> STARTTLS +cmd buf flush 10 bytes SMTP<< 220 TLS go ahead SMTP>> EHLO myhost.test.ex +cmd buf flush 21 bytes SMTP<< 250-myhost.test.ex Hello localhost [127.0.0.1] 250-SIZE 52428800 250-8BITMIME @@ -54,11 +61,13 @@ admin user SMTP>> MAIL FROM: SIZE=ssss SMTP>> RCPT TO: SMTP>> DATA +cmd buf flush 78 bytes SMTP<< 250 OK SMTP<< 250 Accepted SMTP<< 354 Enter message, ending with "." on a line by itself SMTP<< 250 OK id=10HmbA-0005vi-00 SMTP>> QUIT +cmd buf flush 6 bytes SMTP(close)>> LOG: MAIN => userx@test.ex R=client T=send_to_server H=127.0.0.1 [127.0.0.1]* X=TLS1.x:xxxxRSA_AES_256_CBC_SHAnnn:256 CV=no DN="C=UK,O=The Exim Maintainers,OU=Test Suite,CN=Phil Pennock" C="250 OK id=10HmbA-0005vi-00" diff --git a/test/stderr/2113 b/test/stderr/2113 index ec5e415c6..1ea573043 100644 --- a/test/stderr/2113 +++ b/test/stderr/2113 @@ -6,6 +6,7 @@ LOG: queue_run MAIN Connecting to 127.0.0.1 [127.0.0.1]:1225 ... connected SMTP<< 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 SMTP>> EHLO myhost.test.ex +cmd buf flush 21 bytes SMTP<< 250-myhost.test.ex Hello localhost [127.0.0.1] 250-SIZE 52428800 250-8BITMIME @@ -13,8 +14,10 @@ Connecting to 127.0.0.1 [127.0.0.1]:1225 ... connected 250-STARTTLS 250 HELP SMTP>> STARTTLS +cmd buf flush 10 bytes SMTP<< 220 TLS go ahead SMTP>> EHLO myhost.test.ex +cmd buf flush 21 bytes SMTP<< 250-myhost.test.ex Hello localhost [127.0.0.1] 250-SIZE 52428800 250-8BITMIME @@ -23,11 +26,13 @@ Connecting to 127.0.0.1 [127.0.0.1]:1225 ... connected SMTP>> MAIL FROM: SIZE=ssss SMTP>> RCPT TO: SMTP>> DATA +cmd buf flush 78 bytes SMTP<< 250 OK SMTP<< 250 Accepted SMTP<< 354 Enter message, ending with "." on a line by itself SMTP<< 250 OK id=10HmaZ-0005vi-00 SMTP>> EHLO myhost.test.ex +cmd buf flush 21 bytes SMTP<< 250-myhost.test.ex Hello localhost [127.0.0.1] 250-SIZE 52428800 250-8BITMIME @@ -44,8 +49,10 @@ configuration file is TESTSUITE/test-config trusted user admin user SMTP>> STARTTLS +cmd buf flush 10 bytes SMTP<< 220 TLS go ahead SMTP>> EHLO myhost.test.ex +cmd buf flush 21 bytes SMTP<< 250-myhost.test.ex Hello localhost [127.0.0.1] 250-SIZE 52428800 250-8BITMIME @@ -54,11 +61,13 @@ admin user SMTP>> MAIL FROM: SIZE=ssss SMTP>> RCPT TO: SMTP>> DATA +cmd buf flush 78 bytes SMTP<< 250 OK SMTP<< 250 Accepted SMTP<< 354 Enter message, ending with "." on a line by itself SMTP<< 250 OK id=10HmbA-0005vi-00 SMTP>> QUIT +cmd buf flush 6 bytes SMTP(close)>> LOG: MAIN => userx@test.ex R=client T=send_to_server H=127.0.0.1 [127.0.0.1]* X=TLSv1:AES256-SHA:256 CV=no DN="/C=UK/O=The Exim Maintainers/OU=Test Suite/CN=Phil Pennock" C="250 OK id=10HmbA-0005vi-00" diff --git a/test/stderr/5403 b/test/stderr/5403 index 292f09133..b91e254f3 100644 --- a/test/stderr/5403 +++ b/test/stderr/5403 @@ -73,11 +73,14 @@ MUNGED: ::1 will be omitted in what follows >>> SMTP<< 220 server ready >>> 127.0.0.1 in hosts_avoid_esmtp? no (option unset) >>> SMTP>> EHLO myhost.test.ex +>>> cmd buf flush 21 bytes >>> SMTP<< 250 OK >>> 127.0.0.1 in hosts_require_auth? no (option unset) >>> SMTP>> MAIL FROM: +>>> cmd buf flush 37 bytes >>> SMTP<< 250 OK >>> SMTP>> RCPT TO: +>>> cmd buf flush 29 bytes >>> SMTP<< 250 OK >>> holding verify callout open for cutthrough delivery >>> ----------- end verify ------------ diff --git a/test/stderr/5410 b/test/stderr/5410 index fe3ed4429..e305e6a90 100644 --- a/test/stderr/5410 +++ b/test/stderr/5410 @@ -56,6 +56,7 @@ considering: $primary_hostname SMTP<< 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 127.0.0.1 in hosts_avoid_esmtp? no (option unset) SMTP>> EHLO myhost.test.ex +cmd buf flush 21 bytes SMTP<< 250-myhost.test.ex Hello the.local.host.name [ip4.ip4.ip4.ip4] 250-SIZE 52428800 250-8BITMIME @@ -101,12 +102,14 @@ considering: :}} result: : 127.0.0.1 in hosts_verify_avoid_tls? no (end of list) SMTP>> STARTTLS +cmd buf flush 10 bytes SMTP<< 220 TLS go ahead 127.0.0.1 in hosts_require_ocsp? no (option unset) 127.0.0.1 in hosts_request_ocsp? yes (matched "*") 127.0.0.1 in tls_verify_hosts? no (option unset) 127.0.0.1 in tls_try_verify_hosts? no (end of list) SMTP>> EHLO myhost.test.ex +cmd buf flush 21 bytes SMTP<< 250-myhost.test.ex Hello the.local.host.name [ip4.ip4.ip4.ip4] 250-SIZE 52428800 250-8BITMIME @@ -114,8 +117,10 @@ considering: :}} 250 HELP 127.0.0.1 in hosts_require_auth? no (option unset) SMTP>> MAIL FROM: +cmd buf flush 37 bytes SMTP<< 250 OK SMTP>> RCPT TO: +cmd buf flush 28 bytes SMTP<< 250 Accepted holding verify callout open for cutthrough delivery ----------- end cutthrough setup ------------ @@ -314,6 +319,7 @@ considering: $primary_hostname SMTP<< 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 127.0.0.1 in hosts_avoid_esmtp? no (option unset) SMTP>> EHLO myhost.test.ex +cmd buf flush 21 bytes SMTP<< 250-myhost.test.ex Hello the.local.host.name [ip4.ip4.ip4.ip4] 250-SIZE 52428800 250-8BITMIME @@ -341,8 +347,10 @@ considering: *}{:}} 127.0.0.1 in hosts_avoid_tls? yes (matched "*") 127.0.0.1 in hosts_require_auth? no (option unset) SMTP>> MAIL FROM: +cmd buf flush 37 bytes SMTP<< 250 OK SMTP>> RCPT TO: +cmd buf flush 28 bytes SMTP<< 250 Accepted holding verify callout open for cutthrough delivery ----------- end cutthrough setup ------------ @@ -541,6 +549,7 @@ considering: $primary_hostname SMTP<< 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 127.0.0.1 in hosts_avoid_esmtp? no (option unset) SMTP>> EHLO myhost.test.ex +cmd buf flush 21 bytes SMTP<< 250-myhost.test.ex Hello the.local.host.name [ip4.ip4.ip4.ip4] 250-SIZE 52428800 250-8BITMIME @@ -568,8 +577,10 @@ considering: *}{:}} 127.0.0.1 in hosts_avoid_tls? yes (matched "*") 127.0.0.1 in hosts_require_auth? no (option unset) SMTP>> MAIL FROM: +cmd buf flush 37 bytes SMTP<< 250 OK SMTP>> RCPT TO: +cmd buf flush 28 bytes SMTP<< 250 Accepted holding verify callout open for cutthrough delivery ----------- end cutthrough setup ------------ diff --git a/test/stderr/5420 b/test/stderr/5420 index 623b99864..ac54a65d6 100644 --- a/test/stderr/5420 +++ b/test/stderr/5420 @@ -56,6 +56,7 @@ considering: $primary_hostname SMTP<< 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 127.0.0.1 in hosts_avoid_esmtp? no (option unset) SMTP>> EHLO myhost.test.ex +cmd buf flush 21 bytes SMTP<< 250-myhost.test.ex Hello the.local.host.name [ip4.ip4.ip4.ip4] 250-SIZE 52428800 250-8BITMIME @@ -101,11 +102,13 @@ considering: :}} result: : 127.0.0.1 in hosts_verify_avoid_tls? no (end of list) SMTP>> STARTTLS +cmd buf flush 10 bytes SMTP<< 220 TLS go ahead 127.0.0.1 in tls_verify_hosts? no (option unset) 127.0.0.1 in tls_try_verify_hosts? yes (matched "*") 127.0.0.1 in tls_verify_cert_hostnames? yes (matched "*") SMTP>> EHLO myhost.test.ex +cmd buf flush 21 bytes SMTP<< 250-myhost.test.ex Hello the.local.host.name [ip4.ip4.ip4.ip4] 250-SIZE 52428800 250-8BITMIME @@ -113,8 +116,10 @@ considering: :}} 250 HELP 127.0.0.1 in hosts_require_auth? no (option unset) SMTP>> MAIL FROM: +cmd buf flush 37 bytes SMTP<< 250 OK SMTP>> RCPT TO: +cmd buf flush 28 bytes SMTP<< 250 Accepted holding verify callout open for cutthrough delivery ----------- end cutthrough setup ------------ @@ -313,6 +318,7 @@ considering: $primary_hostname SMTP<< 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 127.0.0.1 in hosts_avoid_esmtp? no (option unset) SMTP>> EHLO myhost.test.ex +cmd buf flush 21 bytes SMTP<< 250-myhost.test.ex Hello the.local.host.name [ip4.ip4.ip4.ip4] 250-SIZE 52428800 250-8BITMIME @@ -340,8 +346,10 @@ considering: *}{:}} 127.0.0.1 in hosts_avoid_tls? yes (matched "*") 127.0.0.1 in hosts_require_auth? no (option unset) SMTP>> MAIL FROM: +cmd buf flush 37 bytes SMTP<< 250 OK SMTP>> RCPT TO: +cmd buf flush 28 bytes SMTP<< 250 Accepted holding verify callout open for cutthrough delivery ----------- end cutthrough setup ------------ @@ -540,6 +548,7 @@ considering: $primary_hostname SMTP<< 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 127.0.0.1 in hosts_avoid_esmtp? no (option unset) SMTP>> EHLO myhost.test.ex +cmd buf flush 21 bytes SMTP<< 250-myhost.test.ex Hello the.local.host.name [ip4.ip4.ip4.ip4] 250-SIZE 52428800 250-8BITMIME @@ -567,8 +576,10 @@ considering: *}{:}} 127.0.0.1 in hosts_avoid_tls? yes (matched "*") 127.0.0.1 in hosts_require_auth? no (option unset) SMTP>> MAIL FROM: +cmd buf flush 37 bytes SMTP<< 250 OK SMTP>> RCPT TO: +cmd buf flush 28 bytes SMTP<< 250 Accepted holding verify callout open for cutthrough delivery ----------- end cutthrough setup ------------ diff --git a/test/stderr/5840 b/test/stderr/5840 index 250e606ca..08712d0d9 100644 --- a/test/stderr/5840 +++ b/test/stderr/5840 @@ -26,6 +26,7 @@ MUNGED: ::1 will be omitted in what follows >>> SMTP<< 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000 >>> ip4.ip4.ip4.ip4 in hosts_avoid_esmtp? no (option unset) >>> SMTP>> EHLO myhost.test.ex +>>> cmd buf flush 21 bytes >>> SMTP<< 250-myhost.test.ex Hello the.local.host.name [ip4.ip4.ip4.ip4] >>> 250-SIZE 52428800 >>> 250-8BITMIME @@ -35,11 +36,13 @@ MUNGED: ::1 will be omitted in what follows >>> ip4.ip4.ip4.ip4 in hosts_avoid_tls? no (option unset) >>> ip4.ip4.ip4.ip4 in hosts_verify_avoid_tls? no (option unset) >>> SMTP>> STARTTLS +>>> cmd buf flush 10 bytes >>> SMTP<< 220 TLS go ahead >>> ip4.ip4.ip4.ip4 in hosts_require_ocsp? no (option unset) >>> ip4.ip4.ip4.ip4 in hosts_require_ocsp? no (option unset) >>> ip4.ip4.ip4.ip4 in hosts_request_ocsp? no (end of list) >>> SMTP>> EHLO myhost.test.ex +>>> cmd buf flush 21 bytes >>> SMTP<< 250-myhost.test.ex Hello the.local.host.name [ip4.ip4.ip4.ip4] >>> 250-SIZE 52428800 >>> 250-8BITMIME @@ -47,10 +50,13 @@ MUNGED: ::1 will be omitted in what follows >>> 250 HELP >>> ip4.ip4.ip4.ip4 in hosts_require_auth? no (option unset) >>> SMTP>> MAIL FROM:<> +>>> cmd buf flush 14 bytes >>> SMTP<< 250 OK >>> SMTP>> RCPT TO: +>>> cmd buf flush 38 bytes >>> SMTP<< 250 Accepted >>> SMTP>> QUIT +>>> cmd buf flush 6 bytes >>> wrote callout cache domain record for dane256ee.test.ex: >>> result=1 postmaster=0 random=0 >>> wrote positive callout cache address record for CALLER@dane256ee.test.ex diff --git a/test/stdout/0902 b/test/stdout/0902 index 58dba6788..8c5422035 100644 --- a/test/stdout/0902 +++ b/test/stdout/0902 @@ -138,3 +138,22 @@ BDAT 8380 LAST QUIT 225 OK End of script +Listening on port 1224 ... +Connection request from [127.0.0.1] +220 Greetings +EHLO the.local.host.name +250-Hello there +250-PIPELINING +250 CHUNKING +MAIL FROM:<> +RCPT TO: +BDAT 8191 +250 OK mail +250 OK rcpt +250 OK nonlast bdat +BDAT 829 LAST +250 OK bdat +QUIT +225 OK +Expected EOF read from client +End of script