<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<?rfc strict="yes"?>
<?rfc symrefs="yes"?>
<?rfc linkmailto="no"?>
<rfc ipr="trust200902" category="std" 
     updates="1939, 2595, 3464, 3501, 5068, 6186, 6409"
     docName="draft-ietf-uta-email-deep-05.txt">
<front>
<title abbrev="MUA-STS">Mail User Agent Strict Transport Security (MUA-STS)</title>
<author fullname="Keith Moore" initials="K" surname="Moore">
  <organization>Network Heretics</organization>
  <address>
    <postal>
      <street>PO Box 1934</street>
      <city>Knoxville</city>
      <region>TN</region>
      <country>US</country>
      <code>37901</code>
    </postal>
    <email>moore@network-heretics.com</email>
  </address>
</author>
<author initials="C." surname="Newman" fullname="Chris Newman">
 <organization>Oracle</organization>
 <address>
  <postal>
   <street>440 E. Huntington Dr., Suite 400</street>
   <city>Arcadia</city>
   <region>CA</region>
   <code>91006</code>
   <country>US</country>
  </postal>
  <email>chris.newman@oracle.com</email>
 </address>
</author>
<date month="July" year="2016" />
<area>Applications</area>
<keyword>I-D</keyword>
<keyword>Internet-Draft</keyword>
<abstract><t>
This specification defines a set of requirements and facilities designed
to improve email confidentiality between a mail user agent (MUA) and a
mail submission or mail access server. This provides mechanisms intended
to increase use of already deployed Transport Layer Security (TLS)
technology and provides a model for a mail user agent's confidentiality
assurance. This enables mail service providers to advertise strict
transport security (STS) policies that request MUAs increase
confidentiality assurance.
</t></abstract>
</front>
<middle>
<section title="Introduction">
<t>
Software that provides email service via Internet Message Access
Protocol (IMAP) <xref target="RFC3501"/>, Post Office Protocol (POP)
<xref target="RFC1939"/> and/or Simple Mail Transfer Protocol (SMTP)
Submission <xref target="RFC6409"/> usually has Transport Layer Security
(TLS) <xref target="RFC5246"/> support but often does not use it in a
way that maximizes end-user confidentiality. This specification proposes
changes to email software and deployments intended to increase the use
of TLS and record when that use occurs. This adapts the strict transport
security (STS) model described in <xref target="RFC6797"/> to cover mail
user agents (MUAs).
</t>
<t>In brief, this memo now recommends that:
<list style="symbols">
<t>MUAs associate a confidentiality assurance level with each mail
account, and the default level requires use of TLS with certificate
validation for all TCP connections;</t>

<t>TLS on a well-known port ("Implicit TLS") be supported for IMAP, POP,
and SMTP Submission <xref target="RFC6409"/> for all electronic mail
user agents (MUAs), servers, and service providers;</t>

<t>MUAs and mail protocol servers cooperate (via mechanisms defined in
this specification) to upgrade security feature use and record/indicate
that usage appropriately. The security upgrade model is aligned with
the HTTP STS specification <xref target="RFC6797"/>.</t>
</list>
</t>
<t>This does not address use of TLS with SMTP for message relay (where
<xref target="RFC6409">Message Submission</xref> does not apply).
Improved use of TLS with SMTP for message relay requires a different
approach. One approach to address that topic is described in
<xref target="RFC7672"/>.</t>
<t>The recommendations in this memo do not replace the functionality
of, and are not intended as a substitute for, end-to-end encryption of
electronic mail.</t>
<t>
This draft is subject to change. Implementation of this proposal is not recommended at this time. Please discuss this proposal on the ietf-uta mailing list.
</t>
</section>

<section title="Conventions and Terminology Used in This Document">
<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"/>.</t>
<t>This specification expresses syntax using the Augmented Backus-Naur
Form (ABNF) as described in <xref target="RFC5234"/>, including the core rules in Appendix B and rules from <xref target="RFC5322"/>.</t>
<t>In examples, "C:" and "S:" indicate lines sent by the client and
server respectively. If a single "C:" or "S:" label applies to multiple
lines, then the line breaks between those lines are for editorial
clarity only and are not part of the actual protocol exchange.</t>

</section>

<section anchor="mua-assurance" title="Mail Account Confidentiality Assurance Level">
<t>
A "mail account" refers to the network services an end user uses to
read, submit and manage email communications on the Internet. This
typically involves at least one mail access server (IMAP or POP) and at
least one SMTP submission server. An end users uses a mail user agent
(MUA) to access a mail account and most MUAs support one or more mail
accounts. This document uses the term "confidentiality assurance level"
to indicate the degree to which the network connections between an MUA
and a mail account have confidentiality protection from both passive and
active attackers on the network.
</t>

<t>
The configuration necessary for a mail account includes an email
address, connection information and authentication credentials for
network services. MUAs compliant with this specification MUST also
associate a confidentiality assurance level with each mail account. MUAs
MUST implement a high confidentiality assurance level as described in
the next section.
</t>

<t>
MUAs SHOULD continuously indicate to the user the confidentiality
assurance level of the account currently in use when reading, submitting
and managing mail (e.g., via a lock icon, background colors and
indications similar to those commonly used in web browsers for a similar
purpose) and SHOULD indicate the confidentiality assurance level for
each account whenever displaying a list of mail accounts. Note that the
displayed confidentiality assurance level could be higher than the level
set at account configuration but never lower. If multiple active
connections are associated with an account or view, the indication
should match the level provided by the least confidential connection.
</t>

<t>
Account configuration occurs when an MUA is first used to access a
particular service, when a user wishes to access or submit mail through
servers in addition to those specified or found during first use, or
when a user explicitly requests to change account configuration
parameters such as server names, user names, passwords, client
certificates, etc.  Account configuration can be entirely manual
(entering server names explicitly) or partially automated via a
mechanism such as DNS SRV records <xref target="RFC6186"/>. MUAs SHOULD
use the high confidentiality assurance level as the default for newly
configured accounts.
</t>

<section anchor="high-assurance" title="High Confidentiality Assurance">
<t>
A mail account has a high confidentiality assurance when the following
conditions are met on all TCP server connections associated with an
account. This includes connections to POP, IMAP and SMTP submission
servers as well as any other associated protocols defined now or in the
future. Examples of protocols associated with a mail account include
managesieve <xref target="RFC5804"/> and MTQP <xref target="RFC3887"/>.
<list style="symbols">
<t>TCP connections MUST attempt to negotiate TLS via either Implicit TLS
<xref target="tls-implicit"/> or STARTTLS.</t>
<t>MUAs MUST implement <xref target="RFC7817"/> and PKIX <xref target="RFC5280"/>.</t>
<t>MUAs MAY implement DANE <xref target="RFC6698"/>.</t>
<t>User agents MUST abort a TLS session if the TLS negotiation fails or
the server's certificate or identity fails to verify. A user may
reconfigure the account to lower the expected level of confidentiality
if he/she chooses. Reduction of expected account confidentiality MUST
NOT be done on a click-through basis.</t>
</list>
</t>
<t>
The end user is part of the system that protects the user's confidentiality and
security. As a result, it's critical not to present the end user with a
simple action that reduces their confidentiality in response to certificate
validation failure. An MUA which offers a user actions such as "connect
anyway", "trust certificate for future connections" or "lower
confidentiality assurance for this account" in response to certificate
validation failure is not providing a high confidentiality assurance as
defined in this section and thus does not comply with this document.
Examples of acceptable actions to offer would be "work offline", "try
again later", and "open service provider status web page".
</t>
</section>

<section title="No Confidentiality Assurance">
<t>
MUAs MAY implement a no confidentiality assurance level for accounts. At
this level, the MUA MUST attempt to negotiate TLS, but MAY ignore server
certificate validation failures. MUAs MAY support use of connections
without TLS, but if they do they SHOULD attempt TLS first if available
and MUST implement code to reconnect without TLS if TLS negotiation
fails for reasons other than server certificate validity.
</t>
<t>
Note that if the TLS certificate is not successfully validated as
described in <xref target="high-assurance"/> or a version of SSL/TLS
prior to TLS 1.1 is used, the client MUST NOT present a high
confidentiality indication for the account or connection.
</t>
</section>

<section title="Other Confidentiality Assurance Levels">
<t>
This specification is not intended to limit experimentation and
innovation with respect to user confidentiality. As a result more
confidentiality assurance levels are permitted. However, levels below
"no confidentiality assurance" described in the previous section are
discouraged and implementers are cautioned that end users may be
confused by too many confidentiality assurance levels.
</t>
</section>
</section>

<section anchor="tls-implicit" title="Implicit TLS">
<t>
Previous standards for use of email protocols with TLS used the STARTTLS
mechanism: <xref target="RFC2595"/>, <xref target="RFC3207"/>, and <xref
target="RFC3501"/>. With STARTTLS, the client establishes a clear text
application session and determines whether to issue a STARTTLS command
based on server capabilities and client configuration. If the client
issues a STARTTLS command, a TLS handshake follows that can upgrade the
connection. While this mechanism has been deployed, an alternate mechanism
where TLS is negotiated immediately at connection start on a separate
port (referred to in this document as "Implicit TLS") has been deployed more
successfully. To increase use of TLS, this specification recommends use
of implicit TLS by new POP, IMAP and SMTP Submission software.
</t>
<section title="Implicit TLS for POP">
<t>
When a TCP connection is established for the "pop3s" service (default
port 995), a TLS handshake begins immediately. Clients MUST implement
the certificate validation mechanism described in <xref 
target="RFC7817"/>. Once the TLS session is
established, POP3 <xref target="RFC1939"/> protocol messages are
exchanged as TLS application data for the remainder of the TCP
connection. After the server sends a +OK greeting, the server and
client MUST enter AUTHORIZATION state, even if client credentials were
supplied during the TLS handshake.
</t>
<t>
See <xref target="clientcert"/> for additional information on client
certificate authentication. See <xref target="iana-pop3s"/> for port
registration information.
</t>
</section>
<section title="Implicit TLS for IMAP">
<t>
When a TCP connection is established for the "imaps" service (default
port 993), a TLS handshake begins immediately. Clients MUST implement
the certificate validation mechanism described in <xref
target="RFC3501"/> and SHOULD implement the certificate validation
mechanism described in <xref
target="RFC7817"/>. Once the TLS session is
established, IMAP <xref target="RFC3501"/> protocol messages are
exchanged as TLS application data for the remainder of the TCP
connection. If client credentials were provided during the TLS
handshake that the server finds acceptable, the server MAY issue a
PREAUTH greeting in which case both the server and client enter
AUTHENTICATED state. If the server issues an OK greeting then both
server and client enter NOT AUTHENTICATED state.
</t>
<t>
See <xref target="clientcert"/> for additional information on client
certificate authentication. See <xref target="iana-imaps"/> for port
registration information.
</t>
</section>
<section title="Implicit TLS for SMTP Submission">
<t>
When a TCP connection is established for the "submissions" service
(default port 465), a TLS handshake begins immediately. Clients MUST
implement the certificate validation mechanism described in <xref
target="RFC7817"/>. Once a TLS session is
established, message submission protocol data <xref target="RFC6409"/>
is exchanged as TLS application data for the remainder of the TCP
connection.  (Note: the "submissions" service name is defined in
section 10.3 of this document, and follows the usual convention that
the name of a service layered on top of Implicit TLS consists of the
name of the service as used without TLS, with an "s" appended.)
</t>
<t>The STARTTLS mechanism on port 587 is relatively widely deployed due
to the situation with port 465 (discussed in <xref
target="iana-submissions"/>). This differs from IMAP and POP services
where implicit TLS is more widely deployed on servers than STARTTLS. It
is desirable to migrate core protocols used by MUA software to implicit
TLS over time for consistency as well as the additional reasons
discussed in <xref target="design"/>. However, to maximize use of
encryption for submission it is desirable to support both mechanisms for
Message Submission over TLS for a transition period of several years. As
a result, clients and servers SHOULD implement both STARTTLS on port 587
and implicit TLS on port 465 for this transition period. Note that there
is no significant difference between the security properties of STARTTLS
on port 587 and implicit TLS on port 465 if the implementations are
correct and both client and server are configured to require successful
negotiation of TLS prior to message submission (as required in <xref
target="all-security"/>). </t>
<t>Note that the submissions port provides access to a Mail Submission
Agent (MSA) as defined in <xref target="RFC6409"/> so requirements
and recommendations for MSAs in that document apply to the
submissions port, including the requirement to implement SMTP AUTH
<xref target="RFC4954"/>.</t>
<t>
See <xref target="clientcert"/> for additional information on client
certificate authentication. See <xref target="iana-submissions"/> for port
registration information.
</t>
</section>
<section title="Implicit TLS Connection Closure for POP, IMAP and SMTP">
<t>
When a client or server wishes to close the connection, it SHOULD
initiate the exchange of TLS close alerts before TCP connection
termination. The client MAY, after sending a TLS close alert, gracefully
close the TCP connection without waiting for a TLS response from the
server.
</t>
</section>
</section>

<section title="Email Security Upgrading Using Security Directives">
<t>
Once an improved email security mechanism is deployed and
ready for general use, it is desirable to continue using it for all
future email service. For example, TLS is widely deployed in email
software, but use of TLS is often not required. At the time this is
written, deployed mail user agents (MUAs) <xref target="RFC5598"/>
usually make a determination if TLS is available when an account is
first configured and may require use of TLS with that account if and
only if it was initially available. If the service provider makes TLS
available after initial client configuration, many MUAs will not notice
the change.
</t>
<t>
Alternatively, a security feature may be purely opportunistic and thus
subject to downgrade attacks. For example, at the time this was written,
most TLS stacks that support TLS 1.2 will use an older TLS version if
the peer does not support TLS 1.2 and many do so without alerting the
user of the reduced security. Thus a variety of active attacks could
cause the loss of TLS 1.2 benefits. Only if client policy is upgraded to
require TLS 1.2 can the client prevent all downgrade attacks. However,
this sort of security policy upgrade will be ignored by most users
unless it is automated.
</t>
<t>
This section describes a mechanism, called "security directives", which is
designed to permit an MUA to recognize when a service provider has
committed to provide certain server security features, and that it's
safe for the client to change its configuration for that account to
require that such features be present in future sessions with that
server. When an MUA implements both confidentiality assurance levels and
security directives, then both the end-user and the service provider
independently have the ability to improve the end-user's confidentiality.
</t>
<t>
A security directive has the following formal syntax:
<figure>
<artwork type="abnf">
  directive        =  directive-name [ "=" directive-value ]
  
  directive-name   =  token
  
  directive-value  =  token
  
  token            =  &lt;As defined in RFC 7230&gt;
</artwork>
</figure>
This is a subset of the syntax used by HSTS <xref target="RFC6797"/> as
revised in <xref target="RFC7230"/>; but simplified for use by protocols
other than HTTP.
</t>
</section>
<section title="Server Strict Transport Security Policy">
<t>
Servers supporting this extension MUST advertise an STS policy. This
includes a list of security directives the server administrator has
explicitly configured as recommended for use by clients (the list MAY be
empty). When a server advertises a security directive associated with a
security facility, it is making a commitment to support that facility
(or a revised version of that facility) indefinitely and recommending
that the client save that directive with the account configuration and
require that security facility for future connections to that server.
</t>
<t>
Server STS policy may also include a "sts-url" directive with a
value containing an https Uniform Resource Locator (URL) <xref
target="RFC2818"/> that the client can save and subsequently resolve for
the user in the event of a security connection problem. Server STS
policy has the following formal syntax:
<figure>
<artwork type="abnf"><![CDATA[
  sts-policy        =  [directive *(";" [SP] directive)]
]]></artwork>
</figure>
Protocol extensions to advertise STS policy for email servers are
defined in <xref target="sts-policy"/>.
</t>
<t>The IANA Considerations <xref target="iana"/> defines a registry so
that more directives can be defined in the future. Three initial
directives are defined for use by MUAs in <xref target="iana-initial-security-directives"/>: tls-version, sts-url and
tls-cert.</t>
</section>
<section title="Client Storage of Email Security Directives">
<t>
Before a client can consider storing any security directives, it MUST verify
that the connection to the server uses TLS, the server has
been authenticated, and any requirements for any previously saved
security directives are met. Then the client performs the following steps for
each security directive in the STS policy:
<list style="numbers">
<t>If the security directive name is not known to the client, skip to the next directive.</t>
<t>If the security directive is already saved with the same value (or a value considered greater than the current value in the directive's definition),
the client skips the security directive and moves on to the next one.</t>
<t>The client verifies the connection meets the requirements of the
security directive. If the connection does not, then the directive will not be
saved.</t>
<t>If previous steps pass, the client SHOULD update the current account configuration to save the security directive.</t>
</list>
Once a security directive is saved, all subsequent connections to that
host require any associated security feature. For this confidentiality
protection to work as desired clients MUST NOT offer a
click-through-to-connect action when unable to achieve connection
security matching the saved security directives.
</t>
<section title="Security Directive Upgrade Example">
<t>
Suppose a server advertises the "tls-version" directive name with value
"1.1". A client that successfully negotiates either TLS 1.1 or TLS 1.2
SHOULD save this directive. The server may subsequently change the value
to "1.2". When a client with "1.1" saved value connects and negotiates
TLS 1.2, it will upgrade the saved directive value to "1.2". However, a
client that only supports TLS 1.1 will continue to require use of TLS
1.1 and work with that server as long as it permits TLS 1.1. This way
individual clients can require the newer/stronger protocol (e.g., TLS
1.2), while older clients can continue to communicate securely (albeit
potentially less so) using the older protocol.
</t>
</section>
<section anchor="policy-fail" title="Security Policy Failures">
<t>
When a security directive has been saved for connections from a client to
a server and the facility identified by that directive is no longer available,
this results in a connection failure. An MUA SHOULD inform the user of a
potential threat to their confidentiality and offer to resolve a
previously-recorded sts-url https URL if one is available. MUAs are
discouraged from offering a lightweight option to reset or ignore
directives as this defeats the benefit they provide to end users.
</t>
</section>
</section>

<section anchor="tls-received" title="Recording TLS Cipher Suite in Received Header">
<t>
The ESMTPS transmission type <xref target="RFC3848"/> provides trace
information that can indicate TLS was used when transferring mail.
However, TLS usage by itself is not a guarantee of confidentiality or
security. The TLS cipher suite provides additional information about the
level of security made available for a connection. This defines a new
SMTP "tls" Received header additional-registered-clause that is used to
record the TLS cipher suite that was negotiated for the connection. The
value included in this additional clause SHOULD be the registered cipher
suite name (e.g., TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) included in the TLS
cipher suite registry. In the event the implementation does not know the
name of the cipher suite (a situation that should be remedied promptly),
a four-digit hexadecimal cipher suite identifier MAY be used. The ABNF
for the field follows:
<figure>
<artwork type="abnf">
  tls-cipher-clause  =  CFWS "tls" FWS tls-cipher

  tls-cipher         =  tls-cipher-suite-name / tls-cipher-suite-hex

  tls-cipher-name    =  ALPHA *(ALPHA / DIGIT / "_")
                        ; as registered in IANA cipher suite registry

  tls-cipher-hex     =  "0x" 4HEXDIG
</artwork>
</figure>
</t>
</section>

<section anchor="sts-policy" title="Extensions for STS Policy and Reporting">
<t>
This memo defines optional mechanisms for use by MUAs to communicate
saved STS policy to servers and for servers to advertise policy. 
One purpose of such mechanisms is to permit servers to determine which
and how many clients have saved security directives, and thus, to
permit operators to be aware of potential impact to their users should
support for such facilities be changed. For IMAP, the existing ID
command is extended to provide this capability. For SMTP Submission, a
new CLIENT command is defined. No similar mechanism is defined for POP
in this version of the memo to keep POP simpler, but one may be added in
the future if deemed necessary.
</t>
<t>
In addition, for each of IMAP, POP, and SMTP, a new STS capability is
defined so the client can access the server's STS policy.
</t>
<section anchor="imap-ext" title="IMAP STS Extension">
<t>
When an IMAP server advertises the STS capability, that indicates the IMAP server implements IMAP4 ID <xref target="RFC2971"/> with additional field values defined here. This is grouped with the ID command because that is the existing IMAP mechanism for clients to report data for server logging, and provides a way for the server to report the STS policy.
<list style="hanging">
<t hangText="sts">From server to client, the argument to this ID field is the server STS policy. Servers MUST provide this information in response to an ID command.</t>
<t hangText="saved">From client to server, this is a list of security directives the client has saved
for this server (the client MAY omit the value for the sts-url
directive in this context). Servers MAY record this information so
administrators know the expected security properties of the client and
can thus act to avoid security policy failures (e.g., by renewing server
certificates on time, etc).</t>
<t hangText="policy-fail">From client to server, a
list including one or more security directives the client has saved that
the client was unable to achieve. This allows clients to report errors
to the server prior to terminating the connection in the event an
acceptable security level is unavailable.</t>
<t hangText="directives">From client to server, this is a list of security directive names the client supports that are not saved.</t>
<t hangText="tls">Server-side IMAP proxies that accept TLS connections from clients and connect in-the-clear over a fully private secure network to the server SHOULD use this field to report the tls-cipher (syntax as defined in <xref target="tls-received"/>) to the server.</t>
</list>
IMAP clients SHOULD use the IMAP ID command to report policy failures and determine the server STS policy. Clients MAY use the ID command to report other security directive information. IMAP servers MUST implement the ID command at least to report STS policy to clients.
</t>
<figure title="Example 1"><artwork><![CDATA[
  <client connected to port 993 and negotiated TLS successfully>
  S: * OK [CAPABILITY IMAP4rev1 STS ID AUTH=PLAIN
          AUTH=SCRAM-SHA-1] hello
  C: a001 ID ("name" "Demo Mail" "version" "1.5" "saved"
          "tls-version=1.1; tls-cert"
          "directives" "tls-version=1.2")
  S: * ID ("name" "Demo Server" "version" "1.7" "sts-policy"
           "tls-version=1.1; tls-cert;
           sts-url=https://www.example.com/security-support.html")
  S: a001 OK ID completed
]]></artwork></figure>
<t>This example shows a client that successfully negotiated TLS version
1.1 or later and verified the server's certificate as required by IMAP.
Even if the client successfully validates the server certificate, it
will not require tls-version 1.2 in the future as the server does not
advertise that version as policy. The client has not yet saved an STS
URL, but if the client successfully validated the server certificate, it
will save the provided URL.</t>
<figure title="Example 2"><artwork><![CDATA[
  <client connected to port 993 and negotiated TLS successfully>
  S: * OK [CAPABILITY IMAP4rev1 DEEP ID AUTH=PLAIN
          AUTH=SCRAM-SHA-1] hello
  C: a001 ID ("name" "Demo Mail" "version" "1.5" "policy-failure"
          "tls-cert=pkix")
  S: * ID ("name" "Demo Server" "version" "1.7" "sts-policy"
           "tls-version=1.1;
            sts-url=<https://www.example.com/security-support.html>")
  S: a001 OK ID completed
  C: a002 LOGOUT
]]></artwork></figure>
<t>This example shows a client that negotiated TLS, but was unable to verify the server's certificate. The policy-failure informs the server of this problem, at which point the client can disconnect. If the client had previously latched a URI for security problems from this server, it could offer to resolve that URI. However, the sts-policy in this exchange is ignored due to the latch failure.</t>
<figure title="Example 3"><artwork><![CDATA[
  <IMAP Proxy connected over private network on port 143, there is
  a client connected to the proxy on port 993 that negotiated TLS>
  S: * OK [CAPABILITY IMAP4rev1 DEEP ID AUTH=PLAIN
          AUTH=SCRAM-SHA-1] hello
  C: a001 ID ("name" "Demo Mail" "version" "1.5" "saved"
          "tls-version=1.1; tls-cert=pkix"
          "tls" "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256")
  S: * ID ("name" "Demo Server" "version" "1.7" "sts-policy"
           "tls-version=1.1; tls-cert=pkix;
           sts-url=https://www.example.com/support.html")
  S: a001 OK ID completed
]]></artwork></figure>
<t>This example shows the connection from an IMAP proxy to a back-end
server. The client connected to the proxy and sent the ID command
shown in example 1, and the proxy has added the "tls" item to the ID
command so the back-end server can log the cipher suite that was used
on the connection from the client.</t>
</section>
<section anchor="pop-ext" title="POP DEEP Extension">
<t>
POP servers supporting this specification MUST implement the POP3
extension mechanism <xref target="RFC2449"/>. POP servers MUST
advertise the DEEP capability with an argument indicating the server's
DEEP status.
</t>
<figure title="Example 4"><artwork><![CDATA[
  <client connected to port 995 and negotiated TLS successfully>
  S: +OK POP server ready
  C: CAPA
  S: +OK Capability list follows
  S: TOP
  S: SASL PLAIN SCRAM-SHA-1
  S: RESP-CODES
  S: PIPELINING
  S: UIDL
  S: STS tls-version=1.2
     sts-url=https://www.example.com/security-support.html>
  S: .
]]></artwork></figure>
<t>After verifying the TLS server certificate and issuing CAPA, the
client can save any or all of the STS policy. If the client connects
to this same server later and has a security failure, the client can
direct the user's browser to the previously-saved URL where the
service provider can provide advice to the end user.</t>
</section>
<section anchor="smtp-ext" title="SMTP MSTS Extension">
<t>
SMTP Submission servers supporting this specification MUST implement the
MSTS SMTP extension. The name of this extension is MSTS. The EHLO
keyword value is MSTS and the sts-policy ABNF is the syntax of the EHLO
keyword parameters. This does not add parameters to the MAIL FROM or
RCPT TO commands. This also adds a CLIENT command to SMTP which is used
to report client information to the server. The formal syntax for the
command follows:
</t>
<figure><artwork type="abnf"><![CDATA[
  deep-cmd             = "CLIENT" 1*(SP deep-parameter)
  
  deep-parameter       = name / version / latch / policy-fail
                         / directives / tls / future-extension

  name                 = "name" SP esmtp-value
  
  version              = "version" SP esmtp-value
  
  saved                = "saved" SP directive-list

  policy-fail          = "policy-fail" SP directive-list

  directive-list       = DQUOTE [directive
                         *(";" [SP] directive)] DQUOTE

  directives           = "directives" SP directive-list
  
  tls                  = "tls" SP tls-cipher
  
  future-extension     = Atom SP String
  
  Atom                 = <as defined in RFC 5321>

  String               = <as defined in RFC 5321>
]]></artwork></figure>
<t>
The CLIENT command parameters listed here have the same meaning as the parameters used in the IMAP STS extension (<xref target="imap-ext"/>). The server responds to the CLIENT command with a "250" if the command has correct syntax and a "501" if the command has incorrect syntax.
<figure title="Example 5"><artwork><![CDATA[
  <client connected to port 465 and negotiated TLS successfully>
  S: 220 example.com Demo SMTP Submission Server
  C: EHLO client.example.com
  S: 250-example.com
  S: 250-8BITMIME
  S: 250-PIPELINING
  S: 250-DSN
  S: 250-AUTH PLAIN LOGIN
  S: 250-MSTS tls-version=1.2; tls-cert;
     sts-url=<https://www.example.com/status.html>
  S: 250-BURL imap
  S: 250 SIZE 0
  C: CLIENT name demo_submit version 1.5 saved "tls-version=1.1;
     tls-cert=pkix" directives "tls-version=1.2"
  S: 250 OK
]]></artwork></figure>
</t>
</section>
</section>

<section title="Account Setup Considerations">
<section title="Use of SRV records in Establishing Configuration">
<t>This section updates <xref target="RFC6186"/> by changing the
preference rules and adding a new SRV service label _submissions._tcp to
refer to Message Submission with implicit TLS.</t>
<t>User-configurable MUAs SHOULD support use of <xref target="RFC6186"
/> for account setup. However, when using configuration information
obtained by this method, MUAs SHOULD default to a high confidentiality
assurance level, unless the user has explicitly requested reduced
confidentiality. This will have the effect of causing the MUA to ignore
advertised configurations that do not support TLS, even when those
advertised configurations have a higher priority than other advertised
configurations.</t>
<t>When using <xref target="RFC6186"/> configuration information, Mail
User Agents SHOULD NOT automatically establish new configurations that
do not require TLS for all servers, unless there are no advertised
configurations using TLS. If such a configuration is chosen, prior to
attempting to authenticate to the server or use the server for message
submission, the MUA SHOULD warn the user that traffic to that server
will not be encrypted and that it will therefore likely be intercepted
by unauthorized parties. The specific wording is to be determined by the
implementation, but it should adequately capture the sense of risk given
the widespread incidence of mass surveillance of email traffic.
</t>
<t>When establishing a new configuration for connecting to an IMAP,
POP, or SMTP Submission server, an MUA SHOULD NOT blindly trust SRV
records unless they are signed by DNSSEC and have a valid
signature. Instead, the MUA SHOULD warn the user that the
DNS-advertised mechanism for connecting to the server is not
authenticated, and request the user to manually verify the connection
details by reference to his or her mail service provider's
documentation.</t>
<t>Similarly, an MUA MUST NOT consult SRV records to determine which
servers to use on every connection attempt, unless those SRV records are
signed by DNSSEC and have a valid signature. However, an MUA MAY
consult SRV records from time to time to determine if an MSP's server
configuration has changed, and alert the user if it appears that this
has happened. This can also serve as a means to encourage users to
upgrade their configurations to require TLS if and when their MSPs
support it.</t>
</section>

<section title="Certificate Pinning">
<t>
During account setup, the MUA will identify servers that provide account services such as mail access and mail submission (the previous section describes one way to do this). The certificates for these servers are verified using the rules described in <xref target="RFC7817"/> and PKIX <xref target="RFC5280"/>. In the event the certificate does not validate due to an expired certificate, lack of appropriate chain of trust or lack of identifier match, the MUA MAY create a persistent binding between that certificate and the saved host name for the server. This is called certificate pinning. Certificate pinning is only appropriate during account setup and MUST NOT be offered in response to a failed certificate validation for an existing account. An
MUA that allows certificate pinning MUST NOT allow a certificate pinned
for one account to validate connections for other accounts.
</t>
<t>
A pinned certificate is subject to a man-in-the-middle attack at account
setup time, and lacks a mechanism to revoke or securely refresh the
certificate. Therefore use of a pinned certificate does not provide a
high confidentiality assurance and an MUA MUST NOT indicate a high level
for an account or connection using a pinned certificate. Additional advice on certificate pinning is present in <xref target="RFC6125"/>.
</t>
</section>
</section>

<section title="Implementation Requirements">
<t>This section details requirements for implementations of electronic
mail protocol clients and servers. A requirement for a client or server
implementation to support a particular feature is not the same thing as
a requirement that a client or server running a conforming
implementation be configured to use that feature. Requirements for Mail
Service Providers (MSPs) are distinct from requirements for protocol
implementations, and are listed in a separate section.</t>

<section anchor="all-security" title="All Implementations (Client and Server)">
<t>These requirements apply to MUAs as well as POP, IMAP and SMTP
Submission servers.
<list style="symbols">
<t>All implementations MUST be configurable to support implicit TLS
using the TLS 1.2 protocol or later <xref target="RFC5246"/>.</t>
<t>All implementations MUST implement the recommended cipher suites
described in <xref target="RFC7525"/> or a future BCP or standards track
revision of that document.</t>
<t>All implementations MUST be configurable to require TLS before
performing any operation other than capability discovery and STARTTLS.</t>
<t>The <xref target="RFC3501">IMAP specification</xref> is hereby
modified to revoke the second paragraph of section 11.1 and replace it
with the text from the first three bullet items in this list. See
Appendix B of <xref target="RFC7817"/> to see
additional modifications to IMAP certificate validation rules.</t>
<t>The standard for use of <xref target="RFC2595">TLS with IMAP, POP3
and ACAP</xref> is modified to revoke section 2.1 and replace it with
the text from the first three bullet items in this list. See
Appendix B of <xref target="RFC7817"/> to see
additional modifications to RFC 2595 certificate validation rules.</t>
<t>The standard for <xref target="RFC6409">Message Submission</xref> is
updated to add the first three bullet items above to section 4.3 as well
as to require implementation of the TLS server identity check as
described in <xref target="RFC7817"/> and PKIX
<xref target="RFC5280"/>.</t>
</list>
</t>
<section anchor="clientcert" title="Client Certificate Authentication">
<t>
MUAs and mail servers MAY implement client certificate authentication
on the implicit TLS port. Servers MUST NOT request a client
certificate during the TLS handshake unless the server is configured
to accept some client certificates as sufficient for authentication
and the server has the ability to determine a mail server
authorization identity matching such certificates. How to make this
determination is presently implementation specific. Clients MUST NOT
provide a client certificate during the TLS handshake unless the
server requests one and the client has determined the certificate can
be safely used with that specific server, OR the client has been
explicitly configured by the user to use that particular certificate
with that server. How to make this determination is presently
implementation specific. If the server accepts the client's
certificate as sufficient for authorization, it MUST enable the SASL
EXTERNAL <xref target="RFC4422"/> mechanism. An IMAPS server MAY issue
a PREAUTH greeting instead of enabling SASL EXTERNAL. A client
supporting client certificate authentication with implicit TLS MUST
implement the SASL EXTERNAL <xref target="RFC4422"/> mechanism using
the appropriate authentication command (AUTH for POP3 <xref
target="RFC5034"/>, AUTH for SMTP Submission <xref target="RFC4954"/>,
AUTHENTICATE for IMAP <xref target="RFC3501"/>).
</t>
</section>
</section>

<section title="Mail Server Implementation Requirements">
<t>These requirements apply to servers that implement POP, IMAP or
SMTP Submission.
<list style="symbols">
<t>Servers MUST implement the DEEP extension described in <xref target="sts-policy"/></t>
<t>IMAP and SMTP submission servers SHOULD implement and be configurable
to support STARTTLS. This enables discovery of new TLS availability, and
can increase usage of TLS by legacy clients.</t>
<t>Servers MUST NOT advertise STARTTLS if it is unlikely to succeed
based on server configuration (e.g., there is no server certificate
installed).</t>
<t>SMTP message submission servers that have negotiated TLS SHOULD add
a Received header field to the message including the tls clause
described in <xref target="tls-received"/>.</t>
<t>Servers MUST be configurable to include the TLS cipher information
in any connection or user logging or auditing facility they
provide.</t>
</list>
</t>
</section>

<section title="Mail User Agent Implementation Requirements">
<t>This section describes requirements on Mail User Agents (MUAs) using
IMAP, POP, and/or Submission protocols. Note: Requirements pertaining to
use of Submission servers are also applicable to use of SMTP servers
(e.g., port 25) for mail submission.
<list style="symbols">
<t>User agents SHOULD indicate to users at configuration time, the
expected level of confidentiality based on appropriate security inputs
such as which security directives are pre-set, the number of trust anchors,
certificate validity, use of an extended validation certificate, TLS
version supported, and TLS cipher suites supported by both server and
client. This indication SHOULD also be present when editing or viewing
account configuration.</t>
<t>MUAs SHOULD detect when STARTTLS and/or implicit TLS becomes
available for a protocol and set the tls-version=1.1 directive if the server
advertises the tls-version=1.1 security policy after a successful TLS
negotiation.</t>
<t>Whenever requested to establish any configuration that does not
require both TLS and server certificate verification to talk to a
server or account, an MUA SHOULD warn its user that his or her mail
traffic (including password, if applicable) will be exposed to
attackers, and give the user an opportunity to abort the connection
prior to transmission of any such password or traffic.</t>
<t>MUAs SHOULD implement the "tls-version=1.2" security directive (the TLS library has
to provide an API that controls permissible TLS versions and
communicates the negotiated TLS protocol version to the application for
this to be possible).</t>
<t>See <xref target="mua-assurance"/> for additional requirements.</t>
</list>
</t>
</section>

<section title="Non-configurable MUAs and nonstandard access protocols">
<t>MUAs which are not configurable to use user-specified servers MUST
implement TLS or similarly other strong encryption mechanism when
communicating with their mail servers.  This generally applies to MUAs
that are pre-configured to operate with one or more specific services,
whether or not supplied by the vendor of those services.</t>
<t>MUAs using protocols other than IMAP, POP, and Submission to
communicate with mail servers, MUST implement TLS or other similarly
robust encryption mechanism in conjunction with those protocols.</t>
</section>

<section title="DEEP Compliance for Anti-Virus/Anti-Spam Software and Services">
<t>There are multiple ways to connect an Anti-Virus and/or Anti-Spam
(AVAS) service to a mail server. Some mechanisms, such as the de-facto
milter protocol do not impact DEEP. However, some services use an SMTP
relay proxy that intercepts mail at the application layer to perform a
scan and proxy or forward to another MTA. Deploying AVAS services in
this way can cause many problems <xref target="RFC2979"/> including
direct interference with DEEP and confidentiality or security reduction.
An AVAS product or service is considered DEEP compliant if all IMAP, POP
and SMTP-related software it includes is DEEP compliant and it
advertises and supports all security directives that the actual
servers advertise.</t>

<t>Note that end-to-end email encryption prevents AVAS software and
services from using email content as part of a spam or virus assessment.
Furthermore, while DEEP high confidentiality assurance can prevent a
man-in-the-middle from introducing spam or virus content between the MUA
and Submission server, it does not prevent other forms of client or
account compromise so use of AVAS services for submitted email remains
necessary.</t>
</section>
</section>

<section title="Mail Service Provider Requirements">
  <t>This section details requirements for providers of IMAP, POP, and/or
  SMTP submission services, for providers who claim to conform to this
  specification.</t>
  <section title="Server Requirements">
    <t>Mail Service Providers MUST use server implementations that
    conform to this specification.</t>
  </section>
  <section title="MSPs MUST provide Submission Servers">
    <t>This document updates the advice in <xref target="RFC5068"/> by
    making Implicit TLS on port 465 the preferred submission port.</t>
  
    <t>Mail Service Providers that accept mail submissions from
    end-users using the Internet Protocol MUST provide one or more SMTP
    Submission services, separate from the SMTP MTA services
    used to process incoming mail. Those submission services MUST be
    configured to support Implicit TLS on port 465 and SHOULD support
    STARTTLS if port 587 is used.</t>

    <t>MSPs MAY also support submission of messages via one or
    more designated SMTP servers to facilitate compatibility with
    legacy MUAs.</t>

    <t>Discussion: SMTP servers used to accept incoming mail or to
    relay mail are expected to accept mail in cleartext.  This is
    incompatible with the purpose of this memo which is to encourage
    encryption of traffic between mail servers.  There is no such
    requirement for mail submission servers to accept mail in
    cleartext or without authentication.  For other reasons, use of
    separate SMTP submission servers has been best practice for many
    years.</t>
  </section>
  <section title="TLS Server Certificate Requirements">
    <t>MSPs MUST maintain valid server certificates for all servers.
    See <xref target="RFC7817"/> for the
    recommendations and requirements necessary to achieve this.</t>
    <!--
    <t>A single certificate MAY be used for multiple electronic
    mail protocol servers (including webmail) which all providing
    service for a particular mail domain, but use of the same
    certificate for services other than electronic mail is
    discouraged.</t>
    -->
    <t>If a protocol server provides service for more than one
    mail domain, it MAY use a separate IP address for each domain
    and/or a server certificate that advertises multiple
    domains. This will generally be necessary unless and until it
    is acceptable to impose the constraint that the server and all
    clients support the Server Name Indication extension to
    TLS <xref target="RFC6066"/>. For more discussion of this problem,
    see section 5.1 of <xref target="RFC7817"/>.</t>
  </section>
  <section title="Recommended DNS records for mail protocol servers">
    <t>This section discusses not only the DNS records that are
    recommended, but also implications of DNS records for server
    configuration and TLS server certificates.</t>
    <section title="MX records">
      <t>It is recommended that MSPs advertise MX records
      for handling of inbound mail (instead of relying entirely on
      A or AAAA records), and that those MX records be signed
      using DNSSEC.  This is mentioned here only for completeness,
      as handling of inbound mail is out of scope for this
      document.</t>
    </section>
    <section title="SRV records">
      <t>MSPs SHOULD advertise SRV records to aid MUAs in
      determination of proper configuration of servers, per the
      instructions in <xref target="RFC6186"/>.</t>
      <t>MSPs SHOULD advertise servers that support Implicit TLS
      in preference to those which support cleartext and/or
      STARTTLS operation.</t>
    </section>
    <section title="DNSSEC">
      <t>All DNS records advertised by an MSP as a means of aiding
      clients in communicating with the MSP's servers, SHOULD be
      signed using DNSSEC.</t>
    </section>
    <section title="TLSA records">
      <t>MSPs SHOULD advertise TLSA records to provide an
      additional trust anchor for public keys used in TLS server
      certificates.  However, TLSA records MUST NOT be advertised
      unless they are signed using DNSSEC.</t>
    </section>
  </section>
  <section title="MSP Server Monitoring">
    <t>MSPs SHOULD regularly and frequently monitor their various
    servers to make sure that: TLS server certificates remain valid
    and are not about to expire, TLSA records match the public keys
    advertised in server certificates, are signed using DNSSEC, server
    configurations are consistent with SRV advertisements, and DNSSEC
    signatures are valid and verifiable. Failure to detect expired
    certificates and DNS configuration errors in a timely fashion can
    result in significant loss of service for an MSP's users and a
    significant support burden for the MSP.</t>
  </section>
  <section title="Advertisement of DEEP status">
    <t>MSPs SHOULD advertise a DEEP status that includes tls11, tls-cert
    and an HTTPS URL that can be used to inform clients of service
    outages or problems impacting client confidentiality. Note that
    advertising tls-cert is a commitment to maintain and renew server
    certificates.</t>
  </section>
  <section title="Require TLS">
    <t>New servers and services SHOULD be configured to require TLS
    unless it's necessary to support legacy clients or existing client
    configurations.</t>
  </section>
  <section title="Changes to Internet Facing Servers">
    <t>When an MSP changes the Internet Facing Servers providing mail access and mail submission services, including SMTP-based spam/virus filters, it is generally necessary to support the same and/or a newer version of TLS and the same security directives that were previously advertised.</t>
  </section>
</section>

<section anchor="iana" title="IANA Considerations">
<section anchor="iana-directive" title="Security Directive Registry">
<t>IANA shall create (has created) the registry "STS Security Directives". This registry is a single table and will use an expert review process <xref target="RFC5226"/>. Each registration will contain the following fields:
<list style="hanging">
<t hangText="Name:">The name of the security directive. This follows the directive-name ABNF.</t>
<t hangText="Value:">The permitted values of the security directive. This should also explain if the value is optional or mandatory and what to do if the value is not recognized.</t>
<t hangText="Description:">This describes the meaning of the security directive and the conditions under which the directive is saved.</t>
<t hangText="Scope:">The protocols to which this security directive applies. Presently this may be MSTS (for MUA STS), HSTS (for HTTP STS), or ALL.</t>
<t hangText="Intended Usage:">One of COMMON, LIMITED USE or OBSOLETE.</t>
<t hangText="Reference:">Optional reference to specification.</t>
<t hangText="Submitter:">The identify of the submitter or submitters.</t>
<t hangText="Change Controller:">The identity of the change controller
for the registration. This will be "IESG" in case of registrations in
IETF-produced documents.</t>
</list>
The expert reviewer will verify the directive name follows the ABNF, and
that the value and description fields are clear, unambiguous, do not
overlap existing deployed technology, do not create security problems
and appropriately considers interoperability issues. Email security
directives intended for LIMITED USE have a lower review bar
(interoperability and overlap issues are less of a concern). The
reviewer may approve a registration, reject for a stated reason or
recommend the proposal have standards track review due to importance or
difficult subtleties.
</t>
<t>
Standards-track registrations may be updated if the relevant standards
are updated as a consequence of that action. Non-standards-track entries
may be updated by the listed change controller. The entry's name and
submitter may not be changed. In exceptional cases, any aspect of any
registered entity may be updated at the direction of the IESG (for
example, to correct a conflict).
</t>
</section>

<section anchor="iana-initial-security-directives" title="Initial Set of Security Directives">
<t>This document defines three initial security directives for the registry as follows, and registers the two additional directives specified in <xref target="RFC6797"/>.
<list style="hanging">
<t hangText="Name:">tls-version</t>
<t hangText="Value:">Mandatory; 1.1 refers to <xref target="RFC4346"/> or later and 1.2 refers to <xref target="RFC5246"/> or later. Future versions may be added; this is ignored if the version is unrecognized.</t>
<t hangText="Description:">This directive indicates that the TLS version
negotiated must be the specified version or later. In the event this
directive is saved and only an older TLS version is available, that
results in STS policy failure.</t>
<t hangText="Scope:">MUA only</t>
<t hangText="Intended Usage:">COMMON</t>
<t hangText="Reference:">RFC XXXX (this document once published)</t>
<t hangText="Submitter:">Authors of this document</t>
<t hangText="Change Controller:">IESG</t>
</list>
<list style="hanging">
<t hangText="Name:">tls-cert</t>
<t hangText="Value:">Optional; pkix refers to PKIX certificate validation, dane refers to DANE certificate validation, any refers to any validation mechanism the client considers acceptable. If no value is provided, "any" is assumed.</t>
<t hangText="Description:">This directive indicates that TLS was
successfully negotiated and the server certificate was successfully
verified by the client using PKIX <xref target="RFC5280"/> or DANE <xref
target="RFC6698"/> and the server certificate identity was verified
using the algorithm appropriate for the protocol (see <xref
target="tls-implicit"/>). This directive is saved if the client sees
this in the advertised server STS policy after successfully negotiating
TLS and verifying the certificate and server identity. For the HSTS
protocol, this directive (with the "any" value) is implied by the
presence of the Strict-Transport-Security header, as a result it is
never specified in that protocol.</t>
<t hangText="Scope:">MUA only</t>
<t hangText="Intended Usage:">COMMON</t>
<t hangText="Reference:">RFC XXXX (this document once published)</t>
<t hangText="Submitter:">Authors of this document</t>
<t hangText="Change Controller:">IESG</t>
</list>
<list style="hanging">
<t hangText="Name:">sts-url</t>
<t hangText="Value:">Mandatory for server-policy, optional for client reporting. The value is an https URL.</t>
<t hangText="Description:">This directive indicates that the client
SHOULD resolve (with appropriate certificate validation) and display the
URL in the event of a policy failure.</t>
<t hangText="Scope:">MUA only</t>
<t hangText="Intended Usage:">COMMON</t>
<t hangText="Reference:">RFC XXXX (this document once published)</t>
<t hangText="Submitter:">Authors of this document</t>
<t hangText="Change Controller:">IESG</t>
</list>
<list style="hanging">
<t hangText="Name:">max-age</t>
<t hangText="Value:">see <xref target="RFC6797"/>.</t>
<t hangText="Description:">see <xref target="RFC6797"/>.</t>
<t hangText="Scope:">HSTS only</t>
<t hangText="Intended Usage:">COMMON</t>
<t hangText="Reference:"><xref target="RFC6797"/></t>
<t hangText="Submitter:">Authors of this document</t>
<t hangText="Change Controller:">IESG</t>
</list>
<list style="hanging">
<t hangText="Name:">includeSubDomains</t>
<t hangText="Value:">None</t>
<t hangText="Description:">see <xref target="RFC6797"/>.</t>
<t hangText="Scope:">HSTS only</t>
<t hangText="Intended Usage:">COMMON</t>
<t hangText="Reference:"><xref target="RFC6797"/></t>
<t hangText="Submitter:">Authors of this document</t>
<t hangText="Change Controller:">IESG</t>
</list>
</t>
</section>

<section anchor="iana-pop3s" title="POP3S Port Registration Update">
<t>
IANA is asked to update the registration of the TCP well-known port 995 using the following template (<xref target="RFC6335"/>):
<figure>
<artwork>
  Service Name: pop3s
  Transport Protocol: TCP
  Assignee: IETF &lt;iesg@ietf.org&gt;
  Contact: IESG &lt;iesg@ietf.org&gt;
  Description: POP3 over TLS protocol
  Reference: RFC XXXX (this document once published) <!-- &rfc.number; -->
  Port Number: 995
</artwork></figure>
</t>
</section>
<section anchor="iana-imaps" title="IMAPS Port Registration Update">
<t>
IANA is asked to update the registration of the TCP well-known port 993 using the following template (<xref target="RFC6335"/>):
<figure>
<artwork>
  Service Name: imaps
  Transport Protocol: TCP
  Assignee: IETF &lt;iesg@ietf.org&gt;
  Contact: IESG &lt;iesg@ietf.org&gt;
  Description: IMAP over TLS protocol
  Reference: RFC XXXX (this document once published) <!-- &rfc.number; -->
  Port Number: 993
</artwork></figure>
</t>
</section>
<section anchor="iana-submissions" title="Submissions Port Registration">
<t>
IANA is asked to assign an alternate usage of port 465 in addition to the current assignment using the following template (<xref target="RFC6335"/>):
<figure>
<artwork>
  Service Name: submissions
  Transport Protocol: TCP
  Assignee: IETF &lt;iesg@ietf.org&gt;
  Contact: IESG &lt;iesg@ietf.org&gt;
  Description: Message Submission over TLS protocol
  Reference: RFC XXXX (this document once published) <!-- &rfc.number; -->
  Port Number: 465
</artwork></figure>
</t>
<t>
This is a one time procedural exception to the rules in RFC 6335. This
requires explicit IESG approval and does not set a precedent.
Historically, port 465 was briefly registered as the "smtps" port. This
registration made no sense as the SMTP transport MX infrastructure has
no way to specify a port so port 25 is always used. As a result, the
registration was revoked and was subsequently reassigned to a different
service. In hindsight, the "smtps" registration should have been renamed
or reserved rather than revoked. Unfortunately, some widely deployed
mail software interpreted "smtps" as "submissions" <xref
target="RFC6409"/> and used that port for email submission by default
when an end-user requests security during account setup. If a new port
is assigned for the submissions service, email software will either
continue with unregistered use of port 465 (leaving the port registry
inaccurate relative to de-facto practice and wasting a well-known port),
or confusion between the de-facto and registered ports will cause
harmful interoperability problems that will deter use of TLS for message
submission. The authors believe both of these outcomes are less
desirable than a wart in the registry documenting real-world usage of
a port for two purposes. Although STARTTLS-on-port-587 has deployed, it
has not replaced deployed use of implicit TLS submission on port 465.
</t>
</section>
<section title="STS IMAP Capability">
<t>This document adds the STS capability to the IMAP capabilities registry. This is described in <xref target="imap-ext"/>.</t>
</section>
<section title="STS POP3 Capability">
<t>This document adds the STS capability to the POP3 capabilities registry.
<list style="hanging">
<t hangText="CAPA Tag:">STS</t>
<t hangText="Arguments:">sts-policy</t>
<t hangText="Added Commands:">none</t>
<t hangText="Standard Commands affected:">none</t>
<t hangText="Announced status / possible differences:">both / may change after STLS</t>
<t hangText="Commands Valid in States:">N/A</t>
<t hangText="Specification Reference:">This document</t>
<t hangText="Discussion:">See <xref target="pop-ext"/>.</t>
</list>
</t>
</section>
<section title="MSTS SMTP EHLO Keyword">
<t>This document adds the MSTS EHLO Keyword to the SMTP Service Extension registry. This is described in <xref target="smtp-ext"/>.</t>
</section>
<section title="MAIL Parameters Additional-registered-clauses Sub-Registry">
<t>
This document adds the following entry to the "Additional-registered-clauses" sub-registry of the "MAIL Parameters" registry, created by <xref target="RFC5321"/>:
<list style="hanging">
<t hangText="Clause Name:">tls</t>
<t hangText="Description:">Indicates the TLS cipher suite used for a transport connection.</t>
<t hangText="Syntax Summary:">See tls-cipher ABNF <xref target="tls-received"/></t>
<t hangText="Reference:">This document.</t>
</list>
</t>
</section>
</section>

<section title="Security Considerations">
<t>
This entire document is about security considerations. In general, this
is targeted to improve mail confidentiality and to mitigate threats external to
the email system such as network-level snooping or interception; this is
not intended to mitigate active attackers who have compromised service
provider systems.
</t>
<t>
It could be argued that sharing the name and version of the client
software with the server has privacy implications. Although providing
this information is not required, it is encouraged so that mail service
providers can more effectively inform end-users running old clients that
they need to upgrade to protect their security, or know which clients to
use in a test deployment prior to upgrading a server to have higher
security requirements.
</t>
</section>

</middle>
<back>
<references title="Normative References">
<?rfc include="reference.RFC.1939"?> <!-- POP3 -->
<?rfc include="reference.RFC.2119"?> <!-- Key words -->
<?rfc include="reference.RFC.2449"?> <!-- POP3 CAPA -->
<?rfc include="reference.RFC.2818"?> <!-- https -->
<?rfc include="reference.RFC.2971"?> <!-- IMAP ID -->
<?rfc include="reference.RFC.3207"?> <!-- SMTP STARTTLS -->
<?rfc include="reference.RFC.3501"?> <!-- IMAP -->
<?rfc include="reference.RFC.5034"?> <!-- POP3 AUTH -->
<?rfc include="reference.RFC.5068"?> <!-- Submission Operations BCP -->
<?rfc include="reference.RFC.5234"?> <!-- ABNF -->
<?rfc include="reference.RFC.5246"?> <!-- TLS 1.2 -->
<?rfc include="reference.RFC.5226"?> <!-- IANA Process -->
<?rfc include="reference.RFC.5280"?> <!-- PKIX -->
<?rfc include="reference.RFC.5321"?> <!-- SMTP -->
<?rfc include="reference.RFC.5322"?> <!-- Message Format -->
<?rfc include="reference.RFC.6186"?> <!-- SRV for email -->
<?rfc include="reference.RFC.6409"?> <!-- Message Submission -->
<?rfc include="reference.RFC.6797"?> <!-- HSTS -->
<?rfc include="reference.RFC.7230"?> <!-- HTTP ABNF -->
<?rfc include="reference.RFC.7525"?> <!-- TLS BCP -->
<?rfc include="reference.RFC.7672"?> <!-- SMTP DANE -->
<?rfc include="reference.RFC.7817"?> <!-- email certs -->
</references>
<references title="Informative References">
<?rfc include="reference.RFC.2595"?> <!-- STARTTLS for IMAP and POP -->
<?rfc include="reference.RFC.2979"?> <!-- Firewall Requirements -->
<?rfc include="reference.RFC.3848"?> <!-- ESMTP and LMTP transmission types -->
<?rfc include="reference.RFC.3887"?> <!-- MTQP -->
<?rfc include="reference.RFC.4346"?> <!-- TLS 1.1 -->
<?rfc include="reference.RFC.4422"?> <!-- SASL EXTERNAL -->
<?rfc include="reference.RFC.4954"?> <!-- SMTP AUTH -->
<?rfc include="reference.RFC.5598"?> <!-- Mail architecture -->
<?rfc include="reference.RFC.5804"?> <!-- Manage Sieve -->
<?rfc include="reference.RFC.6066"?> <!-- TLS Extensions; SNI -->
<?rfc include="reference.RFC.6125"?> <!-- Cert validation -->
<?rfc include="reference.RFC.6335"?> <!-- TCP Port Registration -->
<?rfc include="reference.RFC.6698"?> <!-- DANE TLSA -->
</references>
<section anchor="design" title="Design Considerations">
<t>
This section is not normative.
</t>
<t>
The first version of this was written independently from
draft-moore-email-tls-00.txt; subsequent versions merge ideas from both
drafts.
</t>
<t>
One author of this document was also the author of RFC 2595 that
became the standard for TLS usage with POP and IMAP, and the other
author was perhaps the first to propose that idea. In hindsight both
authors now believe that that approach was a mistake. At this point
the authors believe that while anything that makes it easier to deploy
TLS is good, the desirable end state is that these protocols always
use TLS, leaving no need for a separate port for cleartext operation
except to support legacy clients while they continue to be used. The
separate port model for TLS is inherently simpler to implement, debug
and deploy. It also enables a "generic TLS load-balancer" that accepts
secure client connections for arbitrary foo-over-TLS protocols and
forwards them to a server that may or may not support TLS. Such
load-balancers cause many problems because they violate the end-to-end
principle and the server loses the ability to log security-relevant
information about the client unless the protocol is designed to
forward that information (as this specification does for the cipher
suite). However, they can result in TLS deployment where it would not
otherwise happen which is a sufficiently important goal that it
overrides the problems.
</t>
<t>
Although STARTTLS appears only slightly more complex than separate-port
TLS, we again learned the lesson that complexity is the enemy of
security in the form of the STARTTLS command injection vulnerability
(CERT vulnerability ID #555316). Although there's nothing inherently wrong with STARTTLS, the fact it resulted in a common implementation error (made independently by multiple implementers) suggests it is a less secure architecture than Implicit TLS.
</t>
<t>
Section 7 of RFC 2595 critiques the separate-port approach to TLS. The
first bullet was a correct critique. There are proposals in the http
community to address that, and use of SRV records as described in RFC
6186 resolves that critique for email. The second bullet is correct as
well, but not very important because useful deployment of security
layers other than TLS in email is small enough to be effectively
irrelevant. The third bullet is incorrect because it misses the
desirable option of "use and latch-on TLS if available". The fourth
bullet may be correct, but is not a problem yet with current port
consumption rates. The fundamental error was prioritizing a perceived
better design based on a mostly valid critique over real-world
deployability. But getting security and confidentiality facilities
actually deployed is so important it should trump design purity
considerations.
</t>
<t>
Port 465 is presently used for two purposes: for submissions by a large
number of clients and service providers and for the "urd" protocol by
one vendor. Actually documenting this current state is controversial as
discussed in the IANA considerations section. However, there is no good
alternative. Registering a new port for submissions when port 465 is
widely used for that purpose already will just create interoperability
problems. Registering a port that's only used if advertised by an SRV
record (RFC 6186) would not create interoperability problems but would
require all client and server deployments and software to change
significantly which is contrary to the goal of promoting more TLS use.
Encouraging use of STARTTLS on port 587 would not create
interoperability problems, but is unlikely to have impact on current
undocumented use of port 465 and makes the guidance in this document
less consistent. The remaining option is to document the current
state of the world and support future use of port 465 for submission
as this increases consistency and ease-of-deployment for TLS email
submission.
</t>
</section>
<section title="Change Log">
<t>Changes since draft-ietf-uta-email-deep-04:
<list style="symbols">
<t>Swap sections 5.1 and 5.3 ("Email Security Tags" and "Server DEEP Status") as that order may aid understanding of the model. Also rewrote parts of these two sections to try to make the model clearer.</t>
<t>Add text about versioning of security tags to make the model clearer.</t>
<t>Add example of security tag upgrade.</t>
<t>Convert remaining mention of TLS 1.0 to TLS 1.1.</t>
<t>Change document title from DEEP to MUA STS to align with SMTP relay STS.
<list style="symbols">
<t>Slight updates to abstract and introductions.</t>
<t>Rename security latches/tags to security directives.</t>
<t>Rename server DEEP status to STS policy.</t>
<t>Change syntax to use directive-style HSTS syntax.</t>
</list>
</t>
<t>Make HSTS reference normative.</t>
<t>Remove SMTP DSN header as that belongs in SMTP relay STS document.</t>
</list></t>
<t>Changes since draft-ietf-uta-email-deep-03:
<list style="symbols">
<t>Add more references to ietf-uta-email-tls-certs in implementation requirements section.</t>
<t>Replace primary reference to RFC 6125 with ietf-uta-email-tls-certs, so move RFC 6125 to informative list for this specification.</t>
</list></t>
<t>Changes since draft-ietf-uta-email-deep-02:
<list style="symbols">
<t>Make reference to design considerations explicit rather than "elsewhere in this document".</t>
<t>Change provider requirement so SMTP submission services are separate from SMTP MTA services as opposed to the previous phrasing that required the servers be separate (which is too restrictive).</t>
<t>Update DANE SMTP reference</t>
</list></t>
<t>Changes since draft-ietf-uta-email-deep-01:
<list style="symbols">
<t>Change text in tls11 and tls12 registrations to clarify
certificate rules, including additional PKIX and DANE references.</t>
<t>Change from tls10 to tls11 (including reference) as the minimum.</t>
<t>Fix typo in example 5.</t>
<t>Remove open issues section; enough time has passed so not worth waiting for more input.</t>
</list></t>
<t>Changes since draft-ietf-uta-email-deep-00:
<list style="symbols">
<t>Update and clarify abstract</t>
<t>use term confidentiality instead of privacy in most cases.</t>
<t>update open issues to request input for missing text.</t>
<t>move certificate pinning sub-section to account setup section and attempt to define it more precisely.</t>
<t>Add note about end-to-end encryption in AVAS section.</t>
<t>swap order of DNSSEC and TLSA sub-sections.</t>
<t>change meaning of 'tls10' and 'tls12' latches to require certificate validation.</t>
<t>Replace cipher suite advice with reference to RFC 7525. Change examples to use TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 as cipher suite.</t>
<t>Add text to update IMAP, POP3 and Message Submission standards with
newer TLS advice.</t>
<t>Add clearer text in introduction that this does not cover SMTP relay.</t>
<t>Update references to uta-tls-certs.</t>
<t>Add paragraph to Implicit TLS for SMTP Submission section recommending that STARTTLS also be implemented.</t>
</list></t>
<t>Changes since draft-newman-email-deep-02:
<list style="symbols">
<t>Changed "privacy assurance" to "confidentiality assurance"</t>
<t>Changed "low privacy assurance" to "no confidentiality assurance"</t>
<t>Attempt to improve definition of confidentiality assurance level.</t>
<t>Add SHOULD indicate when MUA is showing list of mail accounts.</t>
<t>Add SHOULD NOT latch tls10, tls12 tags until TLS negotiated.</t>
<t>Removed sentence about deleting and re-creating the account in latch failure section.</t>
<t>Remove use of word "fallback" with respect to TLS version negotiation.</t>
<t>Added bullet about changes to Internet facing servers to MSP section.</t>
<t>minor wording improvements based on feedback</t>
</list></t>
<t>Changes since -01:
<list style="symbols">
<t>Updated abstract, introduction and document structure to focus more on mail user agent privacy assurance.</t>
<t>Added email account privacy section, also moving section on account
setup using SRV records to that section.</t>
<t>Finished writing IANA considerations section</t>
<t>Remove provisional concept and instead have server explicitly list
security tags clients should latch.</t>
<t>Added note that rules for the submissions port follow the same
rules as those for the submit port.</t>
<t>Reference and update advice in <xref target="RFC5068"/>.</t>
<t>Fixed typo in Client Certificate Authentication section.</t>
<t>Removed tls-pfs security latch and all mention of perfect forward
secrecy as it was controversial.</t>
<t>Added reference to HSTS.</t>
</list>
</t>
<t>Changes since -00:
<list style="symbols">
<t>Rewrote introduction to merge ideas from draft-moore-email-tls-00.</t>
<t>Added Implicit TLS section, Account configuration section and IANA port registration updates based on draft-moore-email-tls-00.</t>
<t>Add protocol details necessary to standardize implicit TLS for POP/IMAP/submission, using ideas from draft-melnikov-pop3-over-tls.</t>
<t>Reduce initial set of security tags based on feedback.</t>
<t>Add deep status concept to allow a window for software updates to be backed out before latches make that problematic, as well as to provide service providers with a mechanism they can use to assist customers in the event of a privacy failure.</t>
<t>Add DNS SRV section from draft-moore-email-tls-00.</t>
<t>Write most of the missing IANA considerations section.</t>
<t>Rewrite most of implementation requirements section based more on
draft-moore-email-tls-00. Remove new cipher requirements for now
because those may be dealt with elsewhere.</t>
</list>
</t>
</section>
<section title="Acknowledgements">
<t>Thanks to Ned Freed for discussion of the initial latch concepts
in this document. Thanks to Alexey Melnikov for
draft-melnikov-pop3-over-tls-02, which was the basis of the POP3
implicit TLS text. Thanks to Russ Housley, Alexey Melnikov and Dan
Newman for review feedback. Thanks to Paul Hoffman for interesting
feedback in initial conversations about this idea.</t>
</section>
</back>
</rfc>
