draft SMTP Service Extensions Sep 92 SMTP Service Extensions Thu Sep 10 08:32:12 1992 Marshall T. Rose Dover Beach Consulting, Inc. mrose@dbc.mtview.ca.us Einar A. Stefferud Network Management Associates, Inc. stef@nma.com David H. Crocker The Branch Office dcrocker@mordor.stanford.edu 1. Status of this Memo This document is an Internet Draft. Internet Drafts are working documents of the Internet Engineering Task Force (IETF), its Areas, and its Working Groups. Note that other groups may also distribute working documents as Internet Drafts. Internet Drafts are valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. (The file 1id-abstracts.txt on nic.ddn.mil describes the current status of each Internet Draft.) It is not appropriate to use Internet Drafts as reference material or to cite them other than as a "work in progress". 2. Abstract This memo defines a framework for extending the SMTP service by defining a means whereby a server SMTP can inform a client SMTP as to the service extensions it supports. Standard extensions to the SMTP service are registered with the IANA. Expires March 10, 1993 [Page 1] draft SMTP Service Extensions Sep 92 3. Introduction The Simple Mail Transfer Protocol (SMTP) [1] has provided a stable, effective basis for the relay function of message transfer agents. Although a decade old, SMTP has proven remarkably resilient. From SMTP's perspective, it relays a mail object containing an envelope and a content. (1) The SMTP envelope is straight-forward: it consists of an originator address (to which error reports should be directed); a delivery mode (e.g., deliver to recipient mailboxes); and, one or more recipient addresses. (2) The SMTP content has two parts: the headers and the body. The former is a collection of field/value pairs structured according to RFC 822 [2], whilst the latter, if structured, is defined according to MIME [3]. The content is textual in nature, expressed using the US ASCII repertoire. Although SMTP is widely and robustly deployed, some parts of the Internet community might wish to extend the SMTP service. This memo defines a means whereby a server SMTP can inform a client SMTP as to the service extensions that it supports. It must be emphasized that any extension to the SMTP service should not be considered lightly. SMTP's strength comes primarily from its simplicity. Experience with many protocols has shown that: protocols with few options tend towards ubiquity, whilst protocols with many options tend towards obscurity. This means that each and every extension, regardless of its benefits, must be carefully scrutinized with respect to its implementation, deployment, and interoperability costs. In many cases, the cost of extending the SMTP service will likely outweigh the benefit. Expires March 10, 1993 [Page 2] draft SMTP Service Extensions Sep 92 4. The EHLO command A client SMTP should start an SMTP session by issuing the EHLO command instead of the HELO command. The syntax for this command, using the ABNF notation of [2], is: ehlo-cmd ::= "EHLO" SP domain CR LF If successful, the server SMTP responds with code 250. On failure, the server SMTP responds with code 550. On error, the server SMTP responds with one of codes 500, 501, 502, or 421. This command is issued instead of the HELO command, and may be issued at any time in which a HELO command would be appropriate. That is, if the EHLO command is issued, and a successful response is returned, then a subsequent HELO or EHLO command will result in the server SMTP replying with code 501. A client SMTP must not cache any information returned if the EHLO command succeeds. That is, a client SMTP must issue that EHLO command at the start of each SMTP session if information about extended facilities is needed. 4.1. Successful response If the server SMTP implements and is able to perform the EHLO command, it will return code 250. This indicates that both the server and client SMTP are in the initial state, that is, there is no transaction in progress and all state tables and buffers are cleared. Normally, this response will be a multiline reply. Each line of the response contains a keyword and, optionally, one or more parameters. The syntax for a positive response, using the ABNF notation of [2], is: ehlo-ok-rsp ::= "250" [ SP greeting ] CR LF / ( "250-" greeting CR LF *( "250-" ehlo-line CR LF ) "250" SP ehlo-line CR LF ) Expires March 10, 1993 [Page 3] draft SMTP Service Extensions Sep 92 ; the usual HELO chit-chat greeting ::= 1* ehlo-line ::= ehlo-keyword *( SP ehlo-param ) ehlo-keyword ::= (ALPHA / DIGIT) *(ALPHA / DIGIT / "-") ; syntax and values depend on ehlo-keyword ehlo-param ::= 1* ALPHA ::= DIGIT ::= CR ::= LF ::= SP ::= The IANA maintains a registry of standard SMTP service extensions. Associated with each such extension is a corresponding EHLO keyword value. Each service extension registered with the IANA is defined by a standards-track RFC, and such a definition includes: (1) the textual name of the SMTP service extension; (2) the EHLO keyword value associated with the extension; (3) the syntax and possible values of parameters associated with the EHLO keyword value; and, (4) how support for the extension affects the behavior of a server and client SMTP. In addition, any EHLO keyword value that starts with an upper or lower case "X" refers to a local SMTP service extension, which is used through bilateral, rather than standardized, agreement. Expires March 10, 1993 [Page 4] draft SMTP Service Extensions Sep 92 4.2. Failure response If for some reason the server SMTP is unable to list the service extensions it supports, it will return code 502. In the case of a failure response, the client SMTP should issue either the HELO or QUIT command. 4.3. Error responses If the server SMTP does not recognize the EHLO command, it will return code 500. If the server SMTP recognizes the EHLO command, but the command argument is unacceptable, it will return code 501. If the server SMTP recognizes, but does not implement, the EHLO command, it will return code 502. If the server SMTP determines that the SMTP service is no longer available (e.g., due to imminent system shutdown), it will return code 421. In the case of any error response, the client SMTP should issue either the HELO or QUIT command. 5. Initial IANA Registry The IANA's initial registry of SMTP service extensions consists of these entries: Service Extension EHLO keyword parameters behavior ----------------- ------------ ---------- ------------------ Send SEND none defined in RFC 821 Send or Mail SOML none defined in RFC 821 Send and Mail SAML none defined in RFC 821 Expand EXPN none defined in RFC 821 Help HELP none defined in RFC 821 Turn TURN none defined in RFC 821 which correspond to those SMTP commands which are defined as optional in [4]. Expires March 10, 1993 [Page 5] draft SMTP Service Extensions Sep 92 6. Usage Example (1) An interaction of the form: S: C: S: 220 dbc.mtview.ca.us SMTP service ready C: EHLO baiji.dbc.mtview.ca.us S: 250 dbc.mtview.ca.us says hello ... indicates that the server SMTP implements only those SMTP commands which are defined as mandatory in [4]. (2) In contrast, an interaction of the form: S: C: S: 220 dbc.mtview.ca.us SMTP service ready C: EHLO baiji.dbc.mtview.ca.us S: 250-dbc.mtview.ca.us says hello S: 250-EXPN S: 250-HELP S: 250-8BIT S: 250-AMSS 100000 S: 250-XONE S: 250 XVRB indicates that the server SMTP also implements the SMTP EXPN and HELP commands, two standard service extensions (8BIT and AMSS), and two non-standard service extensions (XONE and XVRB). 7. Acknowledgements The authors acknowledge the comments of Harald T. Alvestrand, Ned Freed, John C. Kleinsen, Keith Moore, and, Julian P. Onions Expires March 10, 1993 [Page 6] draft SMTP Service Extensions Sep 92 8. References [1] J.B. Postel. Simple Mail Transfer Protocol. Request for Comments 821, (August, 1982). [2] D.H. Crocker. Standard for the Format of ARPA Internet Text Messages. Request for Comments 822, (August, 1982). [3] N.S. Borenstein, N. Freed. Multipurpose Internet Mail Extensions. Request for Comments 1341, (June, 1992). [4] R.T. Braden. Requirements for Internet Hosts - Application and Support. Request for Comments 1123, (October, 1989). Expires March 10, 1993 [Page 7]