home *** CD-ROM | disk | FTP | other *** search
/ Internet Access: To the Information Highway / InternetAccessToTheInformationHighway1994.disc1of1.iso / internet / rfc4 / rfc1427.txt < prev    next >
Text File  |  1994-05-29  |  18KB  |  452 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                               J. Klensin, WG Chair
  8. Request for Comments: 1427                     United Nations University
  9.                                                         N. Freed, Editor
  10.                                             Innosoft International, Inc.
  11.                                                                 K. Moore
  12.                                                  University of Tennessee
  13.                                                            February 1993
  14.  
  15.  
  16.                          SMTP Service Extension
  17.                       for Message Size Declaration
  18.  
  19. Status of this Memo
  20.  
  21.    This RFC specifies an IAB standards track protocol for the Internet
  22.    community, and requests discussion and suggestions for improvements.
  23.    Please refer to the current edition of the "IAB Official Protocol
  24.    Standards" for the standardization state and status of this protocol.
  25.    Distribution of this memo is unlimited.
  26.  
  27. 1.  Abstract
  28.  
  29.    This memo defines an extension to the SMTP service whereby an SMTP
  30.    client and server may interact to give the server an opportunity to
  31.    decline to accept a message (perhaps temporarily) based on the
  32.    client's estimate of the message size.
  33.  
  34. 2.  Introduction
  35.  
  36.    The MIME extensions to the Internet message protocol provide for the
  37.    transmission of many kinds of data which were previously unsupported
  38.    in Internet mail.  One expected result of the use of MIME is that
  39.    SMTP will be expected to carry a much wider range of message sizes
  40.    than was previously the case.  This has an impact on the amount of
  41.    resources (e.g., disk space) required by a system acting as a server.
  42.  
  43.    This memo uses the mechanism defined in [5] to define extensions to
  44.    the SMTP service whereby a client ("sender-SMTP") may declare the
  45.    size of a particular message to a server ("receiver-SMTP"), after
  46.    which the server may indicate to the client that it is or is not
  47.    willing to accept the message based on the declared message size and
  48.    whereby a server ("receiver-SMTP") may declare the maximum message
  49.    size it is willing to accept to a client ("sender-SMTP").
  50.  
  51. 3.  Framework for the Size Declaration Extension
  52.  
  53.    The following service extension is therefore defined:
  54.  
  55.  
  56.  
  57.  
  58. Klensin, Freed & Moore                                          [Page 1]
  59.  
  60. RFC 1427                 SMTP Size Declaration             February 1993
  61.  
  62.  
  63. (1) the name of the SMTP service extension is "Message Size
  64.     Declaration";
  65.  
  66. (2) the EHLO keyword value associated with this extension is "SIZE";
  67.  
  68. (3) one optional parameter is allowed with this EHLO keyword value, a
  69.     decimal number indicating the fixed maximum message size in bytes
  70.     that the server will accept.  The syntax of the parameter is as
  71.     follows, using the augmented BNF notation of [2]:
  72.  
  73.         size-param ::= [1*DIGIT]
  74.  
  75.     A parameter value of 0 (zero) indicates that no fixed maximum
  76.     message size is in force.  If the parameter is omitted no
  77.     information is conveyed about the server's fixed maximum message
  78.     size;
  79.  
  80. (4) one optional parameter using the keyword "SIZE" is added to the MAIL
  81.     FROM command.  The value associated with this parameter is a decimal
  82.     number indicating the size of the message that is to be transmitted.
  83.     The syntax of the value is as follows, using the augmented BNF
  84.     notation of [2]:
  85.  
  86.         size-value ::= 1*DIGIT
  87.  
  88. (5) no additional SMTP verbs are defined by this extension.
  89.  
  90.    The remainder of this memo specifies how support for the extension
  91.    affects the behavior of an SMTP client and server.
  92.  
  93. 4.  The Message Size Declaration service extension
  94.  
  95.    An SMTP server may have a fixed upper limit on message size.  Any
  96.    attempt by a client to transfer a message which is larger than this
  97.    fixed upper limit will fail.  In addition, a server normally has
  98.    limited space with which to store incoming messages.  Transfer of a
  99.    message may therefore also fail due to a lack of storage space, but
  100.    might succeed at a later time.
  101.  
  102.    A client using the unextended SMTP protocol defined in [1], can only
  103.    be informed of such failures after transmitting the entire message to
  104.    the server (which discards the transferred message).  If, however,
  105.    both client and server support the Message Size Declaration service
  106.    extension, such conditions may be detected before any transfer is
  107.    attempted.
  108.  
  109.    An SMTP client wishing to relay a large content may issue the EHLO
  110.    command to start an SMTP session, to determine if the server supports
  111.  
  112.  
  113.  
  114. Klensin, Freed & Moore                                          [Page 2]
  115.  
  116. RFC 1427                 SMTP Size Declaration             February 1993
  117.  
  118.  
  119.    any of several service extensions.  If the server responds with code
  120.    250 to the EHLO command, and the response includes the EHLO keyword
  121.    value SIZE, then the Message Size Declaration extension is supported.
  122.  
  123.    If a numeric parameter follows the SIZE keyword value of the EHLO
  124.    response, it indicates the size of the largest message that the
  125.    server is willing to accept.  Any attempt by a client to transfer a
  126.    message which is larger than this limit will be rejected with a
  127.    permanent failure (552) reply code.
  128.  
  129.    A server that supports the Message Size Declaration extension will
  130.    accept the extended version of the MAIL command described below.
  131.    When supported by the server, a client may use the extended MAIL
  132.    command (instead of the MAIL command as defined in [1]) to declare an
  133.    estimate of the size of a message it wishes to transfer.  The server
  134.    may then return an appropriate error code if it determines that an
  135.    attempt to transfer a message of that size would fail.
  136.  
  137. 5.  Definitions
  138.  
  139.    The message size is defined as the number of octets, including CR-LF
  140.    pairs, but not the SMTP DATA command's terminating dot or doubled
  141.    quoting dots, to be transmitted by the SMTP client after receiving
  142.    reply code 354 to the DATA command.
  143.  
  144.    The fixed maximum message size is defined as the message size of the
  145.    largest message that a server is ever willing to accept.  An attempt
  146.    to transfer any message larger than the fixed maximum message size
  147.    will always fail.  The fixed maximum message size may be an
  148.    implementation artifact of the SMTP server, or it may be chosen by
  149.    the administrator of the server.
  150.  
  151.    The declared message size is defined as a client's estimate of the
  152.    message size for a particular message.
  153.  
  154. 6.  The extended MAIL command
  155.  
  156.    The extended MAIL command is issued by a client when it wishes to
  157.    inform a server of the size of the message to be sent.  The extended
  158.    MAIL command is identical to the MAIL command as defined in [1],
  159.    except that a SIZE parameter appears after the address.
  160.  
  161.    The complete syntax of this extended command is defined in [5]. The
  162.    esmtp-keyword is "SIZE" and the syntax for esmtp-value is given by
  163.    the syntax for size-value shown above.
  164.  
  165.    The value associated with the SIZE parameter is a decimal
  166.    representation of the declared message size in octets.  This number
  167.  
  168.  
  169.  
  170. Klensin, Freed & Moore                                          [Page 3]
  171.  
  172. RFC 1427                 SMTP Size Declaration             February 1993
  173.  
  174.  
  175.    should include the message header, body, and the CR-LF sequences
  176.    between lines, but not the SMTP DATA command's terminating dot or
  177.    doubled quoting dots.
  178.  
  179.    Ideally, the declared message size is equal to the true message size.
  180.    However, since exact computation of the message size may be
  181.    infeasable, the client may use a heuristically-derived estimate.
  182.    Such heuristics should be chosen so that the declared message size is
  183.    usually larger than the actual message size. (This has the effect of
  184.    making the counting or non-counting of SMTP DATA dots largely an
  185.    academic point.)
  186.  
  187.    NOTE: Servers MUST NOT use the SIZE parameter to determine end of
  188.    content in the DATA command.
  189.  
  190. 6.1  Server action on receipt of the extended MAIL command
  191.  
  192.    Upon receipt of an extended MAIL command containing a SIZE parameter,
  193.    a server should determine whether the declared message size exceeds
  194.    its fixed maximum message size.  If the declared message size is
  195.    smaller than the fixed maximum message size, the server may also wish
  196.    to determine whether sufficient resources are available to buffer a
  197.    message of the declared message size and to maintain it in stable
  198.    storage, until the message can be delivered or relayed to each of its
  199.    recipients.
  200.  
  201.    A server may respond to the extended MAIL command with any of the
  202.    error codes defined in [1] for the MAIL command.  In addition, one of
  203.    the following error codes may be returned:
  204.  
  205. (1) If the server currently lacks sufficient resources to accept a
  206.     message of the indicated size, but may be able to accept the message
  207.     at a later time, it responds with code "452 insufficient system
  208.     storage".
  209.  
  210. (2) If the indicated size is larger than the server's fixed maximum
  211.     message size, the server responds with code "552 message size
  212.     exceeds fixed maximium message size".
  213.  
  214.    A server is permitted, but not required, to accept a message which
  215.    is, in fact, larger than declared in the extended MAIL command, such
  216.    as might occur if the client employed a size-estimation heuristic
  217.    which was inaccurate.
  218.  
  219. 6.2  Client action on receiving response to extended MAIL command
  220.  
  221.    The client, upon receiving the server's response to the extended MAIL
  222.    command, acts as follows:
  223.  
  224.  
  225.  
  226. Klensin, Freed & Moore                                          [Page 4]
  227.  
  228. RFC 1427                 SMTP Size Declaration             February 1993
  229.  
  230.  
  231. (1) If the code "452 insufficient system storage" is returned, the
  232.     client should next send either a RSET command (if it wishes to
  233.     attempt to send other messages) or a QUIT command. The client should
  234.     then repeat the attempt to send the message to the server at a later
  235.     time.
  236.  
  237. (2) If the code "552 message exceeds fixed maximum message size" is
  238.     received, the client should immediately send either a RSET command
  239.     (if it wishes to attempt to send additional messages), or a QUIT
  240.     command.  The client should then declare the message undeliverable
  241.     and return appropriate notification to the sender (if a sender
  242.     address was present in the MAIL command).
  243.  
  244.    A successful (250) reply code in response to the extended MAIL
  245.    command does not constitute an absolute guarantee that the message
  246.    transfer will succeed.  SMTP clients using the extended MAIL command
  247.    must still be prepared to handle both temporary and permanent error
  248.    reply codes (including codes 452 and 552), either immediately after
  249.    issuing the DATA command, or after transfer of the message.
  250.  
  251. 6.3  Messages larger than the declared size.
  252.  
  253.    Once a server has agreed (via the extended MAIL command) to accept a
  254.    message of a particular size, it should not return a 552 reply code
  255.    after the transfer phase of the DATA command, unless the actual size
  256.    of the message transferred is greater than the declared message size.
  257.    A server may also choose to accept a message which is somewhat larger
  258.    than the declared message size.
  259.  
  260.    A client is permitted to declare a message to be smaller than its
  261.    actual size.  However, in this case, a successful (250) reply code is
  262.    no assurance that the server will accept the message or has
  263.    sufficient resources to do so.  The server may reject such a message
  264.    after its DATA transfer.
  265.  
  266. 6.4  Per-recipient rejection based on message size.
  267.  
  268.    A server that implements this extension may return a 452 or 552 reply
  269.    code in response to a RCPT command, based on its unwillingness to
  270.    accept a message of the declared size for a particular recipient.
  271.  
  272.    (1) If a 452 code is returned, the client may requeue the message for
  273.        later delivery to the same recipient.
  274.  
  275.    (2) If a 552 code is returned, the client may not requeue the message
  276.        for later delivery to the same recipient.
  277.  
  278.  
  279.  
  280.  
  281.  
  282. Klensin, Freed & Moore                                          [Page 5]
  283.  
  284. RFC 1427                 SMTP Size Declaration             February 1993
  285.  
  286.  
  287. 7.  Minimal usage
  288.  
  289.    A "minimal" client may use this extension to simply compare its
  290.    (perhaps estimated) size of the message that it wishes to relay, with
  291.    the server's fixed maximum message size (from the parameter to the
  292.    SIZE keyword in the EHLO response), to determine whether the server
  293.    will ever accept the message.  Such an implementation need not
  294.    declare message sizes via the extended MAIL command.  However,
  295.    neither will it be able to discover temporary limits on message size
  296.    due to server resource limitations, nor per-recipient limitations on
  297.    message size.
  298.  
  299.    A minimal server that employs this service extension may simply use
  300.    the SIZE keyword value to inform the client of the size of the
  301.    largest message it will accept, or to inform the client that there is
  302.    no fixed limit on message size.  Such a server must accept the
  303.    extended MAIL command and return a 552 reply code if the client's
  304.    declared size exceeds its fixed size limit (if any), but it need not
  305.    detect "temporary" limitations on message size.
  306.  
  307.    The numeric parameter to the EHLO SIZE keyword is optional.  If the
  308.    parameter is omitted entirely it indicates that the server does not
  309.    advertise a fixed maximum message size.  A server that returns the
  310.    SIZE keyword with no parameter in response to the EHLO command may
  311.    not issue a positive (250) response to an extended MAIL command
  312.    containing a SIZE specification without first checking to see if
  313.    sufficient resources are available to transfer a message of the
  314.    declared size, and to retain it in stable storage until it can be
  315.    relayed or delivered to its recipients.  If possible, the server
  316.    should actually reserve sufficient storage space to transfer the
  317.    message.
  318.  
  319. 8. Example
  320.  
  321.    The following example illustrates the use of size declaration with
  322.    some permanent and temporary failures.
  323.  
  324.       S: <wait for connection on TCP port 25>
  325.       C: <open connection to server>
  326.       S: 220 sigurd.innosoft.com -- Server SMTP (PMDF V4.2-6 #1992)
  327.       C: EHLO ymir.claremont.edu
  328.       S: 250-sigurd.innosoft.com
  329.       S: 250-EXPN
  330.       S: 250-HELP
  331.       S: 250 SIZE 1000000
  332.       C: MAIL FROM:<ned@thor.innosoft.com> SIZE=500000
  333.       S: 250 Address Ok.
  334.       C: RCPT TO:<ned@innosoft.com>
  335.  
  336.  
  337.  
  338. Klensin, Freed & Moore                                          [Page 6]
  339.  
  340. RFC 1427                 SMTP Size Declaration             February 1993
  341.  
  342.  
  343.       S: 250 ned@innosoft.com OK; can accomodate 500000 byte message
  344.       C: RCPT TO:<ned@ymir.claremont.edu>
  345.       S: 552 channel size limit exceeded: ned@YMIR.CLAREMONT.EDU
  346.       C: RCPT TO:<ned@hmcvax.claremont.edu>
  347.       S: 452 insufficient channel storage: ned@hmcvax.CLAREMONT.EDU
  348.       C: DATA
  349.       S: 354 Send message, ending in CRLF.CRLF.
  350.        ...
  351.       C: .
  352.       S: 250 Some recipients OK
  353.       C: QUIT
  354.       S: 250 Goodbye
  355.  
  356. 9. Security considerations
  357.  
  358.    The size declaration extensions described in this memo can
  359.    conceivably be used to facilitate crude service denial attacks.
  360.    Specifically, both the information contained in the SIZE parameter
  361.    and use of the extended MAIL command make it somewhat quicker and
  362.    easier to devise an efficacious service denial attack.  However,
  363.    unless implementations are very weak, these extensions do not create
  364.    any vulnerability that has not always existed with SMTP. In addition,
  365.    no issues are addressed involving trusted systems and possible
  366.    release of information via the mechanisms described in this RFC.
  367.  
  368. 10.  Acknowledgements
  369.  
  370.    This document was derived from an earlier Working Group draft
  371.    contribution.  Jim Conklin, Dave Crocker, Neil Katin, Eliot Lear,
  372.    Marshall T. Rose, and Einar Stefferud provided extensive comments in
  373.    response to earlier drafts of both this and the previous memo.
  374.  
  375. 11.  References
  376.  
  377.    [1] Postel, J., "Simple Mail Transfer Protocol", STD 10, RFC 821,
  378.        USC/Information Sciences Institute, August 1982.
  379.  
  380.    [2] Crocker, D., "Standard for the Format of ARPA Internet Text
  381.        Messages", STD 11, RFC 822, UDEL, August 1982.
  382.  
  383.    [3] Borenstein, N., and N. Freed, "Multipurpose Internet Mail
  384.        Extensions", RFC 1341, Bellcore, Innosoft, June 1992.
  385.  
  386.    [4] Moore, K., "Representation of Non-ASCII Text in Internet Message
  387.        Headers", RFC 1342, University of Tennessee, June 1992.
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394. Klensin, Freed & Moore                                          [Page 7]
  395.  
  396. RFC 1427                 SMTP Size Declaration             February 1993
  397.  
  398.  
  399.    [5] Klensin, J., WG Chair, Freed, N., Editor, Rose, M., Stefferud,
  400.        E., and D. Crocker, "SMTP Service Extensions" RFC 1425, United
  401.        Nations University, Innosoft International, Inc., Dover Beach
  402.        Consulting, Inc., Network Management Associates, Inc., The Branch
  403.        Office, February 1993.
  404.  
  405.    [6] Partridge, C., "Mail Routing and the Domain System", RFC 974,
  406.        BBN, January 1986.
  407.  
  408. 12.  Chair, Editor, and Author's Addresses
  409.  
  410.        John Klensin, WG Chair
  411.        United Nations University
  412.        PO Box 500, Charles Street Station
  413.        Boston, MA 02114-0500  USA
  414.  
  415.        Phone: +1 617 227 8747
  416.        Fax: +1 617 491 6266
  417.        Email: klensin@infoods.unu.edu
  418.  
  419.  
  420.        Ned Freed, Editor
  421.        Innosoft International, Inc.
  422.        250 West First Street, Suite 240
  423.        Claremont, CA 91711  USA
  424.  
  425.        Phone: +1 909 624 7907
  426.        Fax: +1 909 621 5319
  427.        Email: ned@innosoft.com
  428.  
  429.  
  430.        Keith Moore
  431.        Computer Science Dept.
  432.        University of Tennessee
  433.        107 Ayres Hall
  434.        Knoxville, TN 37996-1301  USA
  435.  
  436.        Email: moore@cs.utk.edu
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450. Klensin, Freed & Moore                                          [Page 8]
  451.  
  452.