BDAT
-------------------------------------------------------
The SMTP BDAT command is an alternative to the DATA command, which can be used when a remote SMTP server presents the CHUNKING verb. CHUNKING is an ESMTP functionality. Microsoft Exchange servers implement this feature by default, as do other SMTP servers.
The BDAT verb takes two arguments. The first argument indicates
the length, in octets, of the binary data chunk. The second optional argument
indicates that this data chunk is the last.
Servers that offer the BDAT extension MUST continue to support the
regular SMTP DATA command.
After all MAIL and RCPT responses are collected and processed, the
message is sent using a series of BDAT commands. The BDAT command takes one
required argument, the exact length of the data segment in octets. The message
data is sent immediately after the trailing <CR> <LF> of the BDAT
command line. Once the receiver-SMTP receives the specified number of octets,
it will return a 250 reply code.
The optional LAST parameter on the BDAT command indicates that
this is the last chunk of message data to be sent. The last BDAT command may
have a byte-count of zero indicating there is no additional data to be sent.
Any BDAT command sent after the BDAT LAST is illegal and MUST be replied to
with a 503 "Bad sequence of commands" reply code. The state resulting
from this error is indeterminate. A RSET command MUST be sent to clear the transaction
before continuing.
DATA and BDAT commands cannot be used in the same transaction. If
a DATA statement is issued after a BDAT for the current transaction, a 503
"Bad sequence of commands" MUST be issued.
The
equal logic array sends messages in small chunks using BDAT command. Exchange
2007 & 2010 will by default tarpit (slow down) any BDAT command that is not
the “LAST” chunk. Each chunk gets delayed 5 seconds before Exchange confirms it
has received it. As there are plenty of BDAT commands sent per message with a 5
second delay per packet it adds up very quickly. Now equal logic array has a
timeout of 2 minutes and hence the failure
The problem occurs when multiple email messages are transferred within the same TCP session using multiple BDAT commands. The transfer of a single email per session, with the use of only one BDAT command does not pose a problem.
-------------------------------------------------------