<?xml version="1.0" encoding="US-ASCII"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
    which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!-- One method to get references from the online citation libraries.
    There has to be one entity for each item to be referenced. 
    An alternate method (rfc include) is described in the references. -->

<!ENTITY RFC2119 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml">
<!ENTITY RFC4033 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4033.xml">
<!ENTITY RFC4035 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4035.xml">
<!ENTITY RFC4880 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.4880.xml">
<!ENTITY RFC5248 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5248.xml">
<!ENTITY RFC5321 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5321.xml">
<!ENTITY RFC5751 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.5751.xml">
<!ENTITY RFC3207 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3207.xml">
<!ENTITY RFC7672 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.7672.xml">
<!ENTITY RFC1939 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.1939.xml">
<!ENTITY RFC3501 SYSTEM "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3501.xml">
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<!-- used by XSLT processors -->
<!-- For a complete list and description of processing instructions (PIs), 
    please see http://xml.resource.org/authoring/README.html. -->
<!-- Below are generally applicable Processing Instructions (PIs) that most I-Ds might want to use.
    (Here they are set differently than their defaults in xml2rfc v1.32) -->
<?rfc strict="yes" ?>
<!-- give errors regarding ID-nits and DTD validation -->
<!-- control the table of contents (ToC) -->
<?rfc toc="yes"?>
<!-- generate a ToC -->
<?rfc tocdepth="4"?>
<!-- the number of levels of subsections in ToC. default: 3 -->
<!-- control references -->
<?rfc symrefs="yes"?>
<!-- use symbolic references tags, i.e, [RFC2119] instead of [1] -->
<?rfc sortrefs="yes" ?>
<!-- sort the reference entries alphabetically -->
<!-- control vertical white space 
    (using these PIs as follows is recommended by the RFC Editor) -->
<?rfc compact="yes" ?>
<!-- do not start each main section on a new page -->
<?rfc subcompact="no" ?>
<!-- keep one blank line between list items -->
<!-- end of list of popular I-D processing instructions -->
<rfc category="exp" docName="draft-fenton-smtp-require-tls-01" ipr="trust200902">
 <!-- category values: std, bcp, info, exp, and historic
    ipr values: trust200902, noModificationTrust200902, noDerivativesTrust200902,
       or pre5378Trust200902
    you can add the attributes updates="NNNN" and obsoletes="NNNN" 
    they will automatically be output with "(if approved)" -->

 <!-- ***** FRONT MATTER ***** -->

 <front>

   <title>SMTP Require TLS Option</title>

   <!-- add 'role="editor"' below for the editors if appropriate -->

   <author fullname="Jim Fenton" initials="J.L."
           surname="Fenton">

     <address>
       <postal>
         <street>704 Benvenue Avenue</street>
         <city>Los Altos</city>
         <region>California</region>
         <code>94024</code>
         <country>USA</country>
       </postal>

       <email>fenton@bluepopcorn.net</email>

       <!-- uri and facsimile elements may also be added -->
     </address>
   </author>

   <date year="2016" />

   <!-- If the month and year are both specified and are the current ones, xml2rfc will fill 
        in the current day for you. If only the current year is specified, xml2rfc will fill 
	 in the current day and month for you. If the year is not the current one, it is 
	 necessary to specify at least a month (xml2rfc assumes day="1" if not specified for the 
	 purpose of calculating the expiry date).  With drafts it is normally sufficient to 
	 specify just the year. -->

   <!-- Meta-data Declarations -->

   <area>General</area>

   <workgroup>Internet Engineering Task Force</workgroup>

   <!-- WG name at the upperleft corner of the doc,
        IETF is fine for individual submissions.  
	 If this element is not present, the default is "Network Working Group",
        which is used by the RFC Editor as a nod to the history of the IETF. -->

   <keyword>SMTP</keyword>

   <!-- Keywords will be incorporated into HTML output
        files in a meta tag but they have no effect on text or nroff
        output. If you submit your draft to the RFC Editor, the
        keywords will be used for the search engine. -->

   <abstract>
     <t>The SMTP STARTTLS option, used in negotiating transport-level
     encryption of SMTP connections, is not as useful from a security
     standpoint as it might be because of its opportunistic nature;
     message delivery is prioritized over security. This document
     describes a complementary SMTP service extension, REQUIRETLS. If
     the REQUIRETLS option is used when sending a message, it causes
     message delivery to fail if a TLS connection with the required
     security characteristics cannot be completed with the next hop
     MTA or if that MTA does not also advertise that it supports REQUIRETLS. Message
     originators may therefore expect transport security to be used for messages
     sent with this option.</t>
   </abstract>

 </front>

 <middle>
   <section title="Introduction">
     <t>The <xref target="RFC5321">SMTP</xref> <xref target="RFC3207">STARTTLS
     service extension</xref>
     provides a means by which an SMTP server and client can establish
     a Transport Layer Security (TLS) protected session for the
     transmission of email messages. In this application, TLS is used
     only upon mutual agreement (successful negotiation) between the
     client and server; if this is not possible, the message is sent
     unencrypted. Even if a TLS protected session is
     established, it is uncommon for the client to abort the SMTP
     session if certificate validation fails to authenticate the SMTP server.</t>
     
     <t>The opportunistic nature of SMTP TLS enables several "on the
     wire" attacks on SMTP security between MTAs. These include
     passive eavesdropping on connections for which TLS is not
     used, interference in the SMTP protocol to prevent TLS from
     being negotiated (presumably followed by subsequent eavesdropping),
     and insertion of a man-in-the-middle attacker taking advantage of
     the lack of server authentication by the client. Attacks are more
     described in more detail in the Security Considerations section
     of this document.</t>

     <t>The REQUIRETLS SMTP service extension allows the SMTP client
     to specify that a given message sent during a particular session
     MUST be sent over a TLS protected session with specified security
     characteristics. It also requires that the SMTP server advertise
     that it also supports REQUIRETLS, in effect promising that it
     will honor the requirement to require STARTTLS and REQUIRETLS
     for all onward transmissions of messages specifying that requirement.</t>

     <section title="Requirements Language">
       <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 <xref
       target="RFC2119">RFC 2119</xref>.</t>
     </section>
   </section>

   <section anchor="service_extension" title="The REQUIRETLS Service Extension">
     <t><list style="numbers">
       <t>The textual name of the extension is "Require TLS".</t>
       <t>The EHLO keyword value associated with this extension is
       "REQUIRETLS".</t>
       
       <t>One MAIL FROM option is defined
       by this extension.</t>
       
       <t>Two new SMTP status codes are defined by this extension to
       convey error conditions resulting from failure of the client to
       negotiate a TLS connection with the required security and as a
       result of an attempt to send to a server not also supporting
       the REQUIRETLS extension.</t>
     </list></t>

     <t>In order to specify REQUIRETLS treatment for a given message,
     the REQUIRETLS option is specified on the MAIL FROM command when
     that message is transmitted. This option MUST only be specified
     in the context of an SMTP session meeting the security
     requirements that have been specified:
     <list style="symbols">
       <t>The session itself MUST employ TLS transmission.</t>
       <t>Any server authentication requirements specified as an option to
       the REQUIRETLS option (see below) MUST have been satisfied in
       establishing the current session.</t>
     </list>
     </t>

     <t>An optional parameter to the REQUIRETLS MAIL FROM option
     specifies the requirements for server authentication that
     MUST be used for any onward transmission of the following
     message. The parameter takes the form of either a single value
     or comma-separated list, separated from the REQUIRETLS option by a single "="
     (equals-sign) character. If present, the parameter MUST take one
     or more of the following values:</t>

     <t><list style="symbols">

       <t>CHAIN - The certificate presented by the SMTP server MUST
       verify successfully in a trust chain leading to a certificate
       trusted by the SMTP client. The choice of trusted (root)
       certificates by the client is at their own discretion. The
       client MAY choose to use the certificate set maintained by the
       CA/B forum [citation needed] for this purpose.</t>

       <t>DANE - The certificate presented by the SMTP server MUST
       verify succesfully using DANE as specified in <xref
       target="RFC7672">RFC&nbsp;7672</xref>.</t>

       <t>DNSSEC - The server MUST confirm that any MX record or CNAME lookup
       used to locate the SMTP server must be <xref
       target="RFC4035">DNSSEC</xref> signed and
       valid.</t>
     </list></t>

     <t>The CHAIN and DANE parameters are additive; if both are
     specified, either method of certificate validation is
     acceptable. If neither CHAIN nor DANE is specified,
     the certificate presented by the SMTP server is not required to
     be verified.</t>
     
   </section>

   <section anchor="semantics" title="REQUIRETLS Semantics">
     <section anchor="receipt" title="REQUIRETLS Receipt Requirements">
       <t>Upon receipt of a REQUIRETLS option on a MAIL FROM command
       during the receipt of a message, an SMTP server MUST tag that
       message as requiring TLS transmission with the specified
       option(s). The manner in which this tagging takes place is
       implementation-dependent.</t>
     </section>
     
     <section anchor="sender" title="REQUIRETLS Sender Requirements">
       <t>When sending a message tagged with a TLS requirement, the
       sending (client) MTA MUST:

       <list style="symbols">

	 <t>Look up the SMTP server to which the message is to be
	 sent. If the DNSSEC option is included in the message tag,
	 all lookups in this process MUST use DNSSEC verification and
	 the response MUST be DNSSEC-signed.</t>

	 <t>Open an SMTP session with the peer SMTP server using the
	 EHLO verb. If the server does not advertise the REQUIRETLS
	 capability, the client MUST bounce the message with a 5.7.xxx
	 REQUIRETLS Needed status code.</t>
	 
	 <t>Establish a TLS-protected SMTP session with its peer SMTP
	 server and authenticate the server's certificate with the
	 specified authentication method. If it is unable to do so,
	 the client MUST bounce the message with a 5.7.10 Encryption
	 Needed <xref target="RFC5248">status code</xref>.</t>

	 <t>The SMTP client SHOULD also require that meaningfully
	 secure cipher algorithms and key lengths be negotiated with
	 the server, and bounce the message as described above if this does
	 not occur. The choices of key lengths and algorithms change
	 over time, so a specific requirement is not presented here.</t>

	 <t>Transmit the message, issuing the REQUIRETLS option on the MAIL FROM command with
	 the required option(s), if any.</t>

       </list></t>
     
     </section>

     <section anchor="submission" title="REQUIRETLS Submission">
       <t>An MUA or other agent making the initial introduction of a
       message to SMTP has authority to decide whether to require TLS,
       and if so, using what authentication method(s). It does so by
       issuing the REQUIRETLS option in the MAIL FROM command during
       message submission. This MAY be done based on a user interface
       selection, on a header field included in the message, or based
       on policy. The manner in which the decision to require TLS is
       made is implementation-dependent and is beyond the scope of
       this specification.</t>
     </section>

     <section anchor="delivery" title="Delivery of REQUIRETLS messages">
       <t>Messages are usually delivered to end users using protocols
       other than SMTP such as <xref target="RFC3501">IMAP</xref>,
       <xref target="RFC1939">POP</xref>, or web mail systems. Mail
       delivery agents supporting REQUIRETLS SHOULD require that
       message delivery take place over authenticated, encrypted
       channels.</t>
     </section>
   </section>

     <section anchor="errors" title="Error handling">

       <t>Error ("bounce") messages contain important metadata, and
       therefore MUST be protected in the same manner as the original
       message. All error handling, whether resulting from a
       REQUIRETLS error or some other, MUST employ REQUIRETLS at the
       same authentication method(s) as the message that caused the
       error to occur.</t>

       <t>It should be noted that the path from the origination of an
       error bounce message back to the MAIL FROM address may not
       share the same REQUIRETLS support as the forward
       path. Therefore, users of REQUIRETLS are advised to make sure
       that they are capable of receiving mail using REQUIRETLS at the
       same authentication method(s) as messages they send. Otherwise,
       such error bounces will be lost.</t>
     </section>


   <!-- Possibly a 'Contributors' section ... -->

   <section anchor="IANA" title="IANA Considerations">
     <t>If published as an RFC, this draft requests the addition of
     the keyword REQUIRETLS to the <xref target="MailParams">SMTP
     Service Extensions Registry</xref>.</t>

     <t>If published as an RFC, this draft also requests the creation
     of a registry, REQUIRETLS Security Requirements, to be initially
     populated with the CHAIN, DANE, and DNSSEC keywords.</t>

     <t>If published as an RFC, this draft requests the addition of an
     entry to the <xref
     target="SMTPStatusCodes">Simple Mail Transfer Protocol (SMTP) Enhanced Status
     Codes Registry</xref> in the 5.7.YYY
     range to indicate lack of REQUIRETLS support by an SMTP server to
     which a message is being routed.</t>

     <t>This section is to be removed during conversion into an RFC by
     the RFC Editor.</t>
   </section>

   <section anchor="Security" title="Security Considerations">
       <t>The purpose of REQUIRETLS is to improve communications
       security for email by giving the originator of a message an
       expectation that it will be transmitted in an encrypted form
       "over the wire". When used, REQUIRETLS changes the
       traditional behavior of email transmission, which favors
       delivery over the ability to send email messages using
       transport-layer security, to one in which messages are not
       transmitted unless the required security is available.</t>

       <section anchor="Passive" title="Passive attacks">
	 <t>REQUIRETLS is generally effective against passive
	 attackers who are merely trying to eavesdrop on an SMTP
	 exchange between an SMTP client and server. This assumes, of
	 course, the cryptographic integrity of the TLS connection
	 being used.</t>
       </section>

       <section anchor="Active" title="Active attacks">

	 <t>Active attacks against TLS encrypted SMTP connections can
	 take many forms. One such attack is to interfere in the
	 negotiation by changing the STARTTLS command to something
	 illegal such as XXXXXXXX. This causes TLS negotiation to fail
	 and messages to be sent in the clear, where they can be
	 intercepted. REQUIRETLS detects the failure of STARTTLS and
	 declines to send the message rather than send it
	 insecurely.</t>

	 <t>A second form of attack is a man-in-the-middle attack
	 where the attacker terminates the TLS connection rather than
	 the intended SMTP server. This is possible when, as is
	 commonly the case, the SMTP client either does not verify the
	 server's certificate or establishes the connection even when
	 the verification fails. The REQUIRETLS CHAIN and DANE options
	 allow the message sender to specify that successful
	 certificate validation, using either or both of two different
	 methods, is required before sending the message.</t>

	 <t>Another active attack involves the spoofing of DNS MX
	 records of the recipient domain. An attacker having this
	 capability could cause the message to be redirected to a mail
	 server under the attacker's own control, which would
	 presumably have a valid certificate. The REQUIRETLS DNSSEC
	 option allows the message sender to require that valid <xref
	 target="RFC4033">DNSSEC</xref> signatures be obtained when
	 locating the recipient's mail server, in order to address
	 that attack.</t>

	 <t>In addition to support of the DNSSEC option, domains
	 receiving email SHOULD deploy DNSSEC and SMTP clients SHOULD
	 deploy DNSSEC verification.</t>
       </section>

       <section anchor="badactor" title="Bad Actor MTAs">

	 <t>A bad-actor MTA along the message transmission path could
	 misrepresent its support of REQUIRETLS and/or actively strip
	 REQUIRETLS tags from messages it handles. However, since
	 intermediate MTAs are already trusted with the cleartext of
	 messages they handle, and are not part of the threat model
	 for transport-layer security, they are also not part of the
	 threat model for REQUIRETLS.</t>
	 
	 <t>It should be reemphasized that since SMTP TLS is a
	 transport-layer security protocol, messages sent using
	 REQUIRETLS are not encrypted end-to-end and are visible to
	 MTAs that are part of the message delivery path. Messages
	 containing sensitive information that MTAs should not have
	 access to MUST be sent using end-to-end content encryption
	 such as <xref target="RFC4880">OpenPGP</xref> or <xref
	 target="RFC5751">S/MIME</xref>.</t>
       </section>
   </section>

   <section anchor="acknowledgements" title="Acknowledgements">
     <t>The author would like to acknowledge many helpful suggestions
     on the ietf-smtp mailing list, and in particular those of Tony
     Finch, John Klensin, John Levine, Rolf Sonneveld, and Per
     Thorsheim.</t>

   </section>

     <section anchor="history" title="Revision History">

       <t>To be removed by RFC Editor upon publication as an RFC.</t>

       <section title="Changes Since -00 Draft">
	 
	 <t><list style="symbols">
	 <t>Conversion of REQUIRETLS from an SMTP verb to a MAIL FROM
	 parameter to better associate REQUIRETLS requirements with
	 transmission of individual messages.</t>

	 <t>Addition of an option to require DNSSEC lookup of the
	 remote mail server, since this affects the common name of the
	 certificate that is presented.</t>

	 <t>Clarified the wording to more clearly state that TLS
	 sessions must be established and not simply that STARTTLS is
	 negotiated.</t>

	 <t>Introduced need for minimum encryption standards (key
	 lengths and algorithms)</t>

	 <t>Substantially rewritten Security Considerations section</t>

	 
       </list></t>
       

     </section>
     

   </section>

 </middle>

 <!--  *****BACK MATTER ***** -->

 <back>
   <!-- References split into informative and normative -->

   <!-- There are 2 ways to insert reference entries from the citation libraries:
    1. define an ENTITY at the top, and use "ampersand character"RFC2629; here (as shown)
    2. simply use a PI "less than character"?rfc include="reference.RFC.2119.xml"?> here
       (for I-Ds: include="reference.I-D.narten-iana-considerations-rfc2434bis.xml")

    Both are cited textually in the same manner: by using xref elements.
    If you use the PI option, xml2rfc will, by default, try to find included files in the same
    directory as the including file. You can also define the XML_LIBRARY environment variable
    with a value containing a set of directories to search.  These can be either in the local
    filing system or remote ones accessed by http (http://domain/dir/... ).-->

   <references title="Normative References">
     <!--?rfc include="http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml"?-->
     &RFC2119;
     &RFC3207;
     &RFC4035;
     &RFC5248;
     &RFC5321;
     <reference anchor="MailParams"
                target="http://www.iana.org/assignments/mail-parameters">
       <front>
         <title>IANA Mail Parameters</title>

         <author>
           <organization>Internet Assigned Numbers Authority (IANA)</organization>
         </author>

         <date year="2007" />
       </front>
     </reference>
     <reference anchor="SMTPStatusCodes"
                target="http://www.iana.org/assignments/smtp-enhanced-status-codes">
       <front>
         <title>Simple Mail Transfer Protocol (SMTP) Enhanced Status
	 Codes Registry</title>

         <author>
           <organization>Internet Assigned Numbers Authority (IANA)</organization>
         </author>

         <date year="2008" />
       </front>
     </reference>

   </references>

   <references title="Informative References">
     <!-- Here we use entities that we defined at the beginning. -->

     &RFC1939;
     &RFC3501;
     &RFC4033;
     &RFC4880;
     &RFC5751;
     &RFC7672;
     
     <!-- A reference written by by an organization not a person. -->

   </references>

 </back>
</rfc>
