<!DOCTYPE rfc [
  <!ENTITY nbsp    "&#160;">
  <!ENTITY zwsp   "&#8203;">
  <!ENTITY nbhy   "&#8209;">
  <!ENTITY wj     "&#8288;">
  ]>

  <!-- RFC Editor: All tracking comments have been removed from this
    I-D version, just as I did for RFCs 2821 and 5321.  The comments
	that remain are those in this header/ directive section, notes to
	you, and ones with section numbers or related information to make
	navigating the document while editing easier.  Feel free to remove
	those or check and retain them as you prefer.  Please contact me
    with any questions or issues.  -john
  -->

<?rfc toc='yes' ?>
<!-- Symrefs no means reference numbers, yes is anchors -->
<?rfc symrefs='no' ?>
<?rfc sortrefs='yes'?>
<?rfc linkmailto='no'?>
<?rfc rfcedstyle="yes"?>
<?rfc subcompact="no" ?>
<!-- Expand crefs and put them inline -->
<?rfc comments='yes' ?>
<?rfc inline='yes' ?>
<?rfc consensus="true" ?>
<?rfc-ext parse-xml-in-artwork='yes' ?>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>


<!-- RFC Editor: This version is a pruned form of rfc5321bis-43a (never posted)
     with the tracking comments that go back to the preparation of
     what became RFC 2821 removed.  Retained in tracking archive as
     rfc5321bis-43rpc.xml.  No action on your part required -->


<rfc xmlns:xi="http://www.w3.org/2001/XInclude" ipr="trust200902"
     docName="draft-ietf-emailcore-rfc5321bis-43"
     obsoletes="5321, 1846, 7504, 7505"
     updates=""
     submissionType="IETF"  category="std"
     xml:lang="en" tocInclude="true"
      symRefs="false" sortRefs="true" version="3" consensus="true" >
   <!-- WARNING: if docName is changed here, seriesInfo a few lines
      below also needs to be changed -->

   <!-- xml2rfc v2v3 conversion 3.10.0 -->
  <front>
    <title abbrev="SMTP">Simple Mail Transfer Protocol</title>
    <seriesInfo name="Internet-Draft" value="draft-ietf-emailcore-rfc5321bis-43"/>
    <author initials="J." surname="Klensin" fullname="John C. Klensin">
      <organization/>
      <address>
        <postal>
          <street>1770 Massachusetts Ave, Suite 322</street>
          <city>Cambridge</city>
          <region>MA</region>
          <code>02140</code>
          <country>USA</country>
        </postal>
        <email>john-ietf@jck.com</email>
      </address>
    </author>
    <date month="April" day="28" year="2025"/>
    <area> ART </area>
    <workgroup> EMAILCORE </workgroup>
    <keyword>SMTP</keyword>
    <keyword>ESMTP</keyword>
    <keyword>Email</keyword>
    <keyword>MTA</keyword>

    <abstract>
      <t> This document is a specification of the
    basic protocol for Internet electronic mail transport.  It
    (including text carried forward from RFC 5321) consolidates,
    updates, and clarifies several previous documents, making all or parts
    of most of them obsolete.  It covers the SMTP extension mechanisms and
    best practices for the contemporary Internet, but does not provide details
    about particular extensions.
    The document also provides information about use of SMTP for
    other than strict mail transport and delivery.

    This document replaces RFC 5321, the earlier version with the
    same title, and supersedes RFCs 1846, 7504, and 7505,
    incorporating all the relevant information in them.
      </t>
    </abstract>

	
  </front>

  <middle>
    <section anchor="intro" numbered="true" toc="default">
      <name>Introduction</name>
      <!-- 1 -->


      <section anchor="MailTransport" numbered="true" toc="default">
        <name>Transport of Electronic Mail</name>
        <!-- 1.1 -->
        <t>
      The objective of the Simple Mail Transfer Protocol (SMTP) is to transfer
      mail reliably and efficiently.
        </t>
        <t>
      SMTP is independent of the particular transmission subsystem and requires
      only a reliable ordered data stream channel.  While this document specifically
      discusses transport over TCP, other transports are possible.  Appendices
      to <xref target="RFC0821" format="default">RFC 821</xref> describe some of them.
        </t>
        <t>
      An important feature of SMTP is its capability to transport mail across
      multiple networks, usually referred to as "SMTP mail relaying" (see
      <xref target="relaying" format="default"/>).  A network
      consists of the mutually-TCP-accessible
      hosts on the public Internet, the mutually-TCP-accessible hosts on a
      firewall-isolated TCP/IP Intranet
      <xref target="RFC2979" format="default"/>
      or hosts in some other LAN or WAN
      environment utilizing a non-TCP transport-level protocol.  Using SMTP,
      a process can transfer mail to another process on the same network or
      to some other network via a relay or gateway process accessible to both networks.
        </t>
        <t>
      In this way, a mail message may pass through a number of intermediate
      relay or gateway hosts on its path from sender to ultimate recipient.
      The Mail eXchanger mechanisms of the domain name system
      (<xref target="RFC1035" format="default">RFC 1035</xref>,
      <xref target="RFC0974" format="default">RFC 974</xref>,
      and <xref target="address_resolution" format="default"/>
      of this document) are used to identify the appropriate next-hop destination
      for a message being transported.
        </t>
      </section>
      <!-- end 1.1 -->
      <section anchor="HistoryContext" numbered="true" toc="default">
        <name>History and Context for This Document</name>
        <!-- 1.2 -->
        <t>This Internet Standard specification contains material,
           in many cases including copied exact text, from several
           documents including some
           dating back to <xref target="RFC0821">RFC 821</xref>,
           published over forty years ago.  While most of the early features
              are unchanged, others have been updated or enhanced.
              This section summarizes the relationship of the present
              specification to earlier ones leading up to the very similar
              <xref target="RFC5321">RFC 5321</xref> of October 2008.
              Changes between RFC 5321 and &lt;&lt;This
              Document&gt;&gt; appear in
			  <xref target="I-ChangeSummary"/>.
		</t>
		<t>  This document provides the
      specification of the basic protocol
      for Internet electronic mail transport.  It consolidates, updates
      and clarifies, but does not add new or change existing functionality
      of the following:
        </t>
        <ul spacing="normal">
          <li>the original SMTP (Simple Mail Transfer Protocol) specification
           of <xref target="RFC0821" format="default">RFC 821</xref>,
        </li>
          <li>domain name system requirements and implications for mail transport
           from <xref target="RFC1035" format="default">RFC 1035</xref> and
           <xref target="RFC0974" format="default">RFC 974</xref>,
          </li>
          <li>the clarifications and applicability statements in
           <xref target="RFC1123" format="default">RFC 1123</xref>,</li>
          <li>the new error codes added
           by <xref target="RFC1846" format="default">RFC 1846</xref>
           and later by <xref target="RFC7504" format="default">RFC 7504</xref>,
           obsoleting both of those documents, and</li>
          <li>material drawn from the SMTP Extension mechanisms in
           <xref target="RFC1869" format="default">RFC 1869</xref>.
        </li>
        </ul>
        <t>It also includes editorial, clarification, and correction changes
       that were made to <xref target="RFC2821" format="default">RFC 2821</xref>
       to bring that specification to Draft Standard and similar
       changes to <xref target="RFC5321" format="default">RFC 5321</xref> to bring the
       current document to Internet Standard as well as changes to the
       description and specification of IANA registries to align with
       contemporary practice and thinking.</t>
        <t> It may help the reader to understand that, to reduce the risk
       of introducing errors, large parts of the document essentially
       merge the earlier specifications listed in the bullet points
       above rather than providing a completely rewritten,
       reorganized, and integrated description of SMTP.  That
	   strategy,
       and the consequent document organization, had IETF consensus at
       the time RFC 2821 was written.  An index and additional
       cross-references are provided to assist in the quest for information.</t>
    <t>This document obsoletes RFCs 5321 <xref target="RFC5321" format="default"/> (the earlier
       version of this specification),
       <xref target="RFC1846" format="default">1846</xref> and incorporates the
       substance of
       <xref target="RFC7504" format="default">7504</xref> (specification of reply
       codes), and <xref target="RFC7505" format="default">7505</xref> (the "Null MX"
	   specification).

	   Although SMTP was designed as a mail transport and delivery protocol,
      this specification also contains information that is relevant to its
      optional use for submission of mail by users and to some aspects
      of the Post Office Protocol (POP) (<xref target="RFC0937" format="default">RFC 937</xref>,
      <xref target="RFC1939" format="default">RFC 1939</xref>) and
      IMAP (<xref target="RFC9051" format="default">RFC 9051</xref>)
      protocols.
      <iref item="Message Submission" subitem="Pointer to RFC 6409" primary="false"/>
      In general, the separate mail submission protocol specified
      in <xref target="RFC6409" format="default">RFC 6409</xref>
      is now preferred to direct use of
         SMTP for that function;
         more discussion of that subject appears in that document. </t>
	  <t> <xref target="terminology" format="default"/>
		 provides definitions of terms specific
		 to this document. Except when the historical terminology is necessary
		 for clarity, this document uses the current 'client' and 'server' terminology
		 to identify the sending and receiving SMTP processes,
		 respectively.

		 In general, "sender-SMTP" and "SMTP client" are equivalent as
		 are "receiver-SMTP" and "SMTP server".
	  </t>
	  </section>

	  <section anchor="RelatedDocuments" numbered="true" toc="default">
        <name>Related Documents</name>  <!-- new 1.3 -->
      <t>A companion document, <xref target="rfc5322bis"
      format="default">rfc5322bis</xref>, discusses
      message header sections
      and bodies and specifies formats and structures for them.
		</t>
		<t>Partially because of its origins as discussed earlier in
		   this section, this document is narrowly focused on the
		   SMTP protocol and does not discuss the many extensions to
		   SMTP (an IANA registry provides the current list of such
		   extensions <xref target="SMTPExtIANARegistry"/>) or
		   associated protocols expected to be used with it.  In
		   particular, SMTP was designed to transmit messages in clear
		   text --specifically without consideration of the
		   contents of messages other that the specific mail headers
		   it adds (see <xref target="trace_information"/>) even
		   though part of all of the message body may be encrypted
		   before the message enters the SMTP system -- with
		   the consequence that, in general, protection of messages
		   from surveillance in transit requires extensions or
		   supplemental protocols.  Particularly important extensions
		   and supplemental protocols, including ones intended to
		   address those security issues, are discussed in a
		   forthcoming companion document, referred to as the email
		   Applicability Statement <xref target="Emailcore-AS"/>.
		   That document also provides additional discussion of
		   security considerations surrounding the use of SMTP as well
		   as discussion of other relevant documents. </t>
      </section>
	  <!-- end 1.3 -->
	  

      <section numbered="true" toc="default">
        <name>Document Conventions</name>
        <!-- 1.4 (was 1.5 and 1.3) -->
        <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
           NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED",  "MAY", and
           "OPTIONAL" in this document are to be interpreted as
		   described in BCP 14
           <xref target="RFC2119" format="default">RFC 2119</xref> and
		   <xref target="RFC8174" format="default">RFC 8174</xref>
		   when, and only when, they appear in all capitals, as shown here.
           As each of these
           terms was intentionally and carefully chosen to improve
           the interoperability of email, each use of these terms is
           to be treated as a conformance requirement.
        </t>
 
        <t>This document has a long history.  To avoid
            the risk of various errors and of confusing readers and
            documents that point to this one, most examples and the
            domain names they contain are preserved from RFC 2821.
            Readers are cautioned that these are illustrative
            examples that should not actually be used in either
            code or configuration files.
			In particular, some of those examples use variations on
			"foo", a convention explained in
			<xref target="RFC3092">RFC 3092</xref>. 
        </t>
      </section>
    </section>
    <!-- 1 -->

    <section anchor="SMTPModel" numbered="true" toc="default">
      <name>The SMTP Model</name>
      <!-- 2 -->

      <section anchor="basic_structure" numbered="true" toc="default">
        <name>Basic Structure</name>
        <!-- 2.1 -->
        <t>
      The SMTP design can be pictured as:
        </t>
        <artwork name="" type="" align="left" alt=""><![CDATA[
                +----------+            +----------+
   +------+     |          |            |          |    +------+
   | User |<--> |          |   SMTP     |          |<-->| File |
   +------+     |  Client- |Commands/   | Server-  |    |System|
   +------+     |   SMTP   |  Replies   |    SMTP  |    +------+
   | File |<--> |          |<---------->|          | or
   |System|     |          |  and Mail  |          |    +------+
   +------+     |          |            |          |    |Next- |
                |          |            |          |    |   hop|
   +-------+    |          |            |          |<-->|SMTP  |
   |Submis-|<-->|          |            |          |    |client|
   |   sion|    +----------+            +----------+    +------+
   |System |
   +-------+     SMTP client            SMTP server
                  (sender)               (receiver)
   ]]></artwork>
        <t>
      When an SMTP client has a message to transmit, it establishes a two-
      way transmission channel to an SMTP server.  The responsibility of an
      SMTP client is to transfer mail messages to one or more SMTP servers,
      or report its failure to do so.
        </t>
        <t>
      The means by which a mail message is presented to an SMTP client
      (i.e., between the first two columns above), and
      how that client determines the identifier(s) ("names") of the
      domain(s) to which mail messages
      are to be transferred, are local matters.  They are not addressed by this
      document.  In some cases, the designated domain(s), or those determined
      by an SMTP client, will identify the final destination(s) of the mail
      message.  In other cases, common with SMTP clients associated
      with implementations
      of the POP (<xref target="RFC0937" format="default">RFC 937</xref>,
      <xref target="RFC1939" format="default">RFC 1939</xref>)
      or
      IMAP (<xref target="RFC9051" format="default">RFC 9051</xref>)
      protocols, or when the
      SMTP client is inside an isolated transport service environment, the
      domain determined will identify an intermediate destination through
      which all mail messages are to be relayed.  SMTP clients that transfer
      all traffic regardless of the target domains associated with the
      individual messages, or that do not maintain queues for retrying message
      transmissions that initially cannot be completed, may otherwise conform
      to this specification but are not considered fully-capable.
      Fully-capable
      SMTP implementations, including the relays used by these less capable
      ones, and their destinations, are expected to support all of the queuing,
      retrying, and alternate address functions discussed in this
      specification.
      In many situations and configurations, the less-capable clients
      discussed above SHOULD be using the message submission protocol
      (<xref target="RFC6409" format="default">RFC 6409</xref>)
      <iref item="Message Submission" subitem="Pointer to RFC 6409"
         primary="false"/>
      rather than SMTP.
        </t>
        <t> The means by which an SMTP client, once it has determined a
      target domain, determines the identity of an SMTP server to which a copy of a
      message is to be transferred, and then performs that transfer,
      are covered
      by this document.  To effect a mail transfer to an SMTP server, an SMTP
      client establishes a two-way transmission channel to that SMTP server.
      An SMTP client determines the address of an appropriate host running
      an SMTP server by resolving a destination domain name to either an intermediate
      Mail eXchanger host or a final target host.
        </t>
        <t>
      An SMTP server may be either the ultimate destination or an intermediate
      "relay" (that is, it may assume the role of an SMTP client after receiving
      the message) or "gateway" (that is, it may transport the message further
      using some protocol other than SMTP). SMTP commands are generated by
      the SMTP client and sent to the SMTP server.  SMTP replies are sent
      from the SMTP server to the SMTP client in response to the commands.
        </t>
        <t>
      In other words, message transfer can occur in a single connection between
      the original SMTP-sender and the final SMTP-recipient, or can occur
      in a series of hops through intermediary systems.
      In either case, once the server has issued a success response at
      the end of the mail data, a formal handoff of responsibility for
      the message occurs: the protocol requires that a server MUST
      accept responsibility for either delivering the message
      or properly reporting the failure to do so (see Sections
      <xref target="reliable_delivery" format="counter"/>,
      <xref target="unwanted_messages" format="counter"/>, and
      <xref target="resistance_to_attacks" format="counter"/>, below).
        </t>
        <t>
      Once the transmission channel is established and initial handshaking is
      completed, the SMTP client normally initiates a mail transaction. Such
      a transaction consists of a series of commands to specify the originator
      and destination of the mail and transmission of the message content
      (including any lines in the header section
      or other structure) itself.  When the same message
      is sent to multiple recipients, this protocol encourages the transmission
      of only one copy of the data for all recipients at the same destination
      (or intermediate relay) host.
        </t>
        <t>
      The server responds to each command with a reply; replies may indicate
      that the command was accepted, that additional commands are expected,
      or that a temporary or permanent error condition exists.  Commands specifying
      the sender or recipients may include server- permitted SMTP service
      extension requests, as discussed in <xref target="extension_model" format="default"/>.
      The dialog is purposely lock-step, one-at-a-time, although this can
      be modified by mutually agreed upon extension requests such as command pipelining
      (<xref target="RFC2920" format="default">RFC 2920</xref>).
        </t>
        <t>
      Once a given mail message has been transmitted, the client may either
      request that the connection be shut down or may initiate other mail
      transactions.  In addition, an SMTP client may use a connection to an
      SMTP server for ancillary services such as verification of email addresses
      or retrieval of mailing list subscriber addresses.
        </t>
        <t>
      As discussed above, this protocol provides mechanisms for the transmission
      of mail.  Historically, this transmission normally occurred directly
      from the sending user's host to the receiving user's host when the two
      hosts are connected to the same transport service. When they are not
      connected to the same transport service
      or other circumstances dictate,
      transmission occurs via one
      or more relay SMTP servers.  A very common case in the Internet today
      involves submission of the original message to an intermediate, "message
      submission" server, which is similar to a relay but has some additional
      properties; such servers are discussed in <xref target="ODRGsystems" format="default"/>
      and at some length in
      <xref target="RFC6409" format="default">RFC 6409</xref>.

      An intermediate
      host that acts as either an SMTP relay or as a gateway into some other
      transmission environment is usually selected through the use of the
      domain name service (DNS) Mail eXchanger mechanism.
        </t>
      </section>
      <!-- 2.1 -->

      <section anchor="extension_model" numbered="true" toc="default">
        <name>The Extension Model</name>
        <!-- 2.2 -->
        <section anchor="extension_model_background" numbered="true" toc="default">
          <name>Background</name>
          <!-- 2.2.1 -->
      <t>
        In an effort that started in 1990, approximately a decade after RFC
        821 was completed, the protocol was modified with a "service extensions"
        model that permits the client and server to agree to utilize shared
        functionality beyond the original SMTP requirements
        <xref target="RFC1425"/>. The SMTP extension
        mechanism defines a means whereby an extended SMTP client and server
        may recognize each other, and the server can inform the client as
        to the service extensions that it supports.
          </t>
          <t>
        Contemporary SMTP implementations MUST support the basic extension
        mechanisms.  For instance, servers MUST support the EHLO command even
        if they do not implement any specific extensions and clients SHOULD
        preferentially utilize EHLO rather than HELO.  (However, for compatibility
        with older conforming implementations, SMTP clients and servers MUST
        support the original HELO mechanisms as a fallback.) Unless the different
        characteristics of HELO must be identified for interoperability purposes,
		this document discusses only EHLO.</t>
		<t>
        SMTP is widely deployed and high-quality implementations have proven
        to be very robust.  However, the Internet community now considers
        some services to be important that were not anticipated when the protocol
        was first designed.  If support for those services is to be added,
        it must be done in a way that permits older implementations to continue
        working acceptably.  The extension framework consists of:
          </t>
          <ul spacing="normal">
            <li>
            The SMTP command EHLO, superseding the earlier HELO,
          </li>
            <li>
            a registry of SMTP service extensions,
          </li>
            <li>
            additional parameters to the SMTP MAIL and RCPT commands, and
          </li>
            <li>
            optional replacements for commands defined in this protocol, such
        as for DATA in non-ASCII transmissions
        (<xref target="RFC3030" format="default">RFC 3030</xref>).
          </li>
          </ul>
          <t>
        SMTP's strength comes primarily from its simplicity.  Experience with
        many protocols has shown that protocols with few options tend towards
        ubiquity, whereas protocols with many options tend towards obscurity.
          </t>
		  <t>
			 Each SMTP implementation, as part of deciding whether to
			 implement and support an extension and regardless of the
			 extension's apparent benefits, must carefully 
			 scrutinize it with respect to its implementation,
			 deployment, and interoperability costs.  In many cases,
			 the cost of extending the SMTP service will likely
			 outweigh the benefit. 
          </t>
        </section>
        <!-- end 2.2.1 -->

		<section anchor="definition_of_extensions" numbered="true" toc="default">
          <name>Definition and Registration of Extensions</name>
          <!-- start 2.2.2 -->
          <t>Especially for extensions intended for general use and
             expected to interoperate well with multiple
             implementations,
             a readily-available, stable, and adequate definition is
             essential for those evaluating,
             implementing, or configuring the extension.   The information
             below describes important characteristics of that
             documentation.  In order to make it accessible
             and to prevent naming conflicts, the IANA maintains a
             registry of SMTP service extensions
             <xref target="IANA-Extension-Registry" format="default"/>
             and each service extension must be recorded in that
             registry as specified in
			 <xref target="IANA-ServiceExtensions"/> and below.</t>
          <t> Experience has shown that obtaining thoughtful review
             and input from the broader community produces much
             better results than narrower
             discussions, e.g., only among the designers.   While it
             is usually best to obtain that input prior to
             registration and to do so formally as part of an IETF
             Standards Track specification, there is no requirement
             to do so.  An alternate, simplified, registration
             procedure
             (see <xref target="ExtensionsSimpleRegistration"/>)
             allows extensions to be written and registered that permit
             modifications after
             registration, perhaps even after deployment experience.
             Even when that simplified procedure is used, and although
             it is not required, it will often be useful for the
             submitter or IANA to notify a relevant IETF mailing
             list of the extension request.   Registrants may also
             reach out to selected individuals for advice on the
             specification and how to best obtain additional useful
             input.  Details of the registration process itself and
             two available registration models appear in
             <xref target="IANA-ServiceExtensions"/> below.</t>
          <t>For standards track registrations, the definition and related
             description of the extension will include, not only
             the keyword name and syntax for the service extension and other
             information required for registration, but a detailed
             description of the purpose of the extension, what it is
             expected to accomplish, how its use changes the behavior
             of client and server SMTP implementations that use it,
             and how it interacts with other relevant extensions and
             elements of this specification.  To be of maximum use,
             the alternative procedure should still make that
             information available. </t>

          <t> Any keyword value presented in the EHLO response MUST
            correspond to an SMTP service extension registered with IANA
            as described in <xref target="IANAConsidRegStruct"/>.
            A conforming server MUST NOT offer keyword values that
            are not described in a registered extension.
          </t>
          <t> SMTP Clients MUST ignore any announced extension they do not
             recognize and, if the announcement involves parsing or other problems that
             prevent reliable interpretation of the response to the EHLO
             command, send QUIT and terminate the SMTP session.</t>
        </section>
        <!-- end 2.2.2 -->
        <section numbered="true" toc="default">
          <name>Special Issues with Extensions</name>
          <t> Extensions that change fairly basic
               properties of SMTP operation are permitted.
               The text in other sections
               of this document must be understood in that context.  In
               particular, extensions can change the minimum limits
               specified in <xref target="sizesTimeouts" format="default"/>, can change the
               ASCII character set requirement as mentioned above, or can
               introduce some optional modes of message handling.</t>
          <t>In particular, if an extension implies that the
               delivery path normally supports special features of
               that extension, and an intermediate SMTP system
               finds a next hop that does not support the
               required extension, it MAY choose, based on the
               specific extension and circumstances, to requeue the
               message and try later and/or try an alternate MX
               host.  If this strategy is employed, the
               timeout to fall back to an unextended format (if one is
               available) SHOULD be less than the normal
               timeout for bouncing as undeliverable (e.g., if normal
               timeout is three days, the requeue timeout before
               attempting to transmit the mail without the extension
               might be one day).</t>
        </section>
      </section>
      <!-- 2.2 -->
      <section anchor="terminology" numbered="true" toc="default">
        <name>SMTP Terminology</name>
        <!-- 2.3 -->

        <section anchor="mail_objects" numbered="true" toc="default">
          <name>Mail Objects</name>
          <!-- 2.3.1 -->
          <t><iref item="Terminology" subitem="Mail object" primary="false"/>
        SMTP transports a mail object.  A mail object contains an envelope and content.
          </t>
          <t>
        The SMTP envelope is sent as a series of SMTP protocol units (described
        in <xref target="overview" format="default"/>).  It consists of an originator address
        (to which error reports should be directed), one or more recipient
        addresses, and optional protocol extension material.  Historically,
        variations on the reverse-path (originator) address
        specification command (MAIL)
        could be used to specify alternate delivery modes, such as immediate
        display; those variations have now been deprecated
        (see <xref target="deprecated_features" format="default"/>,
        particularly <xref target="sending_versus_mailing" format="default"/>).</t>
			 <t>The SMTP content is sent in the SMTP DATA protocol
				unit and, except as described below, is restricted
				only to lines of characters from the
				US-ASCII repertoire <xref target="ASCII" format="default"/>
				described in <xref target="lines"/>.
				Uses of SMTP to transmit mail messages on the public
				Internet generally follow a more specific model, with
				the content consisting of two
        parts: the header section 
		and the body.  If the content conforms to the message format
		specification (<xref target="rfc5322bis" format="default">RFC5322bis</xref>),
		the header section consists of a  
        collection of header fields, each consisting of a header name,
		a colon, and data.
		The body, if structured, is defined according to other
		contemporary standards such as
		MIME (<xref target="RFC2045" format="default">RFC 2045</xref>).
		SMTP extensions (such as "8BITMIME",
		<xref target="RFC6152" format="default">RFC 6152</xref>) or
		the replacement for the DATA command specified in
		<xref target="RFC3030">RFC 3030</xref>)
		may relax these restrictions either completely or in a way
		that is specific to the body content.
         Two MIME extensions
        (<xref target="RFC2047" format="default">RFC 2047</xref> and
        <xref target="RFC2231" format="default">RFC 2231</xref>)
        define an algorithm for representing header values outside the US-ASCII
        repertoire, while still encoding them using that repertoire.
          </t>
        </section>
        <!-- 2.3 -->
        <section numbered="true" toc="default">
          <name>Senders and Receivers</name>
          <!-- 2.3.2 -->
          <t><iref item="Terminology" subitem="Senders and Receivers" primary="false"/>
        In RFC 821, the two hosts participating in an SMTP transaction were
        described as the "SMTP-sender" and "SMTP-receiver".  This document
        has been changed to reflect current industry terminology and hence
        refers to them as the "SMTP client" (or sometimes just "the client")
        and "SMTP server" (or just "the server"), respectively.  Since a given
        host may act both as server and client in a relay situation, "receiver"
        and "sender" terminology is still used where needed for clarity.
          </t>
        </section>
        <!-- 2.3.2 -->
        <section numbered="true" toc="default" anchor="mail_agents_and_message">
          <name>Mail Agents and Message Stores</name>
          <!-- 2.3.3 -->
          <t><iref item="Terminology" subitem="Mail Agent" primary="false"/>
             <iref item="Terminology" subitem="Message Store" primary="false"/>
        Additional mail system terminology became common after RFC 821 was
        published and, where convenient, is used in this specification.  In
        particular, SMTP servers and clients provide a mail transport service
        and therefore act as "Mail Transfer Agents" (MTAs).  "Mail User Agents"
        (MUAs or UAs) are normally thought of as the sources and targets of
        mail.  At the source, an MUA might collect mail to be transmitted
        from a user and hand it off to an MTA or, more commonly in
		recent years, a specialized variation of an MTA called a
        "Submission Server" <xref target="RFC6409"/>.
        At the other end of the process, the final ("delivery") MTA
        would be thought of as handing the mail off to an MUA (or at least
        transferring responsibility to it, e.g., by depositing the message
        in a "message store").  However, while these terms are used with at
        least the appearance of great precision in other environments, the
        implied boundaries between MUAs and MTAs often do not accurately match
        common, and conforming, practices with Internet mail.  Hence, the
        reader should be cautious about inferring the strong relationships
        and responsibilities that might be implied if these terms
        were used elsewhere.
          </t>
        </section>
        <!-- 2.3.3 -->
        <section numbered="true" toc="default">
          <name>Host</name>
          <!-- 2.3.4 -->
          <t><iref item="Terminology" subitem="Host" primary="false"/>
        For the purposes of this specification, a host is a computer system
        attached to the Internet (or, in some cases, to a private TCP/IP network)
        and supporting the SMTP protocol.  Hosts are known by names (see the
        next section); they SHOULD NOT be
        identified by numerical addresses, i.e.,
        by address literals as described in
      <xref target="command_argument_syntax" format="default"/>.
          </t>
        </section>
        <!-- end 2.3.4 -->
        <section anchor="domain_names"
               numbered="true" toc="default">
          <name>Domain Names</name>
          <t><iref item="Terminology" subitem="Domain Names" primary="false"/>
           <!--   2.3.5 -->
        A domain name (or often just a "domain") consists of one or
        more components, separated by dots if more than one appears.
        In the case of a top-level domain used by itself
        in an email address, a single string is used without any dots.
		This makes the requirement, described in more detail below,
        that only fully-qualified domain names (often referred to as
		"FQDN"s) appear in SMTP
        transactions on the public Internet, particularly important
        where top-level domain names are involved.
        These components ("labels" in the DNS terminology of RFC 1035
        <xref target="RFC1035" format="default"/>) are
        restricted for purposes of SMTP as defined here
        to consist of a sequence of letters, digits, and hyphens drawn from
        the ASCII character set <xref target="ASCII"
        format="default"/> and conforming to what RFC 1035
        calls the "preferred name syntax", with the exception
        that leading digits in labels are permitted
        <xref target="RFC1035a"/>.
        Domain names are used as names of hosts and, except
        where additionally restricted in this document, of other
        entities in the domain name hierarchy.
        For example, a domain may refer to a host alias (label of a CNAME RR)
        or the label of Mail eXchanger records to be used to deliver mail
        instead of representing a host name.
        See RFC 1035 and <xref target="address_resolution" format="default"/>
        of this specification.
          </t>
          <t>
        The domain name, as described in this document and in
        <xref target="RFC1035" format="default">RFC 1035</xref>,
		MUST be the entire, fully-qualified domain name.
        Other than an address literal (see
        <xref target="address_literals"/>) where those are permitted,
        any string that is not a domain name in FQDN form is no more
        than a reference to be interpreted locally. Such local
        references for domain names MUST NOT appear in any SMTP
        transaction (Cf. <xref target="address_resolution"/>).
        Mechanisms for inferring FQDNs from local references
        (including partial names or local aliases) are out of scope
		for this
        specification and normally the province of message
        submission.   Due to a history of problems, SMTP servers
        SHOULD NOT make such
        inferences (<xref target="RFC6409" format="default">
           Message Submission Servers</xref> have somewhat more
        flexibility) and intermediate (relay) SMTP servers MUST NOT
        make them.
        <iref item="Message Submission" subitem="Domain names" primary="false"/>
          </t>
		  <t>
		Unless further restricted in this document, domain names used
		in SMTP are names that can be resolved 
		to MX or address (A or AAAA) RRs
		<iref item="Terminology" subitem="address RR" primary="false"/>
		(see also <xref target="address_resolution" format="default"/>),
		or to CNAME RRs that can be resolved to an MX or address RR.
        There are two exceptions to the rule requiring FQDNs:
          </t>
          <ul spacing="normal">
            <li>The domain name given in the EHLO command MUST be either a primary
               host name (a domain name that resolves to an address RR)
               <iref item="Terminology" subitem="primary host name" primary="false"/>
               or, if the host has no name, an address literal, as described
         in <xref target="address_literals" format="default"/> and discussed further in
         the EHLO discussion
         of <xref target="order_of_commands" format="default"/>.</li>
            <li>The reserved mailbox name "postmaster" MAY be used in a RCPT
             command without domain qualification (see <xref target="recipient" format="default"/>)
             and MUST be accepted if so used.
          </li>
          </ul>
        </section>
        <!-- end 2.3.5 -->
        <section anchor="buffer-state" numbered="true" toc="default">
          <name>Buffer and State Table</name>
          <!-- 2.3.6 -->
          <t><iref item="Terminology" subitem="Buffer" primary="false"/>
             <iref item="Terminology" subitem="State Table" primary="false"/>
        SMTP sessions are stateful, with both parties carefully maintaining
        a common view of the current state.  In this document, we model this
        state by a virtual "buffer" and a "state table" on the server that
        may be used by the client to, for example, "clear the buffer" or "reset
        the state table", causing the information in the buffer to be discarded
        and the state to be returned to some previous state.
          </t>
        </section>
        <!-- end 2.3.6 -->
        <section anchor="CommandsAndReplies" numbered="true" toc="default">
          <name>Commands and Replies</name>
          <!-- 2.3.7 -->
          <t><iref item="Terminology" subitem="Commands and Replies" primary="false"/>
        SMTP commands and, unless altered by a service extension, message
        data, are transmitted from the sender to the receiver via the
        transmission channel in "lines"
        (defined in <xref target="lines"/> below).</t>
          <t>An SMTP reply is an acknowledgment (positive or negative) sent
       in "lines" from
       receiver to sender via the transmission channel in response to a
       command.  The general form of a reply is a numeric completion code
       (indicating failure or success) usually followed by a text string.
       The codes are for use by programs and the text is usually intended
       for human users.  <xref target="RFC3463" format="default">RFC 3463</xref>,
       specifies further structuring of the
       reply strings, including the use of supplemental and more specific
       completion codes (see also
       <xref target="RFC5248" format="default">RFC 5248</xref>).
          </t>
        </section> <!-- end 2.3.7 -->
        <section anchor="lines" numbered="true" toc="default">
          <name>Lines</name>
          <!-- new 2.3.8 -->
          <t><iref item="Terminology" subitem="Lines" primary="false"/>
             Lines consist of zero or more data
        characters terminated by the sequence ASCII character "CR" (hex value
        0D) followed immediately by ASCII character "LF" (hex value 0A).
        This termination sequence is denoted as &lt;CRLF&gt; in this document.
        Conforming implementations MUST NOT recognize or generate any other
        character or character sequence as a line terminator.  Limits MAY
        be imposed on line lengths by servers
        (see <xref target="smtp_specifications" format="default"/>). </t>
          <t>
        In addition, the appearance of "bare" "CR" or "LF"
        characters in text
        (i.e., either without the other) has a long history of causing problems
        in mail implementations and applications that use the mail system
        as a tool.  Unless negotiated otherwise using an SMTP
        extension,
        SMTP client implementations MUST NOT transmit these characters
        except when they are intended as line terminators and then MUST, as
        indicated above, transmit them only as a &lt;CRLF&gt; sequence.
          </t>
        </section>
        <!-- end 2.3.8 -->

        <section numbered="true" toc="default">
          <name>Message Content and Mail Data</name>
          <!-- 2.3.9 -->
          <t><iref item="Terminology" subitem="Message Content" primary="false"/>
             <iref item="Terminology" subitem="Mail Data" primary="false"/>
        The terms "message content" and "mail data" are used interchangeably
        in this document to describe the material transmitted after the DATA
        command is accepted and before the end of data indication is transmitted.
        Message content includes the message header section
        and the possibly structured message body.  In the absence of
        extensions, both are required to be ASCII (see
        <xref target="mail_objects" format="default"/>). The MIME specification
       (<xref target="RFC2045" format="default">RFC 2045</xref>)
        provides the standard mechanisms for structured message bodies.
          </t>
        </section>
        <!-- end 2.3.9 -->

        <section anchor="ODRGsystems" numbered="true" toc="default">
          <name>Originator, Delivery, Relay, and Gateway Systems</name>
          <!-- 2.3.10 -->
          <t>
        This specification makes a distinction among four types of SMTP systems,
        based on the role those systems play in transmitting electronic mail.
        An "originating" system (sometimes called an SMTP originator)
        <iref item="Terminology" subitem="Originator" primary="false"/>
        introduces
        mail into the Internet or, more generally, into a transport service
        environment.  A "delivery" SMTP system
        <iref item="Terminology" subitem="Delivery SMTP" primary="false"/>
        is one that receives mail from
        a transport service environment and passes it to a mail user agent
        or deposits it in a message store that a mail user agent is expected
        to subsequently access.  A "relay" SMTP system (usually referred to
        just as a "relay")
        <iref item="Terminology" subitem="Relay SMTP" primary="false"/>
        receives mail from an SMTP client and transmits
        it, without modification to the message data other than adding trace
        information (see <xref target="trace_information" format="default"/>), to
        another SMTP server for further relaying or for delivery.
          </t>
          <t>
        A "gateway" SMTP system (usually referred to just as a "gateway")
        <iref item="Terminology" subitem="Gateway" primary="false"/>
        receives mail from a client system in one transport environment and
        transmits it to a server system in another transport environment.
        Differences in protocols or message semantics between the transport
        environments on either side of a gateway may require that the gateway
        system perform transformations to the message that are not permitted
        to SMTP relay systems.  For the purposes of this specification, firewalls
        that rewrite addresses should be considered as gateways, even if SMTP
        is used on both sides of them
        (see <xref target="RFC2979" format="default">RFC 2979</xref>).
          </t>
        </section>
        <!-- end 2.3.10 -->

        <section numbered="true" toc="default">
          <name>Mailbox and Address</name>
          <!-- 2.3.11 (was 2.3.10) -->
          <t>
             As used in this specification, an "address"
             <iref item="Terminology" subitem="Address" primary="false"/>
             is a character string
        that identifies a user to whom mail will be sent or a location into
        which mail will be deposited.  The term "mailbox"
        <iref item="Terminology" subitem="Mailbox" primary="false"/>
        refers to that depository.
        The two terms are typically used interchangeably unless the distinction
        between the location in which mail is placed (the mailbox) and a reference
        to it (the address) is important.  An address normally consists of
        user and domain specifications.  The standard mailbox naming convention
        is defined to be "local-part@domain"; contemporary usage permits
        a much broader set of applications than simple "user names".  Consequently,
        and due to a long history of problems when intermediate hosts have
        attempted to optimize transport by modifying them, the local-part
        MUST be interpreted and assigned semantics only by the host specified
        in the domain part of the address.
          </t>
        </section>
        <!-- end 2.3.11 -->

        <section anchor="SessionAndTransaction" numbered="true" toc="default">
		   <name>Sessions and Transactions</name>
		   <t>This document distinguishes between an "SMTP session"
			  and a "mail transaction". An SMTP session, often called
			  a "mail session", starts when a connection is made between
		      client and server, ending when that connection is
		      terminated.  A "mail transaction" is started and
		      terminated by particular commands, most often MAIL and
		      RSET or QUIT (the latter also instructs the server to
		      close the SMTP session).
			  For more information and details,
              see <xref target="session_initiation"/> and
              <xref target="mail_transactions"/>.
           </t>
        </section>

      </section>      <!-- end 2.3 -->

      <section anchor="general_syntax_principles" numbered="true" toc="default">
        <name>General Syntax Principles and Transaction Model</name>
        <!-- 2.4 -->
        <t>
          SMTP commands and replies have a rigid syntax.  All commands
      begin with a command verb.  All replies begin with a three digit numeric
      code.  In some commands and replies, arguments are required
      following the verb
      or reply code.  Some commands do not accept arguments (after the verb),
      and some reply codes are followed, sometimes optionally, by free form
      text.  In both cases, where text appears, it is separated from the verb
      or reply code by a space character.  Complete definitions of commands
      and replies appear in <xref target="smtp_specifications" format="default"/>.
        </t>
        <t anchor="ExtensionVerbs">
          Verbs and argument values (e.g., "TO:" or "to:" in the RCPT command
      and extension name keywords) are not case sensitive, with the sole exception
      in this specification of a mailbox local-part (SMTP Extensions may explicitly
      specify case-sensitive elements).  That is, a command verb, an argument
      value other than a mailbox local-part, and free form text MAY be encoded
      in upper case, lower case, or any mixture of upper and lower case with
      no impact on its meaning.
      The local-part of a mailbox MUST BE treated as case sensitive.  Therefore,
      SMTP implementations MUST take care to preserve the case of mailbox
      local-parts.  In particular,
      for some hosts, the user "smith" is different from the user "Smith".
      However, exploiting the case sensitivity of mailbox local-parts impedes
      interoperability and is discouraged.
      Mailbox domains follow normal DNS rules and are hence not case
      sensitive.
        </t>
        <t>
          A few SMTP servers, in violation of this specification (and
          RFC 821) may require that command verbs be encoded by clients in upper case.
      Implementations MAY wish to employ this encoding to accommodate those servers.
        </t>
        <t>
          The argument clause consists of a variable-length character string
      ending with the end of the line, i.e., with the character sequence &lt;CRLF&gt;.
      The receiver will take no action until this sequence is received.
        </t>
        <t>
          The syntax for each command is shown with the discussion of that
          command.  Common elements and parameters are shown in
          <xref target="command_argument_syntax" format="default"/>.
        </t>
        <t>
          Commands and replies are composed of characters from the ASCII
          character set <xref target="ASCII" format="default"/>.
          When the transport service provides
      an 8-bit byte (octet) transmission channel, each 7-bit character is
      transmitted, right justified, in an octet with the high-order bit cleared
      to zero.  More specifically, the unextended SMTP service
      provides 7-bit transport only.  An originating SMTP client that has not successfully
      negotiated an appropriate extension with a particular server
      (see the next paragraph) MUST NOT
      transmit messages with information in the high-order bit of octets.
      If such messages are transmitted in violation of this rule, receiving
      SMTP servers MAY clear the high-order bit or reject the message as invalid.
      In general, a relay SMTP SHOULD assume that the message content it has
      received is valid and, assuming that the envelope permits doing so,
      relay it without inspecting that content.  Of course, if the content
      is mislabeled and the data path cannot accept the actual content, this
      may result in the ultimate delivery of a severely garbled message to the
      recipient.  Delivery SMTP systems MAY reject such messages, or
      return them as undeliverable,
      rather than deliver them.  In the absence of a server-offered
      extension explicitly permitting it, a sending SMTP system is not
      permitted to send
      envelope commands in any character set other than US-ASCII. Receiving
      systems SHOULD reject such commands, normally using "500 syntax error
      - invalid character" replies.
        </t>
        <t>8-bit message content transmission MAY be requested of the
      server by a client using extended SMTP facilities, notably the "8BITMIME"
      extension, <xref target="RFC6152" format="default">RFC 6152</xref>.  8BITMIME SHOULD be
      supported by SMTP servers.  However, it MUST NOT be construed
      as authorization
      to transmit unrestricted 8-bit material, nor does 8BITMIME
      authorize transmission of any envelope material encoded in
      anything other than
      US-ASCII.
      8BITMIME MUST NOT be requested
      by senders for material with the high bit on that is not in MIME format
      with an appropriate content-transfer encoding; servers MAY
      reject such messages.
        </t>
        <t>
          The metalinguistic notation used in this document corresponds
      to the "Augmented BNF" used in other Internet mail system documents.
      The reader who is not familiar with that syntax should consult the ABNF
      specification in <xref target="RFC5234" format="default">RFC 5234</xref>.  Metalanguage
      terms used in running text are surrounded by pointed brackets
      (e.g., &lt;CRLF&gt;) for clarity.

      The reader is cautioned that the grammar expressed in
      the metalanguage is not comprehensive.  There are many
      instances in which provisions in the text constrain or
      otherwise modify the syntax or semantics implied by the
      grammar. </t>
      </section>
      <!-- 2.4 -->
    </section>
    <!-- 2 -->
    <section anchor="overview" numbered="true" toc="default">
      <name>The SMTP Procedures: An Overview</name>
      <!-- 3 -->
      <t>
        This section contains descriptions of the procedures used in SMTP:
    session initiation, mail transaction, forwarding mail, verifying mailbox
    names and expanding mailing lists, and opening and closing exchanges.
    Comments on relaying, a note on mail domains, and a discussion of changing
    roles are included at the end of this section.  Several complete scenarios
    are presented in <xref target="scenarios" format="default"/>.
      </t>
      <section anchor="session_initiation" numbered="true" toc="default">
        <name>Session Initiation</name>
        <!-- 3.1 -->
        <t>
          An SMTP session (or "mail session") is initiated when a
          client opens a connection to a server and the server
          responds with an opening message.
        </t>
        <t>
          SMTP server implementations MAY include identification of their
      software and version information in the connection greeting reply after
      the 220 code, a practice that permits more efficient isolation and repair
      of any problems.  Implementations MAY make provision for SMTP servers
      to disable the software and version announcement where it causes security
      concerns.  While some systems also identify their contact point for
      mail problems, this is not a substitute for maintaining the required
      "postmaster" address (see <xref target="smtp_specifications" format="default"/>).
        </t>
        <t>The SMTP protocol allows a server to formally reject a mail session
       while still allowing the initial connection as follows: a 521
       response
      MAY be given in the initial connection opening message instead of the
      220.  A server taking this approach MUST still wait for the client to
      send a QUIT (see <xref target="QUIT" format="default"/>) before closing the connection
      and SHOULD respond to any intervening commands with "503 bad sequence
      of commands".  Since an attempt to make an SMTP connection to such a
      system is probably in error, a server returning a 521
      response on connection
      opening SHOULD provide enough information in the reply text to facilitate
      debugging of the sending system.  See
      <xref target="Clarif-521-554-556" format="default"/>.
        </t>
      </section>
      <!-- 3.1 -->
      <section anchor="client-initiate" numbered="true" toc="default">
        <name>Client Initiation</name>
        <!-- 3.2 -->
        <t> <iref item="Commands and Syntax" subitem="ehlo" primary="false"/>
          Once the server has sent the greeting (welcoming) message and the client
      has received it, the client normally sends the EHLO command to the server,
      indicating the client's identity.  In addition to opening the session,
      use of EHLO indicates that the client is able to process service extensions
      and requests that the server provide a list of the extensions it supports.
      Older SMTP systems that are unable to support service
      extensions, and
      contemporary clients that do not require service extensions in the
      mail session being initiated, MAY use HELO instead of EHLO.  Servers
      MUST NOT return the extended EHLO-style response to a HELO command.
      For a particular connection attempt, if the server returns a "command
      not recognized" response to EHLO, the client SHOULD be able to fall
      back and send HELO.
        </t>
        <t>
          In the EHLO (or HELO) command, the host sending the command identifies itself;
      the command may be interpreted as saying "Hello, I am &lt;domain&gt;"
      (and, in the case of EHLO, "and I support service extension requests").
        </t>
      </section>
      <!-- 3.2 -->
      <section anchor="mail_transactions" numbered="true" toc="default">     <!-- 3.3 -->
        <name>Mail Transactions</name>
        <t> There are three steps to normal SMTP mail transactions.
           The transaction
      starts with a MAIL command that gives the sender identification.  (In
      general, the MAIL command may be sent only when no mail transaction
      is in progress; see <xref target="order_of_commands"
      format="default"/>.)  In a normal session, a series of
      one or more RCPT commands follows, giving the receiver information.
      Then, a DATA command initiates transfer of the mail data and is terminated
      by the "end of mail" data indicator, which also confirms
       (and terminates) the transaction.
        </t>
        <t> Mail transactions are also terminated by the RSET command
           (<xref target="RSET-cmd" format="default"/>), the sending
		   of an EHLO or the equivalent HELO
           command (<xref target="client-initiate" format="default"/>), or the sending of
           a QUIT command (<xref target="TerminatingSessions"
		   format="default"/>).
		   The QUIT command
           terminates not only any active mail transaction but the SMTP
           connection itself.</t>
        <t> The first step in the procedure is the MAIL command.
        </t>
        <ul empty="true" spacing="normal">
          <li>
              MAIL FROM:&lt;reverse-path&gt; [SP
              &lt;mail-parameters&gt; ] &lt;CRLF&gt;
        </li>
        </ul>
        <t>
          This command tells the SMTP-receiver that a new mail transaction
      is starting and to reset all its state tables and buffers, including
      any recipients or mail data.  The &lt;reverse-path&gt; portion of the
      first or only argument contains the source mailbox (between "&lt;" and
      "&gt;" brackets), which can be used to
      report errors (see <xref target="smtp_replies" format="default"/>
      for a discussion of error reporting).  If accepted, the SMTP server
      returns a "250 OK" reply.  If the mailbox specification is not acceptable
      for some reason, the server MUST return a reply indicating whether the
      failure is permanent (i.e., will occur again if the client tries to
      send the same address again) or temporary (i.e., the address might be
      accepted if the client tries again later).  Despite the apparent scope
      of this requirement, there are circumstances in which the acceptability
      of the reverse-path may not be determined until one or more forward-paths
      (in RCPT commands) can be examined.  In those cases, the server MAY
      reasonably accept the reverse-path (with a 250 reply) and then report
      problems after the forward-paths are received and examined.  Normally,
      failures produce 550 or 553 replies.
        </t>
        <t>
          Historically, the &lt;reverse-path&gt; was permitted to contain more than
          just a mailbox; however source routing is now deprecated
          (see <xref target="source_routing" format="default"/>).
        </t>
        <t>
          The optional &lt;mail-parameters&gt; are associated with negotiated
      SMTP service extensions (see <xref target="extension_model" format="default"/>).
        </t>
        <t>
          The second step in the procedure is the RCPT command.  This
          step of the procedure can be repeated any number of times.
        </t>
        <ul empty="true" spacing="normal">
          <li>
          RCPT TO:&lt;forward-path&gt; [ SP &lt;rcpt-parameters&gt; ] &lt;CRLF&gt;
            </li>
        </ul>
        <t>
          The first or only argument to this command includes a forward-path
      (normally a mailbox local-part and domain, always surrounded by "&lt;" and "&gt;"
      brackets) identifying one recipient.  If accepted, the SMTP server returns
      a "250 OK" reply and stores the forward-path.  If the recipient is known
      not to be a deliverable address, the SMTP server returns a 550 reply,
      typically with a string such as "no such user -&nbsp;" and the mailbox name
      (other circumstances and reply codes are possible).
        </t>
        <t>
          Historically, the &lt;forward-path&gt; was permitted to contain
      a source routing list
      of hosts and the destination mailbox; however, source routes are
      now deprecated (see <xref target="source_routing"/>).
      Clients MUST NOT
      assume that any SMTP server on the Internet can be used as their mail
      processing (relaying) site.  If a RCPT command appears without a previous
      MAIL command, the server MUST return a 503 "Bad sequence of commands"
      response.  The optional &lt;rcpt-parameters&gt; are associated with
      negotiated SMTP service extensions
      (see <xref target="extension_model" format="default"/>).
        </t>

   <t> There are two ways that sender-SMTPs can determine the
    next-hop system to which to send the message.  One is to
    use the DNS and MX records as described in Section
    <xref target="Locating-DNS"/>.  The other involves a next-hop destination
    or choice of destinations that are configured into the
    sender-SMTP to deal with special circumstances such as forwarding
    all messages to a particular host for further processing.</t>

        <t>Since it has been a common source of errors, it is worth
      noting that spaces are not permitted on either side of the colon
      following FROM in the MAIL command or TO in the RCPT command.
	  The syntax is exactly as given above.
	   </t>
        <t> The third step in the procedure is the DATA command (or some
      alternative specified in a service extension).
        </t>
        <ul empty="true" spacing="normal">
          <li>
          DATA &lt;CRLF&gt;
            </li>
        </ul>
        <t>
          If accepted, the SMTP server returns a 354 Intermediate reply
      and considers all succeeding lines up to but not including the end of
      mail data indicator to be the message text.  When the end of text is
      successfully received and stored, the SMTP-receiver sends a "250 OK" reply.
        </t>
        <t>
          Since the mail data is sent on the transmission channel, the
      end of mail data must be indicated so that the command and reply dialog
      can be resumed.
      An SMTP client indicates the end of the mail data by sending a
      line containing only a "." (period or full stop, hex 2E), that
      is the character sequence "&lt;CRLF&gt;.&lt;CRLF&gt;".

      A transparency
      procedure is used to prevent this from interfering with the user's text
      (see <xref target="Transparency" format="default"/>).
        </t>
        <t>
          The end of mail data indicator also confirms the mail transaction
      and tells the SMTP server to now process the stored recipients and mail
      data.  If accepted, the SMTP server returns a "250 OK" reply.  The DATA
      command can fail at only two points in the protocol exchange:
        </t>
        <t>
          If there was no MAIL, or no RCPT, command, or all such commands
      were rejected, the server MAY return a "command out of sequence" (503)
      or "no valid recipients" (554) reply in response to the DATA command.
      If one of those replies (or any other 5yz reply) is received, the client
      MUST NOT send the message data; more generally, message data MUST NOT
      be sent unless a 354 reply is received.
        </t>
        <t>
          If the verb is initially accepted and the 354 reply issued, the
      DATA command should fail only if the mail transaction was incomplete
      (for example, no recipients), if resources were unavailable (including,
      of course, the server unexpectedly becoming unavailable), or if the
      server determines that the message should be rejected for policy or other reasons.
        </t>
        <t>
          However, in practice, some servers do not perform recipient verification
      until after the message text is received.  These servers SHOULD treat
      a failure for one or more recipients as a "subsequent failure" and return
      a mail message as discussed in
    <xref target="problem_detection" format="default"/> and, in particular, in
    <xref target="reliable_delivery" format="default"/>.
      Using a "550 mailbox not found" (or equivalent) reply code after the
      data are accepted makes it difficult or impossible for the client to
      determine which recipients failed.
        </t>
        <t>
          When the RFC 822 format (<xref target="RFC0822" format="default"/>,
          <xref target="rfc5322bis" format="default"/>) is being used, the mail data include
      the header fields such as those named
      Date, Subject, To, Cc, and From.  Server SMTP
      systems SHOULD NOT reject messages based on perceived defects in the
      RFC 822 or MIME (<xref target="RFC2045" format="default">RFC 2045</xref>) message
      header section
      or message body.  In particular, they MUST NOT reject messages in which
      the numbers of Resent-header fields do not match or Resent-to appears without
      Resent-from and/or Resent-date.
        </t>
        <t>
          Mail transaction commands MUST be used in the order discussed above.
        </t>
      </section>
      <!-- 3.3 -->

      <section anchor="forwarding_aliasing" numbered="true"
                  toc="default">  <!-- 3.4 -->
         <name> Address Modification and Expansion</name>
      <section anchor="forwarding_for_address_correction" numbered="true" toc="default">
        <name>Forwarding for Address Correction or Updating</name>
        <!-- 3.4.1 -->
        <t>
          Forwarding support is most often required to consolidate and
      simplify addresses within, or relative to, some enterprise and less
      frequently to establish addresses to link a person's prior address with
      a current one.  Silent forwarding of messages (without server notification
      to the sender), for security or non-disclosure purposes, is common in
      the contemporary Internet.
        </t>
        <t>
          In both the enterprise and the "new address" cases, information
      hiding (and sometimes security) considerations argue against exposure
      of the "final" address through the SMTP protocol as a side effect of
      the forwarding activity.  This may be especially important when the
      final address may not even be reachable by the sender.  Consequently,
      the "forwarding" mechanisms described in Section 3.2 of RFC 821, and
      especially the 251 (corrected destination) and 551 reply codes from
      RCPT must be evaluated carefully by implementers and, when they are
      available, by those configuring systems
      (see also <xref target="Reroute_251_551" format="default"/>).
        </t>
        <t>
          In particular:
        </t>
        <ul spacing="normal">
          <li>Servers MAY forward messages when they are aware of an address
           change.  When they do so, they MAY either provide address-updating
           information with a 251 code, or may forward "silently" and return
           a 250 code.  However, if a 251 code is used, they MUST NOT assume that
           the client will actually update address information or even return
           that information to the user.
        </li>
        </ul>
        <t>
      Alternately,
        </t>
        <ul spacing="normal">
          <li>Servers MAY reject messages or return them as
           non-deliverable
           when they cannot be delivered precisely as
           addressed.  When they do so, they MAY either provide address-updating
           information with a 551 code, or may reject the message as undeliverable
           with a 550 code and no address-specific information.
           However, if a
           551 code is used, they MUST NOT assume that the client will actually
           update address information or even return that information to the user.
        </li>
        </ul>
        <t>
          SMTP server implementations that support the 251 and/or 551 reply
      codes SHOULD provide configuration mechanisms so
      that sites that conclude that they would undesirably disclose information
      can disable or restrict their use.  See
      <xref target="Reroute_251_551"/> for further discussion of that
      issue.
        </t>
      </section>  <!-- end 3.4.1 (former 3.4) -->

      <section anchor="MailingListsAliases" numbered="true" toc="include">
        <name>Aliases and Mailing Lists</name>
        <!-- 3.4.2 (former 3.9) -->
        <t>
        Many SMTP-capable hosts support address expansion for
        multiple delivery via one or both of the alias and the list
		models.</t>
	 <t> When a message is delivered
		or forwarded to each address of an expanded list form, the return address
      in the envelope ("MAIL FROM:") MUST be changed to be the address of
      a person or other entity who administers the list.
      This change to the MAIL command does not affect the header
      section of the message.
        </t>
        <t>
      An important mail facility is a mechanism for multi-destination delivery
      of a single message, by transforming (or "expanding" or "exploding")
      a pseudo-mailbox address into a list of destination mailbox addresses.
      When a message is sent to such a pseudo-mailbox (sometimes called an
      "exploder"), copies are forwarded or redistributed to each mailbox in
      the expanded list.  Servers SHOULD simply utilize the addresses on the
      list; application of heuristics or other matching rules to eliminate
      some addresses, such as that of the originator, is strongly discouraged.
      We classify such a pseudo-mailbox as an "alias" or a "list", depending
      upon the expansion rules.
        </t>
      <section anchor="aliases" numbered="true" toc="include">
          <name>Simple Aliases</name>

      <t>
        To expand an alias, the recipient mailer simply replaces the pseudo-
        mailbox address in the envelope with each of the expanded addresses
        in turn; the rest of the envelope and the message body are left unchanged.
        The message is then delivered or forwarded to each expanded address.
          </t>
        </section>

    <section anchor="MailingLists" numbered="true" toc="include">
          <name>Mailing Lists</name> <!-- 3.4.2.2 (former 3.9.2) -->
        <t> Processing of a mailing list may be said to operate by
          "redistribution" rather than by "forwarding" (as in the
           simple alias case in the subsection above).
         To expand a list, the recipient mailer replaces
        the pseudo-mailbox address in the envelope with each of the
        expanded addresses in turn.  The return (backward-pointing)
        address in the envelope is changed so that
        all error messages generated by the final deliveries will be returned
        to a list administrator, not to the message originator, who generally
        has no control over the contents of the list and will typically find
        error messages annoying.
        Note that the key difference between handling simple aliases
        <xref target="aliases"/> and
        redistribution (this subsection) is the change to the
        backward-pointing address.  When a system managing a list
        constrains its processing to the very limited set of
        modifications and actions described here, it is acting
        as part of an MTA; such list processing, like alias
        processing, can be treated as a continuation of email
        transit. </t>
     <t>Mailing list management systems do exist that perform
        additional, sometimes extensive, modifications to a
        message and its envelope.  Such mailing lists need to be
        viewed as MUAs that accept a message delivery and
        then submit a new message for multiple recipients.</t>
        </section>    <!-- end 3.4.2.2 (former 3.9.2) -->
      </section>      <!-- end 3.4.2 (former 3.9) -->
      </section>      <!-- end 3.4 -->

      <section anchor="commands_for_debugging_addresses" numbered="true" toc="default">
        <name>Commands for Debugging Addresses</name>
        <!-- 3.5 -->
        <section anchor="debug-commands-overview" numbered="true" toc="default">
          <name>Overview</name>
          <!-- 3.5.1 -->
          <t>
        SMTP provides commands to verify a user name or obtain the content
        of a mailing list.  This is done with the VRFY and EXPN commands,
        which have character string arguments.  Implementations SHOULD support
        VRFY and EXPN (however, see <xref target="vrfy_normal_response" format="default"/>
        and <xref target="vrfy_expn_security" format="default"/>).
          </t>
          <t>
        For the VRFY command, the string is a user name or a user name and
        domain (see below).  If a normal (i.e., 250) response is returned,
        the response MAY include the full name of the user and MUST include
        the mailbox of the user.  It MUST be in one of the following forms:
          </t> 
          <ul empty="true" spacing="normal">
            <li>
               User Name &lt;local-part@domain&gt;<br/>
               &lt;local-part@domain&gt;<br/>
               local-part@domain
          </li>
          </ul>
          <t>
        When a name that is the argument to VRFY could identify more than
        one mailbox, the server MAY either note the ambiguity or identify
        the alternatives.  In other words, any of the following are legitimate
        responses to VRFY:
          </t>
          <ul empty="true" spacing="normal">
            <li>
        553 User ambiguous
          </li>
          </ul>
          <t>
        or
          </t>
          <ul empty="true" spacing="normal">
            <li>
        553- Ambiguous;  Possibilities are<br/>
        553-Joe Smith &lt;jsmith@foo.com&gt;<br/>
        553-Harry Smith &lt;hsmith@foo.com&gt;<br/>
        553 Melvin Smith &lt;dweep@foo.com&gt;
          </li>
          </ul>
          <t>
        or
          </t>
          <ul empty="true" spacing="normal">
            <li>
        553-Ambiguous;  Possibilities<br/>
        553- &lt;jsmith@foo.com&gt;<br/>
        553- &lt;hsmith@foo.com&gt;<br/>
        553 &lt;dweep@foo.com&gt;
          </li>
          </ul>
          <t>
        Under normal circumstances, a client receiving a 553 reply would be
        expected to expose the result to the user.  Use of exactly the forms
        given, and the "user ambiguous" or "ambiguous" keywords, possibly
        supplemented by extended reply codes, such as those described
        in <xref target="RFC3463" format="default">RFC 3463</xref>, will facilitate
        automated translation
        into other languages as needed.  Of course, a client that was highly
        automated or that was operating in another language than English
        might choose to try to translate the response to return some other
        indication to the user than the literal text of the reply, or to take
        some automated action such as consulting a directory service for additional
        information before reporting to the user.
          </t>
          <t>
        For the EXPN command, the string identifies a mailing list, and the
        successful (i.e., 250) multiline response MAY include the full name
        of the users and MUST give the mailboxes on the mailing list.
          </t>
          <t>
        In some hosts, the distinction between a mailing list and an alias
        for a single mailbox is a bit fuzzy, since a common data structure
        may hold both types of entries, and it is possible to have mailing
        lists containing only one mailbox.  If a request is made to apply
        VRFY to a mailing list, a positive response MAY be given if a message
        so addressed would be delivered to everyone on the list, otherwise
        an error SHOULD be reported (e.g., "550 That is a mailing list, not
        a user" or "252 Unable to verify members of mailing list").  If a
        request is made to expand a user name, the server MAY return a positive
        response consisting of a list containing one name, or an error MAY
        be reported (e.g., "550 That is a user name, not a mailing list").
          </t>
          <t>
        In the case of a successful multiline reply (normal for EXPN), exactly
        one mailbox is to be specified on each line of the reply.  The case
        of an ambiguous request is discussed above.
          </t>
          <t>
        "User name" is a fuzzy term and has been used deliberately.  An implementation
        of the VRFY or EXPN commands MUST include at least recognition of
        local mailboxes as "user names".  However, since current Internet
        practice often results in a single host handling mail for multiple
        domains, hosts, especially hosts that provide this functionality,
        SHOULD accept the "local-part@domain" form as a "user name"; hosts
        MAY also choose to recognize other strings as "user names".
          </t>
          <t>
        The case of expanding a mailbox list requires a multiline reply, such as:
          </t>
          <ul empty="true" spacing="normal">
            <li>
        C: EXPN Example-People<br/>
        S: 250-Jon Postel &lt;Postel@isi.edu&gt;<br/>
        S: 250-Fred Fonebone &lt;Fonebone@physics.foo-u.edu&gt;<br/>
        S: 250 Sam Q.&nbsp;Smith &lt;SQSmith@specific.generic.com&gt;
          </li>
          </ul>
          <t>
        or
          </t>
          <ul empty="true" spacing="normal">
            <li>
        C: EXPN Executive-Washroom-List<br/>
        S: 550 Access Denied to You.
          </li>
          </ul>
          <t>
        The character string arguments of the VRFY and EXPN commands cannot
        be further restricted due to the variety of implementations of the
        user name and mailbox list concepts.  On some systems, it may be appropriate
        for the argument of the EXPN command to be a file name for a file
        containing a mailing list, but again there are a variety of file naming
        conventions on the Internet.  Similarly, historical variations in
        what is returned by these commands are such that the response
        should
        be interpreted very carefully, if at all, and SHOULD generally only
        be used for diagnostic purposes.
          </t>
        </section>
        <!-- 3.5.1 -->
    <section anchor="vrfy_normal_response" numbered="true" toc="default">
          <name>VRFY and EXPN Normal Response</name>
		  <!-- 3.5.2 -->
      <t>
        When normal (2yz or 551) responses are returned from a VRFY or EXPN
        request, the reply MUST include the &lt;Mailbox&gt; name using a
        "&lt;local-part@domain&gt;" construction,
        where "domain" is a fully-qualified domain name.
        In circumstances exceptional enough to justify violating
        the intent of this specification, free-form text MAY be returned.
        In order to facilitate parsing by both computers and people, addresses
        SHOULD appear in pointed brackets.  When addresses, rather than free-form
        debugging information, are returned, EXPN and VRFY MUST return only
        valid domain addresses that are usable in SMTP RCPT commands.  Consequently,
        if an address implies delivery to a program or other system, the mailbox
        name used to reach that target MUST be given.  Paths (explicit source
        routes) MUST NOT be returned by VRFY or EXPN.
          </t>
          <t>
        Server implementations SHOULD support both VRFY and EXPN.  For security
        reasons, implementations MAY provide local installations a way to
        disable either or both of these commands through configuration options
        or the equivalent (see <xref target="vrfy_expn_security" format="default"/>).
        When these commands are supported, they are not
        required to work across relays when relaying is supported.  Since
        they were both optional in RFC 821, but VRFY was made mandatory in
        <xref target="RFC1123" format="default">RFC 1123</xref>, if EXPN is supported,
        it MUST be listed as a service extension in an EHLO response.
        VRFY MAY
        be listed as a convenience but, since support for it is required,
        SMTP clients are not required to check for its presence on the extension
        list before using it.
          </t>
        </section>
        <!-- 3.5.2 -->
    <section anchor="meaning_vrfy_expn_success" numbered="true" toc="default">
          <name>Meaning of VRFY or EXPN Success Response</name>
          <!-- 3.5.3 -->
      <t>
        A server MUST NOT return a 250 code in response to a VRFY or EXPN
        command unless it has actually verified the address.  In particular,
        a server MUST NOT return 250 if all it has done is to verify that
        the syntax given is valid.
        If only a syntax check is made, 502 (Command not implemented)
        or 500 (Syntax error, command unrecognized) SHOULD be returned.  As
        stated elsewhere, implementation (in the sense of actually validating
        addresses and returning information) of VRFY and EXPN are strongly
        recommended.  Hence, implementations that return 500 or 502 for VRFY
        are not in full compliance with this specification.
          </t>
          <t>
        There may be circumstances where an address appears to be valid but
        cannot reasonably be verified in real time, particularly when a server
        is acting as a mail exchanger for another server or domain.  "Apparent
        validity", in this case, would normally involve at least syntax checking
        and might involve verification that any domains specified were ones
        to which the host expected to be able to relay mail.  In these situations,
        reply code 252 SHOULD be returned.  These cases parallel the discussion
        of RCPT verification
        in <xref target="basic_structure" format="default"/>.
        Similarly, the discussion
        in <xref target="forwarding_for_address_correction" format="default"/> applies to the use of
        reply codes 251 and 551 with VRFY (and EXPN) to indicate addresses
        that are recognized but that would be forwarded or rejected
        were mail
        received for them.  Implementations generally SHOULD be more aggressive
        about address verification in the case of VRFY than in the case of
        RCPT, even if it takes a little longer to do so.
          </t>
        </section>
        <!-- 3.5.3 -->
    <section numbered="true" toc="default">
          <name>Semantics and Applications of EXPN</name>
          <!-- 3.5.4 -->
      <t>
        EXPN is often very useful in debugging and understanding problems
        with mailing lists and multiple-target-address aliases.  Some systems
        have attempted to use source expansion of mailing lists as a means
        of eliminating duplicates.  The propagation of aliasing systems with
        mail on the Internet for hosts (typically with MX and CNAME DNS records),
        for mailboxes (various types of local host aliases), and in various
        proxying arrangements has made it nearly impossible for these strategies
        to work consistently, and mail systems SHOULD NOT attempt them.
          </t>
        </section>
        <!-- 3.5.4 -->
      </section>
      <!-- 3.5 -->

<section anchor="relaying" numbered="true" toc="default">
        <name>Relaying and Mail Routing</name>
        <!-- 3.6  -->

        <section anchor="MXandRelay" numbered="true" toc="default">
          <name>Mail eXchange Records and Relaying</name>
          <t>A relay SMTP server is usually the target of a DNS MX record that designates
      it, rather than the final delivery system.  The relay server may accept
      or reject the task of relaying the mail in the same way it accepts or
      rejects mail for a local user.  If it accepts the task, it then becomes
      an SMTP client, establishes a transmission channel to the next SMTP
      server specified in the DNS (according to the rules in
      <xref target="address_resolution" format="default"/>),
      and sends it the mail.  If it declines to relay mail to a particular
      address for policy reasons, a 550 response SHOULD be
      returned.</t>
   <t>
   This specification does not deal with the verification of return
      paths. Server efforts to verify a return path and actions to be
      taken under various circumstances are outside
        the scope of this specification.</t>

          <t>
      It is important to note that MX records can point to SMTP servers that
      act as gateways into other environments, not just SMTP relays and final
      delivery systems; see Sections <xref target="mail_gatewaying"
      format="counter"/>  and <xref target="address_resolution" format="counter"/>.
          </t>
          <t>
      If an SMTP server has accepted the task of relaying the mail and later
      finds that the destination is incorrect or that the mail cannot be delivered
      for some other reason, then it MUST construct an "undeliverable mail"
      notification message and send it to the originator of the undeliverable
      mail (as indicated by the reverse-path).  Formats specified for non-delivery
      reports by other standards (see, for example,
      <xref target="RFC3461" format="default">RFC 3461</xref>
      and <xref target="RFC3464" format="default">RFC 3464</xref>) SHOULD be used if possible.
          </t>
          <t>
      This notification message must be from the SMTP server at the relay
      host or the host that first determines that delivery cannot be accomplished.
      Of course, SMTP servers MUST NOT send notification messages about problems
      transporting notification messages.  One way to prevent loops in error
      reporting is to specify a null reverse-path in the MAIL command of a
      notification message.  When such a message is transmitted, the reverse-path
      MUST be set to null (see <xref target="messages_null_reverse_path" format="default"/>
      for additional discussion).  A MAIL command with a null reverse-path
      appears as follows:
          </t>
          <ul empty="true" spacing="normal">
            <li>
          MAIL FROM:&lt;&gt;
        </li>
          </ul>
          <t>
      As discussed in <xref target="compensating_for_irregularities" format="default"/>, a
      relay SMTP has no need to inspect or act upon the header section
      or body of
      the message data and MUST NOT do so except to add its own "Received:"
      header field (<xref target="Received-field" format="default"/>) and possibly
      other trace header fields and, optionally, to attempt
      to detect looping in the mail system
      (see <xref target="loop_detection" format="default"/>).
      Of course, this prohibition also applies to any modifications of these
      header fields or text
      (see also <xref target="scope_of_operation"
	  format="default"/>).</t>
		</section>

		<section anchor="SubmissionAndRelay" numbered="true" toc="default">
           <name>Message Submission Systems as Relays</name>  <!-- 3.6.2 -->
           <iref item="Message Submission" subitem="As relays" primary="false"/>
          <t>Many mail-sending clients exist, especially in conjunction
         with facilities
      that receive mail via POP3 or IMAP, that have limited capability to
      support some of the requirements of this specification, such as the
      ability to queue messages for subsequent delivery attempts.  For these
      clients, it is common practice to make private arrangements to send
      all messages to a single server for processing and subsequent distribution.
      SMTP, as specified here, is not ideally suited for this role.  A standardized
      mail submission protocol has been developed that is gradually
      superseding practices based on SMTP
      (see <xref target="RFC6409" format="default">RFC 6409</xref>).
      In any event, because these arrangements are private and fall outside
      the scope of this specification, they are not described here.
          </t>
      </section>
      </section>
      <!-- 3.6 -->
      <section anchor="mail_gatewaying" numbered="true" toc="default">
        <name>Mail Gatewaying</name>
        <!-- 3.7 -->
    <t>
      While the relay function discussed above operates within the Internet
      SMTP transport service environment, MX records or various forms of explicit
      routing may require that an intermediate SMTP server perform a translation
      function between one transport service and another.  As discussed in
      <xref target="ODRGsystems" format="default"/>, when such a system is at the boundary
      between two transport service environments, we refer to it as a "gateway"
      or "gateway SMTP".
        </t>
        <t>
      Gatewaying mail between different mail environments, such as different
      mail formats and protocols, is complex and does not easily yield to
      standardization.  However, some general requirements may be given for
      a gateway between the Internet and another mail environment.
        </t>
        <section numbered="true" toc="default">
          <name>Header Fields in Gatewaying</name>
          <!-- 3.7.1 -->
      <t>
        Header fields MAY be rewritten when necessary as messages are gatewayed
        across mail environment boundaries.  This may involve inspecting the
        message body or interpreting the local-part of the destination address
        in spite of the prohibitions in <xref target="compensating_for_irregularities" format="default"/>.
          </t>
          <t>
        Other mail systems gatewayed to the Internet often use a subset of
        the RFC 822 header section
        or provide similar functionality with a different
        syntax, but some of these mail systems do not have an equivalent to
        the SMTP envelope.  Therefore, when a message leaves the Internet
        environment, it may be necessary to fold the SMTP envelope information
        into the message header section.
        A possible solution would be to create new
        header fields to carry the envelope information (e.g., "X-SMTP-MAIL:"
        and "X-SMTP-RCPT:"); however, this would require changes in mail programs
        in foreign environments and might risk disclosure of private information
        (see <xref target="blind_copies" format="default"/>).
          </t>
        </section>
        <!-- 3.7.1 -->
    <section numbered="true" toc="default">
          <name>Received Lines in Gatewaying</name>
          <!-- 3.7.2 -->
      <t>
        When forwarding a message into or out of the Internet environment,
        a gateway MUST prepend a Received: line ("header field", see
        <xref target="Received-field"/>), but it MUST NOT alter in
        any way a Received: line that is already in the header
        section.
          </t>
          <t>
        "Received:" header fields of messages originating from other environments
        may not conform exactly to this specification.  However, the most
        important use of Received: lines is for debugging mail faults, and
        this debugging can be severely hampered by well-meaning gateways that
        try to "fix" a Received: line.  As another consequence of
        trace header fields
        arising in non-SMTP environments, receiving systems MUST NOT reject
        mail based on the format of a trace header field and SHOULD be extremely
        robust in the light of unexpected information or formats in
        those header fields.
          </t>
          <t>
        The gateway SHOULD indicate the environment and protocol in the "via"
        clauses of Received header field(s) that it supplies.
          </t>
        </section>
        <!-- 3.7.2 -->
    <section numbered="true" toc="default">
          <name>Addresses in Gatewaying</name>
          <!-- 3.7.3 -->
      <t>
        From the Internet side, the gateway SHOULD accept all valid address
        formats in SMTP commands and in the RFC 822 header section,
        and all valid RFC 822
        messages.  Addresses and header fields generated by gateways MUST conform
        to applicable standards (including this one
        and <xref target="rfc5322bis" format="default">RFC5322bis</xref>).
        Gateways are, of course, subject to the same rules for handling source
        routes as those described for other SMTP systems
        in <xref target="mail_transactions" format="default"/>.
          </t>
        </section>
        <!-- 3.7.3 -->
    <section numbered="true" toc="default">
          <name>Other Header Fields in Gatewaying</name>
          <!-- 3.7.4 -->
      <t>
        The gateway MUST ensure that all header fields of a message that it
        forwards into the Internet mail environment meet the requirements
        for Internet mail.  In particular, all addresses in "From:", "To:",
        "Cc:", etc., header fields MUST be transformed (if necessary)
        to satisfy the standard header syntax
        of <xref target="rfc5322bis" format="default"> RFC5322bis </xref>,
        MUST reference only fully-qualified domain names,
        and MUST be effective and useful for sending replies.  The translation
        algorithm used to convert mail from the Internet protocols to another
        environment's protocol SHOULD ensure that error messages from the
        foreign mail environment are delivered to the reverse-path from the
        SMTP envelope, not to an address in the "From:", "Sender:", or
        similar header fields of the message.
          </t>
        </section>
        <!-- 3.7.4 -->
    <section numbered="true" toc="default">
          <name>Envelopes in Gatewaying</name>
          <!-- 3.7.5 -->
      <t>
        Similarly, when forwarding a message from another environment into
        the Internet, the gateway SHOULD set the envelope return path in accordance
        with an error message return address, if supplied by the foreign environment.
        If the foreign environment has no equivalent concept, the gateway
        must select and use a best approximation, with the message originator's
        address as the default of last resort.
          </t>
        </section>
		<!-- end 3.7.5 -->

    <section anchor="OtherGatewayIssues" numbered="true" toc="default">
	   <name>Other Gateway Issues</name>
	   <!-- 3.7.6 -->
    <t>
      In general, gateways between the Internet and other mail systems SHOULD
      attempt to preserve any layering semantics across the boundaries between
      the two mail systems involved.  Gateway-translation approaches that
      attempt to take shortcuts by mapping (such as mapping envelope information
      from one system to the message header section or body of another) have generally
      proven to be inadequate in important ways.  Systems translating between
      environments that do not support both envelopes and a header
      section and Internet
      mail must be written with the understanding that some information loss
      is almost inevitable.
      </t>
	</section>  <!-- end 3.7.6 -->
	
      </section>
      <!-- end 3.7 -->
      <section anchor="TerminatingSessions" numbered="true" toc="default">
        <name>Terminating Sessions and Connections</name>
        <!-- 3.8 -->
    <t>
      An SMTP connection is terminated when the client sends a QUIT command.
      The server responds with a positive reply code, after which it closes
      the connection.
        </t>
        <t>
      An SMTP server MUST NOT intentionally close the connection under normal
      operational circumstances (see <xref target="resistance_to_attacks" format="default"/>) except:
        </t>
        <ul spacing="normal">
          <li>After receiving a QUIT command and responding with a 221 reply.
        </li>
          <li>After detecting the need to shut down the SMTP service and
           returning a 421 reply code.  This reply code can be issued
           after the server receives any command or, if necessary, asynchronously
           from command receipt (on the assumption that the client will receive
           it after the next command is issued).
        </li>
          <li>After a timeout, as specified in <xref target="timeouts" format="default"/>,
           occurs waiting for the client to send a command
           or data.
        </li>
        </ul>
        <t>
      In particular, a server that closes connections in response to commands
      that are not understood is in violation of this specification.
      Servers are expected to be tolerant of unknown commands, issuing a 500
      reply and awaiting further instructions from the client.
        </t>
        <t>
      An SMTP server that is forcibly shut down via external means SHOULD
      attempt to send a line containing a 421 reply code to the SMTP client
      before exiting.  The SMTP client will normally read the 421
      reply code after sending its next command.
        </t>
        <t>
      SMTP clients that experience a connection close, reset, or other communications
      failure due to circumstances not under their control (in violation of
      the intent of this specification but sometimes unavoidable) SHOULD,
      to maintain the robustness of the mail system, treat the mail transaction
      as if a 421 response had been received and act accordingly.
        </t>
        <t> There are circumstances, contrary to the intent of this specification,
        in which an SMTP server may receive an indication that the underlying
        TCP connection has been closed or reset.  To preserve the robustness
        of the mail system, SMTP servers should be prepared for this
		condition
        and SHOULD treat it as if a QUIT had been received before the connection
        disappeared.
        </t>
      </section>
      <!-- 3.8 -->
    </section>
    <!-- 3 -->
      <section anchor="smtp_specifications" numbered="true" toc="default">
      <name>The SMTP Specifications</name>
      <!-- 4 -->
    <section numbered="true" toc="default">
        <name>SMTP Commands</name>
        <!-- 4.1 -->
      <section anchor="command_semantics_and_syntax" numbered="true" toc="default">
          <name>Command Semantics and Syntax</name>
          <!-- 4.1.1 -->
        <t>
          The SMTP commands define the mail transfer or the mail system function
          requested by the user.  SMTP commands are character strings terminated
          by &lt;CRLF&gt;.  The commands themselves are alphabetic characters
          terminated by &lt;SP&gt; if parameters follow and &lt;CRLF&gt; otherwise.
          (In the interest of improved interoperability, SMTP
          receivers SHOULD tolerate trailing white space before the terminating
          &lt;CRLF&gt;.)
          The syntax of the local part of a mailbox MUST conform
          to receiver site conventions and the syntax specified
          in <xref target="command_argument_syntax" format="default"/>.
          The SMTP commands are discussed below.  The SMTP replies are discussed
          in <xref target="smtp_replies" format="default"/>.
          </t>
          <t>
          A mail transaction involves several data objects that 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
          that 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.
          </t>
          <t>
          Several commands (RSET, DATA, QUIT) are specified as not permitting
          parameters.  In the absence of specific extensions offered by the
          server and accepted by the client, clients MUST NOT send such parameters
          and servers SHOULD reject commands containing them as having invalid syntax.
          </t>
          <section anchor="extended_hello" toc="include" numbered="true">
            <name>Extended HELLO (EHLO) or HELLO (HELO)</name>
            <!-- 4.1.1.1 -->
           <iref item="Commands and Syntax" subitem="ehlo" primary="false"/>
           <iref item="Commands and Syntax" subitem="helo" primary="false"/>		   

        <t>These commands are used to identify the SMTP client to the SMTP server.
        The argument clause contains the fully-qualified domain name of the SMTP
        client, if one is available.  In situations in which the SMTP client system
        does not have a meaningful domain name (e.g., when its address is dynamically
        allocated and no reverse mapping record is available), the client SHOULD
        send an address literal
        (see <xref target="address_literals" format="default"/>).
           Additional discussion of domain names in SMTP commands
           appears in <xref target="domain_names"/>.</t>

     <t>RFC 2821, and some earlier informal practices, encouraged
        following the literal by information that would help to identify the
        client system.  That convention was not widely supported, and
        many SMTP servers considered it an error.  In the interest of
        interoperability, it is probably wise for servers to be
        prepared for this string to occur, but SMTP clients MUST NOT
		send it.
            </t>
            <t>The SMTP server identifies itself to the SMTP client in
        the connection greeting reply and in the response to this
        command.</t>
            <t>
        A client SMTP SHOULD start an SMTP session by issuing the EHLO command.
        If the SMTP server supports the SMTP service extensions, it will give
        a successful response, a failure response, or an error response.  If
        the SMTP server, in violation of this specification, does not support
        any SMTP service extensions, it will generate an error response.  Older
        client SMTP systems MAY, as discussed above, use HELO (as specified in
        RFC 821) instead of EHLO, and servers MUST support the HELO command and
        reply properly to it.  In any event, a client MUST issue HELO or EHLO
        before starting a mail transaction.
            </t>
            <t>
        These commands, and a "250 OK" reply to one of them, confirm that both
        the SMTP client and the SMTP server are in the initial state, that is,
        there is no transaction in progress and all state tables and buffers
        are cleared.
            </t>
            <t>
        Syntax:

            </t>
            <dl newline="false" spacing="normal" indent="15">
			   <dt>ehlo
				  <iref item="Extension Registration Template Components"
					   subitem="EHLO Keyword" primary="false"/>
			   </dt>
              <dd>
              = "EHLO" SP ( Domain / address-literal ) CRLF
              </dd>
              <dt>helo</dt>
              <dd>
              = "HELO" SP Domain CRLF</dd>
           </dl>
            <t>Normally, the response to EHLO will be a multiline reply.  Each line
        of the response contains a keyword and, optionally, one or more parameters.
        Following the normal syntax for multiline replies, these keywords follow
        the code (250) and a hyphen for all but the last line, and the code and
        a space for the last line.  The syntax for a positive response, using
        the ABNF notation and terminal symbols of
        <xref target="RFC5234" format="default">RFC 5234</xref>, is:
            </t>
            <dl newline="false" spacing="normal" indent="17">
              <dt>ehlo-ok-rsp    =</dt>
              <dd>
               ( "250" SP Domain [ SP ehlo-greet ] CRLF )<br/>
               / ( "250-" Domain [ SP ehlo-greet ] CRLF<br/>
               *( "250-" ehlo-line CRLF )<br/>
                  "250" SP ehlo-line CRLF  )
          </dd>
              <dt>ehlo-greet     =</dt>
              <dd>
             1*(%d0-9 / %d11-12 / %d14-127)<br/>
               ; string of any characters other than CR or LF
          </dd>
              <dt>ehlo-line      =</dt>
              <dd>
              ehlo-keyword *( SP ehlo-param )
          </dd>
              <dt>ehlo-keyword   =</dt>
              <dd>
             (ALPHA / DIGIT) *(ALPHA / DIGIT / "-")<br/>
               ; additional syntax of ehlo-params depends on<br/>
               ; ehlo-keyword
          </dd>
              <dt>ehlo-param     =</dt>
              <dd>
             1*(%d33-126)<br/>
               ; any CHAR excluding &lt;SP&gt; and all<br/>
               ; control characters (US-ASCII 0-31 and 127<br/>
               ; inclusive)
          </dd>
            </dl>
            <t>
        Although EHLO keywords may be specified in upper, lower, or mixed case,
        they MUST always be recognized and processed in a case-insensitive manner.
        This is simply an extension of practices specified in RFC 821
        and
           <xref target="general_syntax_principles" format="default"/>.</t>
            <t>The EHLO response MUST contain keywords (and associated parameters if
            required) for all commands not listed as "required"
            in <xref target="minimum_implementation"
            format="default"/>.
            </t>
          </section>
          <section toc="include" numbered="true">
            <name>MAIL (MAIL)</name>
            <!-- 4.1.1.2 -->
          <t>
        This command is used to initiate a mail transaction in which the mail
        data is delivered to an SMTP server that may, in turn, deliver it to
        one or more mailboxes or pass it on to another system (possibly using
        SMTP).  The argument clause contains a reverse-path and may contain optional
        parameters.  In general, the MAIL command may be sent only when no mail
        transaction is in progress, see <xref target="order_of_commands" format="default"/>.
            </t>
            <t>
        The reverse-path consists of the sender mailbox.  Historically, that
        mailbox might optionally have been preceded by a list of hosts, but that
        behavior is now deprecated (see <xref target="source_routing" format="default"/>).  In
        some types of reporting messages for which a reply is likely to cause
        a mail loop (for example, mail delivery and non-delivery notifications),
        the reverse-path may be null (see <xref target="relaying" format="default"/>).
            </t>
            <t>
        This command clears the reverse-path buffer, the forward-path buffer,
        and the mail data buffer, and it inserts the reverse-path information from
        its argument clause into the reverse-path buffer.
            </t>
            <t>
        If service extensions were negotiated, the MAIL command may also carry
        parameters associated with a particular service extension.
            </t>
            <t>Syntax:
            </t>
            <dl newline="false" spacing="normal" indent="15">
              <dt>  mail = "MAIL FROM:" Reverse-path</dt>
              <dd>
          <br/>
             [SP Mail-parameters] CRLF
            <iref item="Commands and Syntax" subitem="mail" primary="false"/></dd>
            </dl>
          </section>
          <section anchor="recipient" toc="include" numbered="true">
            <name>RECIPIENT (RCPT)</name>
            <!-- 4.1.1.3 -->
          <t>
        This command is used to identify an individual recipient of the mail
        data; multiple recipients are specified by multiple uses of this command.
        The argument clause contains a forward-path and may contain
        optional parameters. </t>
	 <t>
		The forward-path consists of the required destination
        mailbox. When mail reaches its ultimate destination, the
        SMTP server inserts it into the destination mailbox in
		accordance with its host mail conventions.
	 </t>

     <t> Prior versions of the SMTP specification included text and
        examples in this section of use of the deprecated source route
        construct.   If desired, see <xref target="source_routing"/>
        for discussion of that mechanism.</t>

     <t>This command appends its forward-path argument to the
        forward-path buffer; it does not change the reverse-path
        buffer nor the mail data buffer.</t>
            <t>For example, mail received at relay host xyz.com with envelope commands
            </t>
            <ul empty="true" spacing="normal">
              <li>
          MAIL FROM:&lt;userx@y.foo.org&gt;<br/>
          RCPT TO:&lt;userc@d.bar.org&gt;
            </li>
            </ul>
            <t>
        will result in a DNS lookup for d.bar.org and transmission to
        the host specified in the most-preferred MX record that is
        available (or by the address record if there are no MX
        records).  It will use envelope commands identical to the
        above, i.e.,
            </t>
            <ul empty="true" spacing="normal">
              <li>
          MAIL FROM:&lt;userx@y.foo.org&gt;<br/>
          RCPT TO:&lt;userc@d.bar.org&gt;
        </li>
            </ul>

        <t> Since hosts are not required to relay mail at all, xyz.com
        MAY also reject the message entirely when the RCPT command is received,
        using a 550 code (since this is a "policy reason").
        </t>
        <t> If the SMTP server determines that a message sent to the
           mailbox in the forward-path is not deliverable, it MUST
		   either return an appropriate reply code (see
           <xref target="ReplyFunctionGroups"/>) or generate a
		   non-delivery notification.</t>
		<t> If there were multiple failed recipients, either a single
           notification listing all of the failed recipients or separate
           notification messages MUST be sent for each failed recipient.  For
           economy of processing by the sender, the former SHOULD be used
           when possible.
           All notification messages about undeliverable mail
           MUST be sent using the MAIL command
           and MUST use a null return path as discussed
           in <xref target="relaying" format="default"/>.</t>

            <t>
        If service extensions were negotiated, the RCPT command may also carry
        parameters associated with a particular service extension offered by
        the server.  The client MUST NOT transmit parameters other than those
        associated with a service extension offered by the server in
        its EHLO response. </t>
            <t>Syntax:
            </t>
            <dl newline="false" spacing="normal" indent="15">
              <dt>   rcpt = "RCPT TO:" ( "&lt;Postmaster@" Domain "&gt;" / "&lt;Postmaster&gt;" /</dt>
              <dd>
                <br/>
              Forward-path ) [SP Rcpt-parameters] CRLF</dd>
            </dl>
            <t>
               Note that, in a departure from the usual rules for
               local-parts, the "Postmaster" string shown above is
               treated as case-insensitive.
          <iref item="Commands and Syntax" subitem="rcpt" primary="false"/></t>
          </section>
          <section anchor="DATA" toc="include" numbered="true">
            <name>DATA (DATA)</name>
			<!-- 4.1.1.4 -->
          <t>The receiver normally sends a 354 response to DATA, and then treats the
                lines (strings ending in &lt;CRLF&gt; sequences, as described
                in <xref target="lines" format="default"/>) following
				the command as mail data from the sender.
                This command causes the mail data to be appended to
                the mail data buffer.
                Unless some other character or non-character encoding
                is negotiated with an SMTP extension,
                the mail data may contain any of the 128 ASCII
                character codes.  Experience has indicated that use
                of ASCII or ASCII-derived control characters other than SP,
                HT, CR, and LF may cause problems and SHOULD be
                avoided when possible.</t>
            <t>The mail data are terminated by a line containing only a period, that
                is, the character sequence "&lt;CRLF&gt;.&lt;CRLF&gt;", where the first
                &lt;CRLF&gt; is actually the terminator of the previous line
                (see <xref target="Transparency" format="default"/>).  This is the end of mail data indication.
                The first &lt;CRLF&gt; of this terminating sequence is also the &lt;CRLF&gt;
                that ends the final line of the data (message text) or, if there was
                no mail data, ends the DATA command itself (the "no mail data" case does
                not conform to this specification since it would require that neither
                the trace header fields required by this specification nor
                the message header section
                required by <xref target="rfc5322bis" format="default">RFC 5322bis</xref>
                be transmitted).
                An extra &lt;CRLF&gt;
                MUST NOT be added, as that would cause an empty line to be added to the
                message.  The only exception to this rule would arise if the message
                body were passed to the originating SMTP-sender with a final "line" that
                did not end in &lt;CRLF&gt;; in that case, the originating SMTP system
                MUST either reject the message as invalid or add &lt;CRLF&gt; in order
                to have the receiving SMTP server recognize the "end
                of data" condition. </t>
            <t>The custom of accepting lines ending only in &lt;LF&gt;, as a concession
                to non-conforming behavior on the part of some UNIX systems, has proven
                to cause more interoperability problems than it solves, and SMTP server
                systems MUST NOT do this, even in the name of improved robustness.  In
                particular, the sequence "&lt;LF&gt;.&lt;LF&gt;" (bare line feeds, without
                carriage returns) MUST NOT be treated as equivalent to &lt;CRLF&gt;.&lt;CRLF&gt;
                as the end of mail data indication.</t>
            <t>Receipt of the end of mail data indication requires the server to 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, the receiver MUST send a failure
                reply.  The SMTP model does not allow for partial failures at this point:
                either the message is accepted by the server for delivery and a positive
                response is returned or it is not accepted and a
                failure reply is returned
                (see <xref target="GatewayReturnPath"/> for additional
                discussion).
                In sending a positive "250 OK"
                completion reply to the end of data indication,
                the receiver takes full responsibility for the
                message (see <xref target="reliable_delivery" format="default"/>).
                Errors that are diagnosed subsequently MUST be
                reported in a mail message.
			</t>
			<t> The server must give special treatment to cases in
             which processing
             following the end of mail data indication is only partially successful.
             This could happen if, after accepting several recipients and the mail
             data, the SMTP server finds that the mail data could be successfully
             delivered to some, but not all, of the recipients.  In such cases,
             the response to the DATA command MUST be an OK reply.  However, the
             SMTP server MUST compose and send an "undeliverable mail" notification
             message to the originator of the message.
			 </t>
			 <t>When the SMTP server accepts a message either for relaying or for final
                delivery, it inserts a trace record (also referred to interchangeably
                as a "time stamp line", "Received" line, or
                "Received:" header field) at the top of the mail data.
                This trace record indicates the identity of the host that sent the message,
                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.  Details for formation
                of these lines, including their syntax, is specified
                in <xref target="trace_information" format="default"/>.</t>

            <t>Additional discussion about the operation of the DATA command appears
                in <xref target="mail_transactions" format="default"/>.</t>
            <t>Syntax:
            </t>
            <ul empty="true" spacing="normal">
              <li>data = "DATA" CRLF
                   <iref item="Commands and Syntax" subitem="data" primary="false"/></li>
            </ul>
          </section>
          <section anchor="RSET-cmd" toc="include" numbered="true">
            <name>RESET (RSET)</name>
            <!-- 4.1.1.5 -->
          <t>
        This command specifies that the current mail transaction will be aborted.
        Any stored sender, recipients, and mail data MUST be discarded, and all
        buffers and state tables cleared.  The receiver MUST send a "250 OK"
        reply to a RSET command with no arguments.  A reset command may be issued
        by the client at any time.  It is effectively equivalent to a NOOP (i.e.,
        it has no effect) if issued immediately after EHLO or HELO,
		before either of those commands is issued
        in the session, after an end of data indicator has been sent and acknowledged,
        or immediately before a QUIT.  An SMTP server MUST NOT close the connection
        as the result of receiving a RSET; that action is reserved for QUIT (see
        <xref target="QUIT" format="default"/>).
            </t>
            <t>
        Since EHLO implies some additional processing and response by the server,
        RSET will normally be more efficient than reissuing that command, even
        though the formal semantics are the same.
            </t>
            <t>
            Syntax:
            </t>
            <ul empty="true" spacing="normal">
              <li>
          rset = "RSET" CRLF
              <iref item="Commands and Syntax" subitem="rset" primary="false"/></li>
            </ul>
          </section>
          <section toc="include" numbered="true">
            <name>VERIFY (VRFY)</name>
            <!-- 4.1.1.6 -->
          <t>
        This command asks the receiver to confirm that the argument identifies
        a user or mailbox.  If it is a user name, information is returned as
        specified in <xref target="commands_for_debugging_addresses" format="default"/>.
            </t>
            <t>
        This command has no effect on the reverse-path buffer, the forward-path
        buffer, or the mail data buffer.
            </t>
            <t>
            Syntax:
            </t>
            <ul empty="true" spacing="normal">
              <li>
              vrfy = "VRFY" SP String CRLF
            <iref item="Commands and Syntax" subitem="vrfy" primary="false"/></li>
            </ul>
          </section>
          <section toc="include" numbered="true">
            <name>EXPAND (EXPN)</name>
            <!-- 4.1.1.7 -->
          <t>
        This command asks the receiver to confirm that the argument identifies
        a mailing list, and if so, to return the membership of that list.  If
        the command is successful, a reply is returned containing information
        as described in <xref target="commands_for_debugging_addresses" format="default"/>.  This
        reply will have multiple lines except in the trivial case of a one-member list.
            </t>
            <t>
        This command has no effect on the reverse-path buffer, the forward-path
        buffer, or the mail data buffer, and it may be issued at any time.
            </t>
            <t>
            Syntax:
            </t>
            <ul empty="true" spacing="normal">
              <li>
           expn = "EXPN" SP String CRLF
        <iref item="Commands and Syntax" subitem="expn" primary="false"/></li>
            </ul>
          </section>
          <section toc="include" numbered="true">
            <name>HELP (HELP)</name>
            <!-- 4.1.1.8 -->
          <t>
        This command causes the server to send helpful information to the client.
        The command MAY take an argument (e.g., any command name) and return
        more specific information as a response.
            </t>
            <t>
        This command has no effect on the reverse-path buffer, the
        forward-path
        buffer, or the mail data buffer, and it may be issued at any time.
            </t>
            <t>
        SMTP servers SHOULD support HELP without arguments and MAY support it
        with arguments.
            </t>
            <t>
            Syntax:
            </t>
            <ul empty="true" spacing="normal">
              <li>
          help = "HELP" [ SP String ] CRLF
        <iref item="Commands and Syntax" subitem="help" primary="false"/></li>
            </ul>
          </section>

		  <section toc="include" numbered="true">
            <name>NOOP (NOOP)</name>
            <!-- 4.1.1.9 -->
          <t>
        This command does not affect any parameters or previously entered commands.
        It specifies no action other than that the receiver send a
        "250 OK" reply.
            </t>
            <t>
        This command has no effect on the reverse-path buffer, the forward-path
        buffer, or the mail data buffer, and it may be issued at any time.  If a
        parameter string is specified, servers SHOULD ignore it.
            </t>
            <t>
            Syntax:
            </t>
            <ul empty="true" spacing="normal">
              <li>
          noop = "NOOP" [ SP String ] CRLF
        <iref item="Commands and Syntax" subitem="noop" primary="false"/></li>
            </ul>
          </section>
          <section anchor="QUIT" toc="include" numbered="true">
            <name>QUIT (QUIT)</name>
            <!-- 4.1.1.10 -->
          <t>
        This command specifies that the receiver MUST send
        a "221 OK"
        reply, and then close the transmission channel.
            </t>
            <t>
        The receiver MUST NOT intentionally close the transmission channel until
        it receives and replies to a QUIT command (even if there was an error).
        The sender MUST NOT intentionally close the transmission channel until
        it sends a QUIT command, and it SHOULD wait until it receives the reply (even
        if there was an error response to a previous command).  If the connection
        is closed prematurely due to violations of the above or system or network
        failure, the server MUST cancel any pending transaction, but not undo
        any previously completed transaction, and generally MUST act as if the
        command or transaction in progress had received a temporary error (i.e.,
        a 4yz response).</t>
            <t>The QUIT command may be issued at any time.  Any current
        uncompleted mail transaction will be aborted.
        </t>
            <t>Syntax:
            </t>
            <ul empty="true" spacing="normal">
              <li>
          quit = "QUIT" CRLF
        <iref item="Commands and Syntax" subitem="quit" primary="false"/></li>
            </ul>
          </section>
          <section numbered="true" toc="default">   <!-- 4.1.1.11 -->
            <name>Mail-Parameter and Rcpt-Parameter Error Responses</name>
            <t>
       If the server SMTP does not recognize or cannot implement one or more
        of the parameters associated with a particular MAIL or RCPT
        command, it will return code 555.</t>
            <t>If, for some reason, the server is temporarily unable to accommodate
        one or more of the parameters associated with a MAIL or RCPT
        command, and if the definition of the specific parameter does not
        mandate the use of another code, it should return code
        455.</t>
            <t>Errors specific to particular parameters and their values will be
        specified in the document that defines the parameter.</t>
          </section>
        </section>
        <section anchor="command_argument_syntax" numbered="true" toc="default">
          <name>Command Argument Syntax</name>
          <!-- 4.1.2 -->
        <t>The syntax of the argument clauses of the above commands (using the
           syntax specified in
           <xref target="RFC5234" format="default">RFC 5234</xref>
          where
          applicable) is given below.
          Some terminals not defined
          in this document, but are defined elsewhere, specifically:
          </t>
          <ul spacing="normal">
            <li> In the "core" syntax in Appendix B
                of <xref target="RFC5234" format="default">RFC 5234</xref>:
                ALPHA<iref item="Argument Syntax" subitem="ALPHA" primary="false"/>,
                CRLF<iref item="Argument Syntax" subitem="CRLF" primary="false"/>,
                DIGIT<iref item="Argument Syntax" subitem="DIGIT" primary="false"/>,
                HEXDIG<iref item="Argument Syntax" subitem="HEXDIG" primary="false"/>,
                and
                SP <iref item="Argument Syntax" subitem="SP" primary="false"/>. </li>
            <li> In the message format syntax
                in <xref target="rfc5322bis" format="default">RFC5322bis</xref>:
                atext<iref item="Argument Syntax" subitem="atext" primary="false"/>,
                CFWS<iref item="Argument Syntax" subitem="CFWS" primary="false"/>,
                date-time<iref item="Argument Syntax"
                       subitem="date-time" primary="false"/>,
                and
                FWS<iref item="Argument Syntax" subitem="FWS" primary="false"/>
                msg-id<iref item="Argument Syntax" subitem="msg-id" primary="false"/>.
            </li>
          </ul>
          <dl newline="false" spacing="normal" indent="15">
            <dt>Reverse-path</dt>
            <dd>
                = Path  / "&lt;&gt;"
            <iref item="Argument Syntax" subitem="Reverse-Path" primary="false"/></dd>
            <dt>Forward-path</dt>
            <dd>
               = Path
            <iref item="Argument Syntax" subitem="Forward-Path" primary="false"/></dd>
            <dt>Path</dt>
            <dd>
               = "&lt;" Mailbox "&gt;"
            <iref item="Argument Syntax" subitem="Path" primary="false"/></dd>
            <dt>Mail-parameters</dt>
            <dd>
               = esmtp-param *(SP esmtp-param)
            <iref item="Argument Syntax" subitem="Mail-parameters" primary="false"/></dd>
            <dt>Rcpt-parameters</dt>
            <dd>
               = esmtp-param *(SP esmtp-param)
            <iref item="Argument Syntax" subitem="Rcpt-parameters" primary="false"/></dd>
            <dt>esmtp-param</dt>
            <dd>
               = esmtp-keyword ["=" esmtp-value]
            <iref item="Argument Syntax" subitem="esmtp-param" primary="false"/></dd>
            <dt>esmtp-keyword</dt>
            <dd>
               = (ALPHA / DIGIT) *(ALPHA / DIGIT / "-")
            <iref item="Argument Syntax" subitem="esmtp-keyword" primary="false"/></dd>
            <dt>esmtp-value</dt>
            <dd>
               = 1*(%d33-60 / %d62-126)<br/>
                  ; any CHAR excluding "=", SP, and control<br/>
                     ; characters.  If this string is an email
                     address,<br/>
                     ;  i.e., a Mailbox, then the "xtext" syntax
                     <xref target="RFC3461" format="default"/> <br/>
                     ; SHOULD be used.
            <iref item="Argument Syntax" subitem="esmtp-value" primary="false"/></dd>
            <dt>Keyword</dt>
            <dd>
               = Ldh-str
            <iref item="Argument Syntax" subitem="Keyword" primary="false"/></dd>
            <dt>Argument</dt>
            <dd>
               = Atom
            <iref item="Argument Syntax" subitem="Argument" primary="false"/></dd>
            <dt>Domain</dt>
            <dd>
               = sub-domain *("." sub-domain)
               <iref item="Argument Syntax" subitem="Domain" primary="false"/></dd>
            <dt>sub-domain</dt>
            <dd>
               = Let-dig [Ldh-str]
            <iref item="Argument Syntax" subitem="sub-domain" primary="false"/></dd>
            <dt>Let-dig</dt>
            <dd>
              = ALPHA / DIGIT
            <iref item="Argument Syntax" subitem="Let-dig" primary="false"/></dd>
            <dt>Ldh-str</dt>
            <dd>
              = *( ALPHA / DIGIT / "-" ) Let-dig
            <iref item="Argument Syntax" subitem="Ldh-str" primary="false"/></dd>
            <dt>address-literal</dt>
            <dd>
               = "[" ( IPv4-address-literal /
               <br/>
                 IPv6-address-literal /<br/>
                    General-address-literal ) "]"<br/>
                    ; See <xref target="address_literals" format="default"/>
              <iref item="Argument Syntax" subitem="address-literal" primary="false"/></dd>
            <dt>Mailbox</dt>
            <dd>
               = Local-part "@" ( Domain / address-literal )
            <iref item="Argument Syntax" subitem="Mailbox" primary="false"/></dd>
            <dt>Local-part</dt>
            <dd>
               = Dot-string / Quoted-string
               <br/>
                 ; MAY be case-sensitive
            <iref item="Argument Syntax" subitem="Local-part" primary="false"/>
              <br/></dd>
            <dt>Dot-string</dt>
            <dd>
               = Atom *("." Atom)
            <iref item="Argument Syntax" subitem="Dot-string" primary="false"/></dd>
            <dt>Atom</dt>
            <dd>
               = 1*atext
            <iref item="Argument Syntax" subitem="Atom" primary="false"/></dd>
            <dt>Quoted-string</dt>
            <dd>
               = DQUOTE 1*QcontentSMTP DQUOTE
            <iref item="Argument Syntax" subitem="Quoted-string" primary="false"/></dd>
            <dt>QcontentSMTP</dt>
            <dd>
               = qtextSMTP / quoted-pairSMTP
            <iref item="Argument Syntax" subitem="QcontentSMTP" primary="false"/></dd>
            <dt>quoted-pairSMTP</dt>
            <dd>
               = %d92 %d32-126
               <br/>
               ; i.e., backslash followed by any ASCII
               <br/>
               ; graphic (including itself) or SPace
            <iref item="Argument Syntax" subitem="quoted-pairSMTP" primary="false"/></dd>
            <dt>qtextSMTP</dt>
            <dd>
               = %d32-33 / %d35-91 / %d93-126
               <br/>
               ; i.e., within a quoted string, any
               <br/>
              ; ASCII graphic or space is permitted
              <br/>
              ; without backslash-quoting except
              <br/>
              ; double-quote and the backslash itself.
            <iref item="Argument Syntax" subitem="qtextSMTP" primary="false"/></dd>
            <dt>String</dt>
            <dd>
               = Atom / Quoted-string
              <iref item="Argument Syntax" subitem="String" primary="false"/></dd>
          </dl>

          <t>
                 Note that the backslash, "\", is a quote character, which is used
          to indicate that the next character is to be used literally (instead
          of its normal interpretation).  For example, "Joe\,Smith" indicates
          a single nine-character user name string with the comma being the fourth
          character of that string.</t>

       <t>  While the above definition for Local-part is relatively
          permissive, for maximum interoperability, a mailbox SHOULD
          NOT be defined with Local-part requiring (or using) the
          Quoted-string form or with the Local-part being
          case-sensitive. Further, when comparing a Local-part (e.g.,
          to a specific mailbox name), all quoting MUST be treated as
          equivalent. A sending system SHOULD transmit the form that
          uses the minimum quoting possible.</t>

         <t>For example, the following three local-parts are equivalent
            and MUST compare equal: "ab&nbsp;cd&nbsp;ef",
            "ab\&nbsp;cd&nbsp;ef" and "ab\&nbsp;\cd ef".
			Similarly, "fred" and fred (i.e., with and without quotes)
			MUST compare equal.  White space reduction
          MUST NOT be applied to the Local-part by intermediate
          systems.  As particular examples, systems that are not
          making final delivery MUST NOT make assumptions about the
          relationships among "ab&nbsp;&nbsp;&nbsp;cd"@example.com
          and "ab&nbsp;cd"@example.com or even "&nbsp;"@example.com
          and ""@example.com.</t>

          <t>In the absence of extensions, systems MUST NOT define
             mailboxes in such a way as to require the
          use in SMTP of non-ASCII characters (octets with the high order
          bit set to one) or ASCII "control characters" (decimal value 0-31
          and 127) <xref target="ASCII"/><xref target="RFC0020"/>.
          Extensions have been standardized for such use
          <xref target="RFC6530"/><xref target="RFC6531"/>.
          When these extensions are not in use, these characters MUST
          NOT be used in MAIL or RCPT commands or other commands that
          require mailbox names.</t>
          <t>To promote interoperability and consistent with long-standing guidance
          about conservative use of the DNS in naming and applications (e.g.,
          see Section 2.3.1 of the
          base DNS document, <xref target="RFC1035" format="default">RFC 1035</xref>),
          characters outside the set of alphabetic characters, digits, and hyphen MUST NOT
          appear in domain name labels for SMTP clients or servers.  In particular,
          the underscore character is not permitted.  SMTP servers that receive
          a command in which invalid character codes have been employed, and
          for which there are no other reasons for rejection, MUST reject
          that command with a 501 response (this rule, like others,
          could be overridden by appropriate SMTP extensions).</t>
        </section>
        <section anchor="address_literals" numbered="true" toc="default">
          <name>Address Literals</name>
          <!-- 4.1.3 -->
        <t>Sometimes a host is not known to the domain name system and communication
          (and, in particular, communication to report and repair the error)
          is blocked.  To bypass this barrier, a special literal form of the
          address is allowed as an alternative to a domain name.  For IPv4
          addresses, this form uses four small decimal integers separated
          by dots and enclosed by brackets such as [192.0.2.1], which indicates
		  an (IPv4) Internet Address in sequence-of-octets form.
		  For IPv6, 
          the form consists of a standardized "tag" ("IPv6") that identifies the address
          syntax, a colon, and the address itself, in the format specified in
		  <xref target="RFC5952" format="default">RFC 5952</xref>.
		  That format of a tag followed by an address is expected to
		  be used with any other forms of addressing that might
		  eventually be standardized. 
          </t>
          <t>
          Specifically:
          </t>
          <dl newline="false" spacing="normal" indent="15">
            <dt>IPv4-address-literal</dt>
            <dd>
             = Snum 3("." Snum)
          <iref item="Argument Syntax" subitem="IPv4-address-literal" primary="false"/></dd>
            <dt>IPv6-address-literal</dt>
            <dd>
             = "IPv6:" IPv6-addr
          <iref item="Argument Syntax" subitem="IPv6-address-literal" primary="false"/></dd>
            <dt>General-address-literal</dt>
            <dd>
             = Standardized-tag ":" 1*dcontent
          <iref item="Argument Syntax" subitem="General-address-literal" primary="false"/></dd>
            <dt>Standardized-tag</dt>
            <dd>
             = Ldh-str<br/>
                  ; Standardized-tag MUST be specified in a<br/>
                  ; Standards-Track RFC and registered with IANA<br/>
                  ; See <xref target="IANA-AddrLiterals"/>.
          <iref item="Argument Syntax" subitem="Standardized-tag" primary="false"/></dd>
            <dt>dcontent</dt>
            <dd>
             = %d33-90 /        ; Printable US-ASCII<br/>
               %d94-126         ; excl. "[", "\", "]"
          <iref item="Argument Syntax" subitem="dcontent" primary="false"/></dd>
            <dt>Snum</dt>
            <dd>
              = 1*3DIGIT <br/>
              ; representing a decimal integer<br/>
                 ; value in the range 0 through 255
          <iref item="Argument Syntax" subitem="Snum" primary="false"/></dd>
            <dt>IPv6-addr</dt>
            <dd>
              = 6( h16 ":" ) ls32<br/>
                  /                       "::" 5( h16 ":" ) ls32<br/>
                  / [               h16 ] "::" 4( h16 ":" ) ls32<br/>
                  / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32<br/>
                  / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32<br/>
                  / [ *3( h16 ":" ) h16 ] "::"    h16 ":"   ls32<br/>
                  / [ *4( h16 ":" ) h16 ] "::"              ls32<br/>
                  / [ *5( h16 ":" ) h16 ] "::"              h16<br/>
                  / [ *6( h16 ":" ) h16 ] "::"<br/>
                  ; This definition is consistent with the one for<br/>
                  ; URIs <xref target="RFC3986" format="default"/>.
          <iref item="Argument Syntax" subitem="IPv6-addr" primary="false"/></dd>
            <dt>ls32</dt>
            <dd>
             = ( h16 ":" h16 ) / IPv4-address-literal<br/>
                  ; least-significant 32 bits of address

            <iref item="Argument Syntax" subitem="ls32" primary="false"/></dd>
            <dt>h16</dt>
            <dd>
             = 1*4HEXDIG<br/>
                  ; 16 bits of address represented in hexadecimal
             <iref item="Argument Syntax" subitem="h16" primary="false"/></dd>
        </dl>
        </section>
        <section anchor="order_of_commands" numbered="true" toc="default">
          <name>Order of Commands</name>
          <!-- 4.1.4 -->
        <t>There are restrictions on the order in which these commands may
          be used.
          </t>
          <t>
          A session that will contain mail transactions MUST first be initialized
          by the use of the EHLO command.  An SMTP server SHOULD accept commands
          for non-mail transactions (e.g., VRFY, EXPN, or NOOP)
          without this initialization.
          </t>
          <t>
          An EHLO command MAY be issued by a client later in the session.
          If it is issued after the session begins and the EHLO command is
          acceptable to the SMTP server,
          the SMTP server MUST clear
          all buffers and reset the state exactly as if a RSET command had
          been issued (specifically, it terminates any mail
          transaction that was in progress,
          see <xref target="mail_transactions" format="default"/>).
          In other words, the sequence of RSET followed immediately
          by EHLO is redundant, but not harmful other than in the performance
          cost of executing unnecessary commands.  However the
          response to an additional EHLO command MAY be different from
          that from prior ones; the client MUST rely only on the
          responses from the most recent EHLO command.
          </t>
          <t>
          If the EHLO command is not acceptable to the SMTP server, 501, 500,
          502, or 550 failure replies MUST be returned as appropriate.  The
          SMTP server MUST stay in the same state after transmitting
          these replies that it was in before the EHLO was received.
          </t>
          <t>
          The SMTP client MUST, if possible, ensure that the domain parameter
          to the EHLO command is a primary host name as specified for
          this command in <xref target="domain_names" format="default"/>.
          If this is not possible (e.g., when the
          client's address is dynamically assigned and the client does not
          have an obvious name), an address literal SHOULD be substituted
          for the domain name.
          </t>
          <t>
          An SMTP server MAY verify that the domain name argument in the EHLO command
          has an address record matching the IP address of the
          client by looking up the domain name and making the
          comparison.
		  </t>
		  
        <t>
          The NOOP, HELP, EXPN, VRFY, and RSET commands can be used at any
          time during a session, or without previously initializing a session.
          SMTP servers SHOULD process these normally (that is, not return
          a 503 code) even if no EHLO command has yet been received; clients
          SHOULD open a session with EHLO before sending these commands.
          </t>
          <t>
          If these rules are followed, the example in RFC 821 that shows "550
          access denied to you" in response to an EXPN command is incorrect
          unless an EHLO command precedes the EXPN or the denial of access
          is based on the client's IP address or other authentication
          or authorization-determining mechanisms.
          </t>
          <t>
          A mail transaction begins with a MAIL command and then
          consists of
           one or more RCPT commands, and a DATA command, in that
           order.
           A mail transaction may be aborted by the RSET, a new
           EHLO, or the QUIT command. </t>
          <t>   SMTP extensions
           (see <xref target="extension_model" format="default"/>)
           may create additional commands that initiate, abort, or end the
           transaction.  More generally, any new command MUST clearly document any
           effect it has on the transaction state. </t>
		<t>There may be zero or more transactions in a session.
		   The MAIL command
          MUST NOT
          be sent if a mail transaction is already open, i.e., it should be
          sent only if no mail transaction had been started in the session,
          or if the previous one successfully concluded with a successful
          DATA command, or if the previous one was aborted, e.g., with a RSET
          or new EHLO.
          </t>
          <t>
          If the transaction beginning command argument is not acceptable,
          a 501 failure reply MUST be returned and the SMTP server MUST stay
          in the same state.  If the commands in a transaction are out of
          order to the degree that they cannot be processed by the server,
          a 503 failure reply MUST be returned and the SMTP server MUST stay
          in the same state.
          </t>
          <t>
          The last command in a session MUST be the QUIT command.  The QUIT
          command SHOULD
          be used by the client SMTP to request connection closure, even when
          no session opening command was sent and accepted.
          </t>
        </section>

      </section>
      <section anchor="smtp_replies" numbered="true" toc="default">
        <name>SMTP Replies</name>
        <!-- 4.2 -->
      <t>
        Replies to SMTP commands serve to ensure the synchronization of requests
        and actions in the process of mail transfer and to guarantee that
        the SMTP client always knows the state of the SMTP server.
        Every command MUST generate exactly one reply.  Even the
        command pipelining extension mentioned in
        <xref target="basic_structure"/> does not change this; it
        merely allows several commands to be issued before the replies
        for each are sent together.
        </t>
        <t>
        The details of the command-reply sequence are described
        in <xref target="sequencing_of_commands" format="default"/>.
        </t>
        <t>
        An SMTP reply consists of a three digit number (transmitted as three
        numeric characters) followed by some text unless specified otherwise
        in this document.  The number is for use by automata to determine
        what state to enter next; the text is for the human user.  The three
        digits contain enough encoded information that the SMTP client need
        not examine the text and may either discard it or pass it on to the
        user, as appropriate.  Exceptions are as noted elsewhere in this document.
        In particular, the 220, 221, 251, 421, and 551 reply codes are associated
        with message text that must be parsed and interpreted by machines.
        In the general case, the text may be receiver dependent and context
        dependent, so there are likely to be varying texts for each reply
        code.  A discussion of the theory of reply codes is given
        in <xref target="reply_code_severities" format="default"/>.
        Formally, a reply is defined to
        be the sequence: a three-digit code, &lt;SP&gt;, one line of text,
        and &lt;CRLF&gt;, or a multiline reply (as defined in the same section).
        Since, in violation of this specification, the text is sometimes not
        sent, clients that do not receive it SHOULD be prepared to process
        the code alone (with or without a trailing space character).  Only
        the EHLO, EXPN, and HELP commands are expected to result in multiline
        replies in normal circumstances; however, multiline replies are allowed
        for any command.
        </t>
        <t>
        In ABNF, server responses are:
        </t>
        <dl newline="false" spacing="normal" indent="15">
          <dt>Greeting</dt>
          <dd>
          = ( "220 " (Domain / address-literal) <br/> [ SP textstring ] CRLF ) /
          <br/>
          ( "220-" (Domain / address-literal) <br/> [ SP textstring ] CRLF
          <br/>
             *( "220-" [ textstring ] CRLF ) <br/>
             "220" [ SP textstring ] CRLF )
      <iref item="Argument Syntax" subitem="Greeting" primary="false"/></dd>
          <dt>textstring</dt>
          <dd>
          = 1*(%d09 / %d32-126) ; HT, SP, Printable US-ASCII
      <iref item="Argument Syntax" subitem="textstring" primary="false"/></dd>
          <dt>Reply-line</dt>
          <dd>
          = *( Reply-code "-" [ textstring ] CRLF )  <br/>
          Reply-code [ SP textstring ] CRLF
      <iref item="Argument Syntax" subitem="Reply-line" primary="false"/></dd>
          <dt>Reply-code</dt>
          <dd>
           = %x32-35 %x30-35 %x30-39
       <iref item="Argument Syntax" subitem="Reply-code" primary="false"/></dd>
        </dl>
        <t>
        where "Greeting" appears only in the 220 response that announces that
        the server is opening its part of the connection.
        (Other possible server responses upon connection follow the
        syntax of Reply-line.)
        </t>
        <t>
        An SMTP server SHOULD send only the reply codes listed in
        this document or additions to the list as discussed below.
         An SMTP server SHOULD use the text shown in the examples
         in messages where the text is parsed and interpreted by
         machines, as discussed above.
        </t>
        <t>
        An SMTP client MUST determine its actions only by the reply code,
        not by the text (except for the "change of address" 251 and 551 and,
        if necessary, 220, 221, and 421 replies); in the general case, any
        text, including no text at all (although senders SHOULD NOT send bare
        codes), MUST be acceptable.  The space (blank) following the reply
        code is considered part of the text.
        A Sender-SMTP MUST first test the whole 3 digit reply code it
        receives, as well as any accompanying supplemental codes or
        information (see <xref target="RFC3463" format="default"> RFC 3463</xref>
        and <xref target="RFC5248" format="default"> RFC 5248</xref>).
        If the full reply code is not recognized, and the additional
        information is not recognized or missing, the Sender-SMTP MUST
        use the first digit (severity indication) of a reply code it
        receives.
        </t>
		<t>
        The lists of codes that appear below MUST NOT be construed as
		permanent. Use of existing codes with enhanced status codes
		<xref target="RFC3463" format="default"/> is strongly
		preferred to adding new ones.
        For that reason and others, the addition of new codes should
		be a rare and significant activity.  Such an addition should
		carefully specify the information (including enhanced status codes),
		to be included in the textual part of the response.
        Enhanced status codes are specified in RFC 3463, the updates
		or successors to that specification, and the associated
		registry <xref target="RFC5248"/>).
		If new codes are necessary, they may be added as the result of new
        Standards-Track specifications.  Consequently, a sender-SMTP MUST
        be prepared to handle codes not specified in this document and MUST
        do so by interpreting the first digit only.</t>
        <t>In the absence of extensions negotiated with the client, SMTP
        servers MUST NOT send reply codes whose first digits are
        other than 2, 3, 4, or 5.   Clients that receive such
        out-of-range codes SHOULD normally treat them as fatal errors
		and terminate the mail transaction.</t>
	 
        <section anchor="reply_code_severities" numbered="true" toc="default">
          <name>Reply Code Severities and Theory</name>
		  <!-- 4.2.1 -->
        <t>The three digits of the reply code each have a special significance.
          The first digit denotes whether the response is good, bad, or incomplete.
          An unsophisticated SMTP client, or one that receives an unexpected
          code, will be able to determine its next action (proceed as planned,
          redo, retrench, etc.) by examining this first digit.  An SMTP client
          that wants to know approximately what kind of error occurred (e.g.,
          mail system error, command syntax error) may examine the second
          digit, which encodes responses in specific functional
		  categories.  The third digit and any supplemental information that may 
          be present is reserved for the finest gradation of information.
          </t>
          <t>
          There are four values for the first digit of the reply code:
          </t>
          <dl newline="false" spacing="normal">
        <dt>2yz</dt>
            <dd>
          Positive Completion reply<br/>
          The requested action has been successfully
          completed.  A new request may be initiated.
        </dd>
            <dt>3yz</dt>
            <dd>
          Positive Intermediate reply<br/>
          The command has been accepted, but the
          requested action is being held in abeyance, pending receipt of further
          information.  The SMTP client should send another command specifying
          this information.  This reply is used in command sequence groups (i.e., in DATA).
        </dd>
            <dt>4yz</dt>
            <dd>
          Transient Negative Completion reply<br/>
          The command was not accepted, and
          the requested action did not occur.  However, the error condition is
          temporary, and the action may be requested again.  The sender should
          return to the beginning of the command sequence (if any).  It is difficult
          to assign a meaning to "transient" when two different sites (receiver-
          and sender-SMTP agents) must agree on the interpretation.  Each reply
          in this category might have a different time value, but the SMTP client
          SHOULD
          try again.  A rule of thumb to determine whether a
          reply fits into the 4yz or the 5yz category (see below) is that replies
          are 4yz if they can be successful if repeated without any change in
          command form or in properties of the sender or receiver (that is, the
          command is repeated identically and the receiver does not put up a
          new implementation).
        </dd>
            <dt>5yz</dt>
            <dd>
          Permanent Negative Completion reply<br/>
          The command was not accepted and
          the requested action did not occur.  The SMTP client SHOULD
          NOT
          repeat the exact request (in the same sequence).  Even some
          "permanent" error conditions can be corrected, so the human user may
          want to direct the SMTP client to reinitiate the command sequence by
          direct action at some point in the future (e.g., after the spelling
          has been changed, or the user has altered the account status).
        </dd>
          </dl>
          <t>
          It is worth noting that the file transfer protocol (FTP)
          <xref target="RFC0959" format="default"/> uses a very similar code
          architecture and that the SMTP codes are based on the FTP
          model.  However, SMTP uses a one-command, one-response
          model (while FTP is asynchronous) and FTP's 1yz codes are not
          part of the SMTP model.
		  </t>
		  
          <t>The second digit encodes responses in specific categories:
		  </t>
		  
          <dl newline="false" spacing="normal">
            <dt>x0z</dt>
            <dd>
          Syntax: These replies refer to syntax errors, syntactically correct
          commands that do not fit any functional category, and unimplemented
          or superfluous commands.
        </dd>
            <dt>x1z</dt>
            <dd>
          Information: These are replies to requests for information, such as
          status or help.
        </dd>
            <dt>x2z</dt>
            <dd>
          Connections: These are replies referring to the transmission channel.
        </dd>
            <dt>x3z</dt>
            <dd>
          Unspecified.
        </dd>
            <dt>x4z</dt>
            <dd>
          Unspecified.
        </dd>
            <dt>x5z</dt>
            <dd>
          Mail system: These replies indicate the status of the receiver mail
          system vis-a-vis the requested transfer or other mail system action.
        </dd>
          </dl>
          <t>
          The third digit gives a finer gradation of meaning in each category
          specified by the second digit.  The list of replies illustrates
          this.  Each reply text is recommended rather than mandatory, and
          may even change according to the command with which it is associated.
          On the other hand, the reply codes must strictly follow the specifications
          in this section.  Receiver implementations should not invent new
          codes for slightly different situations from the ones described
          here, but rather adapt codes already defined.
          </t>
          <t>
          For example, a command such as NOOP, whose successful execution
          does not offer the SMTP client any new information, will return
          a 250 reply.  The reply is 502 when the command requests an unimplemented
          non-site-specific action.  A refinement of that is the 504 reply
          for a command that is implemented, but that requests an unimplemented parameter.
          </t>
          <t>
          The reply text may be longer than a single line; in these cases
          the complete text must be marked so the SMTP client knows when it
          can stop reading the reply.  This requires a special format to indicate
          a multiple line reply.
          </t>
          <t>
          The format for multiline replies requires that every line, except
          the last, begin with the reply code, followed immediately by a hyphen,
          "-" (also known as minus), followed by text.  The last line will
          begin with the reply code, followed immediately by &lt;SP&gt;, optionally
          some text, and &lt;CRLF&gt;.  As noted above, servers SHOULD send
          the &lt;SP&gt; if subsequent text is not sent, but clients MUST
          be prepared for it to be omitted.
          </t>
          <t>
          For example:
          </t>
          <ul empty="true" spacing="normal">
            <li>
          250-First line<br/>
          250-Second line<br/>
          250-234 Text beginning with numbers <br/>
          250 The last line
          </li>
          </ul>
          <t>In a multiline reply, the reply code on each of the lines
           MUST be the same. It is reasonable for the client to rely
           on this, so it can make processing decisions based on the
           code in any line, assuming that all others will be the
           same.
           In a few cases, there is important
           data for the client in the reply "text".  The client will be able
           to identify these cases from the current context.
          </t>
        </section>

		<section numbered="true" toc="default" anchor="ReplyFunctionGroups">
          <name>Reply Codes by Function Groups (Second Digit)</name>
		  <!-- 4.2.2 -->
		  
        <dl newline="false" spacing="compact">   <!-- x0z -->
            <dt>500</dt>
            <dd>Syntax error, command unrecognized (This
             may include errors such as command line too long)</dd>
            <dt>501</dt>
            <dd>Syntax error in parameters or arguments</dd>
            <dt>502</dt>
            <dd>Command not implemented (see
             <xref target="reply_code_502" format="default"/>)</dd>
            <dt>503</dt>
            <dd>Bad sequence of commands</dd>
            <dt>504</dt>
            <dd>Command parameter not implemented
			   <br/></dd>
		</dl>
		
		<dl newline="false" spacing="compact">  <!-- x1z -->
            <dt>211</dt>
            <dd>System status, or system help reply</dd>
            <dt>214</dt>
            <dd>Help message (Information on how to use the
             receiver or the meaning of a particular non-standard
			 command; this reply is useful only to the human user)
			</dd>
		</dl>
		
		<dl newline="false" spacing="compact">  <!-- x2z -->
            <dt>220</dt>
            <dd>&lt;domain&gt; Service ready</dd>
            <dt>221</dt>
            <dd>&lt;domain&gt; Service closing
             transmission channel</dd>
            <dt>421</dt>
            <dd>&lt;domain&gt; Service not available,
             closing
            transmission channel (This may be a reply to any command
			if the service knows it must shut down)</dd>
            <dt>521</dt>
			<dd>&lt;domain&gt; No mail  service here.
			</dd>
		</dl>
		
		<dl newline="false" spacing="compact">  <!-- x5z -->
            <dt>250</dt>
            <dd>Requested mail action okay, completed</dd>
            <dt>251</dt>
            <dd>User not local; will forward to
             &lt;forward-path&gt; (See
             <xref target="forwarding_for_address_correction" format="default"/>)</dd>
            <dt>252</dt>
            <dd>Cannot VRFY user, but will accept
             message and attempt delivery
             (See <xref target="meaning_vrfy_expn_success" format="default"/>) </dd>

            <dt>354</dt>
            <dd>Start mail input; end with
			   &lt;CRLF&gt;.&lt;CRLF&gt;</dd>

            <dt>450</dt>
            <dd>Requested mail action not taken:
             mailbox unavailable (e.g., mailbox busy or temporarily
             blocked for policy reasons, or server temporarily
             unavailable if returned before a mail transaction is
             started)
			</dd>
            <dt>451</dt>
            <dd>Requested action aborted: error in
			   processing</dd>
            <dt>452</dt>
            <dd>Requested action not taken: insufficient
             system storage (preferred code for "too many
             recipients", see <xref target="workaround-552" format="default"/>)</dd>
			<dt>455</dt>
            <dd>Server unable to accommodate
             parameters
			</dd>
            <dt>550</dt>
            <dd>Requested action not taken: mailbox
             unavailable (e.g., mailbox not found, no access, or
			 command rejected for policy reasons)</dd>
            <dt>552</dt>
            <dd>Requested mail action aborted: exceeded
             storage allocation.
             </dd>
            <dt>553</dt>
            <dd>Requested action not taken: mailbox name
               not allowed (e.g., mailbox syntax incorrect).
               This code is also used as an "ambiguous mailbox"
               response to VRFY, see
			   <xref target="debug-commands-overview"/>.</dd>
            <dt>554</dt>
            <dd>Transaction failed (Or, historically in
             the case of a connection-opening response, "No SMTP
             service here".  521 is now preferred for that function at
             connection-opening if the server never accepts mail.)
            </dd>

			<dt>555</dt>
            <dd>MAIL FROM/RCPT TO parameters not
             recognized or not implemented
			</dd>			

			<dt>556</dt>
            <dd> No mail service at this domain.
			</dd>
		</dl>
		</section>
		
        <section anchor="Reply-Numeric" numbered="true" toc="default">
          <name>Reply Codes in Numeric Order</name>
          <!-- 4.2.3 -->
        <dl newline="false" spacing="normal">
            <dt>211</dt>
            <dd>System status, or system help reply
          </dd>
            <dt>214</dt>
            <dd>Help message (Information on how to use the
            receiver or the meaning of a particular non-standard command; this
        reply is useful only to the human user)
          </dd>
            <dt>220</dt>
            <dd>&lt;domain&gt; Service ready
          </dd>
            <dt>221</dt>
            <dd>&lt;domain&gt; Service closing transmission channel
          </dd>
            <dt>250</dt>
            <dd>Requested mail action okay, completed
          </dd>
            <dt>251</dt>
            <dd>User not local; will forward to &lt;forward-path&gt;
            (See <xref target="forwarding_for_address_correction" format="default"/>)
          </dd>
            <dt>252</dt>
            <dd>Cannot VRFY user, but will accept message
            and attempt delivery (See <xref target="meaning_vrfy_expn_success" format="default"/>)
            </dd>
            <dt>354</dt>
            <dd>Start mail input; end with &lt;CRLF&gt;.&lt;CRLF&gt;
            </dd>
            <dt>421</dt>
            <dd>&lt;domain&gt; Service not available, closing
            transmission channel (This may be a reply to any command if the
        service knows it must shut down)
          </dd>
            <dt>450</dt>
            <dd>Requested mail action not taken:
             mailbox unavailable (e.g., mailbox busy or temporarily
             blocked for policy reasons, or server temporarily
             unavailable  if returned before a mail transaction is
             started)
          </dd>
            <dt>451</dt>
            <dd>Requested action aborted: local error in processing
          </dd>
            <dt>452</dt>
            <dd>Requested action not taken:
             insufficient system storage (also preferred code for "too many
             recipients", see <xref target="workaround-552" format="default"/>)</dd>
            <dt>455</dt>
            <dd>Server unable to accommodate parameters

          <br/></dd>
            <dt>500</dt>
            <dd>Syntax error, command unrecognized (This may
            include errors such as command line too long)
          </dd>
            <dt>501</dt>
            <dd>Syntax error in parameters or arguments
          </dd>
            <dt>502</dt>
            <dd>Command not implemented (see <xref target="reply_code_502" format="default"/>)
          </dd>
            <dt>503</dt>
            <dd>Bad sequence of commands
          </dd>
            <dt>504</dt>
            <dd>Command parameter not implemented
          </dd>
            <dt>521</dt>
            <dd>No mail service (See
             <xref target="Clarif-521-554-556" format="default"/>.)
          </dd>
            <dt>550</dt>
            <dd>Requested action not taken: mailbox unavailable
            (e.g., mailbox not found, no access, or command rejected for policy reasons)
          </dd>
            <dt>551</dt>
            <dd>User not local; please try &lt;forward-path&gt;
            (See <xref target="forwarding_for_address_correction" format="default"/>)
          </dd>
            <dt>552</dt>
            <dd>Requested mail action aborted:
             exceeded storage allocation.
          </dd>
            <dt>553</dt>
            <dd>Requested action not taken: mailbox name not
               allowed (e.g., mailbox syntax incorrect).
               This code is also used as an "ambiguous mailbox"
               response to VRFY, see <xref target="debug-commands-overview"/>.
          </dd>
            <dt>554</dt>
            <dd>Transaction failed (Or, in the case of a connection-opening
            response, "No SMTP service here" although 521 is now
            preferred for the latter. See
            <xref target="Clarif-521-554-556" format="default"/>.)</dd>
            <dt>555</dt>
            <dd>MAIL FROM/RCPT TO parameters not
             recognized or not implemented
            </dd>
            <dt>556</dt>
            <dd> No mail service at this domain. (See
             <xref target="Clarif-521-554-556" format="default"/>.) </dd>
          </dl>
        </section>
        <section numbered="true" toc="default">
          <name>Some specific code situations and relationships</name>
          <section anchor="reply_code_502" numbered="true" toc="include">
            <name>Reply Code 502</name>
            <!-- 4.2.4 -->
        <t>
          Questions have been raised as to when reply code 502 (Command not
          implemented) SHOULD be returned in preference to other codes.  502
          SHOULD be used when the command is actually recognized by the SMTP
          server, but not implemented.  If the command is not recognized,
          code 500 SHOULD be returned.  Extended SMTP systems MUST NOT list
          capabilities in response to EHLO for which they will return 502
          (or 500) replies.
            </t>
          </section>
          <section anchor="Clarif-521-554-556" numbered="true"
                      toc="include"> <!-- 4.2.4.2 -->
            <name>"No mail accepted" situations and the 521, 554, 556,
               and 450 codes</name>
         <t>Codes 521, 554, and 556 are all used to report different
            types of permanent "no mail accepted" situations.  They differ as
            follows.  521 is an indication from a system answering on
            the SMTP port that it does not support SMTP service (a
            so-called "dummy server" as discussed in
            <xref target="RFC7504" format="default">RFC 7504</xref> and elsewhere).
            Obviously, it requires that system exist and that a
            connection can be made successfully to it. Because a
            system that does not accept any mail cannot meaningfully
            accept a RCPT command, any commands (other than QUIT)
            issued after an SMTP server has issued a 521 reply are
            client (sender) errors.</t>
            <t> When a domain does not intend to accept mail and wishes
            to publish that fact rather than being subjected to
            connection attempts, the best way to accomplish that is to
            use the "Null MX" convention.  This is done by
            advertising a single MX RR
            (see Section 3.3.9 of
            <xref target="RFC1035" format="default">RFC 1035</xref>) with an RDATA
            section consisting of preference number 0 and a
            zero-length label, written in master files as ".", as the
            exchange domain, to denote that there exists no mail
            exchanger for that domain.  Reply code 556 is then used
            by a message submission or intermediate SMTP
            system (see <xref target="MailTransport" format="default"/>) to report
            that it cannot forward the message further because it
            knows from the DNS entry that the recipient domain does
            not accept mail.
            <iref item="Message Submission" subitem="Reply codes"
               primary="false"/>
            If, despite publishing the DNS entry,
            the host associated with the server domain chooses to
            respond on the SMTP port, it
            SHOULD respond with the 556 code as well.  The details of
            the Null MX convention were first defined in
            <xref target="RFC7505" format="default">RFC 7505</xref>; see that document
            for additional discussion of the rationale for that
            convention.</t>
         <t>
            Reply code 556 would
            normally be used in response to a RCPT command (or extension
            command with similar intent) when the SMTP system identifies a
            domain that it can (or has) determined never accepts mail.
            Other codes, including 554 and the temporary 450, are
            used for more transient situations and situations in which
            an SMTP server cannot or will not deliver to (or accept
            mail for) a particular system or mailbox for policy
            reasons rather than ones directly related to SMTP
            processing.  The 450 code may also be used to reflect a
            server being temporarily unavailable at connection time or
            after the EHLO command is issued (i.e., before a mail
            transaction is initiated).</t>
		  </section>
		  
          <section anchor="ReplyCodesAfterDATA" numbered="true" toc="include">
            <name>Reply Codes after DATA and the Subsequent &lt;CRLF&gt;.&lt;CRLF&gt;</name>
            <!-- 4.2.5 -->
        <t>
          When an SMTP server returns a positive completion status (2yz code)
          after the DATA command is completed with &lt;CRLF&gt;.&lt;CRLF&gt;,
          it accepts responsibility for:
            </t>
            <ul spacing="normal">
              <li>delivering the message (if the recipient mailbox exists), or
        </li>
              <li>if attempts to deliver the message fail due to transient conditions,
          retrying delivery some reasonable number of times at intervals as specified
          in <xref target="retry_strategies" format="default"/>.
        </li>
              <li>if attempts to deliver the message fail due to permanent conditions,
          or if repeated attempts to deliver the message fail due to transient
          conditions, returning appropriate notification to the sender of the
          original message (using the address in the SMTP MAIL command).
        </li>
            </ul>
            <t>
          When an SMTP server returns a temporary error status
          (4yz)
          code after the DATA command is completed with &lt;CRLF&gt;.&lt;CRLF&gt;,
          it MUST NOT make a subsequent attempt to deliver that message.
          The SMTP client retains responsibility for the delivery of that message
          and may either return it to the user or requeue it for a subsequent
          attempt (see <xref target="sending_strategy" format="default"/>).
            </t>
            <t>
          The text provided by the server as part of the reply
             SHOULD be designed to allow the user, or the user's
             agent, to interpret
          the return of a transient failure status (by mail message or otherwise)
          as a non-delivery indication, just as a permanent failure would
          be interpreted.  If the client SMTP successfully handles these conditions,
          the user will not receive such a reply.
            </t>
            <t>
          When an SMTP server returns a permanent error status (5yz) code
          after the DATA command is completed
          with &lt;CRLF&gt;.&lt;CRLF&gt;, it MUST
          NOT make any subsequent attempt to deliver the message.  As with
          temporary error status codes, the SMTP client retains responsibility
          for the message, but SHOULD NOT again attempt delivery to the same
          server without user review of the message and response and appropriate
          intervention.
            </t>
          </section>
        </section>
      </section>
      <section anchor="sequencing_of_commands" numbered="true" toc="default">
        <name>Sequencing of Commands and Replies</name>
        <!-- 4.3 -->
      <section anchor="SequencingOverview" numbered="true" toc="default">
          <name>Sequencing Overview</name>
          <!-- 4.3.1 -->
        <t>
          The communication between the sender and receiver is an alternating
          dialogue, controlled by the sender.  As such, the sender issues
          a command and the receiver responds with a reply.  Unless other
          arrangements are negotiated through service extensions, the sender
          MUST wait for this response before sending further commands.  One
          important reply is the connection greeting.  Normally, a receiver
          will send a 220 "Service ready" reply when the connection is completed.
          The sender SHOULD wait for this greeting message before sending any commands.
          </t>
          <t>
          Note: all the greeting-type replies have the official name (the
          fully-qualified primary domain name) of the server host as the first
          word following the reply code.  Sometimes the host will have no
          meaningful name.  See <xref target="address_literals" format="default"/> for a discussion
          of alternatives in these situations.
          </t>
          <t>
          For example,
          </t>
          <ul empty="true" spacing="normal">
            <li>220 ISIF.USC.EDU Service ready
        </li>
          </ul>
          <t>
          or
          </t>
          <ul empty="true" spacing="normal">
			 <li>220 mail.example.com SuperSMTP v 6.1.2 Service ready
			 </li>
          </ul>
          <t>
          or
          </t>
          <ul empty="true" spacing="normal">
            <li>220 [10.0.0.1] Clueless host service ready
        </li>
          </ul>
		  <t>
          The detailed discussion in the next section lists
		  alternative success and failure replies for 
          each command.  These SHOULD be strictly adhered to. A receiver MAY
          substitute text in the replies, but the meanings and actions implied
          by the code numbers and by the specific command reply
          sequence MUST be preserved.
          However, in order to provide robustness as SMTP is extended
          and evolves, the discussion in
          <xref target="reply_code_severities" format="default"/> still applies: all
          SMTP clients MUST be prepared to accept any code that
          conforms to the discussion in that section and MUST be
          prepared to interpret it on the basis of its first digit
          only.
          </t>
        </section>
        <section anchor="CommandReply" numbered="true" toc="default">
          <name>Command-Reply Sequences</name>
          <!-- 4.3.2 -->
        <t>
          Each command is listed with its usual possible replies.  The prefixes
          used before the possible replies are "I" for intermediate, "S" for
          success, and "E" for error.  Since some servers may generate other
          replies under special circumstances, and to allow for future extension,
          SMTP clients SHOULD, when possible, interpret only the first digit
          of the reply and MUST be prepared to deal with unrecognized reply
          codes by interpreting the first digit only.  Unless extended using
          the mechanisms described in <xref target="extension_model" format="default"/>, SMTP
          servers MUST NOT transmit reply codes to an SMTP client that are
          other than three digits or that do not start in a digit between
          2 and 5 inclusive.
          </t>
          <t>
          These sequencing rules and, in principle, the codes themselves,
          can be extended or modified by SMTP extensions offered by the server
          and accepted (requested) by the client.   However, if the
          target is more precise granularity in the codes, rather than
          codes for completely new purposes, the system described in
          <xref target="RFC3463" format="default"> RFC 3463</xref> SHOULD be used in
          preference to the
          invention of new codes.</t>
          <t>In addition to the codes listed below, any SMTP command can return
          any of the following codes if the corresponding unusual circumstances
          are encountered:
          </t>
          <dl newline="false" spacing="normal">
            <dt>500</dt>
            <dd>For the "command line too long" case or if the command
          name was not recognized.  Note that producing a "command not recognized"
          error in response to the required subset of these commands is a violation
          of this specification.  Similarly, producing a "command too
          long" message for a command line shorter than 512 characters
          would violate the provisions of
          <xref target="MaxCommandLine" format="default"/>.
          </dd>
            <dt>501</dt>
            <dd>Syntax error in command or arguments.  In order
          to provide for future extensions, commands that are specified in this
          document as not accepting arguments (DATA, RSET, QUIT) SHOULD return
          a 501 message if arguments are supplied in the absence of EHLO-advertised
          extensions.
        </dd>
            <dt>421</dt>
            <dd>Service shutting down and closing transmission channel
        </dd>
          </dl>
          <t>
          Specific sequences are:
          </t>
          <ul empty="true" spacing="normal">
            <li>
              <t> CONNECTION ESTABLISHMENT
              </t>
              <ul spacing="normal">
                <li>S: 220<br/>
                        E: 521, 554, 556,
                        450 (if the system receiving the connection
                        attempt is able to answer but is temporarily
                        not available to receive email)
                     </li>
              </ul>
              <t>
                  EHLO or HELO
              </t>
              <ul spacing="normal">
                <li>S: 250<br/>
                        E: 504 (a conforming implementation could
                        return this code only in fairly obscure
                        cases), 550, 502 (permitted only with an
                        old-style server that does not support
                        EHLO), 450 (see note immediately above under
						"CONNECTION ESTABLISHMENT")
                </li>
              </ul>
              <t>
                  MAIL
              </t>
              <ul spacing="normal">
                <li>S: 250<br/>
                        E: 552, 451, 452, 550, 553, 503, 455, 555</li>
              </ul>
              <t>
                 RCPT
              </t>
              <ul spacing="normal">
                <li>S: 250, 251 (but see
                        <xref target="forwarding_for_address_correction" format="default"/>
                         for discussion of 251 and 551)<br/>
                        E: 550, 551, 552 (obsolete for "too many
                        recipients; see
                        <xref target="workaround-552" format="default"/>),
                        553, 450, 451, 452, 503,
                        455, 555</li>
              </ul>

              <t>
                  DATA
              </t>
              <ul spacing="normal">
                <li>
                  <t>I: 354 -&gt; data -&gt; S: 250<br/>
                  </t>
                  <ul spacing="normal">
                    <li>E: 552, 554, 451, 452</li>
                    <li>E: 450, 550 (rejections for policy
                              reasons)</li>
                  </ul>
                </li>
                <li> E: 503, 554
                </li>
              </ul>
              <t>
                  RSET
              </t>
              <ul spacing="normal">
                <li>S: 250</li>
              </ul>
              <t>
                  VRFY
              </t>
              <ul spacing="normal">
                <li>S: 250, 251, 252<br/>
                        E: 550, 551, 553, 502, 504</li>
              </ul>
              <t>
                  EXPN
              </t>
              <ul spacing="normal">
                <li>S: 250, 252<br/>
                        E: 550, 500, 502, 504</li>
              </ul>
              <t>
                  HELP
              </t>
              <ul spacing="normal">
                <li>S: 211, 214<br/>
                        E: 502, 504</li>
              </ul>
              <t>
                  NOOP
              </t>
              <ul spacing="normal">
                <li>S: 250</li>
              </ul>
              <t>
                  QUIT
              </t>
              <ul spacing="normal">
                <li>S: 221</li>
              </ul>
            </li>
          </ul>
        </section>
      </section>
      <section anchor="trace_information" numbered="true" toc="default">
        <name>Trace Information</name>
        <!-- 4.4 -->
        <t> When inserted by SMTP, trace information is used to
           provide an audit trail of message handling.  In addition,
           it indicates a route back to the sender of the message.</t>
        <section anchor="Received-field" numbered="true" toc="default">
          <name>Received Header Field (Time Stamp)</name>
          <t>
        When an SMTP server receives a message for delivery or further processing,
        it MUST insert a trace field (often referred to as "time stamp" or
        "Received" information) at the
        beginning of the message content, as discussed in <xref target="DATA" format="default"/>.
          </t>
          <t>
        This line MUST be structured as follows:
          </t>
          <ul spacing="normal">
            <li>The FROM clause, which MUST be supplied in an SMTP environment,
            SHOULD contain both (1) the name of the source host as presented
        in the EHLO command and (2) an address literal containing the IP address
        of the source, determined from the TCP connection.
          </li>
            <li>The ID clause MAY contain an "@" as suggested in the
               Internet Message format specification
               <xref target="rfc5322bis"/>,
            but this is not required.</li>
            <li>If the FOR clause appears, it MUST contain exactly one
            &lt;path&gt; entry, even
            when multiple RCPT commands have been given.  Multiple
            &lt;path&gt;s raise some security issues and have been
            deprecated, see <xref target="blind_copies" format="default"/>.
            </li>
          </ul>
          <t>
        An Internet mail program MUST NOT change or delete
        a Received: line that was
        previously added to the message header section.
        SMTP servers MUST prepend
        Received lines to messages; they MUST NOT change the order of existing
        lines or insert Received lines in any other location.
          </t>
          <t>
        As the Internet grows, comparability of Received header fields is important
        for detecting problems, especially slow relays.  SMTP servers that
        create Received header fields SHOULD use explicit offsets in the dates (e.g.,
        -0800), rather than time zone names of any type.  Local time (with
        an offset) SHOULD be used rather than UTC when feasible.

        This formulation allows
        slightly more information about local circumstances to be specified.
        If UTC is needed, the receiver need merely do some simple arithmetic
        to convert the values.  Use of UTC loses information about the time
        zone-location of the server.  If it is desired to supply a time zone
        name, it SHOULD be included in a comment.

        If UTC is actually being supplied instead of the local time
        zone, it should be denoted by a time zone offset of "-0000".
        Time zones aligned with the prime meridian (e.g., "GMT") are
        shown as "+0000".
          </t>
        </section>
        <section anchor="ReturnPath-field" numbered="true" toc="default">
          <name>Return-path Header Field</name>
          <t> When the delivery SMTP server makes the "final
             delivery" of a message,
             it MUST insert a return-path line at the beginning of the mail data.
             Here, final delivery means the message
             has left the SMTP environment.  Normally, this would mean it had been
             delivered to the destination user or an associated mail drop, but
             in some cases it may be further processed and transmitted by another mail system.
          </t>
          <t> It is possible for the mailbox in the return path to be
             different
             from the actual sender's mailbox, for example, if error responses
             are to be delivered to a special error handling mailbox rather than
             to the message sender.  When mailing lists are involved, this arrangement
             is common and useful as a means of directing errors to the list maintainer
             rather than the message originator.
          </t>
          <t> A message-originating SMTP system SHOULD NOT send a
             message that already
             contains a Return-path header field.  SMTP servers performing a relay function
             MUST NOT inspect the message data, and especially not to the extent
             needed to determine if Return-path header fields are present.  SMTP servers
             making final delivery MAY remove Return-path header fields
             before adding their own.
          </t>
          <t> The primary purpose of the Return-path is to designate
             the address
             to which messages indicating non-delivery or other mail system failures
             are to be sent.  For this to be unambiguous, exactly one return path
             SHOULD be present when the message is delivered.  Systems
             using the syntax specified here
             with non-SMTP transports SHOULD designate an unambiguous
             address, associated with the transport envelope, to which error reports
             (e.g., non-delivery messages) should be sent.
          </t>
          <t> It is sometimes difficult for an SMTP server to
             determine whether it is making final delivery
             since forwarding or other operations
             may occur after the message is accepted for delivery.  Consequently,
             any further (forwarding, gateway, or relay) systems MAY remove the
             return path and rebuild the MAIL command as needed to ensure that
             exactly one such line appears in a delivered message.
          </t>
        </section>
        <section  anchor="GatewayReturnPath" numbered="true" toc="default">
           <name>Return-path, Non-SMTP Systems, and Gateways</name>  <!-- 4.4.3 -->
          <t>When SMTP systems, especially relay ones that are
             receiving messages and then processing them for the next
             hop, special issues arise and care must be taken.   In particular:
          </t>
          <ul spacing="normal">
            <li>a gateway from SMTP -&gt; elsewhere SHOULD insert a return-path
          header field, unless it is known that the "elsewhere" transport also uses
          Internet domain addresses and maintains the envelope sender address separately.
            </li>
            <li>a gateway from elsewhere -&gt; SMTP SHOULD delete any
               return-path
          header field present in the message, and either copy that information
          to the SMTP envelope or combine it with information present in the
          envelope of the other transport system to construct the
          reverse-path argument to the MAIL command in the SMTP envelope.
            </li>
          </ul>
        </section>

        <section  anchor="Addtl-Trace-Fields" numbered="true" toc="default">
           <name>Additional Trace Fields</name>  <!-- 4.4.4 -->
         <t> "Received" and "Return-path", defined above, are the
            only two trace fields that are part of SMTP.  Additional
            trace fields, or variations on the definitions here for
            other mail transports, may be defined and registered as
            described in [I-D.ietf-emailcore-rfc5322bis]. </t>
          </section>

        <section anchor="TraceFieldsSummary" numbered="true" toc="default">
          <name>Trace Information Summary and Analysis</name>
          <t>The text above implies 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 rest of the mail data: first the
             balance of the mail header section
             and then the
             body (<xref target="rfc5322bis" format="default">RFC 5322bis</xref>).
          </t>
          <t>
        The time stamp line and the return path line are formally defined
        as follows (the definitions for "FWS" and "CFWS" appear in
        <xref target="rfc5322bis" format="default">RFC 5322bis</xref>):
          </t>
          <dl newline="false" spacing="normal" indent="15">
            <dt>Return-path-line</dt>
            <dd><t>
            = "Return-Path:" FWS Reverse-path &lt;CRLF&gt;
        <iref item="Argument Syntax" subitem="Return-path-line" primary="false"/>
        </t></dd>
            <dt>Time-stamp-line</dt>
            <dd><t>
            = "Received:" FWS Stamp &lt;CRLF&gt;
        <iref item="Argument Syntax" subitem="Time-stamp-line" primary="false"/>
            </t></dd>
            <dt>Stamp</dt>
            <dd><t>
          = From-domain By-domain Opt-info [CFWS]
          ";" <br/> FWS date-time
          <br/>
             ; where "date-time" is as defined
                in <xref target="rfc5322bis" format="default">RFC5322bis</xref><br/>
                ; but the "obs-" forms, especially two-digit<br/>
                ; years, are prohibited in SMTP and MUST NOT
                be used.
          <iref item="Argument Syntax" subitem="Stamp" primary="false"/>
            </t></dd>
            <dt>From-domain</dt>
            <dd><t>
           = "FROM" FWS Extended-Domain
        <iref item="Argument Syntax" subitem="From-domain" primary="false"/>
            </t></dd>
            <dt>By-domain</dt>
            <dd><t>
           = CFWS "BY" FWS Extended-Domain
        <iref item="Argument Syntax" subitem="By-domain" primary="false"/>
            </t></dd>
            <dt>Extended-Domain</dt>
            <dd>
           = Domain /<br/>
           ( Domain FWS "(" TCP-info ")" ) /<br/>
           ( address-literal FWS "(" TCP-info ")" )
        <iref item="Argument Syntax" subitem="Extended-Domain" primary="false"/></dd>
            <dt>TCP-info</dt>
            <dd>
           = address-literal / ( Domain FWS address-literal )
           <br/>
              ; Information derived by server from TCP connection<br/>
                 ; not client EHLO.
        <iref item="Argument Syntax" subitem="TCP-info" primary="false"/></dd>
            <dt>Opt-info</dt>
            <dd>
           = [Via] [With] [ID] [For]<br/>
           [Additional-Registered-Clauses]<br/>
        <iref item="Argument Syntax" subitem="Opt-info" primary="false"/></dd>
            <dt>Via</dt>
            <dd>
           = CFWS "VIA" FWS Link
        <iref item="Argument Syntax" subitem="Via" primary="false"/></dd>
            <dt>With</dt>
            <dd>
           = CFWS "WITH" FWS Protocol
        <iref item="Argument Syntax" subitem="With" primary="false"/></dd>
            <dt>ID</dt>
            <dd>
           = CFWS "ID" FWS ( Atom / msg-id )
           <br/>
           ; msg-id is defined
           in <xref target="rfc5322bis" format="default">RFC 5322bis</xref>
        <iref item="Argument Syntax" subitem="ID" primary="false"/></dd>
            <dt>For</dt>
            <dd>
           = CFWS "FOR" FWS ( Path / Mailbox )
        <iref item="Argument Syntax" subitem="For" primary="false"/></dd>
            <dt>Additional-Registered-Clauses</dt>
            <dd><t>
               = 1*(CFWS Atom FWS String)
               <br/> ; See <xref target="IANA-Additional-Registered"/>.
        <iref item="Argument Syntax" subitem="Additional-Registered-Clauses" primary="false"/>
        </t>
            </dd>
            <dt>Link</dt>
            <dd>
           = "TCP" / Addtl-Link
        <iref item="Argument Syntax" subitem="Link" primary="false"/></dd>
            <dt>Addtl-Link</dt>
            <dd>
           = Atom
           <br/>
              ; Additional standard names for links are <br/>
                 ; registered with the Internet Assigned Numbers<br/>
                 ; Authority (IANA).  "Via" is primarily of value<br/>
                 ; with non-Internet transports.  SMTP servers<br/>
                 ; SHOULD NOT use unregistered names.
        <iref item="Argument Syntax" subitem="Addtl-Link" primary="false"/></dd>
            <dt>Protocol</dt>
            <dd>
           = "ESMTP" / "SMTP" / Addtl-Protocol
        <iref item="Argument Syntax" subitem="Protocol" primary="false"/></dd>
            <dt>Addtl-Protocol</dt>
            <dd>
           = Atom
           <br/>
              ; Additional standard names for protocols are<br/>
                ; registered with the Internet Assigned Numbers<br/>
                ; Authority (IANA) in the "mail parameters"<br/>
                ; registry <xref target="RFC3848" format="default"/>. SMTP servers SHOULD NOT
                <br/>
                ; use unregistered names.
            <iref item="Argument Syntax" subitem="Addtl-Protocol" primary="false"/></dd>
          </dl>
        </section>
      </section>

      <section numbered="true" toc="default">
        <name>Additional Implementation Issues</name>
        <!-- 4.5 -->
      <section anchor="minimum_implementation" numbered="true" toc="default">
          <name>Minimum Implementation</name>
          <!-- 4.5.1 -->
        <t>In order to make SMTP workable, the following minimum
           implementation MUST be provided by all receivers.
           The following commands MUST be supported to conform to this
           specification:</t>
          <ul empty="true" spacing="normal">
            <li>EHLO<br/>
              HELO<br/>
              MAIL<br/>
              RCPT<br/>
              DATA<br/>
              RSET<br/>
              NOOP<br/>
              QUIT<br/>
              VRFY</li>
          </ul>
          <t>Any system that includes an SMTP server supporting mail relaying
          or delivery MUST support the reserved mailbox "postmaster" as a
          case-insensitive local name.  This postmaster address is not strictly
          necessary if the server always returns 554 on connection opening
          (as described in <xref target="session_initiation" format="default"/>).  The requirement
          to accept mail for postmaster implies that RCPT commands that specify
          a mailbox for postmaster at any of the domains for which the SMTP
          server provides mail service, as well as the special case of "RCPT
          TO:&lt;Postmaster&gt;" (with no domain specification), MUST
          be supported. </t>
          <t>SMTP systems are expected to make every reasonable effort to accept
          mail directed to Postmaster from any other system on the Internet.
          In extreme cases -- such as to contain a denial of service attack
          or other breach of security -- an SMTP server may block mail directed
          to Postmaster.  However, such arrangements SHOULD be narrowly tailored
          so as to avoid blocking messages that are not part of such
          attacks. </t>
        </section>
        <section anchor="Transparency" numbered="true" toc="default">
          <name>Transparency</name>
          <!-- 4.5.2 -->
        <t>Without some provision for data transparency, the character sequence
          "&lt;CRLF&gt;.&lt;CRLF&gt;" ends the mail text and cannot be sent
          by the user.  In general, users are not aware of such "forbidden"
          sequences.  To allow all user composed text to be transmitted transparently,
          the following procedures are used:</t>
          <ul spacing="normal">
            <li>Before sending a line of mail text, the SMTP client checks the first
              character of the line.  If it is a period, one additional period is
              inserted at the beginning of the line.</li>
            <li>When a line of mail text is received by the SMTP server, it checks
              the line.  If the line is composed of a single period, it is treated
              as the end of mail indicator.  If the first character is a period and
              there are other characters on the line, the first
              character is deleted. </li>
          </ul>
          <t> The mail data may contain any of the 128 ASCII characters.  All
          characters are to be delivered to the recipient's mailbox, including
          spaces, vertical and horizontal tabs, and other control characters.
          If the transmission channel provides an 8-bit byte (octet) data
          stream, the 7-bit ASCII codes are transmitted, right justified, in
		  the octets, with the high-order bits cleared to zero.
		  </t>
          <t>In some systems, it may be necessary to transform the data as it
          is received and stored.  This may be necessary for hosts that use
          a different character set than ASCII as their local character set,
          that store data in records rather than strings, or which use special
          character sequences as delimiters inside mailboxes.  If such transformations
          are necessary, they MUST be reversible, especially if they are applied
          to mail being relayed.</t>
        </section>
        <section anchor="sizesTimeouts" numbered="true" toc="default">
          <name>Sizes and Timeouts</name>
          <!-- 4.5.3 -->
          <iref item="Sizes, Lengths, and Timeouts" primary="true"/>
        <section toc="include" numbered="true" anchor="SizeLimits">
            <name>Size Limits and Minimums</name>
            <!-- 4.5.3.1 -->
          <t>There are several objects that have required minimum/maximum sizes.
            Every implementation MUST be able to receive objects of at least these
            sizes.  Objects larger than these sizes SHOULD be avoided when possible.
            However, some Internet mail constructs such as encoded X.400 addresses
            (<xref target="RFC2156" format="default">RFC 2156</xref>) will often
            require larger objects.
            Clients MAY attempt to transmit these, but MUST be prepared for a server
            to reject them if they cannot be handled by it.  To the maximum extent
            possible, implementation techniques that impose no limits on the length
            of these objects should be used.</t>
            <t> Extensions to SMTP may involve the use of characters that
            occupy more than a single octet each.  This section
            therefore specifies lengths in octets where absolute
            lengths, rather than character counts, are intended.</t>

		 <section toc="include" numbered="true">
               <name>Local-part</name>
               <iref item="Sizes, Lengths, and Timeouts"
                  subitem="Local part length" primary="false"/>
              <t>The maximum total length of a user name or other
                  local-part is 64 octets.</t>
            </section>
            <section toc="include" numbered="true">
               <name>Domain</name>
               <iref item="Sizes, Lengths, and Timeouts"
                  subitem="Domain name or number length" primary="false"/>
              <t>The maximum total length of a domain name or number
                  is 255 octets.</t>
            </section>
            <section toc="include" numbered="true">
               <name>Path</name>
               <iref item="Sizes, Lengths, and Timeouts"
                  subitem="Path lengths" primary="false"/>
              <t>The maximum total length of a reverse-path or forward-path is 256
                  octets (including the punctuation and element
                  separators).</t>
            </section>
            <section toc="include" anchor="MaxCommandLine" numbered="true">
               <name>Command Line</name>
               <iref item="Sizes, Lengths, and Timeouts"
                     subitem="Command Line length" primary="false"/>
              <t>The maximum total length of a command line including the command
                    word and the &lt;CRLF&gt; is 512 octets.  SMTP extensions may
                    be used to increase this limit.</t>
            </section>
            <section toc="include" numbered="true">
               <name>Reply Line</name>
               <iref item="Sizes, Lengths, and Timeouts"
                     subitem="Reply Line length" primary="false"/>
              <t>The maximum total length of a reply line including the reply code
                    and the &lt;CRLF&gt; is 512 octets.  More information may be
                    conveyed through multiple-line replies.</t>
            </section>
            <section toc="include" numbered="true">
               <name>Text Line</name>
               <iref item="Sizes, Lengths, and Timeouts"
                  subitem="Text Line length" primary="false"/>
               <t>The maximum total length of a text line including the &lt;CRLF&gt;
                    is 1000 octets (not counting the leading dot duplicated for transparency).
                    This number may be increased by the use of SMTP
                    Service Extensions.</t>
            </section>
            <section toc="include" numbered="true">
               <name>Message Content</name>
               <iref item="Sizes, Lengths, and Timeouts"
                  subitem="Message Content Size" primary="false"/>
              <t>The maximum total length of a message content (including any message
                    header section
                    as well as the message body) MUST BE at least 64K octets.
                    Since the introduction of Internet Standards for multimedia mail
                    (<xref target="RFC2045" format="default">RFC 2045</xref>), message
                    lengths on the Internet
                    have grown dramatically, and message size restrictions should be
                    avoided if at all possible.  SMTP server systems that must impose
                    restrictions SHOULD implement the "SIZE" service
                    extension of
                    <xref target="RFC1870" format="default">RFC 1870</xref>,
                    and SMTP client systems that will
                    send large messages SHOULD utilize it when
                    possible.</t>
            </section>
            <section toc="include" numbered="true">
               <name>Recipient Buffer</name>
               <iref item="Sizes, Lengths, and Timeouts"
                     subitem="Minimum Number of Recipients" primary="false"/>
              <t>The minimum total number of recipients that MUST be buffered is 100
                    recipients.  Rejection of messages (for excessive recipients) with
                    fewer than 100 RCPT commands is a violation of this
                    specification.
                    The general principle
                    that relaying SMTP server MUST NOT, and delivery SMTP servers SHOULD
                    NOT, perform validation tests on message header
                    fields 
                    suggests that messages SHOULD NOT be rejected
                    based on the total number of recipients shown in header
                    fields.
                    A server that imposes a limit on the
                    number of recipients MUST behave in an orderly fashion,  such as
                    rejecting additional addresses over its limit rather than silently
                    discarding addresses previously accepted.  A client that needs to
                    deliver a message containing over 100 RCPT commands SHOULD be prepared
                    to transmit in 100-recipient "chunks" if the server declines to accept
                    more than 100 recipients in a single message.</t>
            </section>
            <section toc="include" numbered="true">
              <name>Treatment When Limits Exceeded</name>
               <iref item="Sizes, Lengths, and Timeouts"
                     subitem="Exceeding Limits" primary="false"/>
              <t>Errors due to exceeding these limits may be
                    reported by using the reply codes.  Some examples
                    of reply codes are: </t>
              <ul empty="true" spacing="normal">
                <li>500 Line too long.</li>
              </ul>
              <t>
                    or
              </t>
              <ul empty="true" spacing="normal">
                <li>501 Path too long</li>
              </ul>
              <t>
                    or
              </t>
              <ul empty="true" spacing="normal">
                <li>452 Too many recipients  (see below)</li>
              </ul>
              <t>
                    or
              </t>
              <ul empty="true" spacing="normal">
                <li>552 Too much mail data (historically also
                          used for too many recipients (see below).</li>
              </ul>
            </section>
            <section anchor="workaround-552" toc="include" numbered="true">
              <name>Too Many Recipients Code</name>
              <t><xref target="RFC0821" format="default">RFC 821</xref>
                      incorrectly listed the error
                      where an SMTP server exhausts its implementation limit on the number
                      of RCPT commands ("too many recipients") as having reply code 552.
                      The correct reply code for this condition is
                      452.
                      At the time RFC 5321 was written, the use of
                      reply code 552 by servers was sufficiently
					  common that
                      client implementation were advised to simply treat it
                      as if 452 had been sent.  That advice is no longer
                      necessary or useful.
              </t>
              <t>When a conforming SMTP server encounters this condition, it has
                      at least 100 successful RCPT commands in its recipient buffer.
                      If the server is able to accept the message, then at least these
                      100 addresses will be removed from the SMTP client's queue.  When
                      the client attempts retransmission of those addresses that received
                      452 responses, at least 100 of these will be able to fit in the
                      SMTP server's recipient buffer.  Each retransmission attempt that
                      is able to deliver anything will be able to dispose of at least
                      100 of these recipients.</t>
              <t>If an SMTP server has an implementation limit on the number of RCPT
                      commands and this limit is exhausted,
					  it MUST use a reply code of 452.
                      If the server has a configured site-policy limitation on
                      the number of RCPT commands, it MAY instead use
					  a 5yz reply code.
                      In particular, if the intent is to prohibit messages with more than
                      a site-specified number of recipients, rather than merely limit
                      the number of recipients in a given mail transaction, it would be
                      reasonable to return a 503 response to any DATA command received
                      subsequent to the 452
                      code or to simply return the 503 after DATA
                      without returning any previous negative response.
              </t>
            </section>
          </section>
          <section anchor="timeouts" toc="include" numbered="true">
            <name>Timeouts</name>
			<!-- 4.5.3.2 -->
        <t>An SMTP client MUST provide a timeout mechanism.  It MUST use per-
          command timeouts rather than somehow trying to time the entire mail
          transaction.  Timeouts SHOULD be easily reconfigurable, preferably
          without recompiling the SMTP code.  To implement this, a timer is
          set for each SMTP command and for each buffer of the data transfer.
          The latter means that the overall timeout is inherently proportional
          to the size of the message.</t>
            <t> Based on extensive experience with busy mail-relay hosts, the minimum
			   per-command timeout values SHOULD be as follows:</t>
			
            <section toc="include" numbered="true">
			   <name>Initial 220 Message: 5 Minutes</name>
		<t>An SMTP client process needs to distinguish between a failed TCP connection
          and a delay in receiving the initial 220 greeting message.  Many SMTP
          servers accept a TCP connection but delay delivery of the 220 message
          until their system load permits more mail to be
          processed.</t>
            </section>
            <section toc="include" numbered="true">
               <name>MAIL Command: 5 Minutes</name>
               <iref item="Sizes, Lengths, and Timeouts"
                     subitem="Mail Command Timeout" primary="false"/>
              <t> </t>
            </section>
            <section toc="include" numbered="true">
               <name>RCPT Command: 5 Minutes</name>
               <iref item="Sizes, Lengths, and Timeouts"
                     subitem="RCPT Command Timeout" primary="false"/>
              <t>A longer timeout is required if processing of mailing lists and aliases
          is not deferred until after the message was accepted.</t>
            </section>
            <section toc="include" numbered="true">
              <name>DATA Initiation: 2 Minutes</name>
               <iref item="Sizes, Lengths, and Timeouts"
                     subitem="Data Initialion Timeout Timeout" primary="false"/>
              <t>This is while awaiting the "354 Start Input" reply to a
              DATA command.</t>
            </section>
            <section toc="include" numbered="true">
               <name>Data Block: 3 Minutes</name>
               <iref item="Sizes, Lengths, and Timeouts"
                     subitem="Data Block/ TCP Wait Timeout" primary="false"/>
              <t>This is while awaiting the completion of each TCP SEND
              call transmitting a chunk of data.</t>
            </section>
            <section toc="include" numbered="true">
               <name>DATA Termination: 10 Minutes.</name>
               <iref item="Sizes, Lengths, and Timeouts"
                     subitem="DATA Termination Timeout" primary="false"/>
              <t> This is while awaiting the "250 OK" reply.  When the receiver gets
          the final period terminating the message data, it typically performs
          processing to deliver the message to a user mailbox.  A spurious timeout
          at this point would be very wasteful and would typically result in
          delivery of multiple copies of the message, since it has been successfully
          sent and the server has accepted responsibility for delivery.  See
          <xref target="reliable_delivery" format="default"/> for additional
          discussion.</t>
            </section>
            <section toc="include" numbered="true">
               <name>Server Timeout: 5 Minutes.</name>
               <iref item="Sizes, Lengths, and Timeouts"
                     subitem="Server Wait Timeout" primary="false"/>
              <t>An SMTP server SHOULD have a timeout of at least 5 minutes while
          it is awaiting the next command from the sender.
              </t>
            </section>
          </section>
        </section>

        <section anchor="retry_strategies" numbered="true" toc="default">
          <name>Retry Strategies</name>
          <!-- 4.5.4 -->
      <t>
        The common structure of a host SMTP implementation includes user mailboxes,
        one or more areas for queuing messages in transit, and one or more
        daemon processes for sending and receiving mail.  The exact structure
        will vary depending on the needs of the users on the host and the
        number and size of mailing lists supported by the host.  We describe
        several optimizations that have proved helpful, particularly for mailers
        supporting high traffic levels.
          </t>
          <t>
        Any queuing strategy MUST include timeouts on all activities on a
        per-command basis.  A queuing strategy MUST NOT send error messages
        in response to error messages under any circumstances.
          </t>
          <section anchor="sending_strategy" numbered="true" toc="default">
            <name>Sending Strategy</name>
            <!-- 4.5.4.1 -->
        <t>
          The general model for an SMTP client is one or more processes that
          periodically attempt to transmit outgoing mail.  In a typical system,
          the program that composes a message has some method for requesting
          immediate attention for a new piece of outgoing mail, while mail
          that cannot be transmitted immediately MUST be queued and periodically
          retried by the sender.  A mail queue entry will include not only
          the message itself but also the envelope information.
            </t>
            <t>
          The sender MUST delay retrying a particular destination after one
          attempt has failed.  In general, the retry interval SHOULD be at
          least 30 minutes; however, more sophisticated and variable strategies
          will be beneficial when the SMTP client can determine the reason
          for non-delivery.
            </t>
            <t>
          Retries continue until the message is transmitted or the sender
          gives up; the give-up time generally needs to be at least 4-5 days.
          It MAY be appropriate to set a shorter maximum number of retries
          for non-delivery notifications and equivalent error messages than
          for standard messages.
          The parameters to the retry algorithm MUST be configurable.
            </t>
            <t>
          A client SHOULD keep a list of hosts it cannot reach and corresponding
          connection timeouts, rather than just retrying queued mail items.
            </t>
            <t>
          Experience suggests that failures are typically transient (the target
          system or its connection has crashed), favoring a policy of two
          connection attempts in the first hour the message is in the queue,
          and then backing off to one every two or three hours.
            </t>
            <t>
          The SMTP client can shorten the queuing delay in cooperation with
          the SMTP server.  For example, if mail is received from a particular
          address, it is likely that mail queued for that host can now be
          sent.  Application of this principle may, in many cases, eliminate
          the requirement for an explicit "send queues now" function such
          as ETRN, <xref target="RFC1985" format="default">RFC 1985</xref>.
            </t>
            <t>
          The strategy may be further modified as a result of multiple addresses
          per host (see below) to optimize delivery time versus resource usage.
            </t>
            <t>
          An SMTP client may have a large queue of messages for each unavailable
          destination host.  If all of these messages were retried in every
          retry cycle, there would be excessive Internet overhead and the
          sending system would be blocked for a long period.  Note that an
          SMTP client can generally determine that a delivery attempt has
          failed only after a timeout of several minutes, and even a one-minute
          timeout per connection will result in a very large delay if retries
          are repeated for dozens, or even hundreds, of queued messages to
          the same host.
            </t>
            <t>
          At the same time, SMTP clients SHOULD use great care in caching
          negative responses from servers.  In an extreme case, if EHLO is
          issued multiple times during the same SMTP connection, different
          answers may be returned by the server.  More significantly, 5yz
          responses to the MAIL command MUST NOT be cached.
            </t>
            <t>
          When a mail message is to be delivered to multiple recipients, and
          the SMTP server to which a copy of the message is to be sent is
          the same for multiple recipients, then only one copy of the message
          SHOULD be transmitted.  That is, the SMTP client SHOULD use the
          command sequence: MAIL, RCPT, RCPT, ..., RCPT, DATA instead of the
          sequence: MAIL, RCPT, DATA, ..., MAIL, RCPT, DATA.  However, if
          there are very many addresses, a limit on the number of RCPT commands
          per MAIL command MAY be imposed.  This efficiency
          feature SHOULD be implemented.
            </t>
            <t>
          Similarly, to achieve timely delivery, the SMTP client MAY support
          multiple concurrent outgoing mail transactions.  However, some limit
          may be appropriate to protect the host from devoting all its resources
          to mail.
            </t>
          </section>
          <section numbered="true" toc="default">
            <name>Receiving Strategy</name>
            <!-- 4.5.4.2 -->
        <t>The SMTP server SHOULD attempt to keep a pending listen on the SMTP
          port (specified by IANA as port 25)
          at all times.  This requires the support
          of multiple incoming TCP connections for SMTP.  Some limit MAY be
          imposed, but servers that cannot handle more than one SMTP transaction
          at a time are not in conformance with the intent of this specification.
            </t>
            <t>
          As discussed above, when the SMTP server receives mail from a particular
          host address, it could activate its own SMTP queuing mechanisms
          to retry any mail pending for that host address.
            </t>
          </section>
        </section>
        <section anchor="messages_null_reverse_path" numbered="true" toc="default">
          <name>Messages with a Null Reverse-Path</name>
          <!-- 4.5.5 -->
      <t>
        There are several types of notification messages that are required
        by existing and proposed Standards
        to be sent with a null reverse-path, namely non-delivery
        notifications as discussed in <xref target="MXandRelay" format="default"/> and
        <xref target="SubmissionAndRelay" format="default"/>,
        other kinds of Delivery Status Notifications
        (DSNs, <xref target="RFC3461" format="default">RFC 3461</xref>),
        and Message Disposition Notifications
        (MDNs, <xref target="RFC8098" format="default">RFC 8098</xref>).
        All of these kinds of messages are notifications about a previous
        message, and they are sent to the reverse-path of the previous mail
        message.  (If the delivery of such a notification message fails, that
        usually indicates a problem with the mail system of the host to which
        the notification message is addressed.  For this reason, at some hosts
        the MTA is set up to forward such failed notification messages to
        someone who is able to fix problems with the mail system, e.g., via
        the postmaster alias.)
          </t>
          <t>
        All other types of messages (i.e., any message which is not required
        by a Standards-Track RFC to have a null reverse-path) SHOULD be sent
        with a valid, non-null reverse-path.
          </t>
          <t>
        Implementers of automated email processors should be careful to make
        sure that the various kinds of messages with a null reverse-path are
        handled correctly. In particular, such systems SHOULD NOT reply to
        messages with a null reverse-path, and they SHOULD NOT add a
        non-null reverse-path, or change a null reverse-path to a
        non-null one, to such messages when forwarding.
          </t>
        </section>
      </section>
    </section>
    <section anchor="address_resolution" numbered="true" toc="default">
      <name>Address Resolution and Mail Handling</name>
      <!-- 5 -->
       <section anchor="Locating-DNS" numbered="true" toc="default">
        <name>Locating the Target Host</name>
        <t>Unless special circumstances exist as described in
           <xref target="mail_transactions"/>, once an SMTP client
           lexically identifies a domain to which mail will be
           delivered for processing (as described in
           Sections <xref target="domain_names" format="counter"/>
    and <xref target="relaying" format="counter"/>), a DNS lookup
    MUST be performed to resolve the domain name as specified in
    <xref target="RFC1035" format="default">RFC 1035</xref>
    and <xref target="RFC1123">RFC 1123 Section 5.3.5</xref>).
    The names are
    required to be fully-qualified domain names (FQDNs) as discussed
    in <xref target="domain_names"/>.
        </t>
        <t>The lookup first attempts to locate an MX record associated
       with the name. If a CNAME record is found, the resulting name
       is processed as if it were the initial name. If a non-existent
       domain error is returned, this situation MUST be reported as
       an error. If a temporary error is returned, the message MUST
       be queued and
       retried later (see <xref target="sending_strategy" format="default"/>).
       If an empty list of MXs is returned, the address is
       treated as if it was associated with an implicit MX RR with a
       preference of 0, pointing to that host. If MX records are
       present, but none of them are usable, or the implicit MX is
       unusable, this situation MUST be reported as an error.
        </t>
 <t> When the lookup succeeds, the mapping can result in a list of alternative
    delivery addresses rather than a single address.  This can be due
    to multiple MX records, multihoming, or both.  To provide
    reliable mail transmission,
    the SMTP client MUST be able to try (and be prepared to retry)
    each of the relevant addresses in this list in order (see below),
    until a delivery attempt succeeds.
    However, as discussed more generally in <xref target="resistance_to_attacks"/>
    there
    MAY also be a configurable limit on the number of alternate addresses
    that can be tried.  In any case, the SMTP client SHOULD try at least two
    addresses.
 </t>
 <t>If one or more MX RRs are found
    for a given name, SMTP systems MUST NOT utilize any address RRs associated with
    that name unless they are located using the MX RRs; the "implicit MX"
    rule above applies only if there are no MX records present.  If MX records
    are present, but none of them are usable, this situation MUST be reported
    as an error.
    That domain name also MUST be a primary host name, i.e.,
    it is not allowed to be an alias.
 </t>


        <t>When a domain name associated with an MX RR is looked up and the
    associated data field obtained, the data field of that response
    MUST contain a domain name that conforms to the
    specifications of <xref target="domain_names" format="default"/>.
    That domain name, when queried, MUST
    return at least one address record (e.g., A or AAAA RR) that
    gives the IP address of the SMTP server to which the message
	should be directed.
	An MX record with a CNAME as its target is a misconfiguration, as
	explained in
    <xref target="RFC2181" format="default">RFC 2181, Section 10.3</xref>.
    However, implementations SHOULD still process CNAME responses
	when received, since a significant number of servers on the
	Internet are configured with MX records pointing to CNAMEs.
        </t>
        <t>
    Two types of information are used to rank the host addresses: multiple
    MX records, and multihomed hosts.
        </t>
        <t>
    MX records contain a numerical preference indication that MUST be
    used in sorting if more than one such record appears.  Lower
    numbers are more preferred than higher ones.
    The sender-SMTP MUST inspect the list for any of the names or
    addresses by which it might be known in mail transactions.
    If a matching record is found, all records at that preference level and
    higher-numbered ones MUST be discarded from consideration.  If there are
    no records left at that point, it is an error condition, and a 5yz
    reply code generated (terminating the mail transaction) or the message
    MUST be returned as undeliverable.  If there is a single MX record
    at the most-preferred preference level, the data field associated
    with that record is used as the next destination.  Otherwise, if
    there are multiple records with the same preference and there is
    no clear reason to favor one (e.g., by recognition
    of an easily reached address), then the sender-SMTP MUST randomize them
    to spread the load across multiple mail exchangers for a specific
    organization.
        </t>
        <t>
    The destination host (from either the data field of the preferred
    MX record or from an address record found in an implicit MX) may
    be multihomed.  In those cases the domain name resolver will return a list
    of alternative IP addresses.  It is the responsibility of the domain name
    resolver interface to have ordered this list by decreasing preference
    if necessary, and the SMTP sender MUST try them in the order
    presented.</t>

        <t>
    Although the capability to try multiple alternative addresses is required,
    specific installations may want to limit or disable the use of alternative
    addresses.  The question of whether a sender should attempt retries using
    the different addresses of a multihomed host has been controversial.
    The main argument for using the multiple addresses is that it maximizes
    the likelihood of timely delivery, and indeed sometimes the likelihood
    of any delivery; the counter-argument is that it may result in unnecessary
    resource use.  Note that resource use is also strongly determined by the
    sending strategy discussed in <xref target="sending_strategy" format="default"/>.
        </t>
        <t>
    If an SMTP server receives a message with a destination for which it is
    a designated Mail eXchanger, it MAY relay the message (potentially after
    having rewritten the MAIL FROM and/or RCPT TO addresses), make final delivery
    of the message, or hand it off using some mechanism outside the SMTP-provided
    transport environment.  Of course, neither of the latter require that
    the list of MX records be examined further.
        </t>
        <t>
    If it determines that it should relay the message without rewriting the
    address, it MUST process the MX records as described above to
    determine candidates for delivery.</t>
       </section>

      <section numbered="true" toc="default">
        <name>IPv6 and MX Records</name>
        <t>In the contemporary Internet, SMTP clients and servers
            may be hosted on IPv4 systems, IPv6 systems, or
            dual-stack systems that are compatible with either
            version of the Internet Protocol.  The host domains to
            which MX records point may, consequently, contain "A
            RR"s (IPv4), "AAAA RR"s (IPv6), or any combination of
            them.  While <xref target="RFC3974" format="default">RFC 3974</xref>
            discusses some operational
            experience in mixed environments, it was not
            comprehensive enough to justify standardization, and some
            of its recommendations appear to be inconsistent with
            this specification.  The appropriate actions to be taken
            either will depend on local circumstances, such as
            performance of the relevant networks and any conversions
            that might be necessary, or will be obvious (e.g., an
            IPv6-only client need not attempt to look up A RRs or
            attempt to reach
            IPv4-only servers).  Designers of SMTP implementations
            that might run in IPv6 or dual-stack environments should study
            the procedures above, especially the comments about
            multihomed hosts, and, preferably, provide mechanisms to
            facilitate operational tuning and mail interoperability
            between IPv4 and IPv6 systems while considering local
            circumstances.
        </t>
      </section>
    </section>
    <section anchor="problem_detection" numbered="true" toc="default">
      <name>Problem Detection and Handling</name>
	  <!-- 6 -->
	  
      <section anchor="reliable_delivery" numbered="true" toc="default">
        <name>Reliable Delivery and Replies by Email</name>
        <!-- 6.1 -->
	   <t> When the receiver-SMTP accepts a piece of mail (by sending a "250 OK"
		  message in response to DATA), it is accepting responsibility for
		  delivering or relaying the message. This is a serious responsibility.
		  The message MUST be preserved in a way which is robust against
		  predictable loss (such as reboots, server crashes, disk failures,
		  or resource shortages) until the next system has taken responsibility,
		  or the message has been deliberately discarded.
	      Some reasons that a receiver-SMTP may choose not to deliver or relay a
		  message are discussed in the next subsection and in
		  <xref target="resistance_to_attacks" format="default"/>.
		</t>
	   
        <t>
      If there is a delivery failure after acceptance of a message, the receiver-SMTP
      MUST formulate and mail a notification message.  This notification MUST
      be sent using a null ("&lt;&gt;") reverse-path in the envelope.  The
      recipient of this notification MUST be the address from the envelope
      return path (or the Return-Path: line).  However, if this address is
      null ("&lt;&gt;"), the receiver-SMTP MUST NOT send a notification.
      Obviously, nothing in this section can or should prohibit local decisions
      (i.e., as part of the same system environment as the receiver-SMTP)
      to log or otherwise transmit information about null address events locally
      if that is desired.
        </t>

        <t>
      Some delivery failures after the message is accepted by SMTP will be
      unavoidable.  For example, it may be impossible for the receiving SMTP
      server to validate all the delivery addresses in RCPT command(s) due
      to a "soft" domain system error, because the target is a mailing list
      (see earlier discussion of RCPT), or because the server is acting as
      a relay and has no immediate access to the delivering system.
        </t>
        <t>
      To avoid receiving duplicate messages as the result of timeouts, a receiver-SMTP
      MUST seek to minimize the time required to respond to the final &lt;CRLF&gt;.&lt;CRLF&gt;
      end of data indicator.  See <xref target="RFC1047" format="default">RFC 1047</xref> for a discussion of this problem.
        </t>
	  </section>
	  
      <section anchor="unwanted_messages" numbered="true" toc="default">
        <name>Unwanted, Unsolicited, and "Attack" Messages</name>
        <!-- 6.2 -->
    <t>
      Utility and predictability of the Internet mail system requires that
      messages that can be delivered should be delivered, regardless of any
      syntax or other faults associated with those messages and regardless
      of their content.  If they cannot be delivered, and cannot be rejected
      by the SMTP server during the SMTP transaction, they should be
      "bounced" (returned with non-delivery notification messages)
      as described above.  In today's world, in which many SMTP server operators
      have discovered that the quantity of undesirable bulk email vastly exceeds
      the quantity of desired mail and in which accepting a message may trigger
      additional undesirable traffic by providing verification of the address,
      those principles may not be practical.
        </t>
        <t>
      As discussed in <xref target="resistance_to_attacks" format="default"/>
      and <xref target="scope_of_operation" format="default"/>
      below, dropping mail without notification of the sender is
      permitted
      in practice.  However, it is extremely dangerous and violates a long
      tradition and community expectations that mail is either delivered or
      returned.  If silent message-dropping is misused, it could easily undermine
      confidence in the reliability of the Internet's mail systems.  So silent
      dropping of messages should be considered only in those cases where
      there is very high confidence that the messages are seriously
      fraudulent, pose a significant risk, or are otherwise
      inappropriate.
        </t>
        <t>
      To stretch the principle of delivery if possible even further, it may
      be a rational policy to not deliver mail that has an invalid return
      address, although the history of the network is that users are typically
      better served by delivering any message that can be delivered.  Reliably
      determining that a return address is invalid can be a difficult and
      time-consuming process, especially if the putative sending system is
      not directly accessible or does not  fully and accurately support VRFY
      and, even if a "drop messages with invalid return addresses" policy
      is adopted, it SHOULD
      be applied only when there is near-certainty that
      the return addresses are, in fact, invalid.
        </t>
        <t>
      Conversely, if a message is rejected because it is found to contain
      hostile content (a decision that is outside the scope of an SMTP server
      as defined in this document), rejection ("bounce") messages SHOULD NOT
      be sent unless the receiving site is confident that those messages will
      be usefully delivered.  The preference and default in these cases is
      to avoid sending non-delivery messages when the incoming message is
      determined to contain hostile content.
        </t>
      </section>
      <section anchor="loop_detection" numbered="true" toc="default">
        <name>Loop Detection</name>
        <!-- 6.3 -->
    <t>
      Simple counting of the number of "Received:" header fields
      in a message has
      proven to be an effective, although rarely optimal, method of detecting
      loops in mail systems.  SMTP servers using this technique SHOULD use
      a large rejection threshold, normally at least 100 Received entries.
      Whatever mechanisms are used, servers MUST contain provisions for detecting
      and stopping trivial loops.
        </t>
      </section>
      <section anchor="compensating_for_irregularities" numbered="true" toc="default">
        <name>Compensating for Irregularities</name>
        <!-- 6.4 -->
    <t>Unfortunately, variations, creative interpretations, and outright violations
      of Internet mail protocols do occur; some would suggest that they occur
      quite frequently.  The debate as to whether a well- behaved SMTP receiver
      or relay should reject a malformed message, attempt to pass it on unchanged,
      or attempt to repair it to increase the odds of successful delivery
      (or subsequent reply) began almost with the dawn of structured network
      mail and shows no signs of abating.  Advocates of rejection claim that
      attempted repairs are rarely completely adequate and that rejection
      of bad messages is the only way to get the offending software repaired.
      Advocates of "repair" or "deliver no matter what" argue that users prefer
      that mail go through it if at all possible and that there are significant
      market pressures in that direction.  In practice, these market pressures
      may be more important to particular vendors than strict conformance
      to the standards, regardless of the preference of the actual developers.
        </t>
        <t>
      The problems associated with ill-formed messages were exacerbated by
      the introduction of the split-UA mail reading
      protocols (<xref target="RFC0937" format="default">Post Office Protocol (POP) version 2</xref>,
      <xref target="RFC1939" format="default">Post Office Protocol (POP) version 3</xref>,
      <xref target="RFC1176" format="default">IMAP version 2</xref>, and
      <xref target="RFC1056" format="default">PCMAIL</xref>).  These protocols encouraged
      the use of SMTP as a posting (message submission) protocol, and
      SMTP servers as relay systems
      for these client hosts (which are often only intermittently connected
      to the Internet).  Historically, many of those client machines lacked
      some of the mechanisms and information assumed by SMTP (and indeed,
      by the mail format protocol, <xref target="RFC0822" format="default">RFC 822</xref>).
      Some could not keep adequate track of time; others had no concept of
      time zones; still others could not identify their own names or addresses;
      and, of course, none could satisfy the assumptions that
      underlay RFC 822's conception of authenticated addresses.
        </t>
        <t>
      In response to these weak SMTP clients, many SMTP systems now complete
      messages that are delivered to them in incomplete or incorrect form.
      This strategy is generally considered appropriate when the server can
      identify or authenticate the client, and there are prior agreements
      between them.  By contrast, there is at best great concern about fixes
      applied by a relay or delivery SMTP server that has little or no knowledge
      of the user or client machine.  Many of these issues are
      addressed by using a separate protocol, such as that defined in
      <xref target="RFC6409" format="default">RFC 6409</xref>, for message submission,
      rather than using originating SMTP servers for that purpose.
        </t>
        <t>
      The following changes to a message being processed MAY be applied when
      necessary by an originating SMTP server, or one used as the target of
      SMTP as an initial posting (message submission) protocol:
      <iref item="Message Submission" subitem="Correcting messages" primary="false"/>
        </t>
        <ul spacing="normal">
          <li>Addition of a message-id field when none appears
        </li>
          <li>Addition of a date, time, or time zone when none appears
        </li>
          <li>Correction of addresses to proper FQDN format
        </li>
        </ul>
        <t>
      The less information the server has about the client, the less likely
      these changes are to be correct and the more caution and conservatism
      should be applied when considering whether or not to perform fixes and
      how.  These changes MUST NOT be applied by an SMTP server that provides
      an intermediate relay function.
        </t>
        <t>
      In all cases, properly operating clients supplying correct information
      are preferred to corrections by the SMTP server.  In all cases,
      documentation SHOULD be provided in trace header fields and/or header
      field
      comments for actions performed by the servers.
        </t>
      </section>
    </section>

	<section anchor="security-consider" numbered="true" toc="default">
      <name>Security Considerations</name>
      <!-- 7 -->
	  <t>SMTP is not a secure protocol as that term is
		 understood in the contemporary Internet.
		 It was designed, and is specified in this document, to
		 transport a mail message without any provisions to prevent or
		 detect reading of messages, or alteration of their content,
		 as they move from original sender to final recipient.
		 Similarly, it contains no mechanisms to ensue that the
		 identity of the message originator is real or used with
		 authorization.
		 In the last few decades, mechanisms have been developed as
		 SMTP extensions or supplemental protocols to mitigate those
		 problems and vulnerabilities.  In addition to those outlined
		 in the subsections below, the security considerations
		 that motivate those mechanisms and their
		 limitations are discussed in the
		 Applicability Statement document <xref target="Emailcore-AS"/>.
         Pointers to the individual documents (containing their own
		 Security Considerations sections) appear there as well.  See
		 <xref target="RelatedDocuments"/> for additional
		 discussion.</t> 

      <!-- End security considerations intro -->
	  
      <section anchor="mail_security_and_spoofing" numbered="true" toc="default">
        <name>Mail Security and Spoofing</name>
		<!-- 7.1 -->
		<t>The authenticity of SMTP mail is inherently insecure in
		   that it is feasible for even fairly 
      casual users to negotiate directly with receiving and relaying SMTP
      servers and create messages that will trick a naive recipient into believing
      that they came from somewhere else.  Constructing such a message so
      that the "spoofed" behavior cannot be detected by an expert is somewhat
      more difficult, but not sufficiently so as to be a deterrent to someone
      who is determined and knowledgeable.  Consequently, as knowledge of
      Internet mail increases, so does the knowledge that SMTP mail inherently
      cannot be authenticated, or integrity checks provided, at the transport
	  level.
	  Very high confidence in the authenticity of a message and its
	  originator
	  lies only in end-to-end methods involving
      the message bodies, such as those that use digital signatures on
	  the original message (see
      <xref target="RFC1847" format="default">RFC 1847</xref> and, e.g.,
      Pretty Good Privacy (PGP) in <xref target="RFC9580" format="default">RFC 9580</xref>
      or Secure/Multipurpose Internet Mail Extensions (S/MIME) in
      <xref target="RFC8551" format="default">RFC 8551</xref>).
        </t>
      <t>Various protocol extensions and configuration options that provide authentication
      at the transport level (e.g., from an SMTP client to an SMTP server)
	  improve somewhat on the traditional situation described above.
      However, in general, they only authenticate one server to another
      rather than a chain of relays and servers, much less
      authenticating users or user machines.  Consequently,
      unless they are accompanied by careful handoffs of responsibility in
      a carefully designed trust environment, they remain inherently weaker
      than end-to-end mechanisms that use digitally signed messages rather
      than depending on the integrity of the transport system.
        </t>
        <t>
      Efforts to make it more difficult for users to set envelope return path
      and header "From" fields to point to valid addresses other than their
      own are largely misguided: they frustrate legitimate applications in
      which mail is sent by one user on behalf of another, in which error
      (or normal) replies should be directed to a special address, or
      in which a single message is sent to multiple recipients on
      different hosts.  (Systems
      that provide convenient ways for users to alter these header fields on a per-message
      basis should attempt to establish a primary and permanent mailbox address
      for the user so that Sender header fields within the message data can be generated
      sensibly.)
        </t>
        <t>
      This specification does not further address the authentication issues
      associated with SMTP other than to advocate that useful functionality
      not be disabled in the hope of providing some small margin of protection
      against a user who is trying to fake mail.
        </t>
      </section>
      <section anchor="blind_copies" numbered="true" toc="default">
        <name>Hiding Addresses from Trace</name>
        <!-- 7.2 -->
    <t>Addresses that do not appear in the message header section
      may appear in the
      RCPT commands to an SMTP server for a number of reasons.  The two most
      common involve the use of a mailing address as a "list exploder" (a
      single address that resolves into multiple addresses) and the appearance
      of "blind copies".  When more than one RCPT command is present,
      and in order to avoid defeating some of the purpose of these mechanisms,
      SMTP clients and servers SHOULD NOT copy the  RCPT command
      arguments into the header section,
      either as part of trace header
      fields or as informational or private-extension header fields.
      See <xref target="SecurityConsid-Trace"/> for discussion of some
      related issues.
        </t>
        <t>
      There is no inherent relationship between either "reverse" (from
      the MAIL command)
      or "forward" (RCPT) addresses in the SMTP transaction
      ("envelope") and the addresses in the header section.
      Receiving systems SHOULD
      NOT attempt to deduce such relationships and use them to alter
      the header section
      of the message for delivery.  The popular "Apparently-to" header
      field is
      a violation of this principle as well as a common source of unintended
      information disclosure and SHOULD NOT be used.
        </t>
      </section>
      <section anchor="vrfy_expn_security" numbered="true" toc="default">
        <name>VRFY, EXPN, and Security</name>
        <!-- 7.3 -->
    <t>As discussed in <xref target="commands_for_debugging_addresses" format="default"/>, individual
      sites may want to disable either or both of VRFY or EXPN for security
      reasons (see below).  As a corollary to the above, implementations that permit this
      MUST NOT appear to have verified addresses that are not, in fact, verified.
      If a site disables these commands for security reasons, the SMTP server
      MUST return a 252 response, rather than a code that could be confused
      with successful or unsuccessful verification.
        </t>
        <t>
      Returning a 250 reply code with the address listed in the VRFY command
      after having checked it only for syntax violates this rule.  Of course,
      an implementation that "supports" VRFY by always returning 550 whether
      or not the address is valid is equally not in conformance.</t>
        <t>
      On the public Internet, the contents of mailing lists have become
     popular as an address information source for so-called
     "spammers."
     The use of EXPN to "harvest" addresses has increased as list
     administrators have installed protections against inappropriate uses
     of the lists themselves.
     However, VRFY and EXPN are still useful for authenticated users and
     within an administrative domain. For example, VRFY and EXPN are
     useful for performing internal audits of how email gets routed
     to check and to make sure no one is automatically forwarding
     sensitive mail outside the organization.
     Sites implementing SMTP authentication may choose to make VRFY
     and EXPN available only to authenticated requestors.
     Implementations SHOULD still provide support for EXPN, but sites
     SHOULD carefully evaluate the tradeoffs.
        </t>
        <t>
      Whether disabling VRFY provides any real marginal security
      depends on a series of other conditions.  In many cases, RCPT
      commands can be used to
      obtain the same information about address validity.   On the
      other hand, especially in situations where determination of address validity
      for RCPT commands is deferred until after the DATA command is
      received, RCPT may return no information at all, while VRFY is
      expected to make a serious attempt to determine validity before
	  generating a reply code (see discussion above). </t>
      </section>

      <section anchor="Reroute_251_551" numbered="true" toc="default">
         <!-- 7.4 -->
        <name>Mail Rerouting Based on the 251 and 551 Reply Codes</name>
        <t>Before a client uses the 251 or 551 reply codes from a
            RCPT command to automatically update its future behavior
            (e.g., updating the user's address book), it should be
            certain of the server's authenticity. If it does not, it
            may be subject to a man in the middle attack.
        </t>
      </section>
      <section numbered="true" toc="default">
        <name>Information Disclosure in Announcements</name>
        <!-- 7.5 -->
         <t>There has been an ongoing debate about the tradeoffs between the debugging
      advantages of announcing server type and version (and, sometimes, even
      server domain name) in the greeting response or in response to the HELP
      command and the disadvantages of exposing information that might be
      useful in a potential hostile attack.  The utility of the debugging
      information is beyond doubt.  Those who argue for making it available
      point out that it is far better to actually secure an SMTP server rather
      than hope that trying to conceal known vulnerabilities by hiding the
      server's precise identity will provide more protection.  Sites are encouraged
      to evaluate the tradeoff with that issue in mind;
      implementations SHOULD minimally provide for making type and version
      information available in some way to other network hosts.
        </t>
      </section>
      <section anchor="SecurityConsid-Trace" numbered="true" toc="default">
        <name>Information Disclosure in Trace Fields</name>
        <!-- 7.6 -->
    <t>
      In some circumstances, such as when mail originates from within a LAN
      whose hosts are not directly on the public Internet, trace
      (e.g., "Received")
      header fields produced in conformance with this specification may disclose
      host names and similar information that would not normally be available.
      This ordinarily does not pose a problem, but sites with special concerns
      about name disclosure should be aware of it.
      Also, the optional FOR clause should not be supplied when the
      same message is sent to multiple recipients in the same mail
      transaction in order not to inadvertently disclose the
      identities of "blind copy" recipients to others.
        </t>
      </section>
      <section numbered="true" toc="default">
        <name>Information Disclosure in Message Forwarding</name>
        <!-- 7.7 -->
    <t>
      As discussed in <xref target="forwarding_for_address_correction" format="default"/>,
      use of the 251 or 551 reply codes to identify the replacement address
      associated with a mailbox may inadvertently disclose sensitive information.
      Sites that are concerned about those issues should ensure that they
      select and configure servers appropriately.
        </t>
      </section>
      <section anchor="resistance_to_attacks" numbered="true" toc="default">
        <name>Local Operational Requirements and Resistance to Attacks</name>
        <!-- 7.8 -->
		<t>
      In recent years, there has been an increase of attacks on SMTP
      servers, either in conjunction with attempts
      to discover addresses for sending unsolicited messages or simply to
      make the servers inaccessible to others (i.e., as an
      application-level denial of service attack). There may also be
      important local circumstances that justify departures from some
      of the limits specified in this documents especially ones
      involving maximums or minimums.  While the means of doing so
      are beyond the scope of this Standard, rational operational behavior
      requires that servers be permitted to detect such attacks and take action
      to defend themselves.  For example, if a server determines that a large
      number of RCPT commands are being sent, most or all with invalid
      addresses, as part of such an attack, it would be reasonable for the
      server to close the connection after generating an appropriate number
      of 5yz (normally 550) replies.
        </t>
      </section>
      <section anchor="scope_of_operation" numbered="true" toc="default">
        <name>Scope of Operation of SMTP Servers</name>
        <!-- 7.9 -->
    <t>
      It is a well-established principle that an SMTP server may refuse to
      accept mail for any operational or technical reason that makes sense
      to the site providing the server.  However, cooperation among sites
      and installations makes the Internet possible.  If sites take excessive
      advantage of the right to reject traffic, the ubiquity of email availability
      (one of the strengths of the Internet) will be threatened; considerable
      care should be taken and balance maintained if a site decides to be
      selective about the traffic it will accept and process.
        </t>
        <t>
           Relay function through arbitrary sites, as part of hostile
           efforts to hide the actual origins of mail, has become so
           common that most sites
           limit the use of the relay function to known
           or identifiable sources. </t>
        <t> Implementations SHOULD provide the capability
           to perform this type of analysis of message sources and
           potential message rejection as a result.
           When mail is rejected for these
      or other policy reasons, a 550 code SHOULD be used in response to EHLO
      (or HELO),
      MAIL, or RCPT as appropriate.
        </t>
      </section>
	</section>
	
    <section anchor="IANAConsid" numbered="true" toc="default">
      <name>IANA Considerations</name>
      <!-- 8 -->
	  <t>All of the registries described below were created long
		 before work began on the current version of this document.
		 While the document 
		 specifies several changes to improve the information
		 available, clarity, and organization of some of those
		 registries (including explicitly specifying fields for the
		 "Service Extensions" one
		 (<xref target="IANA-ServiceExtensions"/>, little new has
		 been added and this section was written to optimize community
		 understanding of the registries and the changes being made.
		 The final subsection below (<xref target="IANAConsidNew5321bis"/>)
		 is a detailed summary for IANA, as they requested, of
		 specifics of those changes. </t>

      <section anchor="IANAConsidRegStruct" numbered="true"
                  toc="include">  <!-- begin 8.1 -->
         <name>SMTP-related Registries</name>

         <t> IANA maintains several registries in support of this
             specification, each one described in a subsection below.
			 The first two of them were originally created even before
			 RFC 2821 was published in April 2001.  The others were
			 defined or expanded by RFC 5321.

             The subsections that follow describe the general purpose
             and intent for those registries and substantive
             modifications to existing ones.  Information about actual
             registry structure requirements appears in
             <xref target="IANARegStructure"/>.
         </t>

    <section anchor="IANA-ServiceExtensions" numbered="true"
                toc="include">   <!-- Begin 8.1.1 -->
       <name> Simple Mail Transfer Protocol (SMTP) Service
          Extensions</name>
          <t>The "Simple Mail Transfer Protocol (SMTP) Service
           Extensions" registry
           <xref target="SMTPExtIANARegistry" format="default"/>,
           often referred to in this document as [the] "Service Extension
           Registry", consists of SMTP service extensions with the associated
           keywords, and, as needed, parameters, verbs, and related
           information.</t>
	   

	   <section anchor="RegistrationModels"
			  numbered="true" toc="include">     <!-- begin 8.1.1.1 -->
		  <name> Registration Models </name>
		  <iref item="Registration Models"
                    subitem="Introduction" primary="false"/>
          <t> In order to accommodate both a significant review of
             proposed extensions for those who find that useful and a
             minimally restrictive registration procedure for those
             who simply want to avoid name conflicts and similar
             problems, this registry supports two different
             registration models.  Additional discussion of the
			 reasons for this organization appears in
		     <xref target="definition_of_extensions"/>.</t>
        <t>As noted in <xref target="definition_of_extensions"/>, SMTP
		   Extensions MUST be registered.</t>

        <t> The would-be
         registrant shall pick between the two models described
         below. If the first is attempted and proves
         unsuccessful, the second may then be chosen:</t>
         <ol spacing="normal" type="Model %d:">
            <li>               <!-- Model 1 -->
			   <t> IETF Review and Approval
				  <iref item="Registration Models"
                    subitem="IETF Review and Approval" primary="false"/>
			   </t>
               <t>The document goes through the normal IETF review and
                  approval process, culminating in a published Standards
				  Track or Experimental RFC.
                  The intent is that the extension and its
                  specification will represent careful IETF community
                  review and consensus on its technical merits,
                  utility, and clarity of explanation.  The change
                  controller for all such extensions will be the
                  IETF.</t>
               <t>This model is approximately equivalent to "IETF
                  Review" as described in
                  <xref target="RFC8126"> RFC 8126/ BCP 26</xref>,
                  but involves a requirement for a Standards
                  Track or Experimental publication as a result.</t>

            </li>

            <li anchor="ExtensionsSimpleRegistration">  <!-- Model 2 -->
			   <t> Simple Registration
		          <iref item="Registration Models"
                    subitem="Simple Registration" primary="false"/>
			   </t>
               <t> The sole purpose of this option is to get the
                extension name, a (potentially very brief)
				description, and contact information registered in order to
               minimize the risk of the same extension name being used
               for different purposes.   The intent is that there be no
               barrier to such registrations other than the time and
               effort required to submit the request itself.
               Registrants are encouraged to provide documentation of
               the extension, its interactions with other
               specifications, etc., and to consult individuals or
               groups with SMTP experience for advice, but none of that
               is required.   The change controller for all such
               extensions will be the registrant unless otherwise
               specified in the registration request.  This
			   registration model may be used for specifications
			   published as Informational or Historic RFCs in any
			   Stream as well as specifications documented in other
			   ways. </t>
            <t> Even if this model is chosen, it is expected that
               registrants will supply all of the information in the
               list below and as described above and in
           <xref target="definition_of_extensions"/>
           as either part of the registration or in supplemental
           documents that will be referenced from the registry.
           However, the primary goals of getting extensions registered
           according to this model
           are to avoid conflicts about naming (e.g., two different
           deployed extensions with the same name or keyword) and to
           either identify a stable and generally available
           specification or to establish contact information for
		   additional information.
           Consequently, if no information
		   is available for some of the listed items,
		   the registration should be
		   made and the registry entry should
		   show the absence of such missing data with "Not supplied"
		   in the appropriate field as described in
		   <xref target="MissingInfoNote"/>.</t>
            <t> This model is approximately equivalent to "First
               Come First Served" as described in
               <xref target="RFC8126">RFC 8126/ BCP 26.</xref></t>
            </li>
         </ol>

            <t> IANA will modify the structure of the Service
			   Extension Registry to add a column entry that will
			   specify the model chosen.
			   Cf. <xref target="RegMethod"/></t>
	   </section>

             <section anchor="RegistryInformation" numbered="true"
                   toc="include">         <!-- begin 8.1.1.3 (former 8.1.1.2) -->
                <name>SMTP Service Extension Registration Template</name>
			<iref item="Extension Registration Template Components" subitem="" primary="false"/>

            <t> The following information shall be supplied as part of
               a Service Extension registration application and will be incorporated
               into the registry.  Some information is optional if the
			   second model (see above) is used but should be
			   explicitly noted as not provided.  Except as noted, a
			   reference to an easily available and stable document
			   may be provided rather than including the actual
			   information in the registry.</t>
			<t anchor="MissingInfoNote">
			   For FCFS Registrations, while additional information
			   should be supplied if appropriate, only the EHLO
			   Keyword, Description, Contact, and Change Controller
			   information is required.  Any information not supplied
			   should be explicitly noted in the registry as "Not
			   supplied".</t>
			 <t> Once a registration is complete, any modification
			   requests must follow the same procedure as the original
			   registration except that "FCFS" registration can be
			   changed to "IETF" ones if appropriate permissions are
			   given and the "Model 1" procedures followed. "Legacy"
			   registrations are not permitted to be updated.</t>

           <ol spacing="normal" type="(%d)">
			  <li anchor="Reg-TextName"><t>EHLO Keyword:
				 The textual name of the SMTP
				 service extension.
				 EHLO Keyword values are ASCII case-insensitive
				 letter-digit-hyphen strings, see "ehlo-keyword" ABNF
				 non terminal from <xref target="extended_hello"/>
				 for more details.
				 <iref item="Extension Registration Template Components"
					   subitem="EHLO Keyword" primary="false"/> </t>
			  </li>
			  
			  <li anchor="Reg-Summary"><t>Description:
				 <iref item="Extension Registration Template Components"
						  subitem="Description" primary="false"/>
				A summary of the purpose of the extension and what it 
				is expected to accomplish.
				This will normally include information about how
				support for the extension affects the behavior of a
				server and client SMTP.</t>
			  </li>

			  <li anchor="Reg-Reference"><t>Reference:
				 <iref item="Extension Registration Template Components"
					subitem="Reference" primary="false"/>
				 A reference, such as to one or more RFCs or other
				 documents, for information about the particular
				 registration.</t>
			  </li>
			
              <li anchor="Reg-KeywordParams"><t>EHLO Parameters: The syntax
				 and possible values of any parameters associated
				 with an extension keyword returned by the server in
				 the EHLO command response.
				 See "ehlo-param" in <xref target="extended_hello"/>
				 for syntax information.
				 Explicitly note "None" if no parameters.
				 <iref item="Extension Registration Template Components" 
					subitem="EHLO Parameters" primary="false"/> </t>
			  </li>
			  
			  <li anchor="Reg-AddtlVerbs"><t>Additional verbs:
				 <iref item="Extension Registration Template Components" 
					subitem="Additional verbs" primary="false"/>
				 Any additional SMTP verbs associated with the extension
				 and their arguments if any.
				 These additional verbs will 
                 usually be, but are not required to be, the same as,
                 or begin with, the EHLO keyword value, e.g., if the
				 EHLO keyword value were "EXMP", an associated verb
				 might be "EXMP-XYZ".
				 See <xref target="ExtensionVerbs"/> and
				 <xref target="command_argument_syntax"/> of
				 &lt;&lt;This Document&lt;&lt; for information about syntax.
				 Identify as "none" if there are no additional verbs
				 </t>
			  </li>

			  <li anchor="Reg-MailParams"><t>MAIL/RCPT Parameter Values:
				 Any new parameters the
                 extension associates with the MAIL or RCPT
				 verbs
				 Identify as "none" if the extension does not add any.
				 <iref item="Extension Registration Template Components" 
					subitem="MAIL/RCPT Parameter Values"
					primary="false"/>
				 </t>
			  </li>

			  <li anchor="RegMethod"><t>RegMethod:
				 <iref item="Extension Registration Template Components"
					   subitem="RegMethod" primary="false"/>
				 Keyword values in the registry will
				 indicate a level of approval as "IETF" or "FCFS"
				 (designating, respectively, Model 1 of 2 as described in
				 <xref target="RegistrationModels"/> or, for existing registry
				 entries not specified in RFCs prior to this
				 specification, "Legacy".
				 All other
				 registration approved prior to completion of this
				 specification will have "IETF" in this field.</t>
			  </li>

              <li anchor="MessageSubmissionRegistration">
                 <t>Message submission Use and Values:
                  <iref item="Message Submission"
                    subitem="SMTP Extension Registration" primary="false"/>
                  Keyword indicating relevance for use in
                 message submission as described in
                 <xref target="RFC6409">Section 7 of RFC 6409</xref>.
                 For any registration prior to the publication of
                 &lt;&lt;This document&gt;&gt;
                 for which this information was not specified in RFC
                 6409 or the registration request, this entry in the
				 registry will be set to "MUST NOT".</t>
			  </li>
			  
			  <li anchor="Reg-Increment"><t>Length Added:
				 <iref item="Extension Registration Template Components" 
					subitem="Length Added" primary="false"/>
				 The increment by which the extension is increasing 
                 the maximum length of the commands MAIL and/or RCPT
                 over that specified in this Standard or other
                 registrations that might reasonably be expected to
				 interact with it.</t>
			  </li>

			  <li anchor="Reg-Note"> <t>Note:
				 <iref item="Extension Registration Template Components" 
					subitem="Note" primary="false"/>
				 Any notes applicable to this registration that do not
				 appear in fields other than those listed above.</t>
			  </li> 
			  
			  <li anchor="Reg-contact"><t>Contact:
				 <iref item="Extension Registration Template Components" 
					subitem="Contact" primary="false"/>
				 Provides contact information for the submitter or other
                 responsible party.  Under most circumstances the
				 Contact and Change Controller (see below) will be
				 the same (e.g., "IETF" for SMTP extensions specified in IETF
                 Stream RFCs) but might be identified separately for
				 some "Model 2" registrations.</t>
			  </li>
			  <li anchor="Reg-ChangeControl"><t>Change Controller:
				 <iref item="Extension Registration Template Components" 
					subitem="Change Controller" primary="false"/>
				 Provides contact information for the Change
				 Controller as specified in
				 <xref target="RFC8126"> RFC 8126/ BCP 26</xref>.  See
				 "Contact", above, for additional information.</t>
			  </li>
           </ol>
          </section>

    </section>   <!-- End 8.1.1 -->

        <section anchor="IANA-AddrLiterals" numbered="true" toc="include">
           <name>Address Literal Tags</name>  <!-- Start 8.1.2 -->
		   <t>The "Address Literal Tags"
			  <xref target="DomainLiteralRegistry" format="default"/>
			  registry consists of "tags" that identify forms of domain literals 
               other than those for IPv4 addresses (specified in RFC 821 and in this
			   document).
			   This registry also goes back more than two decades.
               Its initial, and so far only, entry is for
               IPv6 addresses (usage and syntax are specified
			   elsewhere in this document).  No additional 
               literal types are anticipated at this time.  If that
			   prediction is incorrect, registration is required and 
			   requires standardization (the IETF "Standards
			   Action" procedure defined in
			   <xref target="RFC8126"> RFC 8126/ BCP 26</xref>)
			   before being used. </t>
        </section>
        <section anchor="IANA-MailTransmission" numbered="true" toc="include">
           <name>Mail Transmission Types for the "Received:" header
			  field (formerly "Mail Transmission Types")</name>   <!-- Begin 8.1.3 -->
           <t> The "Mail Transmission Types" registry group
              <xref target="SMTPTransIANARegistry" format="default"/>,
              established by RFC 821 and renewed by this specification, is
			  a registry of link and protocol identifiers to be used
			  with the "via" and "with" clauses of the time stamp
			  ("Received:" header field) described
              in <xref target="trace_information" format="default"/>.
              Link and protocol identifiers in addition to those
              specified in this document may be registered only
              according to the "RFC Required" procedure described
			  in <xref target="RFC8126"> RFC 8126/ BCP 26</xref>.</t>

		   <t> An additional subregistry has been added to the "VIA
			  link types" and "WITH protocol types" subregistries of
			  this registry to contain registrations of
			  "Additional-registered-clauses" as in the subsection
			  that follows.  Each of "via", "with", and "Additional
			  Registered Clauses" (keyword and values) has its own
			  subregistry.</t>
		   
        </section>
        <section anchor="IANA-Additional-Registered" numbered="true" toc="include">
		   <name>Additional Registered "Received:" Clauses</name> <!-- 8.1.4 -->
           <t>As mentioned in <xref target="Addtl-Trace-Fields"/> above,
              additional clauses for the "Received:" header field may
              be added by future specifications (details below).  IANA
              has created a registry for such clauses
              <xref target="SMTPAddlRegisteredClausesReg"/> which
			  should be renamed to "Additional Registered 'Received:'
			  Clauses" for clarity.  The registry
              will contain the Clause Name; the name of any
			  associated enabling Service Extension (blank if there is
			  no Service Extension involved); a short
              description; a syntax summary; and a reference to a more
              complete specification.   Only the field for the name
			  of the enabling Service Extension is new with this
			  specification. </t> 
		   <t> Additional clauses may be registered only by the	  
              "IETF Review" procedure described in
              <xref target="RFC8126"> RFC 8126/ BCP 26</xref>.</t>
           <t> As new clauses are defined, they may, in principle, specify
              creation of separate registries (specific to them) if
			  the Strings
			  allowed by the syntax summary
			  consist of reserved 
              terms or keywords rather than less restricted strings.
           </t>
        </section>

      </section> <!-- end 8.1 -->

      <section anchor="IANARegStructure"  numbered="true"  toc="default">
                  <!-- Start new 8.2, old 8.3 -->
         <name>Specification of Registry Group and Registry
            Structure</name>
		 <t> The Mail Parameters Registry Group
			<xref target="MailParamsIANARegistry"/>
			should be reorganized as follows.</t>
		 <ol spacing="normal" type="(%d)">
            <li>The registry for Address Literals
               <xref target="DomainLiteralRegistry"/> should be
               consolidated into the Mail Parameters Registry Group.
               Those literals are specified only for email purposes
               and have no established meaning elsewhere. </li>
            <li> Please insert a category for "Associated registries
               located elsewhere" after the "Registries included
               below" group at the top of the MAIL Parameters Group
               page.  There should be one entry in the new category:
               the name "Message Headers" and a link to the
               appropriate registry
               <xref target="IANAMessageHeaderReg"/>.  Also that
			   registry group should be renamed to "SMTP-related
			   Registries": there is no obvious reason to capitalize
			   "MAIL": all the the registries and subregistries in
			   the group are SMTP-related, and the most important of
			   them is not about parameters at all.
			   "MAIL Parameters" should probably be retained as a
			   comment or parenthetical note because it is almost
			   certainly referenced from other documents.
			</li>
			<li>  Remaining numbered items in this subsection
			   should be separated into different fields in the
			   registry; i.e.,
               none of them should be combined into "Description".
               Information that is not supplied with the registration
               or supplemental documents should be explicitly
               identified as "Not supplied by submitter" or with an
               explicit note pointing to that phrase.</li>
         </ol>
	  </section>   <!-- end new 8.2, old 8.3 -->

      <!-- New 8.3 as of -38 -->
      <section anchor="IANAConsidNew5321bis" numbered="true" toc="default">
         <name>Registry Changes with &lt;&lt;This Document&gt;&gt;</name>
		 <t> While, as noted at the beginning of this Section, this
			document does not introduce any new registries, it
			specifies modifications to several existing ones.  Those
			modifications are listed below for IANA's convenience, in
			what should be a convenient order for applying them.  Some
			of the information below is inevitably redundant with
			information and explanations supplied earlier in this
			Section or elsewhere in the document.</t>
		 <t><cref> RFC Editor: Note that the changes made as a result of
			this section will change the URLs, and sometimes even the
			names, of entries in the References section.  Those
			references should be updated to reflect the new names and
			locations and this note removed.</cref></t>

		 <section anchor="New5321bisAddrLiteral" numbered="true"
					 toc="include">
			<name> Changes to the Registry for Address Literals</name>
			<ol spacing="normal" type="(%d)">
			   <li> Consolidate the Address Literals Registry into the
				  "Mail Parameters" Registry Group.</li>
			   <li> If needed to conform to other IANA practices,
				  leave a note at the location of the existing/old
				  registry explaining the change and pointing to the
				  new location.</li>
			   <li> Update any registries that point to this one
				  (there probably aren't any) to reflect the new
				  location and insure that URLs that reflect the old
				  location point to the new one.</li>
			</ol>
		 </section>
		 
		 <section anchor="New5321bisMailParamsReg"
				numbered="true" toc="include">
			<name> Changes to the top-level "MAIL Parameters" Registry
			   Group</name>
			<ol spacing="normal" type="(%d)">
			   <li> Rename the registry group to "SMTP-related
				  Registries", including a note about the older name.</li>
			   <li> Update all registries that refer to this one to
				  use the new name but insure that URLs based on the
				  older name continue to work and are treated as
				  permanent.</li>
			   <li> Update the "Registries included below" list to reflect
				  the addition of the Address Literals Registry as
				  described in <xref target="New5321bisAddrLiteral"/>
				  above. </li> 

				<!-- 20250218 next bullet new per Alexey -->
				<li>Close the "SMTP Service Extension Parameters"
				   registry, adding the following note: "These
				   entries have been incorporated into the SMTP
				   Service Extension registry's 'EHLO Parameters'
				   field." </li>
				<li>After the "Registries included below" listing,
				   add a new category named "Associated registries
				   located elsewhere".  It should have one entry,
				   "Message Headers"
				   <xref target="IANAMessageHeaderReg"/>.</li> 

				<li>Registries not identified in subsections below,
				   i.e., "Registered-states", "Multicast Email SMTP
				   Extensions", and "SMTP Server Limits", are
				   unchanged.</li>
			</ol>
			</section>
			
		 <section anchor="New5321bisExtensionReg" numbered="true"
					 toc="include">
			<name> Changes to Simple Mail Transfer Protocol (SMTP)
			   Service Extensions Registry </name>
			<section anchor="New5321bisExtensionRegHdr" numbered="true"
						toc="include">
			   <name> Registry Header Information Changes</name>
			<ol spacing="normal" type="(%d)">
			   <li> The "Reference" header information that refers to 
				  RFC 5321 Section 2.2 should be changed to reference
				  <xref target="IANA-ServiceExtensions"/> and
                  <xref target="definition_of_extensions"/> of this
				  document in that order.</li>
			   <li> A note should be added to the header information
				  indicating what information fields may be supplied by
				  reference to a stable and easily available external
				  document rather than spelled out in the registry
				  entry.  Information about which fields these are
				  appear in
				  <xref target="RegistryInformation"/>, particularly
				  <xref target="Reg-contact"/>. </li>

			   <li> The "Registration Procedure(s)" header entry under
				  "SMTP Service Extensions"
				  should be changed to "Either 'Model 1' or 'Model 2'
				  as described in <xref target="RegistrationModels"/> of 
				  &lt;&lt;This Document&gt;&gt;".  </li>   
			</ol>
			</section>
			<section anchor="New5321bisExtensionRegFields" numbered="true"
						toc="include">
			   <name>Fields for Registry Entries</name>
			   <ol spacing="normal" type="(%d)">
			   <li> Add fields to the list of registered extensions
				  "Additional verbs" and "MAIL/RCPT Parameter
				  Values" as specified in detail in
				  <xref target="RegistryInformation"/>.
				  For
				  extensions registered prior to the date this
				  document is posted, the value of those fields should
				  be a reference to the document that now appears in
				  the "Reference" field.
			   </li>
			   <li> Add a field for "EHLO Parameters" after the
				  "MAIL/RCPT Parameter Values" one.  The values for
				  this field consist of additional information supplied
				  by the server along with the EHLO keyword name.  For
				  registrations prior to publication of this document,
				  the value will be copied from the former "SMTP Service
				  Extension Parameters" registry, with "None" for any
				  Service Extensions that did not appear in that
				  registry.</li>
				<li>Add a field to the registry named "RegMethod" with
				   values "IETF", "FCFS", and "Legacy", the first two
				   reflecting the method
				   choice in <xref target="IANA-ServiceExtensions"/>.
				   For registrations prior to approval of this
				   document, "Legacy" will be applied to any
				   registration not associated with an RFC in the
				   Reference field.  All others -- those associated
				   with RFCs --  will have "IETF" in this field.</li>

				<li> Add all other fields listed in
				   <xref target="RegistryInformation"/>, but not
				   explicitly described above, to the registry.
				   In particular, the descriptions for "Message
				   submission Use and Values", "Contact" and "Change
				   Controller" fields contain special instructions on
				   how to populate them. 
				</li>
				<li> For entries that have the value "Legacy" in the
				   "RegMethod" field, the "Contact" and "Change
				   Controller" will be taken from the "Reference"
				   field and the remaining fields will be filled in
				   as "Not supplied".
				</li>
			</ol>
			</section>
			<section anchor="New5321bisExtensionRegEntry" numbered="true"
					 toc="include">
					 <name> Additional Registry Entry</name>
			   <t>While it is not strictly an extension (nor is EXPN),
				 to improve clarity IANA should add VRFY to this
				 registry, immediately before the entry for EXPN.
				 Fields should be:</t>
				 <ul anchor="VRFYregister" bare="true" empty="true"
					 indent="3" spacing="compact">
					<li>EHLO keyword: VRFY</li>
					<li>Description: VRFY command as specified in
					   &lt;&lt;This document&gt;&gt;</li>
					<li>Reference: &lt;&lt;This document&gt;&gt;</li>
					<li>Note: Implementation support for VRFY is
					   required in servers but its listing in the
					   EHLO response is optional.
					   See <xref target="vrfy_normal_response"/> in
					   &lt;&lt;This document&gt;&gt; for details on
					   this subject.</li>
					<li>Parameters: None</li>
					<li>Additional verbs: None</li>
					<li>MAIL/RCPT Parameter Values: None</li>
					<li>RegMethod: IETF</li>
					<li>Message submission Use and Values: MUST NOT</li>
					<li>Behavior and Impact: VRFY command as specified in
					   &lt;&lt;This document&gt;&gt;</li>
					<li>Length Added: Zero</li>
					<li> Contact: IETF</li>
					<li> Change Controller: IETF</li>
				 </ul>
			</section>
		 </section>
			   

		 <section anchor="New5321bisMailTransmission" numbered="true"
					 toc="include">
			<name>Changes to Mail Transmission Types registry</name>
			<ol spacing="normal" type="(%d)">
			   <li> In the first sentence of the Note for the registry
				 replace "The Simple Mail Transfer Protocol
				 [RFC821][RFC5321] and the Standard for the Format of
				 ARPA Internet Text Messages [RFC822] specify
				 that..." with "The Simple Mail Transfer Protocol
				 (&lt;&lt;This Document&gt;&gt;) and the Standard for
                  Internet Message Formats <xref target="rfc5322bis"/>
				  specify that..."</li>
			   <li> The Reference in the registry header should be to
				  <xref target="IANA-MailTransmission"/>  and
				  <xref target="IANA-Additional-Registered"/> of
				  &lt;&lt;This Document&gt;&gt;
				  and <xref target="rfc5322bis"/></li>
			   <li anchor="TransmissionTypesRename">
				  To improve clarity, the title of this registry group
				  should be changed to 'Mail Transmission Types for
				  the "Received:" header field'.</li>
			   <li> "Registration Procedure(s)" for the "via" and
				  "with" clauses should be changed to "RFC Required",
				  as per <xref target="IANA-MailTransmission"/></li> 
			   <li>"Registration Procedure(s)" for
				  "Additional-registered-clauses" should be changed
				  to "IETF Review" as per
				  <xref target="IANA-Additional-Registered"/>.</li>
			</ol>
		</section>		
		 
	  </section>   <!-- end new 8.3 -->
	  
	  <section anchor="IANAConsidAddtl" numbered="true" toc="default">
		 <name>Additional IANA Actions</name> <!-- 8.4 -->
		 <t>All references to RFC 5321 in IANA registries not
			discussed above should be replaced with references to
			&lt;&lt;This Document&gt;&gt;.</t>
	  </section>

    </section>   <!-- End 8, IANA Considerations -->

    <section anchor="Acknow" numbered="true" toc="default">
      <name>Acknowledgments</name>
      <!-- 11 -->
    <t>Many people contributed to the development of RFCs 2821 and
       5321. Those documents should be consulted for those
       acknowledgments.</t>
      <t>Neither this document nor RFCs 2821 or 5321 would have been possible
        without the many contribution and insights of the late Jon
        Postel and Ned Freed.  Jon Postel's contributions of course
        include the original
        specification of SMTP in RFC 821.   A considerable quantity of
        text from RFC 821 still appears in this document as do several
        of Jon's original examples that have been updated only as
        needed to reflect other changes in the specification.
        Ned Freed's many contributions from multiple perspectives, as
        author or co-author of several of the documents that were
        folded into this one, and an extremely careful reader who
        identified and proposed corrections to problems that others
        missed, were similarly invaluable.</t>
      <t>The following filed errata against RFC 5321 that were not
        rejected at the time of submission:
 
        Jasen Betts, 
        Adrien de Croy,
        Guillaume Fortin-Debigare, <!-- RFC Editor: last character of name is U+00E9 -->
        Roberto Javier Godoy,
        David Romerstein,
        Dominic Sayers,
        Rodrigo Speller,
        Alessandro Vesely, and
        Brett Watson.
        Some of those individuals made additional suggestions after
        the EMAILCORE WG was initiated.
        In addition to the above, several of whom continued to make
        other suggestions, specific suggestions that led to
        corrections and improvements in early versions of the current
        specification were received from Dave Crocker, Ned Freed,
        Arnt Gulbrandsen,
        Tony Hansen, Barry Leiba, Ivar Lumi, Pete Resnick,
        Hector Santos, Paul Smith
        and others.</t>
	 <t><cref>RFC Editor: Despite the message to me on 2020-05-03 recommending the
		sentence form that follows, Last Call comments pointed out
		that, as a sentence starting without an upper-case letter, it
		looks odd.  Borrowing from the rest of that discussion, it
		would look less obviously odd if rearranged so that the name
		was not the first word, but that would not solve the perceived
		(but not actual) problem of not capitalizing the name.  This
		is not a useful IETF discussion: up to you if you are
		inclined to change the 2020 advice.  A recent suggestion was
		that we use "chetti [sic]".  Up to you.</cref><br/>
		chetti contributed an analysis that clarified the ABNF
		 productions that implicitly reference other documents.</t>
     <t> The EMAILCORE Working Group was chartered in September 2020
        with Alexey Melnikov and Seth Blank as co-chairs.  Todd Herr
        replaced Seth Blank early in 2021.  Without
        their leadership and technical contributions, and the efforts
        of WG participants under their guidance, this document
        would never have been completed. Many participants in the WG
        reviewed the document or portions of it and made comments that
        resulted in improvement.  During the last stages of working
        group consideration of this document, careful reviews of the
        specification in its entirety by Alexey Melnikov, John Levine,
        Rob Sayre, and Tim Wicinski contributed significantly to the
        clarity of the final version and its relationship to other
        IETF work.
	 </t>
	 <t>
		Additional thanks are due to Alexey Melnikov for rewriting what is
		now <xref target="ErrataDisposition"/> into a form that should
		be intelligible for the long term and for suggestions about
		the IANA Considerations, to Donald Eastlake for a
		comprehensive Last Call review that identified text to be
		clarified and issues that should have probably been better
		explained, to Henry S. Thompson for a helpful late
		review, and to several IESG members, notably Gorry Fairhurst,
		for detailed comments during the April 2025 ballot review.</t>
	 <t>Murray Kucherawy and Andrew (Andy) Newton served as
		Area Directors for the EMAILCORE WG during the crucial years
		of getting this document finished and made both administrative
		and technical contributions to it.  Without their efforts and
		patience, it might never have been finished.</t>
    </section>
  </middle>
  <back>
    <references>
	   <name>References</name>

	   <!-- RFC Editor:  20241230 Attempted to insert a note to you
	   here and failed.  Apparently we cannot have notes, crefs, or text in
	   the References section.  
	   -->
	   <!-- <reference anchor="BogusReference" quoteTitle="true">
		  <front>
			 <title>Bogus reference - placeholder</title>
			 <author/>
			 <note>
				<t><cref> Note to RFC Editor:  See note at the
				   beginning of <xref target="IANAConsidNew5321bis"/>.
				   Remove this note after that action has been
				   taken.</cref></t>
			 </note>
		  </front>	  
	   </reference>  <!.. end bogus placeholder reference -->
	   
      <references>
        <name>Normative References</name>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8174.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8126.xml"/>

        <reference anchor="ASCII">
          <front>
            <title>USA Code for Information Interchange</title>
            <author>
              <organization abbrev="ANSI">
              American National Standards Institute
                (formerly United States of America Standards Institute)
              </organization>
            </author>
            <date year="1968"/>
          </front>
          <seriesInfo name="ANSI" value="X3.4-1968"/>
          <annotation>ANSI X3.4-1968 has been replaced by newer
      versions with slight modifications, but the 1968 version
      remains definitive for the Internet. The 1968 version is also
      described for Internet purposes
      in <xref target="RFC0020">RFC 20</xref>. </annotation>
        </reference>

        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.0020.xml"/>

        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.0821.xml"/>

        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.1035.xml"/>

        <reference anchor="RFC1035a">
           <front>
              <title>Domain names - implementation and specification</title>
              <author initials="P." surname="Mockapetris"
                      fullname="Paul Mockapetris"/>
              <date year="1987" month="November"/>
           </front>
           <seriesInfo name="RFC" value="1035"/>
           <refcontent> Section 2.3.1</refcontent>
           <annotation>
              <cref display="true"><br/>[RFC Editor: please remove this note]]
                 <br/>
                 [[Reviewers and other readers: the mess in this
                 annotation, with embedded "//" markings as part of
                 CREF comments and no separation, even with a line
                 break, of the annotation from the rest of the
                 reference and of the text starting with "This section
                 of RFC 1035..", which is intended to remain in the
                 RFC form from the comments above it, are the result
                 of an xml2rfc bug that
                 was reported in January 2024 and that was considered
                 not worth fixing because the comment will disappear
                 in the RFC version and, with luck, everything else
                 will work out.  The separation of the intended text
                 from the botched comment in the txt form was
                 accomplished by hand-editing the latter.
              <br/>
                After a rather detailed analysis, there is no
                standards track document that explicitly updates RFC
                1035 (or 1034) to allow leading digits in
                "preferred syntax" domain names. What we have is a
                situation in which RFC 1123
                allows leading digits in "host names" but does not do
                so in the section that updates the DNS specs. As
                pointed out in RFC 9499, "host name" has been used and
                misused for several different things, including as
                only the first (leftmost) label in a fully-qualified
                domain name. The discussion of the "host name"
                terminology in that RFC has been read to settle the
                issue by equating "host name" syntax to "preferred
                name syntax", but it does not update 1123 and, equally
                important, uses "often meant" to describe the
                relationship between the two terms and, in the
                subsequent paragraph and as mentioned above, talks
                about the other things that "host name" might mean
                (including only the first label "of a fully-qualified
                domain name).
              <br/>
                The (non-comment) text below in this reference is an
                attempt to explain the situation without making
                claims about, e.g., document updates that are not
                supported by RFC metadata or the structure of RFC 1123.
                <br/>
              </cref>

              This section of RFC 1035 defined the
              "preferred name syntax" as excluding leading digits
              in those names.  Whether the restriction was
              accidental or deliberate, at least one second-level
              domain name starting with a digit had appeared in the
              DNS by the end of 1986, almost a year before RFC 1035
              appeared.  The restriction was removed for "host
              names" in <xref target="RFC1123">RFC 1123</xref>.
              The terminology description for the DNS
              <xref target="RFC9499"/> clarified that "host name"
              was "often meant to be a domain name that follows the
              rules... of 'preferred name syntax'".  So the syntax for
              "domain name" in <xref target="domain_names"/> above is
              consistent with the DNS specifications as generally
              interpreted.</annotation>
        </reference>

        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9499.xml"/>

        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.1123.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.1870.xml"/>
    <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3463.xml"/>
    <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3848.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5952.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5234.xml"/>

        <reference anchor="rfc5322bis"
                   target="https://datatracker.ietf.org/doc/draft-ietf-emailcore-rfc5322bis/">
          <front>
            <title>Internet Message Format</title>
            <author initials="P." surname="Resnick" fullname="Pete Resnick">
              <organization/>
            </author>
            <date year="2024"/>
          </front>
          <annotation>Note to RFC Editor and WG: This reference, and
             citations to it (including mentions of "RFC 5322bis",
             "RFC5322bis", and other variations) should
             be updated to the correct RFC number and other
             information when work on rfc5321bis (this document) and
             rfc5322bis is complete.  All references to the original
             RFC 5322 has been removed from this specification.  Once
             that update has been accomplished, this note should be
             removed.</annotation>
		</reference>

    <reference anchor="Emailcore-AS" target="https://datatracker.ietf.org/doc/draft-ietf-emailcore-as/">
          <front>
            <title>Applicability Statement for IETF Core Email
             Protocols</title>
            <author initials="J.C." surname="Klensin" fullname="John C Klensin" role="editor">
              <organization/>
            </author>
            <author initials="K." surname="Murchison" fullname="Kenneth Murchison" role="editor">
              <organization/>
            </author>
            <author initials="E." surname="Sam" fullname="Ekow Sam" role="editor">
              <organization/>
            </author>
            <date year="2021" month="August" day="6"/>
          </front>
    </reference>		

      </references>  <!-- end Normative References -->

      <references>
        <name>Informative References</name>
        <!-- Note to self (JcK) and RFC Editor (20080415): RFC3461 and 3464 are
       used in a "SHOULD use them" statement, so there is an argument
       that they are normative.  On the other hand, they are separate
       specs and an understanding of them is not required to
       understand this one.  I favored the latter because (i) it was
       that way through all drafts of this spec, despite the comments
       on the list after 2nd last call closed and (ii) while those
       specs are at Draft, I don't want them to turn into gating
       issues for moving this to full Standard if that can be
       avoided.  -->

    <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.0822.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.0937.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.0959.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.0974.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.1047.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.1056.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.1176.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.1425.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.1846.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.1847.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.1869.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.1939.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.1985.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2045.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2047.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2156.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2181.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2231.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2821.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2920.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2979.xml"/>
		<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3030.xml"/>
		<xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3092.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3461.xml"/>
    <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3464.xml"/>
    <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9051.xml"/>
    <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6530.xml"/>
    <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6531.xml"/>
        <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8098.xml"/>
    <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.8551.xml"/>
    <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3974.xml"/>
    <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3986.xml"/>
    <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6409.xml"/>
    <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.9580.xml"/>
    <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5248.xml"/>
    <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6152.xml"/>
    <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7504.xml"/>
    <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7505.xml"/>
    <xi:include href="https://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5321.xml"/>

    <reference anchor="MailParamsIANARegistry"
               target="https://www.iana.org/assignments/mail-parameters">
       <front>
          <title> Mail Parameters</title>
          <author>
              <organization>Internet Assigned Number Authority (IANA) </organization>
            </author>
            <date year="2022"/>
          </front>
    </reference>

        <reference anchor="SMTPExtIANARegistry"
          target="https://www.iana.org/assignments/mail-parameters/mail-parameters.xhtml#mail-parameters-2">
          <front>
            <title>IANA Mail Parameters: SMTP Service Extensions</title>
            <author>
              <organization>Internet Assigned Number Authority (IANA) </organization>
            </author>
            <date year="2022"/>
          </front>
        </reference>
        <reference anchor="SMTPTransIANARegistry"
          target="https://www.iana.org/assignments/mail-parameters/mail-parameters.xhtml#mail-parameters-5">
          <front>
            <title>IANA Mail Parameters: Mail Transmission Types</title>
            <author>
              <organization>Internet Assigned Number Authority (IANA) </organization>
            </author>
            <date year="2022"/>
          </front>
        </reference>
		
        <reference anchor="SMTPAddlRegisteredClausesReg"
             target="https://www.iana.org/assignments/mail-parameters/mail-parameters.xhtml#mail-parameters-8">
                <front>
            <title>IANA Mail Parameters: Additional-registered-clauses</title>
            <author>
              <organization>Internet Assigned Number Authority (IANA) </organization>
            </author>
            <date year="2022"/>
            </front>
        </reference>

        <reference anchor="IANAMessageHeaderReg"
                target="https://www.iana.org/assignments/message-headers/message-headers.xhtml">
           <front>
            <title>Message Headers</title>
            <author>
              <organization>Internet Assigned Number Authority (IANA) </organization>
            </author>
            <date year="2022"/>
          </front>
        </reference>

        <reference anchor="DomainLiteralRegistry"
            target="http://www.iana.org/assignments/address-literal-tags">
          <front>
            <title>Address Literal Tags</title>
            <author>
              <organization>Internet Assigned Number Authority (IANA) </organization>
            </author>
            <date year="2007"/>
          </front>
        </reference>

        <reference anchor="IANA-Extension-Registry" target="https://www.iana.org/assignments/mail-parameters/mail-parameters.xhtml#mail-parameters-2">
          <front>
            <title>SMTP Service Extensions</title>
            <author>
              <organization> IANA </organization>
            </author>
            <date year="2021"/>
          </front>
          <annotation> Notes in draft: RFC Editor: Please adjust date
            field to reflect whatever you want for a registry that is
            updated periodically.   IANA: Please determine if the
            above URL is a sufficiently stable reference and adjust
            as appropriate if it is not. </annotation>
        </reference>

        <reference anchor="RFC5321-errata"
                    target="https://www.rfc-editor.org/errata/rfc5321">
          <front>
             <title>RFC Errata: RFC 5321</title>
             <author>
              <organization> RFC Editor </organization>
             </author>
             <date year="2022"/>
          </front>
          <annotation>Captured 2024-06-20.</annotation>
		</reference>
		
	  </references>

    <!-- end informative -->
    </references>  <!-- end references -->

    <!-- Appendices  -->
      <section numbered="true" toc="default">
      <name>TCP Transport Service</name>
      <!-- A. -->
        <t>
      The TCP connection supports the transmission of 8-bit bytes.  The SMTP
      data is 7-bit ASCII characters.  Each character is transmitted as an
      8-bit byte with the high-order bit cleared to zero.  Service extensions
      may modify this rule to permit transmission of full 8-bit data bytes
      as part of the message body, or, if specifically designed to do
      so, in
      SMTP commands or responses.
      </t>
      </section>

    <section anchor="SMTP-from-headers" numbered="true" toc="default">
      <name>Generating SMTP Commands from Internet Message Format Header Fields</name>
      <!-- Appendix B. -->
      <iref item="Message Submission" subitem="With generated commands" primary="false"/>
         <t> Under ideal circumstances, SMTP servers as specified in this
         document would receive complete information, including proper
         envelope information, either from prior SMTP clients or from
         Message Submission systems that conform to RFC 6409. SMTP
         servers that receive complete information would interact with
         the message body only by prepending trace information as
         discussed in <xref target="trace_information"/> above. </t>

     <t> On the other hand, there are systems in use that do not provide
         the complete information in the expected form. Some are
         "gateways" as described in <xref target="ODRGsystems"/> (possibly
         including the special case of firewalls) and
         <xref target="mail_gatewaying"/>. Some of
         those systems use an Internet Message
         Format <xref target="rfc5322bis"/> header
         section (or something similar without other information) as a
         substitute for a mail submission protocol that conforms to
         <xref target="RFC6409">RFC 6409</xref> or otherwise require
         that SMTP-receivers make up
         commands from information in what SMTP considers the message
         body before such a message is transmitted to the next system by
         the corresponding SMTP-sender. This Appendix discusses some of
         the issues and appropriate actions when those situations are
         encountered.</t>

      <t> Nothing in this appendix, or elsewhere in this specification,
         encourages or allows an SMTP-receiver to alter message headers
         that are compliant with Internet Message Format specifications
         before the message is passed on to another system
         by the corresponding SMTP-sender.  When such messages are, or
         appear to be, compliant in that way, the message content is to
         be altered only by the addition, at the beginning of the
         content, of trace fields as specified in
         <xref target="trace_information"/>. </t>

      <t> While direct communication between a MUA and MTA (rather
         than through a Submission Server <xref target="RFC6409"/>) is
         a private matter, not covered by any Internet Standard, there are problems
         with this approach.  For example, there have been repeated problems
         with proper handling of "bcc" copies
         and redistribution lists when information
         that conceptually belongs to the mail envelope is not separated early
         in processing from header field information (and kept separate).
      </t>

     <t> It is recommended that an MUA provide its initial ("submission
         client")
         MTA with an envelope separate from the message itself.  However, if
         the envelope is not supplied, the envelope
         SHOULD be generated as follows: </t>
      <ol spacing="normal" type="1">
      <li>Each recipient address from a TO, CC, or BCC header field SHOULD
          be copied to a RCPT command (generating multiple message copies
          if that is required for queuing or delivery).  This includes any
          addresses listed in a RFC 822 "group".  Any BCC header
          fields SHOULD then be removed from the header section.
       </li>
       <li>The return address in the MAIL command SHOULD, if possible,
          be derived from the system's identity for the submitting (local)
          user, and the "From:" header field otherwise.  If there is a system
          identity available, it SHOULD also be copied to the Sender header
          field if it is different from the address in the From header field.
          (Any Sender header field that was already there SHOULD be
          removed.)  Systems
          may provide a way for submitters to override the envelope return
          address, but may want to restrict its use to privileged users.
          This will not prevent mail forgery, but may lessen its incidence;
          see <xref target="mail_security_and_spoofing" format="default"/>.
        </li>
      </ol>
      <t> When an MTA is being used in this way, it bears responsibility for ensuring
         that the message being transmitted is valid.  The mechanisms for checking
         that validity, and for handling (or returning) messages that are not
         valid at the time of arrival, are part of the MUA-MTA interface and
         not covered by this specification.
      </t>
      <t>
      A submission protocol based on Standard RFC 822 information alone MUST
      NOT be used to gateway a message from a foreign (non-SMTP) mail system
      into an SMTP environment.  Additional information to construct an envelope
      must come from some source in the other environment, whether supplemental
      header fields or the foreign system's envelope.
      </t>
      <t>
      Attempts to gateway messages using only their header "To" and
      "Cc" fields
      have repeatedly caused mail loops and other behavior adverse to the
      proper functioning of the Internet mail environment.  These problems
      have been especially common when the message originates from an Internet
      mailing list and is distributed into the foreign environment using envelope
      information.  When these messages are then processed by a
      header-section-only
      remailer, loops back to the Internet environment (and the mailing list)
      are almost inevitable.
      </t>
    </section>

    <section anchor="scenarios" numbered="true" toc="default">
      <name>Scenarios</name>
      <!-- D. -->
    <t>
      This section presents complete scenarios of several types of SMTP sessions.
      In the examples, "C:" indicates what is said by the SMTP client, and
      "S:" indicates what is said by the SMTP server.
      </t>
      <section numbered="true" toc="default">
        <name>A Typical SMTP Transaction Scenario</name>
        <!-- D.1 -->
      <t>
		 This SMTP example shows mail sent by Smith at host
        bar.com to Jones,
        Green, and Brown at host foo.com.  Here we assume that host bar.com
        contacts host foo.com directly.  The mail is accepted for Jones and
        Brown.  Green does not have a mailbox at host foo.com.
        </t>
        <ul empty="true" spacing="normal">
          <li>
          S: 220 foo.com Simple Mail Transfer Service Ready<br/>
          C: EHLO bar.com<br/>
          S: 250-foo.com greets bar.com<br/>
          S: 250-8BITMIME<br/>
          S: 250-SIZE<br/>
          S: 250-DSN<br/>
          S: 250 HELP<br/>
          C: MAIL FROM:&lt;Smith@bar.com&gt;<br/>
          S: 250 OK<br/>
          C: RCPT TO:&lt;Jones@foo.com&gt;<br/>
          S: 250 OK<br/>
          C: RCPT TO:&lt;Green@foo.com&gt;<br/>
          S: 550 No such user here<br/>
          C: RCPT TO:&lt;Brown@foo.com&gt;<br/>
          S: 250 OK<br/>
          C: DATA<br/>
          S: 354 Start mail input; end with &lt;CRLF&gt;.&lt;CRLF&gt;<br/>
          C: Blah blah blah...<br/>
          C: ...etc. etc. etc.<br/>
          C: .<br/>
          S: 250 OK<br/>
          C: QUIT<br/>
          S: 221 foo.com Service closing transmission channel<br/>
          </li>
        </ul>
      </section>
      <section numbered="true" toc="default">
        <name>Aborted SMTP Transaction Scenario</name>
        <!-- D.2 -->
      <ul empty="true" spacing="normal">
          <li>
          S: 220 foo.com Simple Mail Transfer Service Ready<br/>
          C: EHLO bar.com<br/>
          S: 250-foo.com greets bar.com<br/>
          S: 250-8BITMIME<br/>
          S: 250-SIZE<br/>
          S: 250-DSN<br/>
          S: 250 HELP<br/>
          C: MAIL FROM:&lt;Smith@bar.com&gt;<br/>
          S: 250 OK<br/>
          C: RCPT TO:&lt;Jones@foo.com&gt;<br/>
          S: 250 OK<br/>
          C: RCPT TO:&lt;Green@foo.com&gt;<br/>
          S: 550 No such user here<br/>
          C: RSET<br/>
          S: 250 OK<br/>
          C: QUIT<br/>
          S: 221 foo.com Service closing transmission channel<br/>
          </li>
        </ul>
      </section>
      <section anchor="RelayScenario" numbered="true" toc="default">
        <name>Relayed Mail Scenario</name>
        <!-- D.3 -->
      <t>
        Step 1  --  Source Host to Relay Host
      <br/>
        The source host performs a DNS lookup on XYZ.COM (the
        destination address) and finds DNS MX records specifying
        xyz.com as the best preference and foo.com as a lower
        preference.  It attempts to open a connection to xyz.com
        and fails.  It then opens a connection to foo.com, with
        the following dialogue:</t>
        <artwork name="" type="" align="left" alt=""><![CDATA[
    S: 220 foo.com Simple Mail Transfer Service Ready
    C: EHLO bar.com
    S: 250-foo.com greets bar.com
    S: 250-8BITMIME
    S: 250-SIZE
    S: 250-DSN
    S: 250 HELP
    C: MAIL FROM:<JQP@bar.com>
    S: 250 OK
    C: RCPT TO:<Jones@XYZ.COM>
    S: 250 OK
    C: DATA
    S: 354 Start mail input; end with <CRLF>.<CRLF>
    C: Date: Thu, 21 May 1998 05:33:29 -0700
    C: From: John Q. Public <JQP@bar.com>
    C: Subject:  The Next Meeting of the Board
    C: To: Jones@xyz.com
    C:
    C: Bill:
    C: The next meeting of the board of directors will be
    C: on Tuesday.
    C:                         John.
    C: .
    S: 250 OK
    C: QUIT
    S: 221 foo.com Service closing transmission channel
]]></artwork>
      <t>
        Step 2  --  Relay Host to Destination Host
        <br/>
            foo.com, having received the message, now does a DNS
            lookup on xyz.com.  It finds the same set of MX records,
            but cannot use the one that points to itself (or to any
            other host as a worse preference).  It tries to open a
            connection to xyz.com itself and succeeds. Then we
            have:</t>
        <artwork name="" type="" align="left" alt=""><![CDATA[
    S: 220 xyz.com Simple Mail Transfer Service Ready
    C: EHLO foo.com
    S: 250 xyz.com is on the air
    C: MAIL FROM:<JQP@bar.com>
    S: 250 OK
    C: RCPT TO:<Jones@XYZ.COM>
    S: 250 OK
    C: DATA
    S: 354 Start mail input; end with <CRLF>.<CRLF>
    C: Received: from bar.com by foo.com ; Thu, 21 May 1998
    C:     05:33:29 -0700
    C: Date: Thu, 21 May 1998 05:33:29 -0700
    C: From: John Q. Public <JQP@bar.com>
    C: Subject:  The Next Meeting of the Board
    C: To: Jones@xyz.com
    C:
    C: Bill:
    C: The next meeting of the board of directors will be
    C: on Tuesday.
    C:                         John.
    C: .
    S: 250 OK
    C: QUIT
    S: 221 xyz.com Service closing transmission channel
]]></artwork>
        <!-- RFC Editor: please be sure that the spacing and layout,
        particularly the indention of "John." are the same in both
        steps of the example.  Cf Erratum 5711 -->
    </section>
      <section numbered="true" toc="default">
        <name>Verifying and Sending Scenario</name>
        <!-- D.4 -->
      <ul empty="true" spacing="normal">
          <li>
          S: 220 foo.com Simple Mail Transfer Service Ready<br/>
          C: EHLO bar.com<br/>
          S: 250-foo.com greets bar.com<br/>
          S: 250-8BITMIME<br/>
          S: 250-SIZE<br/>
          S: 250-DSN<br/>
          S: 250-VRFY<br/>
          S: 250 HELP<br/>
          C: VRFY Crispin<br/>
          S: 250 Mark Crispin &lt;Admin.MRC@foo.com&gt;<br/>
          C: MAIL FROM:&lt;EAK@bar.com&gt;<br/>
          S: 250 OK<br/>
          C: RCPT TO:&lt;Admin.MRC@foo.com&gt;<br/>
          S: 250 OK<br/>
          C: DATA<br/>
          S: 354 Start mail input; end with &lt;CRLF&gt;.&lt;CRLF&gt;<br/>
          C: Blah blah blah...<br/>
          C: ...etc. etc. etc.<br/>
          C: .<br/>
          S: 250 OK<br/>
          C: QUIT<br/>
          S: 221 foo.com Service closing transmission channel
        </li>
        </ul>
      </section>
    </section>

    <section anchor="deprecated_features" numbered="true" toc="default">
      <name>Deprecated Features of RFC 821</name>
      <!-- Appendix D. -->
    <t>
      A few features of RFC 821 have proven to be problematic and SHOULD NOT
      be used in Internet mail.   Some of these features were
      deprecated in RFC 2821 in 2001; source routing and two-digit years
      in dates were deprecated even earlier, by RFC 1123 in 1989.  Of the domain
      literal forms, RFC 1123 required support only for the dotted
      decimal form.  With the possible exception of old,
      hardware-embedded, applications, there is no longer any excuse
      for these features to appear on the contemporary Internet.
      </t>
      <section anchor="TURN-appendix" numbered="true" toc="default">
        <name>TURN</name>
        <!-- D.1 -->
      <iref item="Commands and Syntax" subitem="turn" primary="false"/>
      <t>  This command, described in RFC 821, raises important security issues
        since, in the absence of strong authentication of the host requesting
        that the client and server switch roles, it can easily be used to
        divert mail from its correct destination.  Its use is deprecated;
        SMTP systems SHOULD NOT use it unless the server can
		authenticate the client.  For most of the cases in which TURN
		might be useful, the ETRN
		extension <xref target="RFC1985" format="default"/>, mentioned
		in <xref target="sending_strategy"/>, may be a better choice.
        </t>
      </section>
      <section anchor="source_routing" numbered="true" toc="default">
        <name>Source Routing</name>
        <!-- D.2 -->
        <iref item="Source Routes" primary="true"/>
        <t>RFC 821 utilized the concept of explicit source routing to
           get mail from one host to another via a series of relays.
           Source routes could appear in either the &lt;forward-path&gt; or
            &lt;reverse-path&gt; to show the hosts through which mail
            would be routed to reach the destination. The requirement
            to utilize source routes in regular mail traffic was eliminated by
            the introduction of the domain name system "MX" record
            by RFC 974 in early 1986 and the last significant
            justification for them was eliminated by the introduction,
            in RFC 1123, of a clear requirement that addresses following an "@"
            must all be fully-qualified domain names.  Issues
            involving local aliases for mailboxes were addressed by
            the introduction of a separate specification for mail
            submission <xref target="RFC6409"/>.  Consequently, there
            are no remaining justifications for the use of source routes
            other than support for very old SMTP clients.  Even
            use in mail system debugging is unlikely to work because
            almost all contemporary systems either ignore or reject
            them.</t>
           <t>Historically, for relay purposes, the forward-path may
              have been a source route of the form
              "@ONE,@TWO:JOE@THREE", where ONE, TWO, and THREE MUST
              be fully-qualified domain names.  This form was used to
              emphasize the distinction between an address and a
              route.  The mailbox (here, JOE@THREE) is an absolute
              address, and the route is information about how to get
              there.  The two concepts should not be confused. </t>
           <t> SMTP servers MAY continue to accept source route
              syntax as specified in this appendix.  If
              they do so, they SHOULD ignore the routes and utilize
              only the target domain in the address. If they do
              utilize the source route, the message MUST be sent to
              the first domain shown in the address. </t>
           <t>In particular,
              a server MUST NOT guess at shortcuts within the source
              route.  </t>
           <t>SMTP clients
              MUST NOT attempt to utilize explicit
              source routing. </t>
           <t> If source routes appear in mail received by an SMTP
              server contrary to the requirements and recommendations
              in this specification, RFC 821 and the text below should be consulted
              for the mechanisms for constructing and updating the
              forward-path.  A server that is reached by means of a source
              route (e.g., its domain name appears first in the list in the
              forward-path) MUST remove its domain name from any forward-paths
              in which that domain name appears before forwarding the message
              and MAY remove all other source routing information.  Any source
              route information in the reverse-path SHOULD be removed by servers
              conforming to this specification. </t>
        <t> The following information is provided for historical
           information
           so that the source route syntax and
           application can be understood if needed.</t>
        <t> Syntax:
           <br/> The original form of the &lt;Path&gt; production in
           <xref target="command_argument_syntax"/> was:</t>
        <dl>
            <dt>Path</dt>
            <dd>
               = "&lt;" [ A-d-l ":" ] Mailbox "&gt;"
            <iref item="Source Routes" subitem="Path"
               primary="false"/></dd>
            <dt>A-d-l</dt>
            <dd>
               = At-domain *( "," At-domain )
            <iref item="Source Routes" subitem="A-d-l"
               primary="false"/></dd>
            <dt>At-domain</dt>
            <dd>
               = "@" Domain
            <iref item="Source Routes" subitem="At-domain" primary="false"/></dd>
        </dl>
        <t>For example, suppose that a delivery service notification
           must be sent for a message that arrived with:
           <br/>
           MAIL FROM:&lt;@a.example,@b.example:user@d.example&gt;
           <br/>
           The notification message MUST be sent using:
           <br/>
           RCPT TO:&lt;user@d.example&gt;</t>
      </section>

      <section numbered="true" toc="default">
        <name>HELO</name>
        <!-- D.3 -->
      <t>
        As discussed in Sections <xref target="session_initiation" format="counter"/>
        and <xref target="command_semantics_and_syntax" format="counter"/>,
        EHLO SHOULD be used rather than HELO when the server will accept the
        former.  Servers MUST continue to accept and process HELO in
        order to support older clients.
        </t>
      </section>
      <section numbered="true" toc="default">
        <name>#-literals</name>
        <!-- D.4 -->
      <t>
        RFC 821 provided for specifying an Internet address as a decimal integer
        host number prefixed by a pound sign, "#".  In practice, that form
        has been obsolete since the introduction of TCP/IP.  It is deprecated
        and SHOULD NOT be used.
        </t>
      </section>
      <section numbered="true" toc="default">
        <name>Dates and Years</name>
        <!-- D.5 -->
      <t>
        When dates are inserted into messages by SMTP clients or servers (e.g.,
		in trace header fields), four-digit years SHOULD BE used.
		Two-digit years
        are deprecated; three-digit years were never permitted in the Internet mail system.
        </t>
      </section>
      <section anchor="sending_versus_mailing" numbered="true" toc="default">
         <name>Sending versus Mailing</name>  <!-- E.6 -->
             <iref item="Commands and Syntax" subitem="send, saml, soml" primary="false"/>
         <t> In addition to specifying a mechanism for delivering
            messages to user
        mailboxes, RFC 821 provided additional, optional, commands to deliver
        messages directly to the user's terminal screen.  These commands (SEND,
        SAML, SOML) were rarely implemented, and changes in workstation technology
        and the introduction of other protocols may have rendered them obsolete
        even where they are implemented.</t>
     <t>
        Clients SHOULD NOT use SEND, SAML, or SOML commands.  If a
        server implements them, the implementation
        model specified in <xref target="RFC0821" format="default">RFC 821</xref>
        MUST be used and the command names MUST
        be published in the response to the EHLO command.
        </t>
      </section>
    </section>

      <section anchor="I-ChangeSummary" numbered="true" toc="default">
         <name> Summary of changes from RFC 5321 (published in October 2008) to
            &lt;&lt;This Document&gt;&gt;</name>
         <t>As discussed in <xref target="HistoryContext"/>,
            this
            specification combines material from several earlier ones.
            The most numerous changes from RFC 5321 have been
            editorial in nature.  Those changes have included
            correcting long-standing ambiguities and errors, improving terminology
            and its consistent use, updating references to documents
            that have been replaced, adding additional
            cross-references within the document, and
            reorganizing material to make it easier to follow.  In
            general, those changes are not called out in the list
            below. The order of changes in the list below is not
            significant.</t>

		 <section anchor="NonErrataChanges" numbered="true" toc="include">
         <name>General Change Listing</name>  <!-- E.1 -->
         <t><cref>RFC Editor: The list that follows was numbered in
            order to make review discussion convenient.  Unless you
            prefer it, I'd rather have a bullet list in the final
            version to reinforce the "order not significant"
			message.</cref></t>

		 <t> This appendix summarizes changes between RFC 5321 and
			&lt;&lt;This Document&gt;&gt; that are not the result of
			errata filed against RFC 5321 and that might be helpful to
			someone trying to understand the differences between the
			two documents.   If an implementation has kept up to date
			on changes to SMTP specified in RFCs since RFC 5321 was
			published, it is unlikely that any of them have 
			significant impact on a careful and thoughtful
			implementation based on RFC 5321.  For the errata
			discussion, see <xref target="ErrataDisposition"/>.</t>

         <ol>
            <li> Corrected, updated, or clarified a few ABNF syntax
               errors.</li>
            <li> Improved the descriptions of the applicability of
               several reply codes.   Also included descriptions of codes added
               since RFC 5321 was published. </li>
            <li> Removed the former Appendix C that described Source
               Routes.  Information about them that is still relevant
               appears in <xref target="source_routing"/>.</li>
            <li> An index was added to make it easier for readers to find
               specific terminology, ABNF productions, command
               arguments, and so on.  Several additional
               cross-references have been added for the same reasons.</li>
            <li>Clarified the relationship between mail transactions,
               repeated uses of EHLO within an SMTP session, and
               command arguments and responses between
               transactions.</li>
            <li>Improved the discussion of the distinction of Message
               Submission Agents (MSAs), particularly those described
               in <xref target="RFC6409">RFC 6409</xref>, and
               Mail Transfer Agents (MTAs) as
               exemplified by this specification.  This document
               does not alter RFC 6409 in any way.</li>
			<li>The discussion of "trace information" has been
               reworked to make it more clear and more consistent with
               the discussion in the Message Format
			   specification <xref target="rfc5322bis"/>.
			  While the textual
			  changes are extensive, it is not believed that any of them
			  make substantive changes to the SMTP definition.
            </li>
			<li> In <xref target="extended_hello"/> a SHOULD NOT
			   prohibition on extra text following an argument to EHLO
			   or HELO was changed to a MUST NOT.  While this change makes
			   some previously conforming implementations (ones that
			   followed the advice of RFC 2821) non-conforming, there
			   are not believed to be any contemporary sender
			   implementations that send that text.  Requirements and
			   recommendations for SMTP server implementations are
			   unchanged.
			</li>
            <li>The discussion of SMTP Service Extensions and how they
               are registered with IANA has been extensively revised
               and a new registration model defined.  The reasons for this are
               discussed in <xref target="definition_of_extensions"/>.</li>
			<li> At the request of IANA, the IANA Considerations
			   Section (<xref target="IANAConsid"/>) and some related
			   material have been extensively rewritten to provide
			   more detailed specifications for registry contents and
			   organization.</li>
         </ol>
         </section>

		 <section anchor="ErrataDisposition" numbered="true" toc="include">
			<name>Disposition of Errata Filed Against RFC 5321</name>
     <t> This document addresses the following errata filed against
        RFC 5321 since its publication in October 2008.
        More details on each of these can be found in the RFC Editor's
		Errata listing for RFC 5321
		 <xref target="RFC5321-errata" format="default"/>.
	 </t>

        <dl newline="false" spacing="normal">

          <dt>1543</dt>
		  <dd> Wrong code in description.
			 <xref target="TerminatingSessions" format="default"/></dd>
		  
		  <dt>1683</dt>
		  <dd>ABNF error in Additional-Registered-Clauses.
			 <xref target="trace_information" format="default"/></dd>

		  <dt>1820</dt>
		  <dd>Wrong description of a mailing list function.
			 <xref target="MailingLists"/> <!-- Section 3.4.2.2.-->
		  <br/> Note that the identified issue was correct, but a different fix
			 was used.</dd>
		  
		  <dt>1851</dt>
		  <dd>Location of text on unexpected close <!-- Section 4.1.1.5. -->
			 <xref target="RSET-cmd" format="default"/>
		  Text moved to <xref target="TerminatingSessions"/>.</dd>

		  <dt>2578</dt>
          <dd>Incorrect section reference to core ABNF rules defined
			 in  <xref target="RFC5234"> RFC 5234, Section 4.1.2.
			 </xref> </dd>
		  
		  <dt>3447</dt>

          <dd> Use of normative language (e.g., more "MUST"s);
			 possible confusion in
			 <xref target="trace_information" format="default"/>.  WG
			 was not able to agree that the claimed confusion was
			 substantive or that change was appropriate.</dd> 

		  <dt>4198</dt>
		  <dd>Description error of which entity tests SMTP reply
			 codes. <xref target="smtp_replies" format="default"/>.
			 </dd>

		  <dt>4315</dt>
		  <dd>Updated IPv6-addr ABNF. <!-- Section 4.1.3. -->
			 <xref target="address_literals"/>.
		  <br/>Note that this is a revision of erratum 2467.</dd>

		  <dt>5414</dt>
          <dd>Updated ABNF for Quoted-string to disallow empty string.
			 <xref target="command_argument_syntax" format="default"/>
		  </dd>

		  <dt>4055</dt>
          <dd>Description of SPF and DKIM is wrong. Resolved by dropping
			 the sentence from <xref target="MXandRelay"/>.
                <!-- Section 3.6. -->
		  </dd>

		  <dt>5711</dt>
		  <dd>Missing leading spaces in example in
			 <xref target="RelayScenario" format="default"/>.
			     <!-- Appendix C.3. -->
		  </dd>

		  <dt> The following errata were considered by the WG but
			 no changes were made to the document:</dt>
		  <dd>4079, 4265, 6561</dd>
		</dl>
		 </section>
		 
      </section>   <!-- end of Appendix E -->

	  <!-- Temporary Appendix F -->
      <section anchor="Temp-ChangeSummary" numbered="true"
				  toc="default">
		 <name> Summary of changes made after
			draft-ietf-emailcore-rfc5321bis-29 (posted 2024-05-23)</name>
		 <t><cref> RFC Editor: Please remove this appendix.</cref></t>
         <t> This appendix covers only those changes since draft -29
            (the "cleaned-up" version with detailed change log and
            ticket information removed).   For earlier changes and
            related information, see
            &lt;draft-ietf-emailcore-rfc5321bis-28&gt;</t>

		 <section  numbered="true" toc="default">
         <name> Summary of changes from
            draft-ietf-emailcore-rfc5321bis-29 (posted 2024-05-23) to -30
         </name>
         <ol>
            <li> Added the listing of errata and corrections back in
               per discussion of the errata listing in rfc5322bis and
               instructions from a co-chair.  The list was edited
			   to put the reports in numerical order and eliminate
			   references to ticket numbers, then significantly
			   rewritten by Alexey Melnikov and his version
			   incorporated with minor adjustments. </li>
			<li> After an extended discussion on the mailing list
			   about the issues with erratum 3447
			   (see <xref target="ErrataDisposition"/>), the
			   co-chair concluded that there was no consensus for
			   change.  See
			   &lt;https://mailarchive.ietf.org/arch/msg/emailcore/cvG47YOfQwc8fj-E9-jZCzK5Uro&gt;.
			   </li>
            <li> Small editorial and error corrections.</li>
         </ol>
		 </section>

		 <section  numbered="true" toc="default">
			<name> Summary of changes from
            draft-ietf-emailcore-rfc5321bis-30 (posted 2024-07-05) to -31
         </name>
		 <t> draft-ietf-emailcore-rfc5321bis-31 is the version put out
			for IETF Last Call on 2024-09-26 with the Last Call
			extending to 2024-10-09.</t>
         <ol>
			<li> Editorial/typographical corrections. </li>
			<li> Multiple small corrections of glitches caught by
			   Murray in pre-Last-Call review.  Thanks to him and too
			   Alexey for going over the proposed fixes/ dispositions.</li>
		 </ol>
		 </section>

		 <section anchor="Changes31to32" numbered="true" toc="default">
			<name> Summary of changes from
            draft-ietf-emailcore-rfc5321bis-31 (posted 2024-09-09) to -32
			</name>
			<t>Version -32 of this draft was prepared based on IETF Last
		       Call review comments (a collection that turned out to
			   be incomplete when it was posted) to aid the Working
			   Group in considering responses to those comments.  In some cases,
			   responses have been tentatively integrated.  In others
			   comments have been inserted to act as descriptive
			   placeholders.  Some editorial corrections and improvements
			   have been applied as usual.</t>
			<t>  This version is a special update to assist the WG in
			   processing review comments from IETF Last Call.
			   Everything described in this section that changed the
			   document from -31 is tentative pending WG review and consensus
			   approval.</t>
         <ol>
			<li> Editorial/typographical corrections, starting with a
			   typo reported by Paul Kyzivat 2024-09-29.</li>
			<li> Removed note about updates to RFC 8126 after
			   correspondence from IANA and clarity that such an
			   update would not occur, nor would
			   draft-klensin-iana-consid-hybrid be processed, before
			   IETF Last Call ends on 2024-10-10.</li>
			<li> Per a problem identified in Donald Eastlake's review,
			   added a note to Section 8.3, item (9) about MT-PRIORITY
			   and RFC 6710 and requires require WG action.
			   A similar note was added to Section 4.2.2 which
			   requires either a WG decision to not do that or very
			   careful checking to insure the groups are correct.
			</li>
			<li> Note added to Section 1.2 to explicitly remove
			   "Internet Standard" designation from RFC 821.  See
			   the note there and discussion on mailing list as to
			   whether it should be 
			   here or resolved elsewhere.</li>
			<li> A few other CREF notes were added to flag outstanding
			   Last Call issues.  Existing ticket numbers that were
			   readily at hand have been included in the notes; it
			   does not seem likely that the Chairs will assign
			   tickets to new issues before the IETF 121 schedule
			   requires posting of this draft. </li>
		 </ol>
		 </section>

		 <section anchor="Changes32to33" numbered="true" toc="default">
			<name> Summary of changes from
            draft-ietf-emailcore-rfc5321bis-32 (posted 2024-10-19) to -33 
			</name>
			<t> Like -32 before it (see immediately above), -33 is a
			   temporary working draft.  It was posted at the
			   beginning of IETF 121 to incorporate additional
			   comments and suggestions after -32 was posted and
			   to facilitate WG discussion during that IETF meeting,
			   presumably leading to another draft for IESG review or
			   an additional IETF Last Call.</t> 
			<ol>
			   <li> Rewrote the introductory Note (just below the
				  abstract) to reflect the above.  Some of the text
				  is deliberately redundant.</li>
			   <li> Updated an obsolete reference for OpenPGP.</li>
			   <li>Improved terminology by eliminating all instances
				  of "response code" in favor of "reply code"</li>
			   <li> Fixes per Alexey's 2024-10-21 messages </li>
			   <li> Inserted CREF notes for all of the tickets created
				  between the start of IETF Last Call on 2024-09-26
				  and the time of posting on 2024-11-02.  Annotated a
				  few comments created for draft -32 with the ticket
				  numbers.</li>
			</ol>
		 </section>

        <section anchor="Changes33to34" numbered="true" toc="default">
			<name> Summary of changes from
            draft-ietf-emailcore-rfc5321bis-33 (posted 2024-11-02) to -34 
			</name>
			<ol>
			   <li>Incorporate changes agreed to, and suggested text from,
			   WG meeting on 2024-11-07 as an aid to the meeting
			   scheduled for the next day.
			   <br/>
			   See
			   &lt;https://github.com/ietf-wg-emailcore/emailcore/issues&gt;
			   and
			   &lt;https://notes.ietf.org/notes-ietf-121-emailcore&gt;
			   for additional context.</li>
			<li>Incorporate draft new text to explain the focus of
			   (original) SMTP and the importance and existence of
			   extensions and other tools to mitigate difficulties
			   with that focus on the modern Internet.  Point
			   explicitly to the A/S for discussion of those options
			   and additional security considerations.  See
			   <xref target="RelatedDocuments"/> and the new
			   introduction to 
			   <xref target="security-consider"/> for the text. </li>
			</ol>
		</section>
		 
		 <section anchor="Changes34to35" numbered="true" toc="default">
			<name> Summary of changes from
            draft-ietf-emailcore-rfc5321bis-34 (posted 2024-11-07) to -35 
			</name>
			<ol>
			   <li> Rewrote the introductory Note again.</li>
			   <li> Added text from Bron and Todd to revise
				  <xref target="reliable_delivery"/>, including
				  including some temporary associated notes.  Also added
				  Dave's alternate suggestion and pointers to the
				  discussion.</li>
			   <li> Moved former Appendix D into the main body of the
				  text as new <xref target="OtherGatewayIssues"/>.
				  Note that this causes all subsequent appendices to
				  be renumbered. </li>
			   <li> Changed the SHOULD NOT to a MUST NOT in
				  <xref target="command_semantics_and_syntax"/> per ticket
				  #107 and accordingly added a new bullet point to
				  <xref target="NonErrataChanges"/>.</li>
			   <li> Per advice from Alexey, rearranged the "Function
				  Groups" for reply codes a bit.</li>
			   <li> Additional minor editorial changes and changes to
				  reflect discussion at WG meeting on 2024-11-08.</li>
			</ol>
		 </section>

		 <section anchor="Changes35to36" numbered="true" toc="default">
			<name> Summary of changes from
            draft-ietf-emailcore-rfc5321bis-35 (posted 2024-11-11) to -36 
			</name>
			<ol>
			   <li> Small editorial changes to reflect Vijay Gurbani
				  Last Call review,
				  &lt;https://mailarchive.ietf.org/arch/msg/emailcore/kB1CNtf0-hY4mUlFnBD5_jp2uSE&gt;
				  and other discoveries.</li>
			   <li> Reorganized <xref target="ReplyFunctionGroups"/>
				  to reflect the original (RFC 821) "second digit"
				  structure and improved the explanation of that
				  arrangement.</li>
			   <li> One case where "must" appeared in lower case but
				  upper case was correct was changed.  If finding it
				  is important, search for lower-case "fred".</li>
			   <li> Added text to <xref target="mail_transactions"/>
				  and <xref target="RSET-cmd"/> to clarify that HELO,
				  not just EHLO, terminates mail transactions.</li>
			   <li> Improved slightly on the TURN description in
				  <xref target="TURN-appendix"/>.</li>
			   <li> Annotations ("CREF comments") added to reflect
				  additional open tickets; some earlier ones
				  adjusted. </li>
			</ol>
		 </section>

		 <section anchor="Changes36to37" numbered="true" toc="default">
			<name> Summary of changes from
            draft-ietf-emailcore-rfc5321bis-36 (posted 2024-12-02) to -37 
			</name>
			<t> Changes discussed during 2024-12-03 interim meeting.</t>
			<ol>
			   <li> Reordered former fifth and sixth paragraphs of
				  <xref target="DATA"/> (Ticket #125). </li>
			   <li>The sentence about "other contemporary standards"
				  and surrounding text in
				  <xref target="mail_objects"/> were rewritten to
				  improve clarity (Ticket #124).</li>
			   <li>Rewrote the introductory paragraph of
				  <xref target="security-consider"/> to more closely
				  align it with discussion before, during, and after
				  the interim meeting (Ticket #109 and others).</li>
			   <li> Added very temporary <xref target="RFCEd-notes"/>
				  to note issues spotted during or after IETF Last
				  Call to avoid spending more review time on them.</li>
			</ol>
		 </section>

		 <section anchor="Changes37to38" numbered="true" toc="default">
			<name> Summary of changes from
            draft-ietf-emailcore-rfc5321bis-37 (posted 2024-12-07) to -38 
			</name>
			<ol>
			   <li> Revised IANA Considerations
				  (<xref target="IANAConsid"/>) to reflect notes from
				  IANA, [IANA #1382893], 2024-12-17 and 2024-12-21 and
				  addressing Ticket #120 and removing former CREF note
				  at the top of the Section.  A new CREF note has been
				  introduced to explain the changes.</li>
			   <li> The separate bullet item in <xref target="IANAConsid"/>
				  for "The "SMTP PRIORITY extension Priority
				  Assignment Policy", including the reference to
				  Ticket #103, has been removed on the assumption
				  that it will have been sorted out as a separate
				  administrative action before this document is
				  published.</li>
			   <li> The former Section 8.2 has been moved to the end
				  of Section 8 and rewritten to summarize specific
				  advice/instructions to IANA.</li>
			   <li> Small editorial changes/ fixes.</li>
			</ol>
		 </section>


		 <section anchor="Changes38to39" numbered="true" toc="default">
			<name> Summary of changes from
            draft-ietf-emailcore-rfc5321bis-38 (posted 2025-01-03) to -39 
			</name>
			<ol>
			   <li> Changed pointer to IPv6 syntax to point to
				  RFC 5952 rather than 4291</li>
			   <li> Removed tracking and related CREF comments, i.e.,
				  all such comments other than those addressed to or
				  involving the RFC Editor/RPC or IANA.  The latter
				  should be temporary pending resolution of IANA
				  issues and will then be removed.  Unless errors have
				  been made, the remaining ones should all be
				  identified with "RFC Editor".</li>
			   <li> Undid some of that cleanup by adding new notes for
				  the convenience of the WG at the interim and
				  surrounding days.  If only because the IESG has made
				  it clear that they don't want to see notes that
				  imply decisions have not yet been made in the WG,
				  those additional notes will not survive into
				  -40.</li> 
			   <li>Rewrote what is now the "historical note" at the
				  beginning of
				  <xref target="New5321bisMailParamsReg"/> about
				  IANA Considerations changes.  The IESG was not
				  interested in getting involved with this issue.</li>
			   <li>Aggressively trimmed
				  the note just below the Abstract, 
				  removing the comments about the intermediate
				  versions -32 through -36.  Added a note about -39
				  and the interim.  That entire note will
				  still disappear before RFC publication. </li>
			   <li> Usual small editorial fixes, this time including correcting
				  a reference and removing an unused one.</li>
			</ol>
		 </section>

		 <section anchor="Changes39to40" numbered="true" toc="default">		 
			<name> Summary of changes from
            draft-ietf-emailcore-rfc5321bis-39 (posted 2025-01-15) to -40 
			</name>
			<ol>
			   <li> Further tuned the language of
				  <xref target="mail_security_and_spoofing"/> to make
				  it clear that it is about message and originator
				  authentication and not about other security issues.</li>
			   <li> Clarified updating of "legacy" registrations.</li>
			   <li> Modified the description of the two models
				  described in <xref target="RegistrationModels"/> to
				  revert Model 1 to the "Standards Track or
				  Experimental" rule that was used starting with RFC 1869
				  (November 1995). Also added text to Model 2 to make
				  it explicit that it could be used for Informational
				  and other RFCs.</li>
			   <li> Additional cross references for syntax added to
				  the registration template.  The separate "Behavior
				  and Impact" item merged into
				  "Description" (<xref target="Reg-Summary"/>) with a
				  modified definition for the latter.</li>
			   <li> [Re-]added "Change Controller" to the registration
				  template (<xref target="Reg-ChangeControl"/>).</li>
			   <li> Moved reference to the Applicability Statement to
				  Normative. </li>
			</ol>	   
		 </section>	 

		 <section anchor="Changes40to41" numbered="true" toc="default">		 
			<name> Summary of changes from
            draft-ietf-emailcore-rfc5321bis-40 (posted 2025-02-03) to -41
			</name>
			<ol>
			   <li> Further adjustments to <xref target="IANAConsid" /> including
				  addition of <xref target="IANAConsidAddtl"/>.  As a
				  final step before posting, this included starting
				  consideration of moving most of that material to a
				  separate document and inclusion of a temporar note
				  to that effect.</li> 
			   <li> Additional small editorial adjustments</li>
			</ol>
		 </section>		 

		 <section anchor="Changes41to42" numbered="true" toc="default">		 
			<name> Summary of changes from
            draft-ietf-emailcore-rfc5321bis-41 (posted 2025-02-21) to -42
			</name>
			<ol>
			   <li> Adjusted <xref target="IANAConsid"/> with edited
				  version of suggestions from Alexey Melnikov,
				  pre-approved by IANA. </li>
			   <li> Removed all remaining CREF comments not addressed
				  to the RFC Editor as well as the "Note on
				  reading..." that followed the Abstract.</li>
			   <li> Changed instances of MUST NOT to SHOULD NOT in
				  <xref target="deprecated_features"/> for consistency
				  with the introduction to that appendix and the usual
				  IETF meaning of "deprecated".</li>
			   <li> Other small editorial fixes. </li>
			</ol>	  
		 </section>
		 
		 <section anchor="Changes42to43" numbered="true" toc="default">		 
			<name> Summary of changes from
            draft-ietf-emailcore-rfc5321bis-42 (posted 2025-03-18) to -43
			</name>
			<ol>
			   <li> The description of IPv6 and future protocols in
				  <xref target="address_literals"/> has been adjusted.</li>
			   <li> Some non-ASCII controls that had somehow crept into
				  the second paragraph of 4.1.1.3 were
				  eliminated.</li>
			   <li> Removed the "removed to &lt;section&gt;"
				  placeholders and other placeholder subsections that
				  were used for tracking rearranged text during
				  reviews.  Also removed notes to the RFC Editor
				  associated with those sections.</li>
			   <li> Adjusted the subsection title for <xref target="IANA-MailTransmission"/>
				  as earlier specified in a note/ instruction and
				  removed that note. </li>
			   <li>Tweaked the Acknowledgments slightly.</li>
			</ol>
		 </section>
	  </section> <!-- end temporary appendix F -->

	  <section anchor="RFCEd-notes" numbered="true" toc="default">
		 <name> Notes to RFC Editor / RPC </name>
		 <t>Apparently due to glitches in xml2rfc, some index entries
			embedded in the text with &lt;iref&gt; do not appear in
			the index.  I am guessing the problem may be two
			&lt;iref&gt;s in the same block of text with the same item
			but different subitems, but could be wrong.  That should
			be checked and corrected.   Also, there is at least one
			place where the rendering machinery (at least for
			plaintext) inserts several extra spaces in the middle of a
			line for no apparent reason.</t>
		 <t> Also see notes to you inline in the text,
			especially (because they might otherwise be missed) the
			extensive (and botched) comments in References [8], [16],
			and [63].</t>
		 <t> Obviously this section should be removed once those
			problems are remedied.</t>
	  </section>

  </back>
</rfc>
