Hi folks,
Following came up when I saw problems at feeding TLS wrapped SMTP
connection over the network to Stalker Software's CommuniGate Pro
server, which does implement two recent SMTP extensions:
PIPELINING
STARTTLS
The pipelining they do isn't *quite* fully optimized one, so where
e.g. ZMailer does things by noticing that more stuff is in the input
command buffer at the smtperver, then the ZMailer won't flush out
replies quite just yet.
Therefore when a SMTP transaction in pipelining mode from a client is:
>>> MAIL FROM:<....>\r\n
>>> RCPT TO:<....>\r\n
>>> DATA\r\n
all these are in single TLS level write-out.
ZMailer smtpserver will then formulate answers to them, and notice that
after MAIL FROM has been read, there is still stuff in the read-ahead
buffer, and *suspend* from flushing replies quite just yet. The end
result is that replies are sent in one TLS level write carrying them all.
However if the ZMailer smtpserver is deoptimized so that each reply will
always be sent as its own TLS write (same as CommuniGate Pro does), then
things will break when read-ahead is set at the connecting smtp client.
I tend to think that the read-ahead is partially broken, but how,
I don't quite know. What is it anyway ?
/Matti Aarnio <[EMAIL PROTECTED]>
First with READ-AHEAD set:
MAIL From:<[EMAIL PROTECTED]> BODY=8BITMIME SIZE=283
RCPT To:<[EMAIL PROTECTED]> ORCPT=rfc822;[EMAIL PROTECTED]
RCPT To:<[EMAIL PROTECTED]> ORCPT=rfc822;[EMAIL PROTECTED]
DATA
smtp_sfwrite() to write 185 bytes
# write to 20221D00 [120242590] (213 bytes => 213 (0xD5))
(cipher dump omitted)
# read from 20221D00 [120239D80] (18437 bytes => 61 (0x3D))
(cipher dump omitted)
# smtp_nbread() rc=28 errno=4
# 0000 32 35 30 20 32 2e 31 2e|30 20 53 65 6e 64 65 72 250 2.1. 0 Sender
# 0010 20 73 79 6e 74 61 78 20|4f 6b 0d 0a syntax Ok..
250 2.1.0 Sender syntax Ok
# read from 20221D00 [120239D80] (18437 bytes => 279 (0x117))
(cipher dump omitted)
# smtp_nbread() rc=73 errno=4
# 0000 32 35 30 20 32 2e 31 2e|35 20 4f 6b 3b 20 63 61 250 2.1. 5 Ok; ca
# 0010 6e 20 61 63 63 6f 6d 6f|64 61 74 65 20 32 38 33 n accomo date 283
# 0020 20 62 79 74 65 20 6d 65|73 73 61 67 65 20 66 6f byte me ssage fo
# 0030 72 20 3c 6e 6f 62 6f 64|79 40 6e 69 63 2e 66 75 r <nobod [EMAIL PROTECTED]
# 0040 6e 65 74 2e 66 69 3e 0d|0a net.fi>. .
250 2.1.5 Ok; can accomodate 283 byte message for <[EMAIL PROTECTED]>
[Some OK - code=250, idx=1, pipeindex=3]
Timeout (300 sec) while waiting responses from remote
Failure..
Then with READ-AHEAD disabled:
MAIL From:<[EMAIL PROTECTED]> BODY=8BITMIME SIZE=283
RCPT To:<[EMAIL PROTECTED]> ORCPT=rfc822;[EMAIL PROTECTED]
RCPT To:<[EMAIL PROTECTED]> ORCPT=rfc822;[EMAIL PROTECTED]
DATA
smtp_sfwrite() to write 185 bytes
# write to 20223F70 [120242590] (213 bytes => 213 (0xD5))
(cipher dump omitted)
# read from 20223F70 [120239D80] (5 bytes => 5 (0x5))
(cipher dump omitted)
# read from 20223F70 [120239D85] (56 bytes => 56 (0x38))
(cipher dump omitted)
# smtp_nbread() rc=28 errno=4
# 0000 32 35 30 20 32 2e 31 2e|30 20 53 65 6e 64 65 72 250 2.1. 0 Sender
# 0010 20 73 79 6e 74 61 78 20|4f 6b 0d 0a syntax Ok..
250 2.1.0 Sender syntax Ok
# read from 20223F70 [120239D80] (5 bytes => 5 (0x5))
(cipher dump omitted)
# read from 20223F70 [120239D85] (96 bytes => 96 (0x60))
(cipher dump omitted)
# smtp_nbread() rc=73 errno=4
# 0000 32 35 30 20 32 2e 31 2e|35 20 4f 6b 3b 20 63 61 250 2.1. 5 Ok; ca
# 0010 6e 20 61 63 63 6f 6d 6f|64 61 74 65 20 32 38 33 n accomo date 283
# 0020 20 62 79 74 65 20 6d 65|73 73 61 67 65 20 66 6f byte me ssage fo
# 0030 72 20 3c 6e 6f 62 6f 64|79 40 6e 69 63 2e 66 75 r <nobod [EMAIL PROTECTED]
# 0040 6e 65 74 2e 66 69 3e 0d|0a net.fi>. .
250 2.1.5 Ok; can accomodate 283 byte message for <[EMAIL PROTECTED]>
[Some OK - code=250, idx=1, pipeindex=3]
# read from 20223F70 [120239D80] (5 bytes => 5 (0x5))
(cipher dump omitted)
# read from 20223F70 [120239D85] (96 bytes => 96 (0x60))
(cipher dump omitted)
# smtp_nbread() rc=70 errno=4
# 0000 32 35 30 20 32 2e 31 2e|35 20 4f 6b 3b 20 63 61 250 2.1. 5 Ok; ca
# 0010 6e 20 61 63 63 6f 6d 6f|64 61 74 65 20 32 38 33 n accomo date 283
# 0020 20 62 79 74 65 20 6d 65|73 73 61 67 65 20 66 6f byte me ssage fo
# 0030 72 20 3c 6d 65 61 40 6e|69 63 2e 66 75 6e 65 74 r <mea@n ic.funet
# 0040 2e 66 69 3e 0d 0a .fi>..
250 2.1.5 Ok; can accomodate 283 byte message for <[EMAIL PROTECTED]>
[Some OK - code=250, idx=2, pipeindex=3]
# read from 20223F70 [120239D80] (5 bytes => 5 (0x5))
(cipher dump omitted)
# read from 20223F70 [120239D85] (72 bytes => 72 (0x48))
(cipher dump omitted)
# smtp_nbread() rc=46 errno=4
# 0000 33 35 34 20 53 74 61 72|74 20 6d 61 69 6c 20 69 354 Star t mail i
# 0010 6e 70 75 74 3b 20 65 6e|64 20 77 69 74 68 20 3c nput; en d with <
# 0020 43 52 4c 46 3e 2e 3c 43|52 4c 46 3e 0d 0a CRLF>.<C RLF>..
354 Start mail input; end with <CRLF>.<CRLF>
smtp_sync() did yield code 0 (rcptstates = 0x21)
.
smtp_sfwrite() to write 286 bytes
# write to 20223F70 [120242590] (317 bytes => 317 (0x13D))
(cipher dump omitted)
# read from 20223F70 [120239D80] (5 bytes => 5 (0x5))
(cipher dump omitted)
# read from 20223F70 [120239D85] (64 bytes => 64 (0x40))
(cipher dump omitted)
# smtp_nbread() rc=43 errno=4
# 0000 32 35 30 20 32 2e 36 2e|30 20 53 32 38 33 38 37 250 2.6. 0 S28387
# 0010 41 62 51 44 46 4c 72 49|20 6d 65 73 73 61 67 65 AbQDFLrI message
# 0020 20 61 63 63 65 70 74 65|64 0d 0a accepte d..
250 2.6.0 S28387AbQDFLrI message accepted
Sucessfully completed.
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]