Internet Engineering Task Force (IETF) K. Moore Request for Comments: 8314 Windrock, Inc. Updates: 1939, 2595, 3501, 5068, 6186, 6409 C. Newman Category: Standards Track Oracle ISSN: 2070-1721 January 2018 Cleartext Considered Obsolete: Use of Transport Layer Security (TLS) for Email Submission and AccessAbstract
This specification outlines current recommendations for the use of Transport Layer Security (TLS) to provide confidentiality of email traffic between a Mail User Agent (MUA) and a Mail Submission Server or Mail Access Server. This document updates RFCs 1939, 2595, 3501, 5068, 6186, and 6409. Status of This Memo This is an Internet Standards Track document. This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841. Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at https://www.rfc-editor.org/info/rfc8314. Copyright Notice Copyright (c) 2018 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
Table of Contents
1. Introduction ....................................................3 1.1. How This Document Updates Previous RFCs ....................3 2. Conventions and Terminology Used in This Document ...............4 3. Implicit TLS ....................................................5 3.1. Implicit TLS for POP .......................................5 3.2. Implicit TLS for IMAP ......................................5 3.3. Implicit TLS for SMTP Submission ...........................6 3.4. Implicit TLS Connection Closure for POP, IMAP, and SMTP Submission ............................................7 4. Use of TLS by Mail Access Servers and Message Submission Servers .........................................................7 4.1. Deprecation of Services Using Cleartext and TLS Versions Less Than 1.1 ..............................................8 4.2. Mail Server Use of Client Certificate Authentication .......9 4.3. Recording TLS Ciphersuite in "Received" Header Field .......9 4.4. TLS Server Certificate Requirements .......................10 4.5. Recommended DNS Records for Mail Protocol Servers .........11 4.5.1. MX Records .........................................11 4.5.2. SRV Records ........................................11 4.5.3. DNSSEC .............................................11 4.5.4. TLSA Records .......................................11 4.6. Changes to Internet-Facing Servers ........................11 5. Use of TLS by Mail User Agents .................................12 5.1. Use of SRV Records in Establishing Configuration ..........13 5.2. Minimum Confidentiality Level .............................14 5.3. Certificate Validation ....................................15 5.4. Certificate Pinning .......................................15 5.5. Client Certificate Authentication .........................16 6. Considerations Related to Antivirus/Antispam Software and Services ...................................................17 7. IANA Considerations ............................................17 7.1. POP3S Port Registration Update ............................17 7.2. IMAPS Port Registration Update ............................18 7.3. Submissions Port Registration .............................18 7.4. Additional Registered Clauses for "Received" Fields .......19 8. Security Considerations ........................................19 9. References .....................................................20 9.1. Normative References ......................................20 9.2. Informative References ....................................22 Appendix A. Design Considerations .................................24 Acknowledgements ..................................................26 Authors' Addresses ................................................26
1. Introduction
Software that provides email service via the Internet Message Access Protocol (IMAP) [RFC3501], the Post Office Protocol (POP) [RFC1939], and/or Simple Mail Transfer Protocol (SMTP) Submission [RFC6409] usually has Transport Layer Security (TLS) [RFC5246] support but often does not use it in a way that maximizes end-user confidentiality. This specification describes current recommendations for the use of TLS in interactions between Mail User Agents (MUAs) and Mail Access Servers, and also between MUAs and Mail Submission Servers. In brief, this memo now recommends that: o TLS version 1.2 or greater be used for all traffic between MUAs and Mail Submission Servers, and also between MUAs and Mail Access Servers. o MUAs and Mail Service Providers (MSPs) (a) discourage the use of cleartext protocols for mail access and mail submission and (b) deprecate the use of cleartext protocols for these purposes as soon as practicable. o Connections to Mail Submission Servers and Mail Access Servers be made using "Implicit TLS" (as defined below), in preference to connecting to the "cleartext" port and negotiating TLS using the STARTTLS command or a similar command. This memo does not address the use of TLS with SMTP for message relay (where Message Submission [RFC6409] does not apply). Improving the use of TLS with SMTP for message relay requires a different approach. One approach to address that topic is described in [RFC7672]; another is provided in [MTA-STS]. 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.1.1. How This Document Updates Previous RFCs
This document updates POP (RFC 1939), IMAP (RFC 3501), and Submission (RFC 6409, RFC 5068) in two ways: 1. By adding Implicit TLS ports as Standards Track ports for these protocols as described in Section 3. 2. By updating TLS best practices that apply to these protocols as described in Sections 4 and 5.
This document updates RFC 2595 by replacing Section 7 of RFC 2595 with the preference for Implicit TLS as described in Sections 1 and 3 of this document, as well as by updating TLS best practices that apply to the protocols in RFC 2595 as described in Sections 4 and 5 of this document. This document updates RFC 6186 as described herein, in Section 5.1.2. Conventions and Terminology Used in This Document
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here. The term "Implicit TLS" refers to the automatic negotiation of TLS whenever a TCP connection is made on a particular TCP port that is used exclusively by that server for TLS connections. The term "Implicit TLS" is intended to contrast with the use of STARTTLS and similar commands in POP, IMAP, SMTP Message Submission, and other protocols, that are used by the client and the server to explicitly negotiate TLS on an established cleartext TCP connection. The term "Mail Access Server" refers to a server for POP, IMAP, and any other protocol used to access or modify received messages, or to access or modify a mail user's account configuration. The term "Mail Submission Server" refers to a server for the protocol specified in [RFC6409] (or one of its predecessors or successors) for submission of outgoing messages for delivery to recipients. The term "Mail Service Provider" (or "MSP") refers to an operator of Mail Access Servers and/or Mail Submission Servers. The term "Mail Account" refers to a user's identity with an MSP, that user's authentication credentials, any user email that is stored by the MSP, and any other per-user configuration information maintained by the MSP (for example, instructions for filtering spam). Most MUAs support the ability to access multiple Mail Accounts. For each account that an MUA accesses on its user's behalf, it must have the server names, ports, authentication credentials, and other configuration information specified by the user. This information, which is used by the MUA, is referred to as "Mail Account Configuration".
This specification expresses syntax using the Augmented Backus-Naur Form (ABNF) as described in [RFC5234], including the core rules provided in Appendix B of [RFC5234] and the rules provided in [RFC5322].3. Implicit TLS
Previous standards for the use of email protocols with TLS used the STARTTLS mechanism: [RFC2595], [RFC3207], and [RFC3501]. With STARTTLS, the client establishes a cleartext 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. Although 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 encourage more widespread use of TLS and to also encourage greater consistency regarding how TLS is used, this specification now recommends the use of Implicit TLS for POP, IMAP, SMTP Submission, and all other protocols used between an MUA and an MSP.3.1. Implicit TLS for POP
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 [RFC7817]. Once the TLS session is established, POP3 [RFC1939] protocol messages are exchanged as TLS application data for the remainder of the TCP connection. After the server sends an +OK greeting, the server and client MUST enter the AUTHORIZATION state, even if a client certificate was supplied during the TLS handshake. See Sections 5.5 and 4.2 for additional information on client certificate authentication. See Section 7.1 for port registration information.3.2. Implicit TLS for IMAP
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 [RFC7817]. Once the TLS session is established, IMAP [RFC3501] protocol messages are exchanged as TLS application data for the remainder of the TCP connection. If a client certificate was provided during the TLS handshake that the server finds acceptable, the server MAY issue a PREAUTH greeting, in which case both the
server and the client enter the AUTHENTICATED state. If the server issues an OK greeting, then both the server and the client enter the NOT AUTHENTICATED state. See Sections 5.5 and 4.2 for additional information on client certificate authentication. See Section 7.2 for port registration information.3.3. Implicit TLS for SMTP Submission
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 [RFC7817]. Once the TLS session is established, Message Submission protocol data [RFC6409] is exchanged as TLS application data for the remainder of the TCP connection. (Note: The "submissions" service name is defined in Section 7.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.) The STARTTLS mechanism on port 587 is relatively widely deployed due to the situation with port 465 (discussed in Section 7.3). 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 for the additional reasons discussed in Appendix A. However, to maximize the 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 if both the client and the server are configured to require successful negotiation of TLS prior to Message Submission. Note that the "submissions" port provides access to a Message Submission Agent (MSA) as defined in [RFC6409], so requirements and recommendations for MSAs in that document, including the requirement to implement SMTP AUTH [RFC4954] and the requirements of Email Submission Operations [RFC5068], also apply to the submissions port. See Sections 5.5 and 4.2 for additional information on client certificate authentication. See Section 7.3 for port registration information.
3.4. Implicit TLS Connection Closure for POP, IMAP, and SMTP Submission
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 (e.g., call the close() function on the TCP socket or otherwise issue a TCP CLOSE ([RFC793], Section 3.5)) without waiting for a TLS response from the server.4. Use of TLS by Mail Access Servers and Message Submission Servers
The following requirements and recommendations apply to Mail Access Servers and Mail Submission Servers, or, if indicated, to MSPs: o MSPs that support POP, IMAP, and/or Message Submission MUST support TLS access for those protocol servers. o Servers provided by MSPs other than POP, IMAP, and/or Message Submission SHOULD support TLS access and MUST support TLS access for those servers that support authentication via username and password. o MSPs that support POP, IMAP, and/or Message Submission SHOULD provide and support instances of those services that use Implicit TLS. (See Section 3.) o For compatibility with existing MUAs and existing MUA configurations, MSPs SHOULD also, in the near term, provide instances of these services that support STARTTLS. This will permit legacy MUAs to discover new availability of TLS capability on servers and may increase the use of TLS by such MUAs. However, servers SHOULD NOT advertise STARTTLS if the use of the STARTTLS command by a client is likely to fail (for example, if the server has no server certificate configured). o MSPs SHOULD advertise their Mail Access Servers and Mail Submission Servers, using DNS SRV records according to [RFC6186]. (In addition to making correct configuration easier for MUAs, this provides a way by which MUAs can discover when an MSP begins to offer TLS-based services.) Servers supporting TLS SHOULD be advertised in preference to cleartext servers (if offered). In addition, servers using Implicit TLS SHOULD be advertised in preference to servers supporting STARTTLS (if offered). (See also Section 4.5.) o MSPs SHOULD deprecate the use of cleartext Mail Access Servers and Mail Submission Servers as soon as practicable. (See Section 4.1.)
o MSPs currently supporting such use of cleartext SMTP (on port 25) as a means of Message Submission by their users (whether or not requiring authentication) SHOULD transition their users to using TLS (either Implicit TLS or STARTTLS) as soon as practicable. o Mail Access Servers and Mail Submission Servers MUST support TLS 1.2 or later. o All Mail Access Servers and Mail Submission Servers SHOULD implement the recommended TLS ciphersuites described in [RFC7525] or a future BCP or Standards Track revision of that document. o As soon as practicable, MSPs currently supporting Secure Sockets Layer (SSL) 2.x, SSL 3.0, or TLS 1.0 SHOULD transition their users to TLS 1.1 or later and discontinue support for those earlier versions of SSL and TLS. o Mail Submission Servers accepting mail using TLS SHOULD include in the Received field of the outgoing message the TLS ciphersuite of the session in which the mail was received. (See Section 4.3.) o All Mail Access Servers and Mail Submission Servers implementing TLS SHOULD log TLS cipher information along with any connection or authentication logs that they maintain. Additional considerations and details appear below.4.1. Deprecation of Services Using Cleartext and TLS Versions Less Than 1.1
The specific means employed for deprecation of cleartext Mail Access Servers and Mail Submission Servers MAY vary from one MSP to the next in light of their user communities' needs and constraints. For example, an MSP MAY implement a gradual transition in which, over time, more and more users are forbidden to authenticate to cleartext instances of these servers, thus encouraging those users to migrate to Implicit TLS. Access to cleartext servers should eventually be either (a) disabled or (b) limited strictly for use by legacy systems that cannot be upgraded. After a user's ability to authenticate to a server using cleartext is revoked, the server denying such access MUST NOT provide any indication over a cleartext channel of whether the user's authentication credentials were valid. An attempt to authenticate as such a user using either invalid credentials or valid credentials MUST both result in the same indication of access being denied.
Also, users previously authenticating with passwords sent as cleartext SHOULD be required to change those passwords when migrating to TLS, if the old passwords were likely to have been compromised. (For any large community of users using the public Internet to access mail without encryption, the compromise of at least some of those passwords should be assumed.) Transition of users from SSL or TLS 1.0 to later versions of TLS MAY be accomplished by a means similar to that described above. There are multiple ways to accomplish this. One way is for the server to refuse a ClientHello message from any client sending a ClientHello.version field corresponding to any version of SSL or TLS 1.0. Another way is for the server to accept ClientHello messages from some client versions that it does not wish to support but later refuse to allow the user to authenticate. The latter method may provide a better indication to the user of the reason for the failure but (depending on the protocol and method of authentication used) may also risk exposure of the user's password over a channel that is known to not provide adequate confidentiality. It is RECOMMENDED that new users be required to use TLS version 1.1 or greater from the start. However, an MSP may find it necessary to make exceptions to accommodate some legacy systems that support only earlier versions of TLS or only cleartext.4.2. Mail Server Use of Client Certificate Authentication
Mail Submission Servers and Mail Access Servers MAY implement client certificate authentication on the Implicit TLS port. Such 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. If the server accepts the client's certificate as sufficient for authorization, it MUST enable the Simple Authentication and Security Layer (SASL) EXTERNAL mechanism [RFC4422]. An IMAPS server MAY issue a PREAUTH greeting instead of enabling SASL EXTERNAL.4.3. Recording TLS Ciphersuite in "Received" Header Field
The ESMTPS transmission type [RFC3848] provides trace information that can indicate that TLS was used when transferring mail. However, TLS usage by itself is not a guarantee of confidentiality or security. The TLS ciphersuite provides additional information about the level of security made available for a connection. This section
defines a new SMTP "tls" Received header additional-registered-clause that is used to record the TLS ciphersuite that was negotiated for the connection. This clause SHOULD be included whenever a Submission server generates a Received header field for a message received via TLS. The value included in this additional clause SHOULD be the registered ciphersuite name (e.g., TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) included in the "TLS Cipher Suite Registry". In the event that the implementation does not know the name of the ciphersuite (a situation that should be remedied promptly), a four-digit hexadecimal ciphersuite identifier MAY be used. In addition, the Diffie-Hellman group name associated with the ciphersuite MAY be included (when applicable and known) following the ciphersuite name. The ABNF for the field follows: tls-cipher-clause = CFWS "tls" FWS tls-cipher [ CFWS tls-dh-group-clause ] tls-cipher = tls-cipher-name / tls-cipher-hex tls-cipher-name = ALPHA *(ALPHA / DIGIT / "_") ; as registered in the IANA "TLS Cipher Suite Registry" ; <https://www.iana.org/assignments/tls-parameters> tls-cipher-hex = "0x" 4HEXDIG tls-dh-group-clause = "group" FWS dh-group ; not to be used except immediately after tls-cipher dh-group = ALPHA *(ALPHA / DIGIT / "_" / "-") ; as registered in the IANA "TLS Supported Groups Registry" ; <https://www.iana.org/assignments/tls-parameters>4.4. TLS Server Certificate Requirements
MSPs MUST maintain valid server certificates for all servers. See [RFC7817] for the recommendations and requirements necessary to achieve this. 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 (SNI) extension to TLS [RFC6066]. Mail servers supporting the SNI need to support the post-SRV hostname to interoperate with MUAs that have not implemented [RFC6186]. For more discussion of this problem, see Section 5.1 of [RFC7817].
4.5. Recommended DNS Records for Mail Protocol Servers
This section discusses not only the DNS records that are recommended but also implications of DNS records for server configuration and TLS server certificates.4.5.1. MX Records
It is recommended that MSPs advertise MX records for the handling of inbound mail (instead of relying entirely on A or AAAA records) and that those MX records be signed using DNSSEC [RFC4033]. This is mentioned here only for completeness, as the handling of inbound mail is out of scope for this document.4.5.2. SRV Records
MSPs SHOULD advertise SRV records to aid MUAs in determining the proper configuration of servers, per the instructions in [RFC6186]. MSPs SHOULD advertise servers that support Implicit TLS in preference to servers that support cleartext and/or STARTTLS operation.4.5.3. DNSSEC
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 if and when the parent DNS zone supports doing so.4.5.4. TLSA Records
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.4.6. Changes to Internet-Facing Servers
When an MSP changes the Internet-facing Mail Access Servers and Mail Submission Servers, including SMTP-based spam/virus filters, it is generally necessary to support the same and/or a newer version of TLS than the one previously used.