<?xml version="1.0"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>

<!--
     ASCII to XML transformation by Invisible Worlds, Inc.
     http://invisible.net/
     Last transformation: 03-Feb-1999, 01:43:26

     Cannonical version of this document is at:
     http://info.internet.isi.edu/in-notes/rfc/files/rfc2487.txt

     Implementors should verify all content with
     cannonical version.  Failure to do so may result in
     protocol failures.
-->

<rfc number="2487"
     category="std">
<front>
<title abbrev="SMTP Service Extension">SMTP Service Extension for Secure SMTP over TLS</title>
<author initials="P." surname="Hoffman" fullname="Paul Hoffman">
<organization>Internet Mail Consortium</organization>
<address>
<postal>
<street>127 Segre Place</street>
<city>Santa Cruz</city>
<region>CA</region>
<code>95060</code>
<country>USA</country>
</postal>
<phone>+1 408 426 9827</phone>
<email>phoffman@imc.org</email>
</address>
</author>
<date month="January" year="1999"/>
<area>Applications</area>
<keyword>SMTP</keyword>
<keyword>attack</keyword>
<keyword>authentication</keyword>
<keyword>security</keyword>
<keyword>simple mail transfer protocol</keyword>
<keyword>transport layer security</keyword>
</front>
<middle>
<!-- RFC original section: (1.) -->
<section title="Abstract">
<t>
   This document describes an extension to the SMTP service that allows
   an SMTP server and client to use transport-layer security to provide
   private, authenticated communication over the Internet. This gives
   SMTP agents the ability to protect some or all of their
   communications from eavesdroppers and attackers.
</t>
</section>
<!-- RFC original section: (2.) -->
<section title="Introduction">
<t>
   SMTP [RFC-821] servers and clients normally communicate in the clear
   over the Internet. In many cases, this communication goes through one
   or more router that is not controlled or trusted by either entity.
   Such an untrusted router might allow a third party to monitor or
   alter the communications between the server and client.
</t>
<t>
   Further, there is often a desire for two SMTP agents to be able to
   authenticate each others&apos; identities. For example, a secure SMTP
   server might only allow communications from other SMTP agents it
   knows, or it might act differently for messages received from an
   agent it knows than from one it doesn&apos;t know.
</t>
<t>
   TLS [TLS], more commonly known as SSL, is a popular mechanism for
   enhancing TCP communications with privacy and authentication. TLS is
   in wide use with the HTTP protocol, and is also being used for adding
   security to many other common protocols that run over TCP.
</t>
<!-- RFC original section: (2.1) -->
<section title="Terminology">
<t>
   The key words &quot;MUST&quot;, &quot;MUST NOT&quot;, &quot;REQUIRED&quot;, &quot;SHALL&quot;, &quot;SHALL NOT&quot;,
   &quot;SHOULD&quot;, &quot;SHOULD NOT&quot;, &quot;RECOMMENDED&quot;, &quot;MAY&quot;, and &quot;OPTIONAL&quot; in this
   document are to be interpreted as described in [RFC-2119].
</t>
</section>
</section>
<!-- RFC original section: (3.) -->
<section title="STARTTLS Extension">
<t>
   The STARTTLS extension to SMTP is laid out as follows:
<list>
<t>
   (1) the name of the SMTP service defined here is STARTTLS;
</t>
<t>
   (2) the EHLO keyword value associated with the extension is STARTTLS;
</t>
<t>
   (3) the STARTTLS keyword has no parameters;
</t>
<t>
   (4) a new SMTP verb, &quot;STARTTLS&quot;, is defined;
</t>
<t>
   (5) no additional parameters are added to any SMTP command.
</t></list>
</t>
</section>
<!-- RFC original section: (4.) -->
<section title="The STARTTLS Keyword">
<t>
   The STARTTLS keyword is used to tell the SMTP client that the SMTP
   server allows use of TLS. It takes no parameters.
</t>
</section>
<!-- RFC original section: (5.) -->
<section title="The STARTTLS Command">
<t>
   The format for the STARTTLS command is:
</t>
<t>
   STARTTLS
</t>
<t>
   with no parameters.
</t>
<t>
   After the client gives the STARTTLS command, the server responds with
   one of the following reply codes:
</t>
<figure><artwork>
   220 Ready to start TLS
   501 Syntax error (no parameters allowed)
   454 TLS not available due to temporary reason
</artwork></figure>
<t>
   A publicly-referenced SMTP server MUST NOT require use of the
   STARTTLS extension in order to deliver mail locally. This rule
   prevents the STARTTLS extension from damaging the interoperability of
   the Internet&apos;s SMTP infrastructure. A publicly-referenced SMTP server
   is an SMTP server which runs on port 25 of an Internet host listed in
   the MX record (or A record if an MX record is not present) for the
   domain name on the right hand side of an Internet mail address.
   Any SMTP server may refuse to accept messages for relay based on
   authentication supplied during the TLS negotiation. An SMTP server
   that is not publicly referenced may refuse to accept any messages for
   relay or local delivery based on authentication supplied during the
   TLS negotiation.
</t>
<t>
   A SMTP server that is not publicly referenced may choose to require
   that the client perform a TLS negotiation before accepting any
   commands. In this case, the server SHOULD return the reply code:
</t>
<figure><artwork>
   530 Must issue a STARTTLS command first
</artwork></figure>
<t>
   to every command other than NOOP, EHLO, STARTTLS, or QUIT. If the
   client and server are using the ENHANCEDSTATUSCODES ESMTP extension
   [RFC-2034], the status code to be returned SHOULD be 5.7.0.
</t>
<t>
   After receiving a 220 response to a STARTTLS command, the client
   SHOULD start the TLS negotiation before giving any other SMTP
   commands.
</t>
<t>
   If the SMTP client is using pipelining as defined in RFC 1854, the
   STARTTLS command must be the last command in a group.
</t>
<!-- RFC original section: (5.1) -->
<section title="Processing After the STARTTLS Command">
<t>
   After the TLS handshake has been completed, both parties MUST
   immediately decide whether or not to continue based on the
   authentication and privacy achieved. The SMTP client and server may
   decide to move ahead even if the TLS negotiation ended with no
   authentication and/or no privacy because most SMTP services are
   performed with no authentication and no privacy, but some SMTP
   clients or servers may want to continue only if a particular level of
   authentication and/or privacy was achieved.
</t>
<t>
   If the SMTP client decides that the level of authentication or
   privacy is not high enough for it to continue, it SHOULD issue an
   SMTP QUIT command immediately after the TLS negotiation is complete.
   If the SMTP server decides that the level of authentication or
   privacy is not high enough for it to continue, it SHOULD reply to
   every SMTP command from the client (other than a QUIT command) with
   the 554 reply code (with a possible text string such as &quot;Command
   refused due to lack of security&quot;).
</t>
<t>
   The decision of whether or not to believe the authenticity of the
   other party in a TLS negotiation is a local matter. However, some
   general rules for the decisions are:
<list>
<t>
    - A SMTP client would probably only want to authenticate an SMTP
      server whose server certificate has a domain name that is the
      domain name that the client thought it was connecting to.
</t>
<t>
    - A publicly-referenced  SMTP server would probably want to accept
      any certificate from an SMTP client, and would possibly want to
      put distinguishing information about the certificate in the
      Received header of messages that were relayed or submitted from
      the client.
</t></list>
</t>
</section>
<!-- RFC original section: (5.2) -->
<section title="Result of the STARTTLS Command">
<t>
   Upon completion of the TLS handshake, the SMTP protocol is reset to
   the initial state (the state in SMTP after a server issues a 220
   service ready greeting). The server MUST discard any knowledge
   obtained from the client, such as the argument to the EHLO command,
   which was not obtained from the TLS negotiation itself. The client
   MUST discard any knowledge obtained from the server, such as the list
   of SMTP service extensions, which was not obtained from the TLS
   negotiation itself. The client SHOULD send an EHLO command as the
   first command after a successful TLS negotiation.
</t>
<t>
   The list of SMTP service extensions returned in response to an EHLO
   command received after the TLS handshake MAY be different than the
   list returned before the TLS handshake. For example, an SMTP server
   might not want to advertise support for a particular SASL mechanism
   [SASL] unless a client has sent an appropriate client certificate
   during a TLS handshake.
</t>
<t>
   Both the client and the server MUST know if there is a TLS session
   active.  A client MUST NOT attempt to start a TLS session if a TLS
   session is already active. A server MUST NOT return the TLS extension
   in response to an EHLO command received after a TLS handshake has
   completed.
</t>
</section>
</section>
<!-- RFC original section: (6.) -->
<section title="Usage Example">
<t>
   The following dialog illustrates how a client and server can start a
   TLS session:
</t>
<figure><artwork>
   S: &lt;waits for connection on TCP port 25&gt;
   C: &lt;opens connection&gt;
   S: 220 mail.imc.org SMTP service ready
   C: EHLO mail.ietf.org
   S: 250-mail.imc.org offers a warm hug of welcome
   S: 250 STARTTLS
   C: STARTTLS
   S: 220 Go ahead
   C: &lt;starts TLS negotiation&gt;
   C &amp; S: &lt;negotiate a TLS session&gt;
   C &amp; S: &lt;check result of negotiation&gt;
   C: &lt;continues by sending an SMTP command&gt;
   . . .
</artwork></figure>
</section>
<!-- RFC original section: (7.) -->
<section title="Security Considerations">
<t>
   It should be noted that SMTP is not an end-to-end mechanism. Thus, if
   an SMTP client/server pair decide to add TLS privacy, they are not
   securing the transport from the originating mail user agent to the
   recipient.  Further, because delivery of a single piece of mail may
   go between more than two SMTP servers, adding TLS privacy to one pair
   of servers does not mean that the entire SMTP chain has been made
   private. Further, just because an SMTP server can authenticate an
   SMTP client, it does not mean that the mail from the SMTP client was
   authenticated by the SMTP client when the client received it.
</t>
<t>
   Both the STMP client and server must check the result of the TLS
   negotiation to see whether acceptable authentication or privacy was
   achieved. Ignoring this step completely invalidates using TLS for
   security.  The decision about whether acceptable authentication or
   privacy was achieved is made locally, is implementation-dependant,
   and is beyond the scope of this document.
</t>
<t>
   The SMTP client and server should note carefully the result of the
   TLS negotiation. If the negotiation results in no privacy, or if it
   results in privacy using algorithms or key lengths that are deemed
   not strong enough, or if the authentication is not good enough for
   either party, the client may choose to end the SMTP session with an
   immediate QUIT command, or the server may choose to not accept any
   more SMTP commands.
</t>
<t>
   A server announcing in an EHLO response that it uses a particular TLS
   protocol should not pose any security issues, since any use of TLS
   will be at least as secure as no use of TLS.
</t>
<t>
   A man-in-the-middle attack can be launched by deleting the &quot;250
   STARTTLS&quot; response from the server. This would cause the client not
   to try to start a TLS session. An SMTP client can protect against
   this attack by recording the fact that a particular SMTP server
   offers TLS during one session and generating an alarm if it does not
   appear in the EHLO response for a later session. The lack of TLS
   during a session SHOULD NOT result in the bouncing of email, although
   it could result in delayed processing.
</t>
<t>
   Before the TLS handshake has begun, any protocol interactions are
   performed in the clear and may be modified by an active attacker. For
   this reason, clients and servers MUST discard any knowledge obtained
   prior to the start of the TLS handshake upon completion of the TLS
   handshake.
</t>
<t>
   The STARTTLS extension is not suitable for authenticating the author
   of an email message unless every hop in the delivery chain, including
   the submission to the first SMTP server, is authenticated. Another
   proposal [SMTP-AUTH] can be used to authenticate delivery and MIME
   security multiparts [MIME-SEC] can be used to authenticate the author
   of an email message. In addition, the [SMTP-AUTH] proposal offers
   simpler and more flexible options to authenticate an SMTP client and
   the SASL EXTERNAL mechanism [SASL] MAY be used in conjunction with
   the STARTTLS command to provide an authorization identity.
</t></section>
</middle>
<back>
<references>
 	
                     

<reference anchor='RFC0821'>

<front>
<title>Simple Mail Transfer Protocol</title>
<author initials='J.B.' surname='Postel' fullname='Jonathan B. Postel'>
<organization>University of Southern California (USC)/Information Sciences Institute</organization>
<address>
<postal>
<street>4676 Admiralty Way</street>
<city>Marina del Rey</city>
<region>CA</region>
<code>90291</code>
<country>US</country></postal>
<phone>+1 213 822 1511</phone></address></author>
<date month='August' day='1' year='1982' /></front>

<seriesInfo name='STD' value='10' />
<seriesInfo name='RFC' value='821' />
<format type='TXT' octets='124482' target='ftp://ftp.isi.edu/in-notes/rfc821.txt' />
</reference>
   <!-- _XREF_RFC-821  -->
                     

<reference anchor='RFC1869'>

<front>
<title>SMTP Service Extensions</title>
<author initials='J.' surname='Klensin' fullname='John Klensin'>
<organization>MCI</organization>
<address>
<postal>
<street>2100 Reston Parkway</street>
<city>Reston</city>
<region>VA</region>
<code>22091</code>
<country>US</country></postal>
<phone>+1 703 715 7361</phone>
<facsimile>+1 703 715 7436</facsimile>
<email>klensin@mci.net</email></address></author>
<author initials='N.' surname='Freed' fullname='Ned Freed'>
<organization>Innosoft International, Inc.</organization>
<address>
<postal>
<street>1050 East Garvey Avenue South</street>
<city>West Covina</city>
<region>CA</region>
<code>91790</code>
<country>US</country></postal>
<phone>+1 818 919 3600</phone>
<facsimile>+1 818 919 3614</facsimile>
<email>ned@innosoft.com</email></address></author>
<author initials='M.' surname='Rose' fullname='Marshall T. Rose'>
<organization>Dover Beach Consulting, Inc.</organization>
<address>
<postal>
<street>420 Whisman Court</street>
<city>Mountain View</city>
<region>CA</region>
<code>94043-2186</code>
<country>US</country></postal>
<phone>+1 415 968 1052</phone>
<facsimile>+1 415 968 2510</facsimile>
<email>mrose@dbc.mtview.ca.us</email></address></author>
<author initials='E.' surname='Stefferud' fullname='Einar A. Stefferud'>
<organization>Network Management Associates, Inc.</organization>
<address>
<postal>
<street>17301 Drey Lane</street>
<city>Huntington Beach</city>
<region>CA</region>
<code>92647-5615</code>
<country>US</country></postal>
<phone>+1 714 842 3711</phone>
<facsimile>+1 714 848 2091</facsimile>
<email>stef@nma.com</email></address></author>
<author initials='D.' surname='Crocker' fullname='Dave Crocker'>
<organization>Brandenburg Consulting</organization>
<address>
<postal>
<street>675 Spruce Dr.</street>
<city>Sunnyvale</city>
<region>CA</region>
<code>94086</code>
<country>US</country></postal>
<phone>+1 408 246 8253</phone>
<facsimile>+1 408 249 6205</facsimile>
<email>dcrocker@mordor.stanford.edu</email></address></author>
<date month='November' year='1995' />
<abstract>
<t>This memo defines a framework for extending the SMTP service by defining a means whereby a server SMTP can inform a client SMTP as to the service extensions it supports.  Extensions to the SMTP service are registered with the IANA. This framework does not require modification of existing SMTP clients or servers unless the features of the service extensions are to be requested or provided.</t></abstract></front>

<seriesInfo name='STD' value='10' />
<seriesInfo name='RFC' value='1869' />
<format type='TXT' octets='23299' target='ftp://ftp.isi.edu/in-notes/rfc1869.txt' />
</reference>
   <!-- _XREF_RFC-1869  -->
                     

<reference anchor='RFC2034'>

<front>
<title abbrev='SMTP Enhanced Error Codes'>SMTP Service Extension for Returning Enhanced Error Codes</title>
<author initials='N.' surname='Freed' fullname='Ned Freed'>
<organization>Innosoft International, Inc.</organization>
<address>
<postal>
<street>1050 East Garvey Avenue South</street>
<street>West Covina</street>
<street>CA 91790</street>
<country>USA</country></postal>
<phone>+1 818 919 3600           fax: +1 818 919 3614</phone>
<email>ned@innosoft.com</email></address></author>
<date month='October' year='1996' />
<area>Applications</area>
<keyword>SMTP</keyword>
<keyword>point-to-point protocol</keyword>
<keyword>simple mail transfer protocol</keyword></front>

<seriesInfo name='RFC' value='2034' />
<format type='TXT' octets='10460' target='ftp://ftp.isi.edu/in-notes/rfc2034.txt' />
<format type='HTML' octets='21966' target='http://xml.resource.org/public/rfc/html/rfc2034.html' />
<format type='XML' octets='10728' target='http://xml.resource.org/public/rfc/xml/rfc2034.xml' />
</reference>
   <!-- _XREF_RFC-2034  -->
                     

<reference anchor='RFC2119'>

<front>
<title abbrev='RFC Key Words'>Key words for use in RFCs to Indicate Requirement Levels</title>
<author initials='S.' surname='Bradner' fullname='Scott Bradner'>
<organization>Harvard University</organization>
<address>
<postal>
<street>1350 Mass. Ave.</street>
<street>Cambridge</street>
<street>MA 02138</street></postal>
<phone>- +1 617 495 3864</phone>
<email>sob@harvard.edu</email></address></author>
<date month='March' year='1997' />
<area>General</area>
<keyword>keyword</keyword>
<abstract>
<t>
   In many standards track documents several words are used to signify
   the requirements in the specification.  These words are often
   capitalized.  This document defines these words as they should be
   interpreted in IETF documents.  Authors who follow these guidelines
   should incorporate this phrase near the beginning of their document:

<list>
<t>
      The key words &quot;MUST&quot;, &quot;MUST NOT&quot;, &quot;REQUIRED&quot;, &quot;SHALL&quot;, &quot;SHALL
      NOT&quot;, &quot;SHOULD&quot;, &quot;SHOULD NOT&quot;, &quot;RECOMMENDED&quot;,  &quot;MAY&quot;, and
      &quot;OPTIONAL&quot; in this document are to be interpreted as described in
      RFC 2119.
</t></list></t>
<t>
   Note that the force of these words is modified by the requirement
   level of the document in which they are used.
</t></abstract></front>

<seriesInfo name='BCP' value='14' />
<seriesInfo name='RFC' value='2119' />
<format type='TXT' octets='4723' target='ftp://ftp.isi.edu/in-notes/rfc2119.txt' />
<format type='HTML' octets='14486' target='http://xml.resource.org/public/rfc/html/rfc2119.html' />
<format type='XML' octets='5661' target='http://xml.resource.org/public/rfc/xml/rfc2119.xml' />
</reference>
   <!-- _XREF_RFC-2119  -->
                     

<reference anchor='RFC2222'>

<front>
<title abbrev='SASL'>Simple Authentication and Security Layer (SASL)</title>
<author initials='J.G.' surname='Myers' fullname='John G. Myers'>
<organization>Netscape Communications</organization>
<address>
<postal>
<street>501 E. Middlefield Road</street>
<street>Mail Stop MV-029</street>
<street>Mountain View</street>
<street>CA 94043-4042</street></postal>
<email>jgmyers@netscape.com</email></address></author>
<date month='October' year='1997' />
<area>Security</area>
<keyword>authentication</keyword>
<keyword>security</keyword></front>

<seriesInfo name='RFC' value='2222' />
<format type='TXT' octets='35010' target='ftp://ftp.isi.edu/in-notes/rfc2222.txt' />
<format type='HTML' octets='47275' target='http://xml.resource.org/public/rfc/html/rfc2222.html' />
<format type='XML' octets='33815' target='http://xml.resource.org/public/rfc/xml/rfc2222.xml' />
</reference>
   <!-- _XREF_SASL  -->

<reference anchor="_XREF_SMTP-AUTH">

				<front>
					<title>SMTP Service Extension for Authentication</title>
					<author>
						<organization/>
					</author>
					<date month="" year=""/>
				</front>
				<!--  Work in Progress. -->
			</reference>
 		
                     

<reference anchor='RFC2246'>

<front>
<title>The TLS Protocol Version 1.0</title>
<author initials='T.' surname='Dierks' fullname='Tim Dierks'>
<organization>Certicom</organization>
<address>
<email>tdierks@certicom.com</email></address></author>
<author initials='C.' surname='Allen' fullname='Christopher Allen'>
<organization>Certicom</organization>
<address>
<email>callen@certicom.com</email></address></author>
<author initials='W.' surname='Treese' fullname='Win Treese'>
<organization>Open Market</organization>
<address>
<email>treese@openmarket.com</email></address></author>
<author initials='P.L.' surname='Karlton' fullname='Philip L. Karlton'>
<organization>Netscape Communications</organization>
<address></address></author>
<author initials='A.O.' surname='Freier' fullname='Alan O. Freier'>
<organization>Netscape Communications</organization>
<address>
<email>freier@netscape.com</email></address></author>
<author initials='P.C.' surname='Kocher' fullname='Paul C. Kocher'>
<organization>Independent Consultant</organization>
<address>
<email>pck@netcom.com</email></address></author>
<date month='January' year='1999' />
<abstract>
<t>This document specifies Version 1.0 of the Transport Layer Security (TLS) protocol. The TLS protocol provides communications privacy over the Internet. The protocol allows client/server applications to communicate in a way that is designed to prevent eavesdropping, tampering, or message forgery.</t></abstract></front>

<seriesInfo name='RFC' value='2246' />
<format type='TXT' octets='170401' target='ftp://ftp.isi.edu/in-notes/rfc2246.txt' />
</reference>
   <!-- _XREF_TLS  -->
  

</references>
</back>
</rfc>
