rfc821 (3 of 8)

ron at brl-adm.UUCP ron at brl-adm.UUCP
Mon May 19 14:00:13 AEST 1986



                                                                        
RFC 821                                                      August 1982
                                           Simple Mail Transfer Protocol



   3.7.  DOMAINS

      Domains are a recently introduced concept in the ARPA Internet
      mail system.  The use of domains changes the address space from a
      flat global space of simple character string host names to a
      hierarchically structured rooted tree of global addresses.  The
      host name is replaced by a domain and host designator which is a
      sequence of domain element strings separated by periods with the
      understanding that the domain elements are ordered from the most
      specific to the most general.

      For example, "USC-ISIF.ARPA", "Fred.Cambridge.UK", and
      "PC7.LCS.MIT.ARPA" might be host-and-domain identifiers.

      Whenever domain names are used in SMTP only the official names are
      used, the use of nicknames or aliases is not allowed.

































Postel                                                         [Page 17]


                                                                        
August 1982                                                      RFC 821
Simple Mail Transfer Protocol                                           



   3.8.  CHANGING ROLES

      The TURN command may be used to reverse the roles of the two
      programs communicating over the transmission channel.

      If program-A is currently the sender-SMTP and it sends the TURN
      command and receives an ok reply (250) then program-A becomes the
      receiver-SMTP.

      If program-B is currently the receiver-SMTP and it receives the
      TURN command and sends an ok reply (250) then program-B becomes
      the sender-SMTP.

      To refuse to change roles the receiver sends the 502 reply.

      Please note that this command is optional.  It would not normally
      be used in situations where the transmission channel is TCP.
      However, when the cost of establishing the transmission channel is
      high, this command may be quite useful.  For example, this command
      may be useful in supporting be mail exchange using the public
      switched telephone system as a transmission channel, especially if
      some hosts poll other hosts for mail exchanges.



























[Page 18]                                                         Postel


                                                                        
RFC 821                                                      August 1982
                                           Simple Mail Transfer Protocol



4.  THE SMTP SPECIFICATIONS

   4.1.  SMTP COMMANDS

      4.1.1.  COMMAND SEMANTICS

         The SMTP commands define the mail transfer or the mail system
         function requested by the user.  SMTP commands are character
         strings terminated by <CRLF>.  The command codes themselves are
         alphabetic characters terminated by <SP> if parameters follow
         and <CRLF> otherwise.  The syntax of mailboxes must conform to
         receiver site conventions.  The SMTP commands are discussed
         below.  The SMTP replies are discussed in the Section 4.2.

         A mail transaction involves several data objects which are
         communicated as arguments to different commands.  The
         reverse-path is the argument of the MAIL command, the
         forward-path is the argument of the RCPT command, and the mail
         data is the argument of the DATA command.  These arguments or
         data objects must be transmitted and held pending the
         confirmation communicated by the end of mail data indication
         which finalizes the transaction.  The model for this is that
         distinct buffers are provided to hold the types of data
         objects, that is, there is a reverse-path buffer, a
         forward-path buffer, and a mail data buffer.  Specific commands
         cause information to be appended to a specific buffer, or cause
         one or more buffers to be cleared.

         HELLO (HELO)

            This command is used to identify the sender-SMTP to the
            receiver-SMTP.  The argument field contains the host name of
            the sender-SMTP.

            The receiver-SMTP identifies itself to the sender-SMTP in
            the connection greeting reply, and in the response to this
            command.

            This command and an OK reply to it confirm that both the
            sender-SMTP and the receiver-SMTP are in the initial state,
            that is, there is no transaction in progress and all state
            tables and buffers are cleared.







Postel                                                         [Page 19]


                                                                        
August 1982                                                      RFC 821
Simple Mail Transfer Protocol                                           



         MAIL (MAIL)

            This command is used to initiate a mail transaction in which
            the mail data is delivered to one or more mailboxes.  The
            argument field contains a reverse-path.

            The reverse-path consists of an optional list of hosts and
            the sender mailbox.  When the list of hosts is present, it
            is a "reverse" source route and indicates that the mail was
            relayed through each host on the list (the first host in the
            list was the most recent relay).  This list is used as a
            source route to return non-delivery notices to the sender.
            As each relay host adds itself to the beginning of the list,
            it must use its name as known in the IPCE to which it is
            relaying the mail rather than the IPCE from which the mail
            came (if they are different).  In some types of error
            reporting messages (for example, undeliverable mail
            notifications) the reverse-path may be null (see Example 7).

            This command clears the reverse-path buffer, the
            forward-path buffer, and the mail data buffer; and inserts
            the reverse-path information from this command into the
            reverse-path buffer.

         RECIPIENT (RCPT)

            This command is used to identify an individual recipient of
            the mail data; multiple recipients are specified by multiple
            use of this command.

            The forward-path consists of an optional list of hosts and a
            required destination mailbox.  When the list of hosts is
            present, it is a source route and indicates that the mail
            must be relayed to the next host on the list.  If the
            receiver-SMTP does not implement the relay function it may
            user the same reply it would for an unknown local user
            (550).

            When mail is relayed, the relay host must remove itself from
            the beginning forward-path and put itself at the beginning
            of the reverse-path.  When mail reaches its ultimate
            destination (the forward-path contains only a destination
            mailbox), the receiver-SMTP inserts it into the destination
            mailbox in accordance with its host mail conventions.





[Page 20]                                                         Postel


                                                                        
RFC 821                                                      August 1982
                                           Simple Mail Transfer Protocol



               For example, mail received at relay host A with arguments

                  FROM:<USERX at HOSTY.ARPA>
                  TO:<@HOSTA.ARPA, at HOSTB.ARPA:USERC at HOSTD.ARPA>

               will be relayed on to host B with arguments

                  FROM:<@HOSTA.ARPA:USERX at HOSTY.ARPA>
                  TO:<@HOSTB.ARPA:USERC at HOSTD.ARPA>.

            This command causes its forward-path argument to be appended
            to the forward-path buffer.

         DATA (DATA)

            The receiver treats the lines following the command as mail
            data from the sender.  This command causes the mail data
            from this command to be appended to the mail data buffer.
            The mail data may contain any of the 128 ASCII character
            codes.

            The mail data is terminated by a line containing only a
            period, that is the character sequence "<CRLF>.<CRLF>" (see
            Section 4.5.2 on Transparency).  This is the end of mail
            data indication.

            The end of mail data indication requires that the receiver
            must now process the stored mail transaction information.
            This processing consumes the information in the reverse-path
            buffer, the forward-path buffer, and the mail data buffer,
            and on the completion of this command these buffers are
            cleared.  If the processing is successful the receiver must
            send an OK reply.  If the processing fails completely the
            receiver must send a failure reply.

            When the receiver-SMTP accepts a message either for relaying
            or for final delivery it inserts at the beginning of the
            mail data a time stamp line.  The time stamp line indicates
            the identity of the host that sent the message, and the
            identity of the host that received the message (and is
            inserting this time stamp), and the date and time the
            message was received.  Relayed messages will have multiple
            time stamp lines.

            When the receiver-SMTP makes the "final delivery" of a
            message it inserts at the beginning of the mail data a



Postel                                                         [Page 21]


                                                                        
August 1982                                                      RFC 821
Simple Mail Transfer Protocol                                           



            return path line.  The return path line preserves the
            information in the <reverse-path> from the MAIL command.
            Here, final delivery means the message leaves the SMTP
            world.  Normally, this would mean it has been delivered to
            the destination user, but in some cases it may be further
            processed and transmitted by another mail system.

               It is possible for the mailbox in the return path be
               different from the actual sender's mailbox, for example,
               if error responses are to be delivered a special error
               handling mailbox rather than the message senders.

            The preceding two paragraphs imply that the final mail data
            will begin with a  return path line, followed by one or more
            time stamp lines.  These lines will be followed by the mail
            data header and body [2].  See Example 8.

            Special mention is needed of the response and further action
            required when the processing following the end of mail data
            indication is partially successful.  This could arise if
            after accepting several recipients and the mail data, the
            receiver-SMTP finds that the mail data can be successfully
            delivered to some of the recipients, but it cannot be to
            others (for example, due to mailbox space allocation
            problems).  In such a situation, the response to the DATA
            command must be an OK reply.  But, the receiver-SMTP must
            compose and send an "undeliverable mail" notification
            message to the originator of the message.  Either a single
            notification which lists all of the recipients that failed
            to get the message, or separate notification messages must
            be sent for each failed recipient (see Example 7).  All
            undeliverable mail notification messages are sent using the
            MAIL command (even if they result from processing a SEND,
            SOML, or SAML command).















[Page 22]                                                         Postel


                                                                        
RFC 821                                                      August 1982
                                           Simple Mail Transfer Protocol



     -------------------------------------------------------------

            Example of Return Path and Received Time Stamps

      Return-Path: <@GHI.ARPA, at DEF.ARPA, at ABC.ARPA:JOE at ABC.ARPA>   
      Received: from GHI.ARPA by JKL.ARPA ; 27 Oct 81 15:27:39 PST
      Received: from DEF.ARPA by GHI.ARPA ; 27 Oct 81 15:15:13 PST
      Received: from ABC.ARPA by DEF.ARPA ; 27 Oct 81 15:01:59 PST
      Date: 27 Oct 81 15:01:01 PST                                
      From: JOE at ABC.ARPA                                          
      Subject: Improved Mailing System Installed                  
      To: SAM at JKL.ARPA                                            
                                    
      This is to inform you that ...                              

                               Example 8

     -------------------------------------------------------------

         SEND (SEND)

            This command is used to initiate a mail transaction in which
            the mail data is delivered to one or more terminals.  The
            argument field contains a reverse-path.  This command is
            successful if the message is delivered to a terminal.

            The reverse-path consists of an optional list of hosts and
            the sender mailbox.  When the list of hosts is present, it
            is a "reverse" source route and indicates that the mail was
            relayed through each host on the list (the first host in the
            list was the most recent relay).  This list is used as a
            source route to return non-delivery notices to the sender.
            As each relay host adds itself to the beginning of the list,
            it must use its name as known in the IPCE to which it is
            relaying the mail rather than the IPCE from which the mail
            came (if they are different).

            This command clears the reverse-path buffer, the
            forward-path buffer, and the mail data buffer; and inserts
            the reverse-path information from this command into the
            reverse-path buffer.

         SEND OR MAIL (SOML)

            This command is used to initiate a mail transaction in which
            the mail data is delivered to one or more terminals or



Postel                                                         [Page 23]


                                                                        
August 1982                                                      RFC 821
Simple Mail Transfer Protocol                                           



            mailboxes. For each recipient the mail data is delivered to
            the recipient's terminal if the recipient is active on the
            host (and accepting terminal messages), otherwise to the
            recipient's mailbox.  The argument field contains a
            reverse-path.  This command is successful if the message is
            delivered to a terminal or the mailbox.

            The reverse-path consists of an optional list of hosts and
            the sender mailbox.  When the list of hosts is present, it
            is a "reverse" source route and indicates that the mail was
            relayed through each host on the list (the first host in the
            list was the most recent relay).  This list is used as a
            source route to return non-delivery notices to the sender.
            As each relay host adds itself to the beginning of the list,
            it must use its name as known in the IPCE to which it is
            relaying the mail rather than the IPCE from which the mail
            came (if they are different).

            This command clears the reverse-path buffer, the
            forward-path buffer, and the mail data buffer; and inserts
            the reverse-path information from this command into the
            reverse-path buffer.

         SEND AND MAIL (SAML)

            This command is used to initiate a mail transaction in which
            the mail data is delivered to one or more terminals and
            mailboxes. For each recipient the mail data is delivered to
            the recipient's terminal if the recipient is active on the
            host (and accepting terminal messages), and for all
            recipients to the recipient's mailbox.  The argument field
            contains a reverse-path.  This command is successful if the
            message is delivered to the mailbox.

            The reverse-path consists of an optional list of hosts and
            the sender mailbox.  When the list of hosts is present, it
            is a "reverse" source route and indicates that the mail was
            relayed through each host on the list (the first host in the
            list was the most recent relay).  This list is used as a
            source route to return non-delivery notices to the sender.
            As each relay host adds itself to the beginning of the list,
            it must use its name as known in the IPCE to which it is
            relaying the mail rather than the IPCE from which the mail
            came (if they are different).

            This command clears the reverse-path buffer, the



[Page 24]                                                         Postel


                                                                        
RFC 821                                                      August 1982
                                           Simple Mail Transfer Protocol



            forward-path buffer, and the mail data buffer; and inserts
            the reverse-path information from this command into the
            reverse-path buffer.

         RESET (RSET)

            This command specifies that the current mail transaction is
            to be aborted.  Any stored sender, recipients, and mail data
            must be discarded, and all buffers and state tables cleared.
            The receiver must send an OK reply.

         VERIFY (VRFY)

            This command asks the receiver to confirm that the argument
            identifies a user.  If it is a user name, the full name of
            the user (if known) and the fully specified mailbox are
            returned.

            This command has no effect on any of the reverse-path
            buffer, the forward-path buffer, or the mail data buffer.

         EXPAND (EXPN)

            This command asks the receiver to confirm that the argument
            identifies a mailing list, and if so, to return the
            membership of that list.  The full name of the users (if
            known) and the fully specified mailboxes are returned in a
            multiline reply.

            This command has no effect on any of the reverse-path
            buffer, the forward-path buffer, or the mail data buffer.

         HELP (HELP)

            This command causes the receiver to send helpful information
            to the sender of the HELP command.  The command may take an
            argument (e.g., any command name) and return more specific
            information as a response.

            This command has no effect on any of the reverse-path
            buffer, the forward-path buffer, or the mail data buffer.








Postel                                                         [Page 25]


                                                                        
August 1982                                                      RFC 821
Simple Mail Transfer Protocol                                           



         NOOP (NOOP)

            This command does not affect any parameters or previously
            entered commands.  It specifies no action other than that
            the receiver send an OK reply.

            This command has no effect on any of the reverse-path
            buffer, the forward-path buffer, or the mail data buffer.

         QUIT (QUIT)

            This command specifies that the receiver must send an OK
            reply, and then close the transmission channel.

            The receiver should not close the transmission channel until
            it receives and replies to a QUIT command (even if there was
            an error).  The sender should not close the transmission
            channel until it send a QUIT command and receives the reply
            (even if there was an error response to a previous command).
            If the connection is closed prematurely the receiver should
            act as if a RSET command had been received (canceling any
            pending transaction, but not undoing any previously
            completed transaction), the sender should act as if the
            command or transaction in progress had received a temporary
            error (4xx).

         TURN (TURN)

            This command specifies that the receiver must either (1)
            send an OK reply and then take on the role of the
            sender-SMTP, or (2) send a refusal reply and retain the role
            of the receiver-SMTP.

            If program-A is currently the sender-SMTP and it sends the
            TURN command and receives an OK reply (250) then program-A
            becomes the receiver-SMTP.  Program-A is then in the initial
            state as if the transmission channel just opened, and it
            then sends the 220 service ready greeting.

            If program-B is currently the receiver-SMTP and it receives
            the TURN command and sends an OK reply (250) then program-B
            becomes the sender-SMTP.  Program-B is then in the initial
            state as if the transmission channel just opened, and it
            then expects to receive the 220 service ready greeting.

            To refuse to change roles the receiver sends the 502 reply.



[Page 26]                                                         Postel




More information about the Mod.sources.doc mailing list