idnits 2.17.1 draft-freed-smtp-pipeline-01.txt: ** The Abstract section seems to be numbered Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** Cannot find the required boilerplate sections (Copyright, IPR, etc.) in this document. Expected boilerplate is as follows today (2024-04-25) according to https://trustee.ietf.org/license-info : IETF Trust Legal Provisions of 28-dec-2009, Section 6.a: This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. IETF Trust Legal Provisions of 28-dec-2009, Section 6.b(i), paragraph 2: Copyright (c) 2024 IETF Trust and the persons identified as the document authors. All rights reserved. IETF Trust Legal Provisions of 28-dec-2009, Section 6.b(i), paragraph 3: This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- ** Missing expiration date. The document expiration date should appear on the first and last page. ** The document seems to lack a 1id_guidelines paragraph about Internet-Drafts being working documents. ** The document seems to lack a 1id_guidelines paragraph about 6 months document validity -- however, there's a paragraph with a matching beginning. Boilerplate error? ** The document seems to lack a 1id_guidelines paragraph about the list of current Internet-Drafts. ** The document seems to lack a 1id_guidelines paragraph about the list of Shadow Directories. == No 'Intended status' indicated for this document; assuming Proposed Standard Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** The document seems to lack separate sections for Informative/Normative References. All references will be assumed normative when checking for downward references. == There are 4 instances of lines with non-RFC2606-compliant FQDNs in the document. ** The document seems to lack a both a reference to RFC 2119 and the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. RFC 2119 keyword, line 146: '...ions that employ pipelining MUST check...' RFC 2119 keyword, line 156: '...Command statuses MUST be coordinated w...' RFC 2119 keyword, line 159: '...tiline responses MUST be supported. Ma...' RFC 2119 keyword, line 163: '... implementations MAY elect to operate ...' RFC 2119 keyword, line 168: '...implementations MUST also check the TC...' (10 more instances...) Miscellaneous warnings: ---------------------------------------------------------------------------- == The "Author's Address" (or "Authors' Addresses") section title is misspelled. -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (March 1997) is 9903 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Obsolete normative reference: RFC 821 (ref. '1') (Obsoleted by RFC 2821) ** Obsolete normative reference: RFC 1869 (ref. '2') (Obsoleted by RFC 2821) Summary: 12 errors (**), 0 flaws (~~), 3 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group Ned Freed 3 Internet Draft Innosoft 4 6 SMTP Service Extension 7 for Command Pipelining 9 March 1997 11 Status of this Memo 13 This document is an Internet-Draft. Internet-Drafts are 14 working documents of the Internet Engineering Task Force 15 (IETF), its areas, and its working groups. Note that other 16 groups may also distribute working documents as Internet- 17 Drafts. 19 Internet-Drafts are draft documents valid for a maximum of six 20 months. Internet-Drafts may be updated, replaced, or obsoleted 21 by other documents at any time. It is not appropriate to use 22 Internet-Drafts as reference material or to cite them other 23 than as a "working draft" or "work in progress". 25 To learn the current status of any Internet-Draft, please 26 check the 1id-abstracts.txt listing contained in the 27 Internet-Drafts Shadow Directories on ds.internic.net (US East 28 Coast), nic.nordu.net (Europe), ftp.isi.edu (US West Coast), 29 or munnari.oz.au (Pacific Rim). 31 1. Abstract 33 This memo defines an extension to the SMTP service whereby a 34 server can indicate the extent of its ability to accept 35 multiple commands in a single TCP send operation. Using a 36 single TCP send operation for multiple commands can improve 37 SMTP performance significantly. 39 2. Introduction 41 Although SMTP is widely and robustly deployed, certain 42 extensions may nevertheless prove useful. In particular, many 43 parts of the Internet make use of high latency network links. 45 SMTP's intrinsic one command-one response structure is 46 significantly penalized by high latency links, often to the 47 point where the factors contributing to overall connection 48 time are dominated by the time spent waiting for responses to 49 individual commands (turnaround time). 51 In the best of all worlds it would be possible to simply 52 deploy SMTP client software that makes use of command 53 pipelining: batching up multiple commands into single TCP send 54 operations. Unfortunately, the original SMTP specification [1] 55 did not explicitly state that SMTP servers must support this. 56 As a result a non-trivial number of Internet SMTP servers 57 cannot adequately handle command pipelining. Flaws known to 58 exist in deployed servers include: 60 (1) Connection handoff and buffer flushes in the middle of 61 the SMTP dialogue. Creation of server processes for 62 incoming SMTP connections is a useful, obvious, and 63 harmless implementation technique. However, some SMTP 64 servers defer process forking and connection handoff 65 until some intermediate point in the SMTP dialogue. 66 When this is done material read from the TCP connection 67 and kept in process buffers can be lost. 69 (2) Flushing the TCP input buffer when an SMTP command 70 fails. SMTP commands often fail but there is no reason 71 to flush the TCP input buffer when this happens. 72 Nevertheless, some SMTP servers do this. 74 (3) Improper processing and promulgation of SMTP command 75 failures. For example, some SMTP servers will refuse to 76 accept a DATA command if the last RCPT TO command 77 fails, paying no attention to the success or failure of 78 prior RCPT TO command results. Other servers will 79 accept a DATA command even when all previous RCPT TO 80 commands have failed. Although it is possible to 81 accommodate this sort of behavior in a client that 82 employs command pipelining, it does complicate the 83 construction of the client unnecessarily. 85 This memo uses the mechanism described in [2] to define an 86 extension to the SMTP service whereby an SMTP server can 87 declare that it is capable of handling pipelined commands. The 88 SMTP client can then check for this declaration and use 89 pipelining only when the server declares itself capable of 90 handling it. 92 3. Framework for the Command Pipelining Extension 94 The Command Pipelining extension is defined as follows: 96 (1) the name of the SMTP service extension is Pipelining; 98 (2) the EHLO keyword value associated with the extension is 99 PIPELINING; 101 (3) no parameter is used with the PIPELINING EHLO keyword; 103 (4) no additional parameters are added to either the MAIL 104 FROM or RCPT TO commands. 106 (5) no additional SMTP verbs are defined by this extension; 107 and, 109 (6) the next section specifies how support for the 110 extension affects the behavior of a server and client 111 SMTP. 113 4. The Pipelining Service Extension 115 When a client SMTP wishes to employ command pipelining, it 116 first issues the EHLO command to the server SMTP. If the 117 server SMTP responds with code 250 to the EHLO command, and 118 the response includes the EHLO keyword value PIPELINING, then 119 the server SMTP has indicated that it can accommodate SMTP 120 command pipelining. 122 4.1. Client use of pipelining 124 Once the client SMTP has confirmed that support exists for the 125 pipelining extension, the client SMTP may then elect to 126 transmit groups of SMTP commands in batches without waiting 127 for a response to each individual command. In particular, the 128 commands RSET, MAIL FROM, SEND FROM, SOML FROM, SAML FROM, and 129 RCPT TO can all appear anywhere in a pipelined command group. 130 The EHLO, DATA, VRFY, EXPN, TURN, QUIT, and NOOP commands can 131 only appear as the last command in a group since their success 132 or failure produces a change of state which the client SMTP 133 must accommodate. (NOOP is included in this group so it can be 134 used as a synchronization point.) 136 Additional commands added by other SMTP extensions may only 137 appear as the last command in a group unless otherwise 138 specified by the extensions that define the commands. 140 The actual transfer of message content is explicitly allowed 141 to be the first "command" in a group. That is, a RSET/MAIL 142 FROM sequence used to initiate a new message transaction can 143 be placed in the same group as the final transfer of the 144 headers and body of the previous message. 146 Client SMTP implementations that employ pipelining MUST check 147 ALL statuses associated with each command in a group. For 148 example, if none of the RCPT TO recipient addresses were 149 accepted the client must then check the response to the DATA 150 command -- the client cannot assume that the DATA command will 151 be rejected just because none of the RCPT TO commands worked. 152 If the DATA command was properly rejected the client SMTP can 153 just issue RSET, but if the DATA command was accepted the 154 client SMTP should send a single dot. 156 Command statuses MUST be coordinated with responses by 157 counting each separate response and correlating that count 158 with the number of commands known to have been issued. 159 Multiline responses MUST be supported. Matching on the basis 160 of either the error code value or associated text is expressly 161 forbidden. 163 Client SMTP implementations MAY elect to operate in a 164 nonblocking fashion, processing server responses immediately 165 upon receipt, even if there is still data pending transmission 166 from the client's previous TCP send operation. If nonblocking 167 operation is not supported, however, client SMTP 168 implementations MUST also check the TCP window size and make 169 sure that each group of commands fits entirely within the 170 window. The window size is usually, but not always, 4K octets. 171 Failure to perform this check can lead to deadlock conditions. 173 Clients MUST NOT confuse responses to multiple commands with 174 multiline responses. Each command requires one or more lines 175 of response, the last line not containing a dash between the 176 response code and the response string. 178 4.2. Server support of pipelining 180 A server SMTP implementation that offers the pipelining 181 extension: 183 (1) MUST NOT flush or otherwise lose the contents of the 184 TCP input buffer under any circumstances whatsoever. 186 (2) SHOULD issue a positive response to the DATA command if 187 and only if one or more valid RCPT TO addresses have 188 been previously received. 190 (3) MUST NOT, after issuing a positive response to a DATA 191 command with no valid recipients and subsequently 192 receiving an empty message, send any message whatsoever 193 to anybody. 195 (4) SHOULD elect to store responses to grouped RSET, MAIL 196 FROM, SEND FROM, SOML FROM, SAML FROM, and RCPT TO 197 commands in an internal buffer so they can sent as a 198 unit. 200 (5) MUST NOT buffer responses to EHLO, DATA, VRFY, EXPN, 201 TURN, QUIT, and NOOP. 203 (6) MUST NOT buffer responses to unrecognized commands. 205 (7) MUST send all pending responses immediately whenever 206 the local TCP input buffer is emptied. 208 (8) MUST NOT make assumptions about commands that are yet 209 to be received. 211 (9) SHOULD issue response text that indicates, either 212 implicitly or explicitly, what command the response 213 matches. 215 The overriding intent of these server requirements is to make 216 it as easy as possible for servers to conform to these 217 pipelining extensions. 219 5. Examples 221 Consider the following SMTP dialogue that does not use 222 pipelining: 224 S: 225 C: 226 S: 220 innosoft.com SMTP service ready 227 C: HELO dbc.mtview.ca.us 228 S: 250 innosoft.com 229 C: MAIL FROM: 230 S: 250 sender OK 231 C: RCPT TO: 232 S: 250 recipient OK 233 C: RCPT TO: 234 S: 250 recipient OK 235 C: RCPT TO: 236 S: 250 recipient OK 237 C: DATA 238 S: 354 enter mail, end with line containing only "." 239 ... 240 C: . 241 S: 250 message sent 242 C: QUIT 243 S: 221 goodbye 245 The client waits for a server response a total of 9 times in 246 this simple example. But if pipelining is employed the 247 following dialogue is possible: 249 S: 250 C: 251 S: 220 innosoft.com SMTP service ready 252 C: EHLO dbc.mtview.ca.us 253 S: 250-innosoft.com 254 S: 250 PIPELINING 255 C: MAIL FROM: 256 C: RCPT TO: 257 C: RCPT TO: 258 C: RCPT TO: 259 C: DATA 260 S: 250 sender OK 261 S: 250 recipient OK 262 S: 250 recipient OK 263 S: 250 recipient OK 264 S: 354 enter mail, end with line containing only "." 265 ... 266 C: . 267 C: QUIT 268 S: 250 message sent 269 S: 221 goodbye 271 The total number of turnarounds has been reduced from 9 to 4. 273 The next example illustrates one possible form of behavior 274 when pipelining is used and all recipients are rejected: 276 S: 277 C: 278 S: 220 innosoft.com SMTP service ready 279 C: EHLO dbc.mtview.ca.us 280 S: 250-innosoft.com 281 S: 250 PIPELINING 282 C: MAIL FROM: 283 C: RCPT TO: 284 C: RCPT TO: 285 C: DATA 286 S: 250 sender OK 287 S: 550 remote mail to not allowed 288 S: 550 remote mail to not allowed 289 S: 554 no valid recipients given 290 C: QUIT 291 S: 221 goodbye 293 The client SMTP waits for the server 4 times here as well. If 294 the server SMTP does not check for at least one valid 295 recipient prior to accepting the DATA command, the following 296 dialogue would result: 298 S: 299 C: 300 S: 220 innosoft.com SMTP service ready 301 C: EHLO dbc.mtview.ca.us 302 S: 250-innosoft.com 303 S: 250 PIPELINING 304 C: MAIL FROM: 305 C: RCPT TO: 306 C: RCPT TO: 307 C: DATA 308 S: 250 sender OK 309 S: 550 remote mail to not allowed 310 S: 550 remote mail to not allowed 311 S: 354 enter mail, end with line containing only "." 312 C: . 313 C: QUIT 314 S: 554 no valid recipients 315 S: 221 goodbye 317 6. Security Considerations 319 This RFC does not discuss security issues and is not believed 320 to raise any security issues not endemic in electronic mail 321 and present in fully conforming implementations of [1]. 323 7. Acknowledgements 325 This document is based on the SMTP service extension model 326 presented in RFC 1425. Marshall Rose's description of SMTP 327 command pipelining in his book "The Internet Message" also 328 served as a source of inspiration for this extension. 330 8. References 332 [1] J.B. Postel. Simple Mail Transfer Protocol. Request for 333 Comments 821, (August, 1982). 335 [2] J.C. Klensin, N. Freed, M.T. Rose, E.A. Stefferud, 336 D.H. Crocker. SMTP Service Extensions. Request for 337 Comments 1869, (November, 1995). 339 9. Author Address 341 Ned Freed 342 Innosoft International, Inc. 343 1050 East Garvey Avenue South 344 West Covina, CA 91790 345 USA 346 tel: +1 818 919 3600 fax: +1 818 919 3614 347 email: ned@innosoft.com 349 This document is a product of work done by the Internet 350 Engineering Task Force Working Group on Messaging Extensions, 351 Alan Cargille, chair.