Minor revisions of the SMTP extensions documents

Ned Freed <NED@sigurd.innosoft.com> Sat, 07 May 1994 09:14 UTC

Received: from ietf.nri.reston.va.us by IETF.CNRI.Reston.VA.US id aa01561; 7 May 94 5:14 EDT
Received: from CNRI.RESTON.VA.US by IETF.CNRI.Reston.VA.US id aa01557; 7 May 94 5:14 EDT
Received: from dimacs.rutgers.edu by CNRI.Reston.VA.US id aa01908; 7 May 94 5:14 EDT
Received: by dimacs.rutgers.edu (5.59/SMI4.0/RU1.5/3.08) id AA24596; Sat, 7 May 94 04:56:39 EDT
Received: from SIGURD.INNOSOFT.COM by dimacs.rutgers.edu (5.59/SMI4.0/RU1.5/3.08) id AA24592; Sat, 7 May 94 04:56:27 EDT
Received: from SIGURD.INNOSOFT.COM by SIGURD.INNOSOFT.COM (PMDF V4.4-0 #1234) id <01HC1GXSUBMO8Y52FD@SIGURD.INNOSOFT.COM>; Sat, 7 May 1994 01:56:14 PDT
Date: Sat, 07 May 1994 01:52:37 -0700
Sender: ietf-archive-request@IETF.CNRI.Reston.VA.US
From: Ned Freed <NED@sigurd.innosoft.com>
Subject: Minor revisions of the SMTP extensions documents
In-Reply-To: Your message dated "Fri, 06 May 1994 14:13:42 -0400" <9405061413.aa04662@IETF.CNRI.Reston.VA.US>
To: Internet-Drafts@CNRI.Reston.VA.US
Cc: ietf-smtp@dimacs.rutgers.edu
Message-Id: <01HC1H5YDSUE8Y52FD@SIGURD.INNOSOFT.COM>
Mime-Version: 1.0
Content-Type: MULTIPART/MIXED; BOUNDARY="Boundary (ID t37cp/gnA0zFNYPQV6V0NQ)"

I recently realized that the latest versions of these documents aren't the
ones in the Internet-Drafts area. Please update them with the new versions
provided below.

The changes are incredibly minor. A clarifying sentence was added to the
base extensions document and to the size extensions, specifying that
only a single occurrence of the parameter is allowed. Some wordsmithing
was done to the 8bitMIME and pipelining documents. No protocol changes
have been made at all.

				Ned






Network Working Group                   John Klensin, WG Chair
Internet Draft                               Ned Freed, Editor
<draft-ietf-smtpext-extensions-01.txt>           Marshall Rose
                                               Einar Stefferud
                                                 David Crocker

                   SMTP Service Extensions

                         May 6, 1994



                     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 draft documents valid for a maximum of six
months. Internet-Drafts may be updated, replaced, or obsoleted
by other documents at any time.  It is not appropriate to use
Internet-Drafts as reference material or to cite them other
than as a "working draft" or "work in progress".

To learn the current status of any Internet-Draft, please
check the 1id-abstracts.txt listing contained in the
Internet-Drafts Shadow Directories on ds.internic.net,
nic.nordu.net, ftp.isi.edu, or munnari.oz.au.

This draft is intended to supercede RFC 1425.


1.  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.
This framework does not require modification of existing SMTP
clients or servers unless the features of the service
extensions are to be requested or provided.













Internet Draft     SMTP Service Extensions            May 1994


2.  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. Nevertheless, the need for a number of
protocol extensions has become evident. Rather than describing
these extensions as separate and haphazard entities, this
document enhances SMTP in a straightforward fashion that
provides a framework in which all future extensions can be
built in a single consistent way.


3.  Framework for SMTP Extensions

For the purpose of service extensions to SMTP, SMTP relays a
mail object containing an envelope and a content.

(1)  The SMTP envelope is straightforward, and is sent as a
     series of SMTP protocol units: 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 is sent in the SMTP DATA protocol unit
     and has two parts: the headers and the body. The headers
     form a collection of field/value pairs structured
     according to RFC 822 [2], whilst the body, if structured,
     is defined according to MIME [3]. The content is textual
     in nature, expressed using the US ASCII repertoire (ANSI
     X3.4-1986). Although extensions (such as MIME) may relax
     this restriction for the content body, the content
     headers are always encoded using the US ASCII repertoire.
     The algorithm defined in [4] is used to represent header
     values outside the US ASCII repertoire, whilst still
     encoding them 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 both an extended SMTP client
and server may recognize each other as such and the server can
inform the client as to the service extensions that it
supports.







                    Expires November 1994             [Page 2]





Internet Draft     SMTP Service Extensions            May 1994


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.

Given this environment, the framework for the extensions
described in this memo consists of:

(1)  a new SMTP command (section 4)

(2)  a registry of SMTP service extensions (section 5)

(3)  additional parameters to the SMTP MAIL FROM and RCPT TO
     commands (section 6).

4.  The EHLO command

A client SMTP supporting SMTP service extensions should start
an SMTP session by issuing the EHLO command instead of the
HELO command. If the SMTP server supports the SMTP service
extensions it will give a successful response (see section
4.3), a failure response (see 4.4), or an error response
(4.5). If the SMTP server does not support any SMTP service
extensions it will generate an error response (see section
4.5).


4.1.  Changes to RFC 821

RFC 821 states that the first command in an SMTP session must
be the HELO command. This requirement is hereby amended to
allow a session to start with either EHLO or HELO.









                    Expires November 1994             [Page 3]





Internet Draft     SMTP Service Extensions            May 1994


4.2.  Command syntax

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, 504, or
421.

This command is issued instead of the HELO command, and may be
issued at any time that 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 503.  A
client SMTP must not cache any information returned if the
EHLO command succeeds. That is, a client SMTP must issue the
EHLO command at the start of each SMTP session if information
about extended facilities is needed.


4.3.  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"    domain [ SP greeting ] CR LF
                    / (    "250-"   domain [ SP greeting ] CR LF
                        *( "250-"      ehlo-line           CR LF )
                           "250"    SP ehlo-line           CR LF   )

                  ; the usual HELO chit-chat
     greeting     ::= 1*<any character other than CR or LF>

     ehlo-line    ::= ehlo-keyword *( SP ehlo-param )





                    Expires November 1994             [Page 4]





Internet Draft     SMTP Service Extensions            May 1994


     ehlo-keyword ::= (ALPHA / DIGIT) *(ALPHA / DIGIT / "-")

                  ; syntax and values depend on ehlo-keyword
     ehlo-param   ::= 1*<any CHAR excluding SP and all
                         control characters (US ASCII 0-31
                         inclusive)>

     ALPHA        ::= <any one of the 52 alphabetic characters
                       (A through Z in upper case, and,
                        a through z in lower case)>
     DIGIT        ::= <any one of the 10 numeric characters
                       (0 through 9)>

     CR           ::= <the carriage-return character
                       (ASCII decimal code 13)>
     LF           ::= <the line-feed character
                       (ASCII decimal code 10)>
     SP           ::= <the space character
                       (ASCII decimal code 32)>

Although EHLO keywords may be specified in upper, lower, or
mixed case, they must always be recognized and processed in a
case-insensitive manner. This is simply an extension of
practices begun in RFC 821.

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;

(4)  any additional SMTP verbs associated with the extension
     (additional verbs will usually be, but are not required
     to be, the same as the EHLO keyword value);

(5)  any new parameters the extension associates with the MAIL
     FROM or RCPT TO verbs; and,






                    Expires November 1994             [Page 5]





Internet Draft     SMTP Service Extensions            May 1994


(6)  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. Keywords beginning with "X" may not be used in a
registered service extension.

Any keyword values presented in the EHLO response that do not
begin with "X" must correspond to a standard or standards-
track SMTP service extension registered with IANA.  A
conforming server must not offer non "X" prefixed keyword
values that are not described in a registered and standardized
extension.

Additional verbs are bound by the same rules as EHLO keywords;
specifically, verbs begining with "X" are local extensions
that may not be standardized and verbs not beginning with "X"
must always be registered.


4.4.  Failure response

If for some reason the server SMTP is unable to list the
service extensions it supports, it will return code 554.

In the case of a failure response, the client SMTP should
issue either the HELO or QUIT command.


4.5.  Error responses from extended servers

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.





                    Expires November 1994             [Page 6]





Internet Draft     SMTP Service Extensions            May 1994


4.6.  Responses from servers without extensions

A server SMTP that conforms to RFC 821 but does not support
the extensions specified here will not recognize the EHLO
command and will consequently return code 500, as specified in
RFC 821.  The server SMTP should stay in the same state after
returning this code (see section 4.1.1 of RFC 821).  The
client SMTP may then issue either a HELO or a QUIT command.

4.7.  Responses from improperly implemented servers

Some SMTP servers are known to disconnect the SMTP
transmission channel upon receipt of the EHLO command. The
disconnect can occur immediately or after sending a response.
Such behavior violates section 4.1.1 of RFC 821, which
explicitly states that disconnection should only occur after a
QUIT command is issued.

Nevertheless, in order to achieve maxmimum interoperablity it
is suggested that extended SMTP clients using EHLO be coded to
check for server connection closure after EHLO is sent, either
before or after returning a reply.  If this happens the client
must decide if the operation can be successfully completed
without using any SMTP extensions. If it can a new connection
can be opened and the HELO command can be used.

Other improperly-implemented servers will not accept a HELO
command after EHLO has been sent and rejected.  In some cases,
this problem can be worked around by sending a RSET after the
failure response to EHLO, then sending the HELO.  Clients that
do this should be aware that many implementations will return
a failure code (e.g., 503 Bad sequence of commands) in
response to the RSET.  This code can be safely ignored.

















                    Expires November 1994             [Page 7]





Internet Draft     SMTP Service Extensions            May 1994


5.  Initial IANA Registry

The IANA's initial registry of SMTP service extensions
consists of these entries:

Service Ext   EHLO Keyword Parameters Verb       Added Behavior
------------- ------------ ---------- ---------- ------------------
Send             SEND         none       SEND    defined in RFC 821
Send or Mail     SOML         none       SOML    defined in RFC 821
Send and Mail    SAML         none       SAML    defined in RFC 821
Expand           EXPN         none       EXPN    defined in RFC 821
Help             HELP         none       HELP    defined in RFC 821
Turn             TURN         none       TURN    defined in RFC 821

which correspond to those SMTP commands which are defined as
optional in [5].  (The mandatory SMTP commands, according to
[5], are HELO, MAIL, RCPT, DATA, RSET, VRFY, NOOP, and QUIT.)


6.  MAIL FROM and RCPT TO Parameters

It is recognized that several of the extensions planned for
SMTP will make use of additional parameters associated with
the MAIL FROM and RCPT TO command. The syntax for these
commands, again using the ABNF notation of [2] as well as
underlying definitions from [1], is:

  esmtp-cmd        ::= inner-esmtp-cmd [SP esmtp-parameters] CR LF
  esmtp-parameters ::= esmtp-parameter *(SP esmtp-parameter)
  esmtp-parameter  ::= esmtp-keyword ["=" esmtp-value]
  esmtp-keyword    ::= (ALPHA / DIGIT) *(ALPHA / DIGIT / "-")

                       ; syntax and values depend on esmtp-keyword
  esmtp-value      ::= 1*<any CHAR excluding "=", SP, and all
                          control characters (US ASCII 0-31
                          inclusive)>

                       ; The following commands are extended to
                       ; accept extended parameters.
  inner-esmtp-cmd  ::= ("MAIL FROM:<" reverse-path ">")   /
                       ("RCPT TO:<" forward-path ">")









                    Expires November 1994             [Page 8]





Internet Draft     SMTP Service Extensions            May 1994


All esmtp-keyword values must be registered as part of the
IANA registration process described above. This definition
only provides the framework for future extension; no extended
MAIL FROM or RCPT TO parameters are defined by this RFC.


6.1.  Error responses

If the server SMTP does not recognize or cannot implement one
or more of the parameters associated with a particular MAIL
FROM or RCPT TO command, it will return code 555.

If for some reason the server is temporarily unable to
accomodate one or more of the parameters associated with a
MAIL FROM or RCPT TO command, and if the definition of the
specific parameter does not mandate the use of another code,
it should return code 455.

Errors specific to particular parameters and their values will
be specified in the parameter's defining RFC.


7.  Received: Header Field Annotation

SMTP servers are required to add an appropriate Received:
field to the headers of all messages they receive. A "with
ESMTP" clause should be added to this field when any SMTP
service extensions are used. "ESMTP" is hereby added to the
list of standard protocol names registered with IANA.


8.  Usage Examples

(1)  An interaction of the form:

     S: <wait for connection on TCP port 25>
     C: <open connection to server>
     S: 220 dbc.mtview.ca.us SMTP service ready
     C: EHLO ymir.claremont.edu
     S: 250 dbc.mtview.ca.us says hello
      ...

     indicates that the server SMTP implements only those SMTP
     commands which are defined as mandatory in [5].






                    Expires November 1994             [Page 9]





Internet Draft     SMTP Service Extensions            May 1994


(2)  In contrast, an interaction of the form:

     S: <wait for connection on TCP port 25>
     C: <open connection to server>
     S: 220 dbc.mtview.ca.us SMTP service ready
     C: EHLO ymir.claremont.edu
     S: 250-dbc.mtview.ca.us says hello
     S: 250-EXPN
     S: 250-HELP
     S: 250-8BITMIME
     S: 250-XONE
     S: 250 XVRB
      ...

     indicates that the server SMTP also implements the SMTP
     EXPN and HELP commands, one standard service extension
     (8BITMIME), and two non-standard service extensions (XONE
     and XVRB).


(3)  Finally, a server that does not support SMTP service
     extensions would act as follows:

     S: <wait for connection on TCP port 25>
     C: <open connection to server>
     S: 220 dbc.mtview.ca.us SMTP service ready
     C: EHLO ymir.claremont.edu
     S: 500 Command not recognized: EHLO
      ...

     The 500 response indicates that the server SMTP does not
     implement the extensions specified here.  The client
     would normally send a HELO command and proceed as
     specified in RFC 821.   See section 4.7 for additional
     discussion.


9.  Security Considerations

This RFC does not discuss security issues and is not believed
to raise any security issues not already endemic in electronic
mail and present in fully conforming implementations of RFC-
821.  It does provide an announcement of server mail
capabilities via the response to the EHLO verb. However, all
information provided by announcement of any of the initial set





                    Expires November 1994            [Page 10]





Internet Draft     SMTP Service Extensions            May 1994


of service extensions defined by this RFC can be readily
deduced by selective probing of the verbs required to
transport and deliver mail. The security implications of
service extensions described in other RFCs should be dealt
with in those RFCs.


10.  Acknowledgements

This document represents a synthesis of the ideas of many
people and reactions to the ideas and proposals of others.
Randall Atkinson, Craig Everhart, Risto Kankkunen, and Greg
Vaudreuil contributed ideas and text sufficient to be
considered co-authors.  Other important suggestions, text, or
encouragement came from Harald Alvestrand, Jim Conklin, Mark
Crispin, Frank da Cruz, 'Olafur Gudmundsson, Per Hedeland,
Christian Huitma, Neil Katin, Eliot Lear, Harold A.  Miller,
Dan Oscarsson, Julian Onions, Rayan Zachariassen, and the
contributions of the entire IETF SMTP Working Group. Of
course, none of the individuals are necessarily responsible
for the combination of ideas represented here. Indeed, in some
cases, the response to a particular criticism was to accept
the problem identification but to include an entirely
different solution from the one originally proposed.


11.  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 1521, (September,
     1993).

[4]  K. Moore.  Representation of Non-ASCII Text in Internet
     Message Headers.  Request for Comments 1522, (September,
     1993).

[5]  R.T. Braden.  Requirements for Internet Hosts -
     Application and Support.  Request for Comments 1123,
     (October, 1989).





                    Expires November 1994            [Page 11]





Internet Draft     SMTP Service Extensions            May 1994


12.  Chair, Editor, and Author Addresses

John Klensin, WG Chair
United Nations University
P.O. Box 500, Charles Street Station
Boston, MA 02114-0500
USA
 tel: +1 617 227 8747           fax: +1 617 491 6266
 email: klensin@infoods.unu.edu

Ned Freed, Editor
Innosoft International, Inc.
1050 East Garvey Avenue South
West Covina, CA 91790
USA
 tel: +1 818 919 3600           fax: +1 818 919 3614
 email: ned@innosoft.com

Marshall T. Rose
Dover Beach Consulting, Inc.
420 Whisman Court
Moutain View, CA  94043-2186
USA
 tel: +1 415 968 1052           fax: +1 415 968 2510
 email: mrose@dbc.mtview.ca.us

Einar A. Stefferud
Network Management Associates, Inc.
17301 Drey Lane
Huntington Beach, CA, 92647-5615
USA
 tel: +1 714 842 3711           fax: +1 714 848 2091
 email: stef@nma.com

Dave Crocker
Silicon Graphics, Inc.
2011 N. Shoreline Blvd.
P.O. Box 7311
Mountain View, CA 94039
USA
 tel: +1 415 390 1804           fax: +1 415 962 8404
 email: dcrocker@sgi.com








                    Expires November 1994            [Page 12]







Network Working Group                   John Klensin, WG Chair
Internet Draft                               Ned Freed, Editor
<draft-ietf-smtpext-8bitmime-01.txt>             Marshall Rose
                                               Einar Stefferud
                                                 David Crocker

                    SMTP Service Extension
                    for 8bit-MIMEtransport

                         May 6, 1994



                     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 draft documents valid for a maximum of six
months. Internet-Drafts may be updated, replaced, or obsoleted
by other documents at any time.  It is not appropriate to use
Internet-Drafts as reference material or to cite them other
than as a "working draft" or "work in progress".

To learn the current status of any Internet-Draft, please
check the 1id-abstracts.txt listing contained in the
Internet-Drafts Shadow Directories on ds.internic.net,
nic.nordu.net, ftp.isi.edu, or munnari.oz.au.

This draft is intended to supercede RFC 1426.


1.  Abstract

This memo defines an extension to the SMTP service whereby an
SMTP content body consisting of text containing octets outside
of the US ASCII octet range (hex 00-7F) may be relayed using
SMTP.















Internet Draft     SMTP 8bit-MIMEtransport            May 1994


2.  Introduction

Although SMTP is widely and robustly deployed, various
extensions have been requested by parts of the Internet
community. In particular, a significant portion of the
Internet community wishes to exchange messages in which the
content body consists of a MIME message [3] containing
arbitrary octet-aligned material. This memo uses the mechanism
described in [5] to define an extension to the SMTP service
whereby such contents may be exchanged. Note that this
extension does NOT eliminate the possibility of an SMTP server
limiting line length; servers are free to implement this
extension but nevertheless set a line length limit no lower
than 1000 octets. Given that this restriction still applies,
this extension does NOT provide a means for transferring
unencoded binary via SMTP.


3.  Framework for the 8bit MIME Transport Extension

The 8bit MIME transport extension is laid out as follows:

(1)  the name of the SMTP service extension defined here is
     8bit-MIMEtransport;

(2)  the EHLO keyword value associated with the extension is
     8BITMIME;

(3)  no parameter is used with the 8BITMIME EHLO keyword;

(4)  one optional parameter using the keyword BODY is added to
     the MAIL FROM command.  The value associated with this
     parameter is a keyword indicating whether a 7bit message
     (in strict compliance with [1]) or a MIME message (in
     strict compliance with [3]) with arbitrary octet content
     is being sent. The syntax of the value is as follows,
     using the ABNF notation of [2]:

          body-value ::= "7BIT" / "8BITMIME"

(5)  no additional SMTP verbs are defined by this extension;
     and,

(6)  the next section specifies how support for the extension
     affects the behavior of a server and client SMTP.





                    Expires November 1994             [Page 2]





Internet Draft     SMTP 8bit-MIMEtransport            May 1994


4.  The 8bit-MIMEtransport service extension

When a client SMTP wishes to submit (using the MAIL command) a
content body consisting of a MIME message containing arbitrary
lines of octet-aligned material, it first issues the EHLO
command to the server SMTP. If the server SMTP responds with
code 250 to the EHLO command, and the response includes the
EHLO keyword value 8BITMIME, then the server SMTP is
indicating that it supports the extended MAIL command and will
accept MIME messages containing arbitrary octet-aligned
material.

The extended MAIL command is issued by a client SMTP when it
wishes to transmit a content body consisting of a MIME message
containing arbitrary lines of octet-aligned material. The
syntax for this command is identical to the MAIL command in
[1], except that a BODY parameter must appear after the
address.  Only one BODY parameter may be used in a single MAIL
command.

The complete syntax of this extended command is defined in
[5]. The esmtp-keyword is BODY and the syntax for esmtp-value
is given by the syntax for body-value shown above.

The value associated with the BODY parameter indicates whether
the content body which will be passed using the DATA command
consists of a MIME message containing some arbitrary octet-
aligned material ("8BITMIME") or is encoded entirely in
accordance with [1] ("7BIT").

A server which supports the 8-bit MIME transport service
extension shall preserve all bits in each octet passed using
the DATA command.

Naturally, the usual SMTP data-stuffing algorithm applies so
that a content which contains the five-character sequence of

     <CR> <LF> <DOT> <CR> <LF>

or a content that begins with the three-character sequence of

     <DOT> <CR> <LF>

does not prematurely terminate the transfer of the content.
Further, it should be noted that the CR-LF pair immediately





                    Expires November 1994             [Page 3]





Internet Draft     SMTP 8bit-MIMEtransport            May 1994


preceeding the final dot is considered part of the content.
Finally, although the content body contains arbitrary lines of
octet-aligned material, the length of each line (number of
octets between two CR-LF pairs), is still subject to SMTP
server line length restrictions (which may allow as few as
1000 octets on a single line). This restriction means that
this extension MAY provide the necessary facilities for
transferring a MIME object with the 8BIT content-transfer-
encoding, it DOES NOT provide a means of transferring an
object with the BINARY content-transfer-encoding.

Once a server SMTP supporting the 8bit-MIMEtransport service
extension accepts a content body containing octets with the
high-order (8th) bit set, the server SMTP must deliver or
relay the content in such a way as to preserve all bits in
each octet.

If a server SMTP does not support the 8-bit MIME transport
extension (either by not responding with code 250 to the EHLO
command, or by not including the EHLO keyword value 8BITMIME
in its response), then the client SMTP must not, under any
circumstances, attempt to transfer a content which contains
characters outside the US ASCII octet range (hex 00-7F).

A client SMTP has two options in this case: first,  it may
implement a gateway transformation to convert the message into
valid 7bit MIME, or second, or may treat this as a permanent
error and handle it in the usual manner for delivery failures.
The specifics of the transformation from 8bit MIME to 7bit
MIME are not described by this RFC; the conversion is
nevertheless constrained in the following ways:

(1)  it must cause no loss of information; MIME transport
     encodings must be employed as needed to insure this is
     the case, and

(2)  the resulting message must be valid 7bit MIME.


5.  Usage Example

The following dialogue illustrates the use of the 8bit-
MIMEtransport service extension:

S: <wait for connection on TCP port 25>





                    Expires November 1994             [Page 4]





Internet Draft     SMTP 8bit-MIMEtransport            May 1994


C: <open connection to server>
S: 220 dbc.mtview.ca.us SMTP service ready
C: EHLO ymir.claremont.edu
S: 250-dbc.mtview.ca.us says hello
S: 250 8BITMIME
C: MAIL FROM:<ned@ymir.claremont.edu> BODY=8BITMIME
S: 250 <ned@ymir.claremont.edu>... Sender and 8BITMIME ok
C: RCPT TO:<mrose@dbc.mtview.ca.us>
S: 250 <mrose@dbc.mtview.ca.us>... Recipient ok
C: DATA
S: 354 Send 8BITMIME message, ending in CRLF.CRLF.
 ...
C: .
S: 250 OK
C: QUIT
S: 250 Goodbye


6.  Security Considerations

This RFC does not discuss security issues and is not believed
to raise any security issues not already endemic in electronic
mail and present in fully conforming implementations of [1].


7.  Acknowledgements

This document represents a synthesis of the ideas of many
people and reactions to the ideas and proposals of others.
Randall Atkinson, Craig Everhart, Risto Kankkunen, and Greg
Vaudreuil contributed ideas and text sufficient to be
considered co-authors.  Other important suggestions, text, or
encouragement came from Harald Alvestrand, Jim Conklin, Mark
Crispin, Frank da Cruz, 'Olafur Gudmundsson, Per Hedeland,
Christian Huitma, Neil Katin, Eliot Lear, Harold A.  Miller,
Keith Moore, Dan Oscarsson, Julian Onions, Neil Rickert, John
Wagner, Rayan Zachariassen, and the contributions of the
entire IETF SMTP Working Group. Of course, none of the
individuals are necessarily responsible for the combination of
ideas represented here. Indeed, in some cases, the response to
a particular criticism was to accept the problem
identification but to include an entirely different solution
from the one originally proposed.







                    Expires November 1994             [Page 5]





Internet Draft     SMTP 8bit-MIMEtransport            May 1994


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 1521, (September,
     1993).

[4]  K. Moore.  Representation of Non-ASCII Text in Internet
     Message Headers.  Request for Comments 1522, (September,
     1993).

[5]  M.T. Rose, E.A. Stefferud, D.H. Crocker, J.C. Klensin,
     N. Freed.  SMTP Service Extensions.  Internet-Draft,
     (May, 1994).

[6]  C. Partridge.  Mail Routing and the Domain System.
     Request for Comments 974, (January, 1986).




























                    Expires November 1994             [Page 6]





Internet Draft     SMTP 8bit-MIMEtransport            May 1994


9.  Chair, Editor, and Author Addresses

John Klensin, WG Chair
United Nations University
P.O. Box 500, Charles Street Station
Boston, MA 02114-0500
USA
 tel: +1 617 227 8747           fax: +1 617 491 6266
 email: klensin@infoods.unu.edu

Ned Freed, Editor
Innosoft International, Inc.
1050 East Garvey Avenue South
West Covina, CA 91790
USA
 tel: +1 818 919 3600           fax: +1 818 919 3614
 email: ned@innosoft.com

Marshall T. Rose
Dover Beach Consulting, Inc.
420 Whisman Court
Moutain View, CA  94043-2186
USA
 tel: +1 415 968 1052           fax: +1 415 968 2510
 email: mrose@dbc.mtview.ca.us

Einar A. Stefferud
Network Management Associates, Inc.
17301 Drey Lane
Huntington Beach, CA, 92647-5615
USA
 tel: +1 714 842 3711           fax: +1 714 848 2091
 email: stef@nma.com

Dave Crocker
Silicon Graphics, Inc.
2011 N. Shoreline Blvd.
P.O. Box 7311
Mountain View, CA 94039
USA
 tel: +1 415 390 1804           fax: +1 415 962 8404
 email: dcrocker@sgi.com








                    Expires November 1994             [Page 7]

Network Working Group                             John Klensin, WG Chair
Internet Draft                                         Ned Freed, Editor
<draft-ietf-smtpext-size-01.txt>                             Keith Moore


                         SMTP Service Extension
                      for Message Size Declaration

                              May, 6, 1994


                          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 draft documents valid for a maximum of six
months.  Internet-Drafts may be updated, replaced, or obsoleted by other
documents at any time.  It is not appropriate to use Internet-Drafts as
reference material or to cite them other than as a working draft or work
in progress.

   To learn the current status of any Internet-Draft, please check the
1id-abstracts.txt listing contained in the Internet-Drafts Shadow
Directories on ds.internic.net, nic.nordu.net, ftp.isi.edu, or
munnari.oz.au.

   This draft is intended to supercede RFC 1427.


1.  Abstract

   This memo defines an extension to the SMTP service whereby an SMTP
client and server may interact to give the server an opportunity to
decline to accept a message (perhaps temporarily) based on the client's
estimate of the message size.


2.  Introduction

   The MIME extensions to the Internet message protocol provide for the
transmission of many kinds of data which were previously unsupported in
Internet mail.  One expected result of the use of MIME is that SMTP will
be expected to carry a much wider range of message sizes than was
previously the case.  This has an impact on the amount of resources
(e.g. disk space) required by a system acting as a server.

   This memo uses the mechanism defined in [5] to define extensions to
the SMTP service whereby a client ("sender-SMTP") may declare the size
of a particular message to a server ("receiver-SMTP"), after which the
server may indicate to the client that it is or is not willing to accept
the message based on the declared message size and whereby a server
("receiver-SMTP") may declare the maximum message size it is willing to



                         Expires November 1994                  [Page 1]


Internet Draft           SMTP Size Declaration                  May 1994



accept to a client ("sender-SMTP").


3.  Framework for the Size Declaration Extension

   The following service extension is therefore defined:

(1) the name of the SMTP service extension is "Message Size
    Declaration";

(2) the EHLO keyword value associated with this extension is "SIZE";

(3) one optional parameter is allowed with this EHLO keyword value, a
    decimal number indicating the fixed maximum message size in bytes
    that the server will accept.  The syntax of the parameter is as
    follows, using the augmented BNF notation of [2]:

        size-param ::= [1*DIGIT]

    A parameter value of 0 (zero) indicates that no fixed maximum
    message size is in force.  If the parameter is omitted no
    information is conveyed about the server's fixed maximum message
    size;

(4) one optional parameter using the keyword "SIZE" is added to the MAIL
    FROM command.  The value associated with this parameter is a decimal
    number indicating the size of the message that is to be transmitted.
    The syntax of the value is as follows, using the augmented BNF
    notation of [2]:

        size-value ::= 1*DIGIT

(5) no additional SMTP verbs are defined by this extension.

The remainder of this memo specifies how support for the extension
affects the behavior of an SMTP client and server.


4.  The Message Size Declaration service extension

   An SMTP server may have a fixed upper limit on message size.  Any
attempt by a client to transfer a message which is larger than this
fixed upper limit will fail.  In addition, a server normally has limited
space with which to store incoming messages.  Transfer of a message may
therefore also fail due to a lack of storage space, but might succeed at
a later time.

   A client using the unextended SMTP protocol defined in [1], can only
be informed of such failures after transmitting the entire message to
the server (which discards the transferred message).  If, however, both
client and server support the Message Size Declaration service



                         Expires November 1994                  [Page 2]


Internet Draft           SMTP Size Declaration                  May 1994



extension, such conditions may be detected before any transfer is
attempted.

   An SMTP client wishing to relay a large content may issue the EHLO
command to start an SMTP session, to determine if the server supports
any of several service extensions.  If the server responds with code 250
to the EHLO command, and the response includes the EHLO keyword value
SIZE, then the Message Size Declaration extension is supported.

   If a numeric parameter follows the SIZE keyword value of the EHLO
response, it indicates the size of the largest message that the server
is willing to accept.  Any attempt by a client to transfer a message
which is larger than this limit will be rejected with a permanent
failure (552) reply code.

   A server that supports the Message Size Declaration extension will
accept the extended version of the MAIL command described below.  When
supported by the server, a client may use the extended MAIL command
(instead of the MAIL command as defined in [1]) to declare an estimate
of the size of a message it wishes to transfer.  The server may then
return an appropriate error code if it determines that an attempt to
transfer a message of that size would fail.


5.  Definitions

   The message size is defined as the number of octets, including CR-LF
pairs, but not the SMTP DATA command's terminating dot or doubled
quoting dots, to be transmitted by the SMTP client after receiving reply
code 354 to the DATA command.

   The fixed maximum message size is defined as the message size of the
largest message that a server is ever willing to accept.  An attempt to
transfer any message larger than the fixed maximum message size will
always fail.  The fixed maximum message size may be an implementation
artifact of the SMTP server, or it may be chosen by the administrator of
the server.

   The declared message size is defined as a client's estimate of the
message size for a particular message.


6.  The extended MAIL command

   The extended MAIL command is issued by a client when it wishes to
inform a server of the size of the message to be sent.  The extended
MAIL command is identical to the MAIL command as defined in [1], except
that a SIZE parameter appears after the address.

   The complete syntax of this extended command is defined in [5]. The
esmtp-keyword is "SIZE" and the syntax for esmtp-value is given by the



                         Expires November 1994                  [Page 3]


Internet Draft           SMTP Size Declaration                  May 1994



syntax for size-value shown above.

   The value associated with the SIZE parameter is a decimal
representation of the declared message size in octets.  This number
should include the message header, body, and the CR-LF sequences between
lines, but not the SMTP DATA command's terminating dot or doubled
quoting dots. Only one SIZE parameter may be specified in a single MAIL
command.

   Ideally, the declared message size is equal to the true message size.
However, since exact computation of the message size may be infeasable,
the client may use a heuristically-derived estimate.  Such heuristics
should be chosen so that the declared message size is usually larger
than the actual message size. (This has the effect of making the
counting or non-counting of SMTP DATA dots largely an academic point.)

   NOTE: Servers MUST NOT use the SIZE parameter to determine end of
content in the DATA command.


6.1  Server action on receipt of the extended MAIL command

   Upon receipt of an extended MAIL command containing a SIZE parameter,
a server should determine whether the declared message size exceeds its
fixed maximum message size.  If the declared message size is smaller
than the fixed maximum message size, the server may also wish to
determine whether sufficient resources are available to buffer a message
of the declared message size and to maintain it in stable storage, until
the message can be delivered or relayed to each of its recipients.

   A server may respond to the extended MAIL command with any of the
error codes defined in [1] for the MAIL command.  In addition, one of
the following error codes may be returned:

(1) If the server currently lacks sufficient resources to accept a
    message of the indicated size, but may be able to accept the message
    at a later time, it responds with code "452 insufficient system
    storage".

(2) If the indicated size is larger than the server's fixed maximum
    message size, the server responds with code "552 message size
    exceeds fixed maximium message size".

A server is permitted, but not required, to accept a message which is,
in fact, larger than declared in the extended MAIL command, such as
might occur if the client employed a size-estimation heuristic which was
inaccurate.







                         Expires November 1994                  [Page 4]


Internet Draft           SMTP Size Declaration                  May 1994



6.2  Client action on receiving response to extended MAIL command

   The client, upon receiving the server's response to the extended MAIL
command, acts as follows:

(1) If the code "452 insufficient system storage" is returned, the
    client should next send either a RSET command (if it wishes to
    attempt to send other messages) or a QUIT command. The client should
    then repeat the attempt to send the message to the server at a later
    time.

(2) If the code "552 message exceeds fixed maximum message size" is
    received, the client should immediately send either a RSET command
    (if it wishes to attempt to send additional messages), or a QUIT
    command.  The client should then declare the message undeliverable
    and return appropriate notification to the sender (if a sender
    address was present in the MAIL command).

A successful (250) reply code in response to the extended MAIL command
does not constitute an absolute guarantee that the message transfer will
succeed.  SMTP clients using the extended MAIL command must still be
prepared to handle both temporary and permanent error reply codes
(including codes 452 and 552), either immediately after issuing the DATA
command, or after transfer of the message.


6.3  Messages larger than the declared size.

   Once a server has agreed (via the extended MAIL command) to accept a
message of a particular size, it should not return a 552 reply code
after the transfer phase of the DATA command, unless the actual size of
the message transferred is greater than the declared message size.  A
server may also choose to accept a message which is somewhat larger than
the declared message size.

   A client is permitted to declare a message to be smaller than its
actual size.  However, in this case, a successful (250) reply code is no
assurance that the server will accept the message or has sufficient
resources to do so.  The server may reject such a message after its DATA
transfer.


6.4  Per-recipient rejection based on message size.

   A server that implements this extension may return a 452 or 552 reply
code in response to a RCPT command, based on its unwillingness to accept
a message of the declared size for a particular recipient.

(1) If a 452 code is returned, the client may requeue the message for
    later delivery to the same recipient.




                         Expires November 1994                  [Page 5]


Internet Draft           SMTP Size Declaration                  May 1994



(2) If a 552 code is returned, the client may not requeue the message
    for later delivery to the same recipient.


7.  Minimal usage

   A "minimal" client may use this extension to simply compare its
(perhaps estimated) size of the message that it wishes to relay, with
the server's fixed maximum message size (from the parameter to the SIZE
keyword in the EHLO response), to determine whether the server will ever
accept the message.  Such an implementation need not declare message
sizes via the extended MAIL command.  However, neither will it be able
to discover temporary limits on message size due to server resource
limitations, nor per-recipient limitations on message size.

   A minimal server that employs this service extension may simply use
the SIZE keyword value to inform the client of the size of the largest
message it will accept, or to inform the client that there is no fixed
limit on message size.  Such a server must accept the extended MAIL
command and return a 552 reply code if the client's declared size
exceeds its fixed size limit (if any), but it need not detect
"temporary" limitations on message size.

   The numeric parameter to the EHLO SIZE keyword is optional.  If the
parameter is omitted entirely it indicates that the server does not
advertise a fixed maximum message size.  A server that returns the SIZE
keyword with no parameter in response to the EHLO command may not issue
a positive (250) response to an extended MAIL command containing a SIZE
specification without first checking to see if sufficient resources are
available to transfer a message of the declared size, and to retain it
in stable storage until it can be relayed or delivered to its
recipients.  If possible, the server should actually reserve sufficient
storage space to transfer the message.


8. Example

The following example illustrates the use of size declaration with some
permanent and temporary failures.

   S: <wait for connection on TCP port 25>
   C: <open connection to server>
   S: 220 sigurd.innosoft.com -- Server SMTP (PMDF V4.2-6 #1992)
   C: EHLO ymir.claremont.edu
   S: 250-sigurd.innosoft.com
   S: 250-EXPN
   S: 250-HELP
   S: 250 SIZE 1000000
   C: MAIL FROM:<ned@thor.innosoft.com> SIZE=500000
   S: 250 Address Ok.
   C: RCPT TO:<ned@innosoft.com>



                         Expires November 1994                  [Page 6]


Internet Draft           SMTP Size Declaration                  May 1994



   S: 250 ned@innosoft.com OK; can accomodate 500000 byte message
   C: RCPT TO:<ned@ymir.claremont.edu>
   S: 552 Channel size limit exceeded: ned@YMIR.CLAREMONT.EDU
   C: RCPT TO:<ned@hmcvax.claremont.edu>
   S: 452 Insufficient channel storage: ned@hmcvax.CLAREMONT.EDU
   C: DATA
   S: 354 Send message, ending in CRLF.CRLF.
    ...
   C: .
   S: 250 Some recipients OK
   C: QUIT
   S: 250 Goodbye


9. Security considerations

The size declaration extensions described in this memo can conceivably
be used to facilitate crude service denial attacks. Specifically, both
the information contained in the SIZE parameter and use of the extended
MAIL command make it somewhat quicker and easier to devise an
efficacious service denial attack.  However, unless implementations are
very weak, these extensions do not create any vulnerability that has not
always existed with SMTP. In addition, no issues are addressed involving
trusted systems and possible release of information via the mechanisms
described in this RFC.


10.  Acknowledgements

This document was derived from an earlier Working Group draft
contribution.  Jim Conklin, Dave Crocker, Neil Katin, Eliot Lear,
Marshall T. Rose, and Einar Stefferud provided extensive comments in
response to earlier drafts of both this and the previous memo.


11.  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 1521, September 1993.

[4] K. Moore. Representation of Non-ASCII Text in Internet Message
    Headers.  Request for Comments 1522, September 1993.

[5] M. T. Rose, E. A. Stefferud, D. H. Crocker, John C. Klensin, Ned
    Freed.  SMTP Service Extensions.  Internet-draft, May 1994.



                         Expires November 1994                  [Page 7]


Internet Draft           SMTP Size Declaration                  May 1994



[6] C. Partridge.  Mail Routing and the Domain System.  Request for
    Comments 974, January 1986.


12.  Chair, editor, and author addresses

John Klensin, WG Chair
United Nations University
P.O. Box 500, Charles Street Station
Boston, MA 02114-0500
USA
 tel: +1 617 227 8747
 fax: +1 617 491 6266
 email: klensin@infoods.unu.edu

Ned Freed, Editor
Innosoft International, Inc.
1050 East Garvey Avenue South
West Covina, CA 91790
USA
 tel: +1 818 919 3600
 fax: +1 818 919 3614
 email: ned@innosoft.com

Keith Moore
Computer Science Dept.
University of Tennessee
107 Ayres Hall
Knoxville, TN 37996-1301
USA
 email: moore@cs.utk.edu























                         Expires November 1994                  [Page 8]








Network Working Group                   John Klensin, WG Chair
Internet Draft                                       Ned Freed
<draft-ietf-smtpext-pipeline-01.txt>

                    SMTP Service Extension
                    for Command Pipelining

                         May 6, 1994


                     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 draft documents valid for a maximum of six
months. Internet-Drafts may be updated, replaced, or obsoleted
by other documents at any time.  It is not appropriate to use
Internet-Drafts as reference material or to cite them other
than as a "working draft" or "work in progress".

To learn the current status of any Internet-Draft, please
check the 1id-abstracts.txt listing contained in the
Internet-Drafts Shadow Directories on ds.internic.net,
nic.nordu.net, ftp.isi.edu, or munnari.oz.au.


1.  Abstract

This memo defines an extension to the SMTP service whereby a
server can indicate the extent of its ability to accept
multiple commands in a single TCP send operation. Using a
single TCP send operation for multiple commands can improve
SMTP performance significantly.


2.  Introduction

Although SMTP is widely and robustly deployed, certain
extensions may nevertheless prove useful. In particular, many
parts of the Internet make use of high latency network links.
SMTP's intrinsic one command-one response structure is











Internet Draft         SMTP Pipelining                May 1994


significantly penalized by high latency links, often to the
point where the factors contributing to overall connection
time are dominated by the time spent waiting for responses to
individual commands (turnaround time).

In the best of all worlds it would be possible to simply
deploy SMTP client software that makes use of command
pipelining: batching up multiple commands into single TCP send
operations. Unfortunately, the original SMTP specification [1]
did not explicitly state that SMTP servers must support this.
As a result a non-trivial number of Internet SMTP servers
cannot adequately handle command pipelining. Flaws known to
exist in deployed servers include:

(1)  Connection handoff and buffer flushes in the middle of
     the SMTP dialogue.  Creation of server processes for
     incoming SMTP connections is a useful, obvious, and
     harmless implementation technique. However, some SMTP
     servers defer process forking and connection handoff
     until some intermediate point in the SMTP dialogue. When
     this is done material read from the TCP connection and
     kept in process buffers can be lost.

(2)  Flushing the TCP input buffer when an SMTP command fails.
     SMTP commands often fail but there is no reason to flush
     the TCP input buffer when this happens.  Nevertheless,
     some SMTP servers do this.

(3)  Improper processing and promulgation of SMTP command
     failures. For example, some SMTP servers will refuse to
     accept a DATA command if the last RCPT TO command fails,
     paying no attention to the success or failure of prior
     RCPT TO command results. Other servers will accept a DATA
     command even when all previous RCPT TO commands have
     failed. Although it is possible to accomodate this sort
     of behavior in a client that employs command pipelining,
     it does complicate the construction of the client
     unnecessarily.

This memo uses the mechanism described in [2] to define an
extension to the SMTP service whereby an SMTP server can
declare that it is capable of handling pipelined commands. The
SMTP client can then check for this declaration and use
pipelining only when the server declares itself capable of
handling it.





                    Expires November 1994             [Page 2]





Internet Draft         SMTP Pipelining                May 1994


3.  Framework for the Command Pipelining Extension

The Command Pipelining extension is defined as follows:

(1)  the name of the SMTP service extension is Pipelining;

(2)  the EHLO keyword value associated with the extension is
     PIPELINING;

(3)  no parameter is used with the PIPELINING EHLO keyword;

(4)  no additional parameters are added to either the MAIL
     FROM or RCPT TO commands.

(5)  no additional SMTP verbs are defined by this extension;
     and,

(6)  the next section specifies how support for the extension
     affects the behavior of a server and client SMTP.


4.  The Pipelining Service Extension

When a client SMTP wishes to employ command pipelining, it
first issues the EHLO command to the server SMTP. If the
server SMTP responds with code 250 to the EHLO command, and
the response includes the EHLO keyword value PIPELINING, then
the server SMTP has indicated that it can accomodate SMTP
command pipelining.


4.1.  Client use of pipelining

Once the client SMTP has confirmed that support exists for the
pipelining extension, the client SMTP may then elect to
transmit groups of SMTP commands in batches without waiting
for a response to each individual command. In particular, the
commands RSET, MAIL FROM, SEND FROM, SOML FROM, SAML FROM, and
RCPT TO can all appear anywhere in a pipelined command group.
The EHLO, DATA, VRFY, EXPN, TURN, QUIT, and NOOP commands can
only appear as the last command in a group since their success
or failure produces a change of state which the client SMTP
must accomodate. (NOOP is included in this group so it can be
used as a synchronization point.)






                    Expires November 1994             [Page 3]





Internet Draft         SMTP Pipelining                May 1994


Additional commands added by other SMTP extensions may only
appear as the last command in a group unless otherwise
specified by the extensions that define the commands.

Client SMTP implementations that employ pipelining MUST check
all statuses associated with each command in the group. For
example, if none of the RCPT TO recipient addresses were
accepted the client must then check the response to the DATA
command. If the DATA command was properly rejected the client
SMTP can just issue RSET, but if the DATA command was accepted
the client SMTP should send a single dot.

Command status MUST be coordinated with responses by counting
each separate response and correlating that count with the
number of commands known to have been issued. Multiline
responses MUST be supported. Matching on the basis of either
the error code value or associated text is expressly
forbidden.

Client SMTP implementations MAY elect to operate in a
nonblocking fashion, processing server responses immediately
upon receipt. If nonblocking operation is not supported,
however, client SMTP implementations MUST also check the TCP
window size and make sure that each group of commands fits
entirely within the window. The window size is usually, but
not always, 4K octets. Failure to perform this check can lead
to deadlock conditions.


4.2.  Server support of pipelining

A server SMTP implementation that offers the pipelining
extension:

(1)  MUST NOT flush or otherwise lose the contents of the TCP
     input buffer under any circumstances whatsoever.

(2)  SHOULD issue a positive response to the DATA command if
     and only if one or more valid RCPT TO addresses have been
     previously received.

(3)  MUST NOT, after issuing a positive response to a DATA
     command with no valid recipients and subsequently
     receiving an empty message, send any message whatsoever
     to anyone.





                    Expires November 1994             [Page 4]





Internet Draft         SMTP Pipelining                May 1994


(4)  SHOULD elect to store command responses to RSET, MAIL
     FROM, SEND FROM, SOML FROM, SAML FROM, and RCPT TO in an
     internal buffer so they can sent as a unit.

(5)  MUST NOT confuse responses to multiple commands with
     multiline responses. Each command requires one or more
     lines of response, the last line not containing a dash
     between the response code and the response string.

(6)  MUST NOT buffer responses to EHLO, DATA, VRFY, EXPN,
     TURN, QUIT, and NOOP.

(7)  MUST NOT buffer responses to unrecognized commands.

(8)  MUST send all pending responses immediately whenever the
     local TCP input buffer is emptied.

(9)  MUST NOT make assumptions about commands that are yet to
     be received.

(10) SHOULD issue response text that indicates, either
     implicitly or explicitly, what command the response
     matches.

The overriding intent of these server requirements is to make
it as easy as possible for servers to conform to these
pipelining extensions.

5.  Examples

Consider the following SMTP dialogue that does not use
pipelining:

S: <wait for open connection>
C: <open connection to server>
S: 220 innosoft.com SMTP service ready
C: HELO dbc.mtview.ca.us
S: 250 innosoft.com
C: MAIL FROM:<mrose@dbc.mtview.ca.us>
S: 250 sender <mrose@dbc.mtview.ca.us> OK
C: RCPT TO:<ned@innosoft.com>
S: 250 recipient <ned@innosoft.com> OK
C: RCPT TO:<dan@innosoft.com>
S: 250 recipient <dan@innosoft.com> OK
C: RCPT TO:<kvc@innosoft.com>





                    Expires November 1994             [Page 5]





Internet Draft         SMTP Pipelining                May 1994


S: 250 recipient <kvc@innosoft.com> OK
C: DATA
S: 354 enter mail, end with line containing only "."
 ...
C: .
S: 250 message sent
C: QUIT
S: 250 goodbye

The client waits for a server response a total of 9 times in
this simple example. But if pipelining is employed the
following dialogue is possible:

S: <wait for open connection>
C: <open connection to server>
S: 220 innosoft.com SMTP service ready
C: EHLO dbc.mtview.ca.us
S: 250-innosoft.com
S: 250 PIPELINING
C: MAIL FROM:<mrose@dbc.mtview.ca.us>
C: RCPT TO:<ned@innosoft.com>
C: RCPT TO:<dan@innosoft.com>
C: RCPT TO:<kvc@innosoft.com>
C: DATA
S: 250 sender <mrose@dbc.mtview.ca.us> OK
S: 250 recipient <ned@innosoft.com> OK
S: 250 recipient <dan@innosoft.com> OK
S: 250 recipient <kvc@innosoft.com> OK
S: 354 enter mail, end with line containing only "."
 ...
C: .
C: QUIT
S: 250 message sent
S: 250 goodbye

The total number of turnarounds has been reduced from 9 to 4.

The next example illustrates one possible form of behavior
when pipelining is used and all recipients are rejected:

S: <wait for open connection>
C: <open connection to server>
S: 220 innosoft.com SMTP service ready
C: EHLO dbc.mtview.ca.us
S: 250-innosoft.com





                    Expires November 1994             [Page 6]





Internet Draft         SMTP Pipelining                May 1994


S: 250 PIPELINING
C: MAIL FROM:<mrose@dbc.mtview.ca.us>
C: RCPT TO:<nsb@thumper.bellcore.com>
C: RCPT TO:<galvin@tis.com>
C: DATA
S: 250 sender <mrose@dbc.mtview.ca.us> OK
S: 550 remote mail to <nsb@thumper.bellore.com> not allowed
S: 550 remote mail to <galvin@tis.com> not allowed
S: 550 no valid recipients given
C: QUIT
S: 250 goodbye

The client SMTP waits for the server 4 times here as well. If
the server SMTP does not check for at least one valid
recipient prior to accepting the DATA command, the following
dialogue would result:

S: <wait for open connection>
C: <open connection to server>
S: 220 innosoft.com SMTP service ready
C: EHLO dbc.mtview.ca.us
S: 250-innosoft.com
S: 250 PIPELINING
C: MAIL FROM:<mrose@dbc.mtview.ca.us>
C: RCPT TO:<nsb@thumper.bellcore.com>
C: RCPT TO:<galvin@tis.com>
C: DATA
S: 250 sender <mrose@dbc.mtview.ca.us> OK
S: 550 remote mail to <nsb@thumper.bellore.com> not allowed
S: 550 remote mail to <galvin@tis.com> not allowed
S: 354 enter mail, end with line containing only "."
 ...
C: .
C: QUIT
S: 550 no valid recipients
S: 250 goodbye

6.  Security Considerations

This RFC does not discuss security issues and is not believed
to raise any security issues not endemic in electronic mail
and present in fully conforming implementations of [1].








                    Expires November 1994             [Page 7]





Internet Draft         SMTP Pipelining                May 1994


7.  Acknowledgements

This document is based on the SMTP service extension model
presented in RFC 1425. Marshall Rose's description of SMTP
command pipelining in his book "The Internet Message" also
served as a source of inspiration for this extension.


8.  References

[1]  J.B. Postel.  Simple Mail Transfer Protocol. Request for
     Comments 821, (August, 1982).

[2]  J.C. Klensin, N. Freed, M.T. Rose, E.A. Stefferud,
     D.H. Crocker.  SMTP Service Extensions. Internet-draft,
     (May, 1994).


































                    Expires November 1994             [Page 8]





Internet Draft         SMTP Pipelining                May 1994


9.  Chair and Author Addresses

John Klensin, WG Chair
United Nations University
P.O. Box 500, Charles Street Station
Boston, MA 02114-0500
USA
 tel: +1 617 227 8747           fax: +1 617 491 6266
 email: klensin@infoods.unu.edu

Ned Freed
Innosoft International, Inc.
1050 East Garvey Avenue South
West Covina, CA 91790
USA
 tel: +1 818 919 3600           fax: +1 818 919 3614
 email: ned@innosoft.com

































                    Expires November 1994             [Page 9]