Section 3. The SMTP Procedures: An Overview

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 Appendix D.
3.1.  Session Initiation
   An SMTP session is initiated when a client opens a connection to a
   server and the server responds with an opening message.
   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 Section 4).
   The SMTP protocol allows a server to formally reject a mail session
   while still allowing the initial connection as follows: a 554
   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 Section 4.1.1.10) 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 554 response on connection opening SHOULD provide enough
   information in the reply text to facilitate debugging of the sending
   system.
3.2.  Client Initiation
   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.
   In the EHLO command, the host sending the command identifies itself;
   the command may be interpreted as saying "Hello, I am <domain>" (and,
   in the case of EHLO, "and I support service extension requests").
3.3.  Mail Transactions
   There are three steps to 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 Section 4.1.4.)  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 the transaction.
   The first step in the procedure is the MAIL command.
      MAIL FROM:<reverse-path> [SP <mail-parameters> ] <CRLF>
   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 <reverse-path> portion of the first or
   only argument contains the source mailbox (between "<" and ">"
   brackets), which can be used to report errors (see Section 4.2 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.
   Historically, the <reverse-path> was permitted to contain more than
   just a mailbox; however, contemporary systems SHOULD NOT use source
   routing (see Appendix C).
   The optional <mail-parameters> are associated with negotiated SMTP
   service extensions (see Section 2.2).
   The second step in the procedure is the RCPT command.  This step of
   the procedure can be repeated any number of times.
      RCPT TO:<forward-path> [ SP <rcpt-parameters> ] <CRLF>
   The first or only argument to this command includes a forward-path
   (normally a mailbox and domain, always surrounded by "<" and ">"
   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 -
   " and the mailbox name (other circumstances and reply codes are
   possible).
   The <forward-path> can contain more than just a mailbox.
   Historically, the <forward-path> was permitted to contain a source
   routing list of hosts and the destination mailbox; however,
   contemporary SMTP clients SHOULD NOT utilize source routes (see
   Appendix C).  Servers MUST be prepared to encounter a list of source
   routes in the forward-path, but they SHOULD ignore the routes or MAY
   decline to support the relaying they imply.  Similarly, servers MAY
   decline to accept mail that is destined for other hosts or systems.
   These restrictions make a server useless as a relay for clients that
   do not support full SMTP functionality.  Consequently, restricted-
   capability 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
   <rcpt-parameters> are associated with negotiated SMTP service
   extensions (see Section 2.2).
   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.
   The third step in the procedure is the DATA command (or some
   alternative specified in a service extension).
      DATA <CRLF>
   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.
   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.  SMTP indicates the end of the mail data by sending a
   line containing only a "." (period or full stop).  A transparency
   procedure is used to prevent this from interfering with the user's
   text (see Section 4.5.2).
   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:
   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.
   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.
   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 Section 6 and, in
   particular, in Section 6.1.  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.
   When the RFC 822 format ([28], [4]) 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 (RFC 2045 [21]) 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.
   Mail transaction commands MUST be used in the order discussed above.
3.4.  Forwarding for Address Correction or Updating
   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.
   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 Section 7.4).
   In particular:
   o  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.
   Alternately,
   o  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.
   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.
3.5.  Commands for Debugging Addresses
3.5.1.  Overview
   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 Section 3.5.2 and Section 7.3).
   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 either of the following
   forms:
      User Name <local-part@domain>
      local-part@domain
   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:
      553 User ambiguous
   or
      553- Ambiguous; Possibilities are
      553-Joe Smith <jsmith@foo.com>
      553-Harry Smith <hsmith@foo.com>
      553 Melvin Smith <dweep@foo.com>
   or
      553-Ambiguous; Possibilities
      553- <jsmith@foo.com>
      553- <hsmith@foo.com>
      553 <dweep@foo.com>
   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 RFC
   3463 [25], 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.
   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.
   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").
   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.
   "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".
   The case of expanding a mailbox list requires a multiline reply, such
   as:
      C: EXPN Example-People
      S: 250-Jon Postel <Postel@isi.edu>
      S: 250-Fred Fonebone <Fonebone@physics.foo-u.edu>
      S: 250 Sam Q. Smith <SQSmith@specific.generic.com>
   or
      C: EXPN Executive-Washroom-List
      S: 550 Access Denied to You.
   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 in 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.
3.5.2.  VRFY Normal Response
   When normal (2yz or 551) responses are returned from a VRFY or EXPN
   request, the reply MUST include the <Mailbox> name using a
   "<local-part@domain>" 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.
   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 Section 7.3).  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 RFC 1123 [3], 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.
3.5.3.  Meaning of VRFY or EXPN Success Response
   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.  In that case, 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.
   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 Section 2.1.
   Similarly, the discussion in Section 3.4 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.
3.5.4.  Semantics and Applications of EXPN
   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.
3.6.  Relaying and Mail Routing
3.6.1.  Source Routes and Relaying
   In general, the availability of Mail eXchanger records in the domain
   name system (RFC 1035 [2], RFC 974 [12]) makes the use of explicit
   source routes in the Internet mail system unnecessary.  Many
   historical problems with the interpretation of explicit source routes
   have made their use undesirable.  SMTP clients SHOULD NOT generate
   explicit source routes except under unusual circumstances.  SMTP
   servers MAY decline to act as mail relays or to accept addresses that
   specify source routes.  When route information is encountered, SMTP
   servers MAY ignore the route information and simply send to the final
   destination specified as the last element in the route and SHOULD do
   so.  There has been an invalid practice of using names that do not
   appear in the DNS as destination names, with the senders counting on
   the intermediate hosts specified in source routing to resolve any
   problems.  If source routes are stripped, this practice will cause
   failures.  This is one of several reasons why SMTP clients MUST NOT
   generate invalid source routes or depend on serial resolution of
   names.
   When source routes are not used, the process described in RFC 821 for
   constructing a reverse-path from the forward-path is not applicable
   and the reverse-path at the time of delivery will simply be the
   address that appeared in the MAIL command.
3.6.2.  Mail eXchange Records and Relaying
   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 Section 5), and sends it the mail.  If it declines to
   relay mail to a particular address for policy reasons, a 550 response
   SHOULD be returned.
   This specification does not deal with the verification of return
   paths for use in delivery notifications.  Recent work, such as that
   on SPF [29] and DKIM [30] [31], has been done to provide ways to
   ascertain that an address is valid or belongs to the person who
   actually sent the message.  A server MAY attempt to verify the return
   path before using its address for delivery notifications, but methods
   of doing so are not defined here nor is any particular method
   recommended at this time.
3.6.3.  Message Submission Servers as Relays
   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 RFC 4409 [18]).  In any event, because these arrangements are
   private and fall outside the scope of this specification, they are
   not described here.
   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 3.7 and 5.
   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, RFC 3461 [32] and RFC 3464 [33]) SHOULD be used if
   possible.
   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
   Section 4.5.5 for additional discussion).  A MAIL command with a null
   reverse-path appears as follows:
      MAIL FROM:<>
   As discussed in Section 6.4, 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 (Section 4.4)
   and, optionally, to attempt to detect looping in the mail system (see
   Section 6.3).  Of course, this prohibition also applies to any
   modifications of these header fields or text (see also Section 7.9).
3.7.  Mail Gatewaying
   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 Section 2.3.10, when such a system is at the boundary
   between two transport service environments, we refer to it as a
   "gateway" or "gateway SMTP".
   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.
3.7.1.  Header Fields in Gatewaying
   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 Section 6.4.
   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 Section 7.2).
3.7.2.  Received Lines in Gatewaying
   When forwarding a message into or out of the Internet environment, a
   gateway MUST prepend a Received: line, but it MUST NOT alter in any
   way a Received: line that is already in the header section.
   "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.
   The gateway SHOULD indicate the environment and protocol in the "via"
   clauses of Received header field(s) that it supplies.
3.7.3.  Addresses in Gatewaying
   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
   RFC 5322 [4]).  Gateways are, of course, subject to the same rules
   for handling source routes as those described for other SMTP systems
   in Section 3.3.
3.7.4.  Other Header Fields in Gatewaying
   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 RFC 5322 [4], 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.
3.7.5.  Envelopes in Gatewaying
   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.
3.8.  Terminating Sessions and Connections
   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.
   An SMTP server MUST NOT intentionally close the connection under
   normal operational circumstances (see Section 7.8) except:
   o  After receiving a QUIT command and responding with a 221 reply.
   o  After detecting the need to shut down the SMTP service and
      returning a 421 response code.  This response 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).
   o  After a timeout, as specified in Section 4.5.3.2, occurs waiting
      for the client to send a command or data.
   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.
   An SMTP server that is forcibly shut down via external means SHOULD
   attempt to send a line containing a 421 response code to the SMTP
   client before exiting.  The SMTP client will normally read the 421
   response code after sending its next command.
   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 451 response had been received and
   act accordingly.
3.9.  Mailing Lists and Aliases
   An SMTP-capable host SHOULD support both the alias and the list
   models of address expansion for multiple delivery.  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.
   However, in this case, the message header section (RFC 5322 [4]) MUST
   be left unchanged; in particular, the "From" field of the header
   section is unaffected.
   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.
3.9.1.  Alias
   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.
3.9.2.  List
   A mailing list may be said to operate by "redistribution" rather than
   by "forwarding".  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 aliases (Section 3.9.1) and
   forwarding (this subsection) is the change to the backward-pointing
   address in this case.  When a list constrains its processing to the
   very limited set of modifications and actions described here, it is
   attempting to emulate an MTA; such lists can be treated as a
   continuation in email transit.
   There exist mailing lists that perform additional, sometimes
   extensive, modifications to a message and its envelope.  Such mailing
   lists need to be viewed as full MUAs, which accept a delivery and
   post a new message.