Preserve input and flush replies at the right time
04The server may combine some replies in a buffer, while preserving both command order and unread input. Buffering must not turn into deadlock.
Separate group containing only MAIL and RCPT: once the local TCP input buffer is empty, all pending replies must go out immediately, even without DATA.
Source for this drawing: RFC 2920 · Read RFC section 3.2 ↗
New to this? Start hereA quick picture + helpful background
A message needs an address.
Think of a packet as a small addressed envelope. Devices pass it onward; transport protocols decide what delivery promises an application gets.
Helpful first, if these ideas are unfamiliar
These pictures are analogies to help you learn. The linked RFC explains the actual rules.
Terms in this drawing
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.
A server offering PIPELINING MUST reply in received command order, MUST NOT assume commands not yet received, and MUST NOT flush or lose TCP input-buffer contents even when a command fails.
- A server offering PIPELINING MUST reply in received command order, MUST NOT assume commands not yet received, and MUST NOT flush or lose TCP input-buffer contents even when a command fails.
- The server SHOULD buffer replies to grouped envelope commands such as MAIL and RCPT, but MUST NOT buffer replies to EHLO, DATA, VRFY, EXPN, TURN, QUIT or NOOP, nor replies to unrecognized commands.
- Whenever the local TCP input buffer is emptied, the server MUST send all pending replies immediately. It cannot wait indefinitely for a guessed next command or the remainder of an imagined group.
- Buffering is an implementation choice within these rules, not a requirement for one TCP packet. A server SHOULD include explanatory text identifying the command, but clients still MUST correlate by count/order, not that text.
Fictional ASCII SMTP examples. PIPELINING batches commands, not delivery guarantees or security. Packet boundaries and wall-clock timing are schematic.
Read the RFC section ↗