home *** CD-ROM | disk | FTP | other *** search
/ Unix System Administration Handbook 1997 October / usah_oct97.iso / rfc / 700s / rfc780.txt < prev    next >
Text File  |  1992-10-14  |  80KB  |  2,600 lines

  1.  
  2.                                                                         
  3.  
  4.                                     
  5.                                     
  6.                                     
  7.                                     
  8.                                     
  9.                          MAIL TRANSFER PROTOCOL
  10.                                     
  11.                                     
  12.                                     
  13.                             Suzanne Sluizer
  14.                                     
  15.                                   and
  16.                                     
  17.                            Jonathan B. Postel
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.                                 RFC 780
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.                                 May 1981
  40.                                     
  41.                                     
  42.                                     
  43.                      Information Sciences Institute
  44.                    University of Southern California
  45.                            4676 Admiralty Way
  46.                    Marina del Rey, California  90291
  47.  
  48.                              (213) 822-1511
  49.  
  50.  
  51.  
  52.                                                                         
  53. May 1981                                                         RFC 780
  54. Mail Transfer Protocol                                                  
  55.  
  56.  
  57.  
  58.                            TABLE OF CONTENTS
  59.  
  60.    1.  INTRODUCTION .................................................. 1
  61.  
  62.    2.  THE MTP MODEL ................................................. 2
  63.  
  64.    3.  BASIC MAIL .................................................... 4
  65.  
  66.       3.1.  Forwarding ............................................... 5
  67.       3.2.  Source Routing ........................................... 6
  68.  
  69.    4.  MULTI-RECIPIENT MAIL .......................................... 8
  70.  
  71.       4.1.  Scheme Selection: MRSQ ................................... 8
  72.       4.2.  Message Text Specification: MAIL ......................... 9
  73.       4.3.  Recipient Specification: MRCP ........................... 10
  74.       4.4.  Scheme Mechanics: Recipients First ...................... 10
  75.       4.5.  Scheme Mechanics: Text First ............................ 12
  76.       4.6.  Discussion .............................................. 12
  77.  
  78.    5.  SPECIFICATIONS ............................................... 16
  79.  
  80.       5.1.  MTP Commands ............................................ 16
  81.       5.1.1.  Command Semantics ..................................... 16
  82.       5.1.2.  Command Syntax ........................................ 18
  83.       5.2.  MTP Replies ............................................. 22
  84.       5.2.1.  Reply Codes by Function Group ......................... 23
  85.       5.2.2.  Reply Codes in Numeric Order .......................... 24
  86.       5.3.  Sequencing of Commands and Replies ...................... 25
  87.       5.4.  State Diagrams .......................................... 28
  88.       5.5.  Details ................................................. 30
  89.       5.5.1.  Minimum Implementation ................................ 30
  90.       5.5.2.  Transparency .......................................... 30
  91.       5.5.3.  Sizes ................................................. 30
  92.  
  93.    APPENDIX A:  TCP ................................................. 32
  94.    APPENDIX B:  NCP ................................................. 33
  95.    APPENDIX C:  NITS ................................................ 34
  96.    APPENDIX D:  X.25 ................................................ 35
  97.    APPENDIX E:  Theory of Reply Codes ............................... 36
  98.  
  99.    GLOSSARY ......................................................... 39
  100.  
  101.    REFERENCES ....................................................... 42
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108. Network Working Group                                         S. Sluizer
  109. Request for Comments: 780                                      J. Postel
  110.                                                                      ISI
  111. Replaces: RFC 772                                               May 1981
  112.  
  113.                          MAIL TRANSFER PROTOCOL
  114.  
  115.  
  116. 1.  INTRODUCTION
  117.  
  118.    The objective of Mail Transfer Protocol (MTP) is to transfer mail
  119.    reliably and efficiently.
  120.  
  121.    MTP is designed to be independent of the particular transmission
  122.    subsystem and requires only a reliable ordered data stream channel.
  123.    Appendices describe the use of MTP with various transport services.
  124.    A Glossary provides the definitions of terms as used in this
  125.    document.
  126.  
  127.    An important feature of MTP is its capability to relay mail from one
  128.    transport environment to another.  A transport service provides an
  129.    interprocess communication environment (IPCE).  An IPCE may cover one
  130.    network, several networks, or a subset of a network.  A process can
  131.    communicate directly with another process anywhere in its own IPCE.
  132.    Mail is a special case of interprocess communication.  Mail can be
  133.    communicated between proceses in different IPCEs by relaying through
  134.    a process connected to two (or more) IPCEs.  More specifically, mail
  135.    can be relayed between hosts on different transport systems by a host
  136.    on both transport systems.  It is important to realize that transport
  137.    systems (or IPCEs) are not one-to-one with networks.
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162. Sluizer & Postel                                                [Page 1]
  163.  
  164.  
  165.                                                                         
  166. May 1981                                                         RFC 780
  167. Mail Transfer Protocol                                                  
  168.  
  169.  
  170.  
  171. 2.  THE MTP MODEL
  172.  
  173.    The MTP design is based on the following model of communication:  at
  174.    the initiation of the user, the sender-MTP establishes the
  175.    full-duplex transmission channel.  MTP commands are generated by the
  176.    sender-MTP and sent to the receiver-MTP.  MTP replies are sent from
  177.    the receiver-MTP to the sender-MTP in response to the commands.
  178.  
  179.    In the simplest case, once the transmission channel is established
  180.    the MTP-sender sends a MAIL command indicating the sender and
  181.    receiver of the mail.  If the MTP-receiver can accept the mail it
  182.    responds with a go ahead reply.  Then the MTP-sender sends the mail
  183.    data, terminating with a special sequence.  If the MTP-receiver
  184.    successfully processes the mail it responds with an OK reply.
  185.  
  186.      -------------------------------------------------------------
  187.  
  188.    
  189.                +----------+                +----------+
  190.    +------+    |          |                |          |
  191.    | User |<-->|          |      MTP       |          |
  192.    +------+    |  Sender- |Commands/Replies| Receiver-|
  193.    +------+    |   MTP    |<-------------->|    MTP   |    +------+
  194.    | File |<-->|          |    and Mail    |          |<-->| File |
  195.    |System|    |          |                |          |    |System|
  196.    +------+    +----------+                +----------+    +------+
  197.    
  198.  
  199.                 Sender-MTP                 Receiver-MTP
  200.  
  201.                            Model for MTP Use
  202.  
  203.                                 Figure 1
  204.  
  205.      -------------------------------------------------------------
  206.  
  207.    The MTP provides mechanisms for the transmission of mail; directly
  208.    from the sending user's host to the receiving user's host when the
  209.    two host are connected to the same transport service, or via one or
  210.    more relay MTP-servers when the source and destination hosts are not
  211.    connected to the same transport service.
  212.  
  213.    To be able to provide the relay capability the MTP-server must be
  214.    supplied with the name of the ultimate destination host as well as
  215.    the destination mailbox name.
  216.  
  217.  
  218.  
  219.  
  220. [Page 2]                                                Sluizer & Postel
  221.  
  222.  
  223.                                                                         
  224. RFC 780                                                         May 1981
  225.                                                   Mail Transfer Protocol
  226.  
  227.  
  228.  
  229.    The arguments to the MAIL command are a FROM path and a TO path.  The
  230.    TO path is a source route while the FROM path is a return route
  231.    (which may be used to return a message to the sender when an error
  232.    occurs with a relayed message).
  233.  
  234.    The preceding discussion has outlined the transmission of one copy of
  235.    one message from a source to a destination host and the possibility
  236.    of relaying messages between different transport services.  The MTP
  237.    additionally supports the transmission of one copy of a message
  238.    addressed to multiple recipients.
  239.  
  240.    In order for mail to be successfully transmitted the destination
  241.    users must be known at the destination receiver-MTP and the mail data
  242.    must be correctly received and stored.  In the single recipient case
  243.    discussed above the positive response to the MAIL command indicated
  244.    the recipient was known, and the final OK response indicated the mail
  245.    was received and stored.
  246.  
  247.    To support multi-recipient mail, MTP provides two procedures:
  248.    Text-First, and Recipients-First.  In the text-first scheme the mail
  249.    data is sent and acknowledged, then each recipient identification is
  250.    sent and acknowledged (or refused) separately.  In the
  251.    recipients-first scheme the recipients are negotiated first, then the
  252.    text is sent and acknowledged (for all recipients at once).  The
  253.    choice of scheme is up to the MTP-receiver, and depends on the way
  254.    mail is handled in the destination host.
  255.  
  256.    The multi-recipient mail procedures are optional and the
  257.    determination of which scheme to use is negotiated.  The use of the
  258.    multi-recipient schemes is strongly encouraged by the economy they
  259.    provide in transmission and processing.
  260.  
  261.    The mail commands and replies have a rigid syntax.  Replies also have
  262.    a numeric code.  In the following, examples appear which use actual
  263.    commands and replies.  The complete lists of commands and replies
  264.    appears in Section 5 on specifications.
  265.  
  266.    Commands and replies are not case sensitive.  That is, a command or
  267.    reply word may be upper case, lower case, or any mixture of upper and
  268.    lower case.  Note that this is not true of mailbox user names.  For
  269.    some hosts the user name is case sensitive, and MTP implementations
  270.    must take case to preserve the case of user names as they appear in
  271.    mailbox arguments.
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278. Sluizer & Postel                                                [Page 3]
  279.  
  280.  
  281.                                                                         
  282. May 1981                                                         RFC 780
  283. Mail Transfer Protocol                                                  
  284.  
  285.  
  286.  
  287. 3.  BASIC MAIL
  288.  
  289.    The basic command for transmitting mail is MAIL.  This command causes
  290.    the transmitted data to be entered into the recipient's mailbox, or
  291.    accepted for relaying to the destination host.
  292.  
  293.    The mail text is also sent on the transmission channel.  This
  294.    requires  that the end of the text be signalled so that the command
  295.    and reply dialog can be resumed.  MTP signals the end of the mail
  296.    text by sending a line containing only a period.  A transparency
  297.    procedure is used to prevent this interfering with the users text
  298.    (see Section 5.5.2).
  299.  
  300.       MAIL <SP> FROM:<sender-path> <SP> TO:<receiver-path> <CRLF>
  301.  
  302.          The <sender-path> contains the source mailbox; the
  303.          <receiver-path> contains the destination mailbox.  If accepted,
  304.          the receiver-MTP returns a 354 reply and considers all
  305.          succeeding lines to be the message text.  The message text is
  306.          terminated by a line containing only a period, upon which a 250
  307.          completion reply is returned.  Various errors are possible.
  308.  
  309.          Actually the <sender-path> and <receiver-path> are more than
  310.          just the mailboxes, they may be source routes.  The
  311.          <receiver-path> is a source routing list of hosts and
  312.          destination mailbox; the <sender-path> is a reverse source
  313.          routing list of hosts and source mailbox.
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336. [Page 4]                                                Sluizer & Postel
  337.  
  338.  
  339.                                                                         
  340. RFC 780                                                         May 1981
  341.                                                   Mail Transfer Protocol
  342.  
  343.  
  344.  
  345.      -------------------------------------------------------------
  346.  
  347.                       Example of MAIL (Basic Mail)
  348.  
  349.       This MAIL command specifies the mail is sent by Waldo at host A,
  350.       and is to be delivered to Foo at host Y.  Here we assume that host
  351.       A contacts host Y directly.
  352.  
  353.          S: MAIL FROM:<waldo@A> TO:<Foo@Y> <CRLF>
  354.          R: 354 Start mail input; end with <CRLF>.<CRLF>
  355.          S: Blah blah blah blah....etc. etc. etc.
  356.          S: <CRLF>.<CRLF>
  357.          R: 250 Mail sent
  358.  
  359.       The mail text has now been sent to "Foo".
  360.  
  361.                                Example 1
  362.  
  363.      -------------------------------------------------------------
  364.  
  365.    3.1.  FORWARDING
  366.  
  367.       There are two possible preliminary replies that a receiver may use
  368.       to indicate that it is accepting mail for a user whose mailbox is
  369.       not at that host.
  370.  
  371.          151 User not local; will forward to <user>@<host>
  372.  
  373.             This reply indicates that the receiver-MTP knows the user's
  374.             mailbox is on another host and will take responsibility for
  375.             forwarding the mail to that host.  This reply is only sent
  376.             when the sender would not expect the mail to be forwarded.
  377.             That is, when <receiver-path> as given in the command
  378.             indicates mail relaying, this reply will not be used.  This
  379.             reply could be used for an organization with several hosts
  380.             when each has a list of many of the users on the hosts.  A
  381.             host can accept mail for any user on its list and forward it
  382.             to the correct host.
  383.  
  384.          152 User Unknown; mail will be forwarded by the operator
  385.  
  386.             This reply indicates that the host does not recognize the
  387.             user name, but that it will accept the mail and have the
  388.             operator attempt to deliver it.  This is useful if the user
  389.             name is misspelled, but may be a disservice if the mail is
  390.             really undeliverable.
  391.  
  392.  
  393.  
  394. Sluizer & Postel                                                [Page 5]
  395.  
  396.  
  397.                                                                         
  398. May 1981                                                         RFC 780
  399. Mail Transfer Protocol                                                  
  400.  
  401.  
  402.  
  403.       If forwarding by the operator is unacceptable or if the
  404.       sending-user would prefer to send the mail directly to the
  405.       recipient's actual host, the action may be aborted.
  406.  
  407.       The MTP-sender must accept or reject the proposal in the
  408.       preliminary reply by sending a continue (CONT) or abort (ABRT)
  409.       command.  In the case of the continue, the next reply from the
  410.       MTP-receiver will be any of the replies expected for the MAIL
  411.       command, most likely "354 Start mail input, ...".  In the case of
  412.       the abort, the next reply from the MTP-receiver will be "201
  413.       Command okay, action aborted".
  414.  
  415.    3.2.  SOURCE ROUTING
  416.  
  417.       The receiver-path may be a source route of the form
  418.       "@ONE,@TWO,JOE@THREE", where ONE, TWO, and THREE are hosts.  This
  419.       form is used to emphasize the distinction between an address and a
  420.       route.
  421.  
  422.       At some distant future time it might be necessary to expand the
  423.       mailbox format to include a region identifier, such as
  424.       "user@host@region".  If this occured the MTP  path convention
  425.       could be expanded to
  426.       "host@region,host@region,...user@host@region". For example,
  427.       "ONE@R1,TWO@R2,JOE@THREE@R3".
  428.  
  429.       The mailbox is an absolute address, and the route is information
  430.       about how to get there.  The two concepts should not be confused.
  431.  
  432.       The elements of the receiver-path are to be moved to the
  433.       sender-path as the message is relayed from one MTP to another. The
  434.       sender-path is a reverse source route, that is, a source route to
  435.       the originator of the message.  When an MTP deletes its identifier
  436.       from the receiver-path and inserts it into the sender-path, it
  437.       must use the name it is known by in the environment it is sending
  438.       into, not the environment the mail came from, in case the MTP is
  439.       known be different names in different environments.
  440.  
  441.       When source routing is used the receiver-MTP will receive mail to
  442.       be relayed to another MTP.  The receiver-MTP may accept the task
  443.       of relaying the mail or reject it in the same way it accepts or
  444.       reject mail for a local user.  It does not use the 151 "User not
  445.       local" or 152 "User unknown" preliminary replies.  Once the
  446.       receiver-MTP accepts the relaying task it receives the mail text
  447.       and transforms the command arguments by removing its own
  448.       identifier from the receiver-path and inserting it in the
  449.  
  450.  
  451.  
  452. [Page 6]                                                Sluizer & Postel
  453.  
  454.  
  455.                                                                         
  456. RFC 780                                                         May 1981
  457.                                                   Mail Transfer Protocol
  458.  
  459.  
  460.  
  461.       beginning of the sender-path.  The receiver-MTP then becomes a
  462.       sender-MTP and establishes a transmission channel to the next MTP
  463.       in the receiver-path and sends it the mail.
  464.  
  465.       If an MTP has accepted the task of relaying the mail and later
  466.       finds that the receiver-path is incorrect or that the mail cannot
  467.       be delivered for whatever reason, then it must construct a
  468.       notification message and send it to the originator of the
  469.       undeliverable mail as indicated by the sender-path.  This
  470.       notification message must be from the MTP at this host.  That is,
  471.       the sender-path of the notification message itself will be
  472.       "MTP@<host>", and in the notification message header the From
  473.       field will be "MTP at <host>".  Of course, MTPs should not send
  474.       notification messages about problems with notification messages.
  475.  
  476.  
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
  494.  
  495.  
  496.  
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510. Sluizer & Postel                                                [Page 7]
  511.  
  512.  
  513.                                                                         
  514. May 1981                                                         RFC 780
  515. Mail Transfer Protocol                                                  
  516.  
  517.  
  518.  
  519. 4.  MULTI-RECIPIENT MAIL
  520.  
  521.    There are two MTP commands which allow the text of a message to be
  522.    mailed to several recipients simultaneously; such message
  523.    transmission is far more efficient than the practice of sending the
  524.    text again and again for each additional recipient at a host.  In one
  525.    scheme, all recipients are specified first, and then the text is
  526.    sent.  In the other scheme, the order is reversed and the text is
  527.    sent first, followed by the recipients.  The sender-MTP suggests the
  528.    scheme it would prefer, but receiver-MTP controls which scheme is
  529.    actually used.  To select a particular scheme, the MRSQ command is
  530.    used; to specify recipients after a scheme is chosen, MRCP commands
  531.    are given; and to furnish text, the MAIL command is used.
  532.  
  533.    Both schemes are necessary because neither by itself is optimal for
  534.    all systems.  MRSQ R allows more of a "bulk" mailing because
  535.    everything is saved up and then mailed simultaneously.  This is very
  536.    useful for systems such as ITS where the MTP-receiver does not itself
  537.    write mail directly, but hands it on to a central mailer demon.  The
  538.    more information (e.g., recipients) associated with a single
  539.    "hand-off", the more efficiently mail can be delivered.
  540.  
  541.    By contrast, MRSQ T is geared to receiver-MTPs which want to deliver
  542.    mail directly, in one-by-one incremental fashion.  For each given
  543.    recipient this scheme returns an individual success/failure reply
  544.    code which may depend on variable mail system factors such as
  545.    exceeding disk allocation, mailbox access conflicts, and so forth.
  546.    If these receiver-MTPs tried to emulate MRSQ Rs bulk mailing, they
  547.    would have to ensure that a success reply to the MAIL indeed meant
  548.    that it had been delivered to ALL recipients specified -- not just
  549.    some.
  550.  
  551.    4.1.  SCHEME SELECTION:  MRSQ
  552.  
  553.       MRSQ is the means by which a sender-MTP can test for MRSQ/MRCP
  554.       implementation, select a particular scheme, reset its state, and
  555.       even do some rudimentary negotiation.  Its format is as follows:
  556.  
  557.          MRSQ [<SP> <scheme>] <CRLF>
  558.  
  559.          <scheme> is a single character.  The following are defined:
  560.             R  Recipients first.  If this is not implemented, T must be.
  561.             T  Text first.  If this is not implemented, R must be.
  562.             ?  Request for preference.  This must always be implemented.
  563.  
  564.  
  565.  
  566.  
  567.  
  568. [Page 8]                                                Sluizer & Postel
  569.  
  570.  
  571.                                                                         
  572. RFC 780                                                         May 1981
  573.                                                   Mail Transfer Protocol
  574.  
  575.  
  576.  
  577.             No argument means a "selection" of none of the schemes (the
  578.             default).
  579.  
  580.          Possible replies are:
  581.             200 OK, use the specified scheme
  582.             215 <scheme> This is the scheme I prefer
  583.             504 I understand MRSQ but can't use that scheme
  584.             5xx Command unrecognized or unimplemented
  585.  
  586.       There are three aspects of MRSQ.  The first is that an MRSQ with
  587.       no argument must always return a 200 reply and restore the default
  588.       state of having no scheme selected.  Any other reply implies that
  589.       MRSQ and hence MRCP are not understood or cannot be performed
  590.       correctly.
  591.  
  592.       The second is that the use of "?" as a <scheme> asks the MTP
  593.       receiver to return a 215 reply in which the receiver specifies a
  594.       "preferred" scheme.  The format of this reply is simple:
  595.  
  596.          215 <SP> <scheme> [<SP> <string>] <CRLF>
  597.  
  598.          Any other reply (e.g., 4xx or 5xx) implies that MRSQ and MRCP
  599.          are not implemented, because "?" must always be implemented if
  600.          MRSQ is.
  601.  
  602.       The third important point about MRSQ is that it always has the
  603.       side effect of reseting all schemes to their initial state.  This
  604.       reset must be done no matter what the reply will be -- 200, 215,
  605.       or 504.  The actions necessary for a reset will be explained when
  606.       discussing how each scheme actually works.
  607.  
  608.       Note that the receiver gets to choose which scheme is used.  The
  609.       sender must be prepared to do either.
  610.  
  611.    4.2.  MESSAGE TEXT SPECIFICATION:  MAIL
  612.  
  613.       Regardless of which scheme (if any) has been selected, a MAIL
  614.       command with a non-null receiver-path argument will behave exactly
  615.       as before; the MRSQ/MRCP commands have no effect on it.  However,
  616.       a normal MAIL command does have the same side effect as MRSQ; it
  617.       "resets" all schemes to their initial state.
  618.  
  619.       It is only when the receiver-path argument is null that the
  620.       particular scheme chosen is important.
  621.  
  622.          MAIL FROM:<sender-path> <CRLF>
  623.  
  624.  
  625.  
  626. Sluizer & Postel                                                [Page 9]
  627.  
  628.  
  629.                                                                         
  630. May 1981                                                         RFC 780
  631. Mail Transfer Protocol                                                  
  632.  
  633.  
  634.  
  635.       Rather than producing an error, the receiver will accept message
  636.       text for this "null" recipient specification.  What it does with
  637.       it depends on which scheme is in effect, and will be described in
  638.       the section on Scheme Mechanics.
  639.  
  640.    4.3.  RECIPIENT SPECIFICATION:  MRCP
  641.  
  642.       In order to specify recipient names (i.e., mailboxes) and receive
  643.       some acknowledgment (or refusal) for each name, the following
  644.       command is used:
  645.  
  646.          MRCP <SP> TO:<receiver-path> <CRLF>
  647.  
  648.          Reply for no scheme:
  649.             503 No scheme specified yet; use MRSQ
  650.          Replies for scheme T are identical to those for MAIL.
  651.          Replies for scheme R (recipients first):
  652.             200 OK, name stored
  653.             452 Recipient table full, this name not stored
  654.             550 Recipient name rejected
  655.             4xx Temporary error, try this name again later
  656.             5xx Permanent error, report to sender
  657.  
  658.       Note that use of this command is an error if no scheme has been
  659.       selected yet; an MRSQ <scheme> must have been given if MRCP is to
  660.       be used.
  661.  
  662.    4.4.  SCHEME MECHANICS:  MRSQ R (RECIPIENTS-FIRST)
  663.  
  664.       In the recipients-first scheme, MRCP is used to specify names
  665.       which the MTP receiver stores in a list or table.  Normally the
  666.       reply for each MRCP will be either a 200 for acceptance or a
  667.       4xx/5xx rejection code.  All 5xx codes are permanent rejections
  668.       (e.g., user not known) which should be reported to the human user,
  669.       whereas 4xx codes in general connote some temporary error that may
  670.       be rectified later.  None of the 4xx/5xx replies impinge on
  671.       previous or succeeding MRCP commands, except for 452 which
  672.       indicates that no further MRCPs will succeed unless a message is
  673.       sent to the already stored recipients or a reset is done.
  674.  
  675.       Sending message text to stored recipients is done by giving a MAIL
  676.       command with no receiver-path argument; that is, just MAIL <SP>
  677.       FROM: <sender-path> <CRLF>.  Transmission of the message text is
  678.       exactly the same as for normal MAIL.  However, a positive
  679.       acknowledgment at the end of transmission means the message has
  680.       been sent to ALL recipients that were remembered with MRCP, and a
  681.  
  682.  
  683.  
  684. [Page 10]                                               Sluizer & Postel
  685.  
  686.  
  687.                                                                         
  688. RFC 780                                                         May 1981
  689.                                                   Mail Transfer Protocol
  690.  
  691.  
  692.  
  693.       failure code means that it should be considered to have failed for
  694.       ALL of these specified recipients.  This applies regardless of the
  695.       actual error code.  Regardless of what the reply signifies, all
  696.       stored recipient names are flushed and forgotten -- in other
  697.       words, things are reset to their initial state.  This purging of
  698.       the recipient name list must also be done as the reset side effect
  699.       of any use of MRSQ (or MAIL with a non-null receiver-path
  700.       argument).
  701.  
  702.       A 452 reply (out of storage space) to an MRCP can be handled by
  703.       using MAIL to specify the message for currently stored recipients,
  704.       and then sending more MRCPs and another MAIL, as many times as
  705.       necessary.  For example, if a receiver only had room for 10 names
  706.       this would result in a 50-recipient message being sent 5 times, to
  707.       10 different recipients each time.
  708.  
  709.       If a sender attempts to specify message text (MAIL with no
  710.       receiver-path argument) before any successful MRCPs have been
  711.       given, this should be treated exactly as a "normal" MAIL with a
  712.       null recipient would be; some receivers return an error, such as
  713.       "550 Null recipient".
  714.  
  715.       -------------------------------------------------------------
  716.  
  717.                   Example of MRSQ R (Recipients First)
  718.  
  719.          First the sender must establish that the receiver implements
  720.          MRSQ.
  721.  
  722.             S: MRSQ <CRLF>
  723.             R: 200 OK, no scheme selected
  724.  
  725.          An MRSQ with a null argument always returns a 200 if
  726.          implemented, selecting the default "scheme", i.e., none of
  727.          them.  If MRSQ were not implemented, a code of 4xx or 5xx would
  728.          be returned.
  729.  
  730.             S: MRSQ R <CRLF>
  731.             R: 200 OK, using that scheme
  732.  
  733.          All is well; now the recipients can be specified.
  734.  
  735.             S: MRCP TO:<Foo@Y> <CRLF>
  736.             R: 200 OK
  737.  
  738.  
  739.  
  740.  
  741.  
  742. Sluizer & Postel                                               [Page 11]
  743.  
  744.  
  745.                                                                         
  746. May 1981                                                         RFC 780
  747. Mail Transfer Protocol                                                  
  748.  
  749.  
  750.  
  751.             S: MRCP TO:<Raboof@Y> <CRLF>
  752.             R: 550 No such user here
  753.  
  754.             S: MRCP TO:<bar@Y> <CRLF>
  755.             R: 200 OK
  756.  
  757.             S: MRCP TO:<@Y,@X,fubar@Z> <CRLF>
  758.             R: 200 OK
  759.  
  760.          Note that the failure of "Raboof" has no effect on the storage
  761.          of mail for "Foo", "bar" or the mail to be relayed to "fubar@Z"
  762.          through host "X".  Now the message text is furnished, by giving
  763.          a MAIL command with no receiver-path argument.
  764.  
  765.             S: MAIL FROM:<waldo@A><CRLF>
  766.             R: 354 Start mail input; end with <CRLF>.<CRLF>
  767.             S: Blah blah blah blah....etc. etc. etc.
  768.             S: <CRLF>.<CRLF>
  769.             R: 250 Mail sent
  770.  
  771.          The mail text has now been sent to "Foo" and "bar" as well as
  772.          relayed to "fubar@Z".
  773.  
  774.                                Example 2
  775.  
  776.       -------------------------------------------------------------
  777.  
  778.    4.5.  SCHEME MECHANICS:  MRSQ T (TEXT-FIRST)
  779.  
  780.       In the text-first scheme, MAIL with no receiver-path argument is
  781.       used to specify message text, which the receiver stores away.
  782.       Succeeding MRCPs are then treated as if they were MAIL commands,
  783.       except that none of the text transfer manipulations are done; the
  784.       stored message text is sent to the specified recipient, and a
  785.       reply code is returned identical to that which an actual MAIL
  786.       would invoke. (Note that any 2xx code indicates success.)
  787.  
  788.       The stored message text is not forgotten until the next MAIL or
  789.       MRSQ, which will either replace it with new text or flush it
  790.       entirely.  Any use of MRSQ will reset this scheme by flushing
  791.       stored text, as will any use of MAIL with a non-null receiver-path
  792.       argument.
  793.  
  794.       If an MRCP is seen before any message text has been stored, the
  795.       sender in effect is trying to send a null message; some receivers
  796.       might allow this, others would return an error code.
  797.  
  798.  
  799.  
  800. [Page 12]                                               Sluizer & Postel
  801.  
  802.  
  803.                                                                         
  804. RFC 780                                                         May 1981
  805.                                                   Mail Transfer Protocol
  806.  
  807.  
  808.  
  809.       -------------------------------------------------------------
  810.  
  811.                      Example of MRSQ T (Text First)
  812.  
  813.          First the sender must establish that the receiver implements
  814.          MRSQ.
  815.  
  816.             S: MRSQ ? <CRLF>
  817.             R: 215 T Text first, please
  818.  
  819.          MRSQ is indeed implemented, and the receiver says that it
  820.          prefers "T", but that needn't stop the sender from trying
  821.          something else.
  822.  
  823.             S: MRSQ R <CRLF>
  824.             R: 504 Sorry, I really can't do that
  825.  
  826.          It's possible that it could have understood "R" also, but in
  827.          general it's best to use the "preferred" scheme, since the
  828.          receiver knows which is most efficient for its particular site.
  829.  
  830.             S: MRSQ T <CRLF>
  831.             R: 200 OK, using that scheme
  832.  
  833.          Scheme "T" is now selected, and the message text is sent by
  834.          giving a mail command with no receiver-path argument.
  835.  
  836.             S: MAIL FROM:<WALDO@A><CRLF>
  837.             R: 354 Start mail input; end with <CRLF>.<CRLF>
  838.             S: Blah blah blah blah....etc. etc. etc.
  839.             S: <CRLF>.<CRLF>
  840.             R: 250 Mail stored
  841.  
  842.          Now recipients can be specified.
  843.  
  844.             S: MRCP TO:<Foo@Y> <CRLF>
  845.             R: 250 Stored mail sent
  846.  
  847.             S: MRCP TO:<Raboof@Y> <CRLF>
  848.             R: 550 No such user here
  849.  
  850.             S: MRCP TO:<bar@Y> <CRLF>
  851.             R: 250 Stored mail sent
  852.  
  853.             S: MRCP TO:<@Y,@X,fubar@Z> <CRLF>
  854.             R: 250 Mail accepted for relaying
  855.  
  856.  
  857.  
  858. Sluizer & Postel                                               [Page 13]
  859.  
  860.  
  861.                                                                         
  862. May 1981                                                         RFC 780
  863. Mail Transfer Protocol                                                  
  864.  
  865.  
  866.  
  867.          The text has now been sent to "Foo" and "bar" at host "Y" and
  868.          will be relayed to "fubar@Z" through host "X", and still
  869.          remains stored.  A new message can be sent with another
  870.          MAIL/MRCP ... sequence, but a careful sender would reset the
  871.          state using the exchange below.
  872.  
  873.             S: MRSQ ? <CRLF>
  874.             R: 215 T Text first, please
  875.  
  876.          Which resets the state without altering the scheme in effect.
  877.  
  878.                                Example 3
  879.  
  880.       -------------------------------------------------------------
  881.  
  882.    4.6.  DISCUSSION
  883.  
  884.       Because these commands are not required in the minimum
  885.       implementation of MTP, one must be prepared to deal with sites
  886.       which don't recognize either MRSQ or MRCP.  "MRSQ" and "MRSQ ?"
  887.       are explicitly designed as tests to see whether either scheme is
  888.       implemented.  MRCP is not designed as a test, and a failure return
  889.       of the "unimplemented" variety could be confused with "No scheme
  890.       selected yet", or even with "Recipient unknown".
  891.  
  892.       There is no way to indicate in a positive response to "MRSQ ?"
  893.       that the preferred "scheme" for a receiver is that of the default
  894.       state; i.e., none of the multi-recipient schemes.  The rationale
  895.       is that in this case, it would be pointless to implement MRSQ/MRCP
  896.       at all, and the response would therefore be negative.
  897.  
  898.       One reason that the use of MAIL is restricted to null
  899.       receiver-path arguments with this multi-recipient extension is the
  900.       ambiguity that would result if a non-null receiver-path argument
  901.       were allowed.  For example, if MRSQ R was in effect and some MRCPs
  902.       had been given, and a MAIL FROM:<X@Y> TO:<FOO@Z><CRLF> was done,
  903.       there would be no way to distinguish a failure reply for mailbox
  904.       "FOO" from a global failure for all recipients specified.  A
  905.       similar situation exists for MRSQ T; it would not be clear whether
  906.       the text was stored and the mailbox failed, or vice versa, or
  907.       both.
  908.  
  909.       "Resets" of all schemes are done by all MRSQs and "normal" MAILs
  910.       to avoid confusion and overly complicated implementation.  The
  911.       MRSQ command implies a change or uncertainty of status, and the
  912.       MAIL command would otherwise have to use some independent
  913.  
  914.  
  915.  
  916. [Page 14]                                               Sluizer & Postel
  917.  
  918.  
  919.                                                                         
  920. RFC 780                                                         May 1981
  921.                                                   Mail Transfer Protocol
  922.  
  923.  
  924.  
  925.       mechanisms to avoid clobbering the data bases (e.g., message text
  926.       storage area) used by the T/R schemes.  However, once a scheme is
  927.       selected, it remains in effect.  The recommended way for doing a
  928.       reset, without changing the current selection, is with "MRSQ ?".
  929.       Remember that "MRSQ" alone reverts to the no-scheme state.
  930.  
  931.  
  932.  
  933.  
  934.  
  935.  
  936.  
  937.  
  938.  
  939.  
  940.  
  941.  
  942.  
  943.  
  944.  
  945.  
  946.  
  947.  
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974. Sluizer & Postel                                               [Page 15]
  975.  
  976.  
  977.                                                                         
  978. May 1981                                                         RFC 780
  979. Mail Transfer Protocol                                                  
  980.  
  981.  
  982.  
  983. 5.  SPECIFICATIONS
  984.  
  985.    5.1.  MTP COMMANDS
  986.  
  987.       5.1.1.  COMMAND SEMANTICS
  988.  
  989.          The MTP commands define the mail transfer or the mail system
  990.          function requested by the user.  MTP commands are character
  991.          strings terminated by <CRLF>.  The command codes themselves are
  992.          alphabetic characters terminated by <SP> if parameters follow
  993.          and <CRLF> otherwise.  The syntax of mailboxes must conform to
  994.          receiver site conventions. The MTP commands are discussed
  995.          below.  MTP replies are discussed in the Section 5.2.
  996.  
  997.          MAIL (MAIL)
  998.  
  999.             This command is used to send mail over the transmission
  1000.             channel.  The argument field contains a sender-path sequence
  1001.             and optional receiver-path sequence.
  1002.  
  1003.             The sender-path sequence consists of an optional list of
  1004.             hosts and the sender mailbox.  When the list of hosts is
  1005.             present, it is "reverse" source routing information and
  1006.             indicates that the mail was relayed through each host on the
  1007.             list (the first host in the list was the most recent relay).
  1008.             This list is used as source routing to return non-delivery
  1009.             notices to the sender.  As each relay host adds itself to
  1010.             the beginning of the list, it must use its name as known in
  1011.             the network to which it is relaying the mail rather than the
  1012.             network from which the mail came (if they are different).
  1013.  
  1014.             If the receiver-path sequence is present, it consists of an
  1015.             optional list of hosts and a destination mailbox.  When the
  1016.             list of hosts is present, it is source routing information
  1017.             and indicates that the mail must be relayed to the first
  1018.             host on the list.
  1019.  
  1020.             The receiver treats the lines following the command as mail
  1021.             text from the sender.  The mail text is terminated by the
  1022.             character sequence "<CRLF>.<CRLF>", (see Section 5.5.2 on
  1023.             Transparency).
  1024.  
  1025.             As mail is relayed along the receiver-path sequence, each
  1026.             relay host must remove itself from the path sequence and put
  1027.             itself at the beginning of the sender-path sequence.  When
  1028.             mail reaches its ultimate destination (the receiver-path
  1029.  
  1030.  
  1031.  
  1032. [Page 16]                                               Sluizer & Postel
  1033.  
  1034.  
  1035.                                                                         
  1036. RFC 780                                                         May 1981
  1037.                                                   Mail Transfer Protocol
  1038.  
  1039.  
  1040.  
  1041.             sequence has only a destination mailbox), the receiver-MTP
  1042.             inserts it into the destination mailbox in accordance with
  1043.             its host mail conventions.  (For example, "MAIL FROM:<X@Y>
  1044.             TO:<@A,@B,C@D> <CRLF>" will eventually be relayed as "MAIL
  1045.             FROM:<@A,X@Y> TO:<@B,C@D> <CRLF>.)
  1046.  
  1047.             If the receiver-path sequence is empty, the mail is destined
  1048.             for a printer or other designated place for host general
  1049.             delivery mail (if allowed at this host).  The mail may be
  1050.             marked as sent from the sender as specified in the
  1051.             sender-path sequence field.
  1052.  
  1053.          MAIL RECIPIENT SCHEME QUESTION (MRSQ)
  1054.  
  1055.             This MTP command is used to select a scheme for the
  1056.             transmission of mail to several users at the same host.  The
  1057.             schemes are recipients-first, or text-first.
  1058.  
  1059.          MAIL RECIPIENT (MRCP)
  1060.  
  1061.             This command is used to identify the individual recipients
  1062.             of the mail in the transmission of mail for multiple users
  1063.             at one host.
  1064.  
  1065.          HELP (HELP)
  1066.  
  1067.             This command causes the receiver to send helpful information
  1068.             regarding its implementation status over the transmission
  1069.             channel to the receiver.  The command may take an argument
  1070.             (e.g., any command name) and return more specific
  1071.             information as a response.
  1072.  
  1073.          QUIT (QUIT)
  1074.  
  1075.             This command specifies that the receiver must close the
  1076.             transmission channel.
  1077.  
  1078.          NOOP (NOOP)
  1079.  
  1080.             This command does not affect any parameters or previously
  1081.             entered commands.  It specifies no action other than that
  1082.             the receiver send an OK reply.
  1083.  
  1084.  
  1085.  
  1086.  
  1087.  
  1088.  
  1089.  
  1090. Sluizer & Postel                                               [Page 17]
  1091.  
  1092.  
  1093.                                                                         
  1094. May 1981                                                         RFC 780
  1095. Mail Transfer Protocol                                                  
  1096.  
  1097.  
  1098.  
  1099.          CONTINUE (CONT)
  1100.  
  1101.             This command specifies that the previously specified action
  1102.             is to be continued.  This is sent only following a
  1103.             preliminary reply.
  1104.  
  1105.          ABORT (ABRT)
  1106.  
  1107.             This command specifies that the previously specified action
  1108.             is to be aborted.  This is sent only following a preliminary
  1109.             reply.  It specifies no further action other than that the
  1110.             receiver send an OK reply.
  1111.  
  1112.       5.1.2.  COMMAND SYNTAX
  1113.  
  1114.          The commands begin with a command code followed by an argument
  1115.          field.  The command codes are four alphabetic characters.
  1116.          Upper and lower case alphabetic characters are to be treated
  1117.          identically.  Thus any of the following may represent the mail
  1118.          command:
  1119.  
  1120.             MAIL    Mail    mail    MaIl    mAIl
  1121.  
  1122.          This also applies to any symbols representing parameter values,
  1123.          such as R or r for RECIPIENT first.  The command codes and the
  1124.          argument fields are separated by one or more spaces.
  1125.  
  1126.          But, note that in the sender-path and receiver-path arguments
  1127.          case is important.  In particular, in some hosts the user "foo"
  1128.          is different from the user "Foo".
  1129.  
  1130.          The argument field consists of a variable length character
  1131.          string ending with the character sequence <CRLF>.  It should be
  1132.          noted that the receiver is to take no action until the end of
  1133.          the line is received.
  1134.  
  1135.          Square brackets denote an optional argument field.  If the
  1136.          option is not taken, the appropriate default is implied.  All
  1137.          characters are in the ASCII characters set.
  1138.  
  1139.  
  1140.  
  1141.  
  1142.  
  1143.  
  1144.  
  1145.  
  1146.  
  1147.  
  1148. [Page 18]                                               Sluizer & Postel
  1149.  
  1150.  
  1151.                                                                         
  1152. RFC 780                                                         May 1981
  1153.                                                   Mail Transfer Protocol
  1154.  
  1155.  
  1156.  
  1157.          The following are the MTP commands:
  1158.  
  1159.          MAIL <SP> FROM:<sender-path> [<SP> TO:<receiver-path>] <CRLF>
  1160.  
  1161.          MRSQ [<SP> <scheme>] <CRLF>
  1162.  
  1163.          MRCP <SP> TO:<receiver-path> <CRLF>
  1164.  
  1165.          HELP [<SP> <string>] <CRLF>
  1166.  
  1167.          QUIT <CRLF>
  1168.  
  1169.          NOOP <CRLF>
  1170.  
  1171.          CONT <CRLF>
  1172.  
  1173.          ABRT <CRLF>
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.  
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.  
  1196.  
  1197.  
  1198.  
  1199.  
  1200.  
  1201.  
  1202.  
  1203.  
  1204.  
  1205.  
  1206. Sluizer & Postel                                               [Page 19]
  1207.  
  1208.  
  1209.                                                                         
  1210. May 1981                                                         RFC 780
  1211. Mail Transfer Protocol                                                  
  1212.  
  1213.  
  1214.  
  1215.          The syntax of the above argument fields (using BNF notation
  1216.          where applicable) is given below.  The "..." notation indicates
  1217.          that a field may be repeated one or more times.
  1218.  
  1219.             <sender-path> ::= <path>
  1220.  
  1221.             <receiver-path> ::= <path>
  1222.  
  1223.             <scheme> ::= "R" | "T" | "?"
  1224.  
  1225.             <string> ::= <char> | <char> <string>
  1226.  
  1227.             <path> ::= "<" ["@" <host> "," ...] <mailbox> ">"
  1228.  
  1229.             <host> ::= <a> <string> | "#" <number> | "[" <dotnum> "]"
  1230.  
  1231.             <mailbox> ::= <user> "@" <host>
  1232.  
  1233.             <user> ::= <string>
  1234.  
  1235.             <char> ::= <c> | '\' <c> | '\' <s>
  1236.  
  1237.             <dotnum> ::= <snum> "." <snum> "." <snum> "." <snum>
  1238.  
  1239.             <number> ::= <d> | <d> <number>
  1240.  
  1241.             <snum> ::= three digits representing an integer value in the
  1242.             range 0 through 255
  1243.  
  1244.             <specials> ::= '<', '>', '(', ')', '\', ',', ';', ':', '@',
  1245.             '"', and the control characters (ASCII codes 0 through 37
  1246.             octal inclusive and 177 octal)
  1247.  
  1248.             <a> ::= any one of the 26 letters A through Z in either case
  1249.  
  1250.             <c> ::= any one of the 128 ASCII characters except
  1251.             <specials>
  1252.  
  1253.             <d> ::= any one of the ten digits 0 through 9
  1254.  
  1255.             <s> ::= any one of <specials>
  1256.  
  1257.             Note that the backslash, '\', is a quote character, which is
  1258.             used to indicate that the next character is to be used
  1259.             literally instead of with its normal interpretation.  For
  1260.  
  1261.  
  1262.  
  1263.  
  1264. [Page 20]                                               Sluizer & Postel
  1265.  
  1266.  
  1267.                                                                         
  1268. RFC 780                                                         May 1981
  1269.                                                   Mail Transfer Protocol
  1270.  
  1271.  
  1272.  
  1273.             example, "Joe\,Smith" could be used to indicate a single
  1274.             nine character user field with comma being the fourth
  1275.             character of the field.
  1276.  
  1277.          Hosts are generally known by names which are translated to
  1278.          addresses  in each host.  Sometimes a host is not known to the
  1279.          translation function and communication is blocked.  To bypass
  1280.          this barrier numeric forms are also allowed for host "names".
  1281.          One form is a decimal integer prefixed by a pound sign, "#",
  1282.          which indicates the number is the address of the host.  Another
  1283.          form is four small decimal integers separated by dots and
  1284.          enclosed by brackets, e.g., "[123.255.37.321]", which indicates
  1285.          a 32 bit ARPA Internet Address in four eight bit fields.
  1286.  
  1287.          
  1288.  
  1289.  
  1290.  
  1291.  
  1292.  
  1293.  
  1294.  
  1295.  
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322. Sluizer & Postel                                               [Page 21]
  1323.  
  1324.  
  1325.                                                                         
  1326. May 1981                                                         RFC 780
  1327. Mail Transfer Protocol                                                  
  1328.  
  1329.  
  1330.  
  1331.    5.2.  MTP REPLIES
  1332.  
  1333.       Replies to MTP commands are devised to ensure the synchronization
  1334.       of requests and actions in the process of mail transfer, and to
  1335.       guarantee that the sender-MTP always knows the state of the
  1336.       receiver-MTP.  Every command must generate exactly one reply.
  1337.       Additionally, some commands must occur sequentially, such as
  1338.       MRSQ T->MAIL->MRCP or MRSQ R->MRCP->MAIL.
  1339.  
  1340.          The details of the command-reply sequence are made explicit in
  1341.          the Sections 5.3 and 5.4 on Sequencing and State Diagrams.
  1342.  
  1343.       An MTP reply consists of a three digit number (transmitted as
  1344.       three alphanumeric characters) followed by some text.  The number
  1345.       is intended for use by automata to determine what state to enter
  1346.       next; the text is meant for the human user.  It is intended that
  1347.       the three digits contain enough encoded information that the
  1348.       sender-MTP will not need to examine the text and may either
  1349.       discard it or pass it on to the user, as appropriate.  In
  1350.       particular, the text may be receiver-dependent, so there are
  1351.       likely to be varying texts for each reply code. Further
  1352.       explanation of the assignment of reply codes is given in the
  1353.       Appendix E on the Theory of Reply Codes.  Formally, a reply is
  1354.       defined to be the sequence:  a three-digit code, <SP>, one line of
  1355.       text, and <CRLF>.
  1356.  
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380. [Page 22]                                               Sluizer & Postel
  1381.  
  1382.  
  1383.                                                                         
  1384. RFC 780                                                         May 1981
  1385.                                                   Mail Transfer Protocol
  1386.  
  1387.  
  1388.  
  1389.       5.2.1.  REPLY CODES BY FUNCTION GROUPS
  1390.  
  1391.          200 Command okay
  1392.          201 Command okay, action aborted
  1393.          500 Syntax error, command unrecognized
  1394.             [This may include errors such as command line too long]
  1395.          501 Syntax error in parameters or arguments
  1396.          502 Command not implemented
  1397.          503 Bad sequence of commands
  1398.          504 Command parameter not implemented
  1399.           
  1400.          211 System status, or system help reply
  1401.          214 Help message
  1402.             [Information on how to use the receiver or the meaning of a
  1403.             particular non-standard command; this reply is useful only
  1404.             to the human user]
  1405.          215 <scheme> is the preferred scheme
  1406.           
  1407.          120 <host> Service ready in nnn minutes
  1408.          220 <host> Service ready for new user
  1409.          221 <host> Service closing transmission channel
  1410.          421 <host> Service not available, closing transmission channel
  1411.             [This may be a reply to any command if the service knows it
  1412.             must shut down]
  1413.           
  1414.          151 User not local; will forward to <user>@<host>
  1415.          152 User unknown; mail will be forwarded by the operator
  1416.          250 Requested mail action okay, completed
  1417.          450 Requested mail action not taken: mailbox unavailable
  1418.             [E.g., mailbox busy]
  1419.          550 Requested action not taken: mailbox unavailable
  1420.             [E.g., mailbox not found, no access]
  1421.          451 Requested action aborted: local error in processing
  1422.          452 Requested action not taken: insufficient system storage
  1423.          552 Requested mail action aborted: exceeded storage allocation
  1424.             [For current mailbox location]
  1425.          553 Requested action not taken: mailbox name not allowed
  1426.             [E.g., mailbox syntax incorrect]
  1427.          354 Start mail input; end with <CRLF>.<CRLF>
  1428.          
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438. Sluizer & Postel                                               [Page 23]
  1439.  
  1440.  
  1441.                                                                         
  1442. May 1981                                                         RFC 780
  1443. Mail Transfer Protocol                                                  
  1444.  
  1445.  
  1446.  
  1447.       5.2.2.  NUMERIC ORDER LIST OF REPLY CODES
  1448.  
  1449.          120 <host> Service ready in nnn minutes
  1450.          151 User not local; will forward to <user>@<host>
  1451.          152 User unknown; mail will be forwarded by the operator
  1452.           
  1453.          200 Command okay
  1454.          201 Command okay, action aborted
  1455.          211 System status, or system help reply
  1456.          214 Help message
  1457.             [Information on how to use the receiver or the meaning of a
  1458.             particular non-standard command; this reply is useful only
  1459.             to the human user]
  1460.          215 <scheme> is the preferred scheme
  1461.          220 <host> Service ready for new user
  1462.          221 <host> Service closing transmission channel
  1463.          250 Requested mail action okay, completed
  1464.           
  1465.          354 Start mail input; end with <CRLF>.<CRLF>
  1466.           
  1467.          421 <host> Service not available, closing transmission channel
  1468.             [This may be a reply to any command if the service knows it
  1469.             must shut down]
  1470.          450 Requested mail action not taken: mailbox unavailable
  1471.             [E.g., mailbox busy]
  1472.          451 Requested action aborted: local error in processing
  1473.          452 Requested action not taken: insufficient system storage
  1474.           
  1475.          500 Syntax error, command unrecognized
  1476.             [This may include errors such as command line too long]
  1477.          501 Syntax error in parameters or arguments
  1478.          502 Command not implemented
  1479.          503 Bad sequence of commands
  1480.          504 Command parameter not implemented
  1481.          550 Requested action not taken: mailbox unavailable
  1482.             [E.g., mailbox not found, no access]
  1483.          552 Requested mail action aborted: exceeded storage allocation
  1484.             [For current mailbox location]
  1485.          553 Requested action not taken: mailbox name not allowed
  1486.             [E.g., mailbox syntax incorrect]
  1487.          
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496. [Page 24]                                               Sluizer & Postel
  1497.  
  1498.  
  1499.                                                                         
  1500. RFC 780                                                         May 1981
  1501.                                                   Mail Transfer Protocol
  1502.  
  1503.  
  1504.  
  1505.    5.3.  SEQUENCING OF COMMANDS AND REPLIES
  1506.  
  1507.       The communication between the sender and receiver is intended to
  1508.       be an alternating dialogue.  As such, the sender issues an MTP
  1509.       command and the receiver responds with a prompt primary reply.
  1510.       The sender should wait for this response before sending further
  1511.       commands.
  1512.  
  1513.       The preliminary (1xx) and intermediate (3xx) replies indicate that
  1514.       further commands and information are required to complete the
  1515.       required action.  The preliminary replies require either a
  1516.       continue or abort command to proceed; the intermediate replies
  1517.       require action dependent further commands.
  1518.  
  1519.       One important reply is the connection greetings.  Under normal
  1520.       circumstances, a receiver will send a 220 "Awaiting input" reply
  1521.       when the connection is completed.  The sender should wait for this
  1522.       greeting message before sending any commands.  If the receiver is
  1523.       unable to accept input right away, it should send a 120 "Expected
  1524.       delay" reply immediately.  The sender can then indicate it is
  1525.       willing to wait via a continue command, or not via the abort
  1526.       command.  The receiver will respond to the abort with a 201 reply,
  1527.       and to the continue with the 220 reply when ready.
  1528.  
  1529.          Note: all the greeting type replies have the official name of
  1530.          the server host as the first word following the reply code.
  1531.  
  1532.             For example,
  1533.  
  1534.                220 <SP> USC-ISIF <SP> Service ready <CRLF>
  1535.  
  1536.       The table below lists alternative success and failure replies for
  1537.       each command.  These must be strictly adhered to; a receiver may
  1538.       substitute text in the replies, but the meaning and action implied
  1539.       by the code numbers and by the specific command reply sequence
  1540.       cannot be altered.
  1541.  
  1542.       COMMAND-REPLY SEQUENCES
  1543.  
  1544.          Each command is listed with its possible replies.  Preliminary
  1545.          replies are listed first with their succeeding replies indented
  1546.          under them, then success and failure completion, and finally
  1547.          intermediary replies with the remaining commands from the
  1548.          sequence following.  The prefixes used before the possible
  1549.          replies are "P" for preliminary, "I" for intermediate, "S" for
  1550.          success, "F" for failure, and "E" for error.  The 421 reply
  1551.  
  1552.  
  1553.  
  1554. Sluizer & Postel                                               [Page 25]
  1555.  
  1556.  
  1557.                                                                         
  1558. May 1981                                                         RFC 780
  1559. Mail Transfer Protocol                                                  
  1560.  
  1561.  
  1562.  
  1563.          (service not available, closing transmission channel) may be
  1564.          given to any command if the MTP-receiver knows it must shut
  1565.          down.  This listing forms the basis for the State Diagrams, in
  1566.          Section 5.4.
  1567.  
  1568.             CONNECTION ESTABLISHMENT
  1569.                P: 120 -> CONT -> S: 220
  1570.                                  F: 421
  1571.                          ABRT    S: 201
  1572.                                  F: 421
  1573.                S: 220
  1574.                F: 421
  1575.             MAIL
  1576.                P: 151 -> CONT -> I: 354 -> text -> S: 250
  1577.                   152                              F: 451,552,450,
  1578.                                                       550,452,553
  1579.                          ABRT -> S: 201
  1580.                                  F: 451,552,450,550,452,553
  1581.                I: 354 -> text -> S: 250
  1582.                                  F: 451,552,450,550,452,553
  1583.                F: 451, 552, 450, 550, 452, 553
  1584.                E: 500, 501, 502, 421
  1585.             MRSQ
  1586.                S: 200, 215
  1587.                E: 500, 501, 502, 504, 421
  1588.             MRCP
  1589.                P: 151 -> CONT -> S: 200, 215, 250
  1590.                   152            F: 451,552,450,550,452,553
  1591.                          ABRT -> S: 201
  1592.                                  F: 451,552,450,550,452,553
  1593.                S: 200, 215, 250
  1594.                F: 451, 552, 450, 550, 452, 553
  1595.                E: 500, 501, 502, 503, 421
  1596.  
  1597.  
  1598.  
  1599.  
  1600.  
  1601.  
  1602.  
  1603.  
  1604.  
  1605.  
  1606.  
  1607.  
  1608.  
  1609.  
  1610.  
  1611.  
  1612. [Page 26]                                               Sluizer & Postel
  1613.  
  1614.  
  1615.                                                                         
  1616. RFC 780                                                         May 1981
  1617.                                                   Mail Transfer Protocol
  1618.  
  1619.  
  1620.  
  1621.             QUIT
  1622.                S: 221
  1623.                E: 500, 421
  1624.             HELP
  1625.                S: 211, 214
  1626.                E: 500, 501, 502, 504, 421
  1627.             NOOP
  1628.                S: 200
  1629.                E: 500, 421
  1630.             CONT
  1631.                S: depends on previous command
  1632.                F: depends on previous command
  1633.                E: 500, 501, 502, 504, 421
  1634.             ABRT
  1635.                S: 201,
  1636.                E: 500, 501, 502, 504, 421
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.  
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.  
  1658.  
  1659.  
  1660.  
  1661.  
  1662.  
  1663.  
  1664.  
  1665.  
  1666.  
  1667.  
  1668.  
  1669.  
  1670. Sluizer & Postel                                               [Page 27]
  1671.  
  1672.  
  1673.                                                                         
  1674. May 1981                                                         RFC 780
  1675. Mail Transfer Protocol                                                  
  1676.  
  1677.  
  1678.  
  1679.    5.4.  STATE DIAGRAMS
  1680.  
  1681.       Following are state diagrams for a very simple minded MTP
  1682.       implementation.  Only the first digit of the reply codes is used.
  1683.       There is one state diagram for each group of MTP commands.
  1684.  
  1685.       The command groupings were determined by constructing a model for
  1686.       each command and then collecting together the commands with
  1687.       structurally identical models.
  1688.  
  1689.       For each command there are three possible outcomes:  "success"
  1690.       (S), "failure" (F), and "error" (E). In the state diagrams below
  1691.       we use the symbol B for "begin", and the symbol W for "wait for
  1692.       reply".
  1693.  
  1694.       First, the diagram that represents most of the MTP commands:
  1695.  
  1696.          
  1697.                                   1,3    +---+
  1698.                              ----------->| E |
  1699.                             |            +---+
  1700.                             |
  1701.          +---+    cmd    +---+    2      +---+
  1702.          | B |---------->| W |---------->| S |
  1703.          +---+           +---+           +---+
  1704.                             |
  1705.                             |     4,5    +---+
  1706.                              ----------->| F |
  1707.                                          +---+
  1708.          
  1709.  
  1710.          This diagram models the commands:
  1711.  
  1712.             HELP, MRCP, MRSQ, NOOP, QUIT, ABRT.
  1713.  
  1714.  
  1715.  
  1716.  
  1717.  
  1718.  
  1719.  
  1720.  
  1721.  
  1722.  
  1723.  
  1724.  
  1725.  
  1726.  
  1727.  
  1728. [Page 28]                                               Sluizer & Postel
  1729.  
  1730.  
  1731.                                                                         
  1732. RFC 780                                                         May 1981
  1733.                                                   Mail Transfer Protocol
  1734.  
  1735.  
  1736.  
  1737.       A more complex diagram models the MAIL command:
  1738.  
  1739.          
  1740.                               ABRT       +---+ 1,3
  1741.                  CONT ---- ------------->| W |-------
  1742.                      |    |              +---+       |
  1743.                      |    |1           4,5|  |2      V
  1744.          +---+  cmd   -->+---+ 2          |  |     +---+
  1745.          | B |---------->| W |-------------------->| E |
  1746.          +---+           +---+        ------------>+---+
  1747.                          3| |4,5     |    |  |
  1748.                           | |        |    |  |
  1749.             --------------  ------   |    |  |
  1750.            |                      |  |    |   ---->+---+
  1751.            |               ----------------------->| S |
  1752.            |              |       |  |    |        +---+
  1753.            |              |  --------     |
  1754.            |              | |     |       |
  1755.            V             2| |1,3  |       |
  1756.          +---+   text    +---+    |        ------->+---+
  1757.          |   |---------->| W |     --------------->| F |
  1758.          +---+           +---+-------------------->+---+
  1759.                               4,5
  1760.  
  1761.  
  1762.          Note that the "text" here is a series of lines sent from the
  1763.          sender to the receiver with no response expected until the last
  1764.          line is sent.
  1765.  
  1766.  
  1767.  
  1768.  
  1769.  
  1770.  
  1771.  
  1772.  
  1773.  
  1774.  
  1775.  
  1776.  
  1777.  
  1778.  
  1779.  
  1780.  
  1781.  
  1782.  
  1783.  
  1784.  
  1785.  
  1786. Sluizer & Postel                                               [Page 29]
  1787.  
  1788.  
  1789.                                                                         
  1790. May 1981                                                         RFC 780
  1791. Mail Transfer Protocol                                                  
  1792.  
  1793.  
  1794.  
  1795.    5.5.  DETAILS
  1796.  
  1797.       5.5.1.  MINIMUM IMPLEMENTATION
  1798.  
  1799.          In order to make MTP workable, the following minimum
  1800.          implementation is required for all receivers:
  1801.  
  1802.             COMMANDS -- MAIL
  1803.                         QUIT
  1804.                         NOOP
  1805.  
  1806.       5.5.2.  TRANSPARENCY
  1807.  
  1808.          Without some provision for data transparency the character
  1809.          sequence "<CRLF>.<CRLF>" ends the the mail text and cannot be
  1810.          sent by the user.  In general, users are not aware of such
  1811.          "forbidden"  sequences.  To allow all user composed text to be
  1812.          transmitted transparently the following procedures are used.
  1813.  
  1814.          1. Before sending a line of mail text the sender-MTP checks the
  1815.          first character of the line.  If it is a period, one additional
  1816.          period is inserted at the beginning of the line.
  1817.  
  1818.          2. When a line of mail text is received by the receiver-MTP it
  1819.          checks the the line.  If the line is composed of a single
  1820.          period it is the end of mail.  If the first character is a
  1821.          period and there are other characters on the line, the first
  1822.          character is deleted.
  1823.  
  1824.       5.5.3.  SIZES
  1825.  
  1826.          There are several objects that ought to have defined maximum
  1827.          sizes.
  1828.  
  1829.             user
  1830.  
  1831.                The maximum total length of a user name is 40 characters.
  1832.  
  1833.             host
  1834.  
  1835.                The maximum total length of a host name or number is 20
  1836.                characters.
  1837.  
  1838.  
  1839.  
  1840.  
  1841.  
  1842.  
  1843.  
  1844. [Page 30]                                               Sluizer & Postel
  1845.  
  1846.  
  1847.                                                                         
  1848. RFC 780                                                         May 1981
  1849.                                                   Mail Transfer Protocol
  1850.  
  1851.  
  1852.  
  1853.             path
  1854.  
  1855.                The maximum total length of a sender-path or
  1856.                receiver-path is 100 characters.
  1857.  
  1858.             command line
  1859.  
  1860.                The maximum total length of a command line including the
  1861.                command word and the <CRLF> is 200 characters.
  1862.  
  1863.             reply line
  1864.  
  1865.                The maximum total length of a reply line including the
  1866.                reply code and the <CRLF> is 65 characters.
  1867.  
  1868.             text line
  1869.  
  1870.                The maximum total length of a text line including the the
  1871.                <CRLF> is 1000 characters.
  1872.  
  1873.          To the maximum extent possible implementation techniques which
  1874.          impose no limits at all to the length of these objects should
  1875.          be used.
  1876.  
  1877.  
  1878.  
  1879.  
  1880.  
  1881.  
  1882.  
  1883.  
  1884.  
  1885.  
  1886.  
  1887.  
  1888.  
  1889.  
  1890.  
  1891.  
  1892.  
  1893.  
  1894.  
  1895.  
  1896.  
  1897.  
  1898.  
  1899.  
  1900.  
  1901.  
  1902. Sluizer & Postel                                               [Page 31]
  1903.  
  1904.  
  1905.                                                                         
  1906. May 1981                                                         RFC 780
  1907. Mail Transfer Protocol                                                  
  1908.  
  1909.  
  1910.  
  1911. APPENDIX A
  1912.  
  1913.    TCP Transport service
  1914.  
  1915.       The Transmission Control Protocol [1] is used in the ARPA
  1916.       Internet, and in any network following the US DoD standards for
  1917.       internetwork protocols.
  1918.  
  1919.       Connection Establishment
  1920.  
  1921.          The MTP transmission channel is a TCP connection established
  1922.          between the sender process port U and the receiver process port
  1923.          L.  This single full duplex connection is used as the
  1924.          transmission channel.  This protocol is assigned the service
  1925.          port 57 (71 octal), that is L=57.
  1926.  
  1927.       Data Transfer
  1928.  
  1929.          The TCP connection supports the transmission of 8-bit bytes.
  1930.          The MTP data is 7-bit ASCII characters.  Each character is
  1931.          transmitted as a 8-bit byte with the high-order bit cleared to
  1932.          zero.
  1933.  
  1934.  
  1935.  
  1936.  
  1937.  
  1938.  
  1939.  
  1940.  
  1941.  
  1942.  
  1943.  
  1944.  
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951.  
  1952.  
  1953.  
  1954.  
  1955.  
  1956.  
  1957.  
  1958.  
  1959.  
  1960. [Page 32]                                               Sluizer & Postel
  1961.  
  1962.  
  1963.                                                                         
  1964. RFC 780                                                         May 1981
  1965.                                                   Mail Transfer Protocol
  1966.  
  1967.  
  1968.  
  1969. APPENDIX B
  1970.  
  1971.    NCP Transport service
  1972.  
  1973.       The ARPANET Host-to-Host Protocol [2] (implemented by the Network
  1974.       Control Program) may be used in the ARPANET.
  1975.  
  1976.       Connection Establishment
  1977.  
  1978.          The MTP transmission channel is established via NCP between the
  1979.          the sender process socket U and receiver process socket L.  The
  1980.          Initial Connection Protocol [3] is followed resulting in a pair
  1981.          of simplex connections.  This pair of connections is used as
  1982.          the transmission channel.  This protocol is assigned the
  1983.          contact socket 57 (71 octal), that is L=57.
  1984.  
  1985.       Data Transfer
  1986.  
  1987.          The NCP data connections are established in 8-bit byte mode.
  1988.          The MTP data is 7-bit ASCII characters.  Each character is
  1989.          transmitted as a 8-bit byte with the high-order bit cleared to
  1990.          zero.
  1991.  
  1992.  
  1993.  
  1994.  
  1995.  
  1996.  
  1997.  
  1998.  
  1999.  
  2000.  
  2001.  
  2002.  
  2003.  
  2004.  
  2005.  
  2006.  
  2007.  
  2008.  
  2009.  
  2010.  
  2011.  
  2012.  
  2013.  
  2014.  
  2015.  
  2016.  
  2017.  
  2018. Sluizer & Postel                                               [Page 33]
  2019.  
  2020.  
  2021.                                                                         
  2022. May 1981                                                         RFC 780
  2023. Mail Transfer Protocol                                                  
  2024.  
  2025.  
  2026.  
  2027. APPENDIX C
  2028.  
  2029.    NITS
  2030.  
  2031.       The Network Independent Transport Service [4] may be used.
  2032.  
  2033.       Connection Establishment
  2034.  
  2035.          The MTP transmission channel is established via NITS between
  2036.          the the sender process and receiver process.  The sender
  2037.          process executes the CONNECT primitive, and the waiting
  2038.          receiver process executes the ACCEPT primitive.
  2039.  
  2040.       Data Transfer
  2041.  
  2042.          The NITS connection supports the transmission of 8-bit bytes.
  2043.          The MTP data is 7-bit ASCII characters.  Each character is
  2044.          transmitted as a 8-bit byte with the high-order bit cleared to
  2045.          zero.
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.  
  2054.  
  2055.  
  2056.  
  2057.  
  2058.  
  2059.  
  2060.  
  2061.  
  2062.  
  2063.  
  2064.  
  2065.  
  2066.  
  2067.  
  2068.  
  2069.  
  2070.  
  2071.  
  2072.  
  2073.  
  2074.  
  2075.  
  2076. [Page 34]                                               Sluizer & Postel
  2077.  
  2078.  
  2079.                                                                         
  2080. RFC 780                                                         May 1981
  2081.                                                   Mail Transfer Protocol
  2082.  
  2083.  
  2084.  
  2085. APPENDIX D
  2086.  
  2087.    X.25 Transport service
  2088.  
  2089.       It may be possible to use the X.25 service [5] as provided by the
  2090.       Public Data Networks directly, but there are indications that it
  2091.       is too error prone to qualify as a reliable channel.  It is
  2092.       suggested that a reliable end-to-end protocol such as TCP be used
  2093.       on top of X.25 connections.
  2094.  
  2095.  
  2096.  
  2097.  
  2098.  
  2099.  
  2100.  
  2101.  
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.  
  2114.  
  2115.  
  2116.  
  2117.  
  2118.  
  2119.  
  2120.  
  2121.  
  2122.  
  2123.  
  2124.  
  2125.  
  2126.  
  2127.  
  2128.  
  2129.  
  2130.  
  2131.  
  2132.  
  2133.  
  2134. Sluizer & Postel                                               [Page 35]
  2135.  
  2136.  
  2137.                                                                         
  2138. May 1981                                                         RFC 780
  2139. Mail Transfer Protocol                                                  
  2140.  
  2141.  
  2142.  
  2143. APPENDIX E
  2144.  
  2145.    Theory of Reply Codes
  2146.  
  2147.       The three digits of the reply each have a special significance.
  2148.       The first digit denotes whether the response is good, bad or
  2149.       incomplete.  An unsophisticated sender-MTP will be able to
  2150.       determine its next action (proceed as planned, redo, retrench,
  2151.       etc.) by simply examining this first digit.  A sender-MTP that
  2152.       wants to know approximately what kind of error occurred (e.g.,
  2153.       mail system error, command syntax error) may examine the second
  2154.       digit, reserving the third digit for the finest gradation of
  2155.       information.
  2156.  
  2157.          There are five values for the first digit of the reply code:
  2158.  
  2159.             1yz   Positive Preliminary reply
  2160.  
  2161.                The command has been accepted, but the requested action
  2162.                is being held in abeyance, pending confirmation of the
  2163.                information in this reply.  The sender-MTP should send
  2164.                another command specifying whether to continue or abort
  2165.                the action.
  2166.  
  2167.             2yz   Positive Completion reply
  2168.  
  2169.                The requested action has been successfully completed.  A
  2170.                new request may be initiated.
  2171.  
  2172.             3yz   Positive Intermediate reply
  2173.  
  2174.                The command has been accepted, but the requested action
  2175.                is being held in abeyance, pending receipt of further
  2176.                information.  The sender-MTP should send another command
  2177.                specifying this information.  This reply is used in
  2178.                command sequence groups.
  2179.  
  2180.             4yz   Transient Negative Completion reply
  2181.  
  2182.                The command was not accepted and the requested action did
  2183.                not occur.  However, the error condition is temporary and
  2184.                the action may be requested again.  The sender should
  2185.                return to the beginning of the command sequence (if any).
  2186.                It is difficult to assign a meaning to "transient" when
  2187.                two different sites (receiver- and sender- MTPs) must
  2188.                agree on the interpretation.  Each reply in this category
  2189.  
  2190.  
  2191.  
  2192. [Page 36]                                               Sluizer & Postel
  2193.  
  2194.  
  2195.                                                                         
  2196. RFC 780                                                         May 1981
  2197.                                                   Mail Transfer Protocol
  2198.  
  2199.  
  2200.  
  2201.                might have a different time value, but the sender-MTP is
  2202.                encouraged to try again.  A rule of thumb to determine if
  2203.                a reply fits into the 4yz or the 5yz category (see below)
  2204.                is that replies are 4yz if they can be repeated without
  2205.                any change in command form or in properties of the sender
  2206.                or receiver.  (E.g., the command is repeated identically;
  2207.                the receiver does not put up a new implementation).
  2208.  
  2209.             5yz   Permanent Negative Completion reply
  2210.  
  2211.                The command was not accepted and the requested action did
  2212.                not occur.  The sender-MTP is discouraged from repeating
  2213.                the exact request (in the same sequence).  Even some
  2214.                "permanent" error conditions can be corrected, so the
  2215.                human user may want to direct the sender-MTP to
  2216.                reinitiate the command sequence by direct action at some
  2217.                point in the future (e.g., after the spelling has been
  2218.                changed, or the user has altered the account status.)
  2219.  
  2220.          The second digit encodes responses in specific categories:
  2221.  
  2222.             x0z   Syntax -- These replies refer to syntax errors,
  2223.                   syntactically correct commands that don't fit any
  2224.                   functional category, and unimplemented or superfluous
  2225.                   commands.
  2226.  
  2227.             x1z   Information --  These are replies to requests for
  2228.                   information, such as status or help.
  2229.  
  2230.             x2z   Connections -- These are replies referring to the
  2231.                   transmission channel.
  2232.  
  2233.             x3z   Unspecified as yet.
  2234.  
  2235.             x4z   Unspecified as yet.
  2236.  
  2237.             x5z   Mail system -- These replies indicate the status of
  2238.                   the receiver mail system vis-a-vis the requested
  2239.                   transfer or other mail system action.
  2240.  
  2241.          The third digit gives a finer gradation of meaning in each
  2242.          category specified by the second digit.  The list of replies
  2243.          illustrates this.  Each reply text is recommended rather than
  2244.          mandatory, and may even change according to the command with
  2245.          which it is associated.  On the other hand, the reply codes
  2246.          must strictly follow the specifications in this section.
  2247.  
  2248.  
  2249.  
  2250. Sluizer & Postel                                               [Page 37]
  2251.  
  2252.  
  2253.                                                                         
  2254. May 1981                                                         RFC 780
  2255. Mail Transfer Protocol                                                  
  2256.  
  2257.  
  2258.  
  2259.          Receiver implementations should not invent new codes for
  2260.          slightly different situations from the ones described here, but
  2261.          rather adapt codes already defined.
  2262.  
  2263.          For example, a command such as NOOP whose successful execution
  2264.          does not offer the sender-MTP any new information will return a
  2265.          200 reply.  The response is 502 when the command requests an
  2266.          unimplemented non-site-specific action.  A refinement of that
  2267.          is the 504 reply for a command that is implemented, but that
  2268.          requests an unimplemented parameter.
  2269.  
  2270.       The reply text may be longer than a single line; in these cases
  2271.       the complete text must be marked so the sender-MTP knows when it
  2272.       can stop reading the reply.  This requires a special format to
  2273.       indicate a multiple line reply.
  2274.  
  2275.          The format for multi-line replies requires that every line,
  2276.          except the last, begin with the reply code, followed
  2277.          immediately by a hyphen, "-" (also known as minus), followed by
  2278.          text.  The last line will begin with the reply code, followed
  2279.          immediately by <SP>, optionally some text, and <CRLF>.
  2280.  
  2281.             For example:
  2282.                                 123-First line
  2283.                                 123-Second line
  2284.                                 123-234 text beginning with numbers
  2285.                                 123 The last line
  2286.  
  2287.          The sender-MTP then simply needs to search for the reply code
  2288.          followed by <SP> at the beginning of a line, and ignore all
  2289.          preceding lines.
  2290.  
  2291.  
  2292.  
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.  
  2308. [Page 38]                                               Sluizer & Postel
  2309.  
  2310.  
  2311.                                                                         
  2312. RFC 780                                                         May 1981
  2313.                                                   Mail Transfer Protocol
  2314.  
  2315.  
  2316.  
  2317. GLOSSARY
  2318.  
  2319.    ASCII
  2320.  
  2321.       American Standard Code for Information Interchange [6].
  2322.  
  2323.    command
  2324.  
  2325.       A request for a mail service action sent by the sender-MTP to the
  2326.       receiver-MTP.
  2327.  
  2328.    host
  2329.  
  2330.       A computer in the internetwork environment on which mailboxes or
  2331.       MTP processes reside.
  2332.  
  2333.    line
  2334.  
  2335.       A line of text ending with a <CRLF>.
  2336.  
  2337.    mail
  2338.  
  2339.       A sequence of ASCII characters of arbitrary length, which conforms
  2340.       to the standard set in RFC 733 (Standard for the Format of ARPA
  2341.       Network Text Messages [7]).
  2342.  
  2343.    mailbox
  2344.  
  2345.       A character string (address) which identifies a user to whom mail
  2346.       is to be sent.  Mailbox normally consists of the host and user
  2347.       specifications.  The standard mailbox naming convention is defined
  2348.       to be "user@host".  Additionally, the "container" in which mail is
  2349.       stored.
  2350.  
  2351.    receiver-MTP process
  2352.  
  2353.       A process which transfers mail in cooperation with a sender-MTP
  2354.       process.  It waits for a connection to be established via the
  2355.       transport service.  It receives MTP commands from the sender-MTP,
  2356.       sends replies, and governs the transfer of mail.
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.  
  2366. Sluizer & Postel                                               [Page 39]
  2367.  
  2368.  
  2369.                                                                         
  2370. May 1981                                                         RFC 780
  2371. Mail Transfer Protocol                                                  
  2372.  
  2373.  
  2374.  
  2375.    reply
  2376.  
  2377.       A reply is an acknowledgment (positive or negative) sent from
  2378.       receiver to sender via the transmission channel in response to a
  2379.       MTP command.  The general form of a reply is a completion code
  2380.       (including error codes) followed by a text string.  The codes are
  2381.       for use by programs and the text is usually intended for human
  2382.       users.
  2383.  
  2384.    sender-MTP process
  2385.  
  2386.       A process which transfers mail in cooperation with a receiver-MTP
  2387.       process.  A local language may be used in the user interface
  2388.       command/reply dialogue.  The sender-MTP initiates the transport
  2389.       service connection.  It initiates MTP commands, receives replies,
  2390.       and governs the transfer of mail.
  2391.  
  2392.    transmission channel
  2393.  
  2394.       A full-duplex communication path between a sender-MTP and a
  2395.       receiver-MTP for the exchange of commands, replies, and mail text.
  2396.  
  2397.    transport service
  2398.  
  2399.       Any reliable stream-oriented data communication services.  For
  2400.       example, NCP, TCP, NITS.
  2401.  
  2402.    user
  2403.  
  2404.       A human being (or a process on behalf of a human being) wishing to
  2405.       obtain mail transfer service.  In addition, a recipient of
  2406.       computer mail.
  2407.  
  2408.    word
  2409.  
  2410.       A human being (or a process on behalf of a human being) wishing to
  2411.       obtain mail transfer service.  In addition, a recipient of
  2412.       computer mail.
  2413.  
  2414.    <CRLF>
  2415.  
  2416.       The characters carriage return and line feed (in that order).
  2417.  
  2418.  
  2419.  
  2420.  
  2421.  
  2422.  
  2423.  
  2424. [Page 40]                                               Sluizer & Postel
  2425.  
  2426.  
  2427.                                                                         
  2428. RFC 780                                                         May 1981
  2429.                                                   Mail Transfer Protocol
  2430.  
  2431.  
  2432.  
  2433.    <SP>
  2434.  
  2435.       The space character.
  2436.  
  2437.  
  2438.  
  2439.  
  2440.  
  2441.  
  2442.  
  2443.  
  2444.  
  2445.  
  2446.  
  2447.  
  2448.  
  2449.  
  2450.  
  2451.  
  2452.  
  2453.  
  2454.  
  2455.  
  2456.  
  2457.  
  2458.  
  2459.  
  2460.  
  2461.  
  2462.  
  2463.  
  2464.  
  2465.  
  2466.  
  2467.  
  2468.  
  2469.  
  2470.  
  2471.  
  2472.  
  2473.  
  2474.  
  2475.  
  2476.  
  2477.  
  2478.  
  2479.  
  2480.  
  2481.  
  2482. Sluizer & Postel                                               [Page 41]
  2483.  
  2484.  
  2485.                                                                         
  2486. May 1981                                                         RFC 780
  2487. Mail Transfer Protocol                                                  
  2488.  
  2489.  
  2490.  
  2491. REFERENCES
  2492.  
  2493.    [1]  TCP
  2494.  
  2495.       Postel, J., ed., "DOD Standard Transmission Control Protocol",
  2496.       IEN 129, RFC 761, USC/Information Sciences Institute,
  2497.       NTIS ADA082609, January 1980.  Appears in: Computer Communication
  2498.       Review, Special Interest Group on Data Communications, ACM, V.10,
  2499.       N.4, October 1980.
  2500.  
  2501.    [2]  NCP
  2502.  
  2503.       McKenzie,A., "Host/Host Protocol for the ARPA Network", NIC 8246,
  2504.       January 1972.  Also in:  Feinler, E. and J. Postel, eds., "ARPANET
  2505.       Protocol Handbook", NIC 7104, for the Defense Communications
  2506.       Agency by SRI International, Menlo Park, California, Revised
  2507.       January 1978.
  2508.  
  2509.    [3]  Initial Connection Protocol
  2510.  
  2511.       Postel, J., "Official Initial Connection Protocol", NIC 7101,
  2512.       11 June 1971.  Also in:  Feinler, E. and J. Postel, eds., "ARPANET
  2513.       Protocol Handbook", NIC 7104, for the Defense Communications
  2514.       Agency by SRI International, Menlo Park, California, Revised
  2515.       January 1978.
  2516.  
  2517.    [4]  NITS
  2518.  
  2519.       PSS/SG3, "A Network Independent Transport Service", Study Group 3,
  2520.       The Post Office PSS Users Group, February 1980.  Available from
  2521.       the DCPU, National Physical Laboratory, Teddington, UK.
  2522.  
  2523.    [5]  X.25
  2524.  
  2525.       CCITT, "Recommendation X.25 - Interface Between Data Terminal
  2526.       Equipment (DTE) and Data Circuit-terminating Equipment (DCE) for
  2527.       Terminals Operating in the Packet Mode on Public Data Networks,"
  2528.       CCITT Orange Book, Vol. VIII.2, International Telephone and
  2529.       Telegraph Consultative Committee, Geneva, 1976.
  2530.  
  2531.  
  2532.  
  2533.  
  2534.  
  2535.  
  2536.  
  2537.  
  2538.  
  2539.  
  2540. [Page 42]                                               Sluizer & Postel
  2541.  
  2542.  
  2543.                                                                         
  2544. RFC 780                                                         May 1981
  2545.                                                   Mail Transfer Protocol
  2546.  
  2547.  
  2548.  
  2549.    [6]  ASCII
  2550.  
  2551.       ASCII, "USA Code for Information Interchange", United States of
  2552.       America Standards Institute, X3.4, 1968.  Also in:  Feinler, E.
  2553.       and J. Postel, eds., "ARPANET Protocol Handbook", NIC 7104, for
  2554.       the Defense Communications Agency by SRI International, Menlo
  2555.       Park, California, Revised January 1978.
  2556.  
  2557.    [7]  RFC 733
  2558.  
  2559.       Crocker, D., J. Vittal, K. Pogran, and D. Henderson, "Standard for
  2560.       the Format of ARPA Network Text Messages," RFC 733, NIC 41952,
  2561.       November 1977.  Also in:  Feinler, E. and J. Postel, eds.,
  2562.       "ARPANET Protocol Handbook", NIC 7104, for the Defense
  2563.       Communications Agency by SRI International, Menlo Park,
  2564.       California, Revised January 1978.
  2565.  
  2566.          
  2567.  
  2568.  
  2569.  
  2570.  
  2571.  
  2572.  
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578.  
  2579.  
  2580.  
  2581.  
  2582.  
  2583.  
  2584.  
  2585.  
  2586.  
  2587.  
  2588.  
  2589.  
  2590.  
  2591.  
  2592.  
  2593.  
  2594.  
  2595.  
  2596.  
  2597.  
  2598. Sluizer & Postel                                               [Page 43]
  2599.  
  2600.