RFC 8314
Cleartext Considered Obsolete: Use of Transport Layer Security (TLS) for Email Submission and Access
Cleartext Considered Obsolete โจ
Okay bestie, this is RFC 8314 ๐ฆ, published by the Internet Engineering Task Force (IETF) in January 2018 as a Standards Track document (ISSN 2070-1721). Its title is Cleartext Considered Obsolete: Use of Transport Layer Security (TLS) for Email Submission and Access. The authors are K. Moore of Windrock, Inc. and C. Newman of Oracle. It updates RFCs 1939, 2595, 3501, 5068, 6186, and 6409, so it's a big glow-up for all of them ๐.
Abstract
Here's the tea โ: this spec lays out the current recommendations for using Transport Layer Security (TLS) to keep email traffic confidential between a Mail User Agent (MUA) and either a Mail Submission Server or a Mail Access Server. It updates RFCs 1939, 2595, 3501, 5068, 6186, and 6409.
Status of This Memo
This is an Internet Standards Track document ๐ธ.
It's a product of the IETF, which means it reflects the consensus of the IETF community. It went through public review and was approved for publication by the Internet Engineering Steering Group (IESG). If you want more on Internet Standards, check out Section 2 of RFC 7841 ๐.
For the latest status of this document, any errata, and where to send feedback, head to https://www.rfc-editor.org/info/rfc8314 โจ.
Copyright Notice
The copyright belongs to the IETF Trust and the people listed as the document's authors (Copyright (c) 2018), and all rights are reserved ๐ .
This document is covered by BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) as they stood on the publication date. Read those carefully, because they spell out your rights and restrictions for this document ๐. Any Code Components pulled out of this document must include Simplified BSD License text, as described in Section 4.e of the Trust Legal Provisions, and they come without warranty, as the Simplified BSD License describes.
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 โจ
Email software that talks over the Internet Message Access Protocol (IMAP) [RFC3501], the Post Office Protocol (POP) [RFC1939], and/or SMTP Submission [RFC6409] usually has Transport Layer Security (TLS) [RFC5246] support, but it often doesn't use it in a way that maximizes end-user confidentiality ๐. This specification describes the current recommendations for using TLS between Mail User Agents (MUAs) and Mail Access Servers, and also between MUAs and Mail Submission Servers ๐.
In brief, this memo now recommends that:
- 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.
- 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.
- 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 cover using TLS with SMTP for message relay, which is where Message Submission [RFC6409] doesn't apply ๐ โโ๏ธ. Improving TLS for SMTP relay needs a different approach. One approach is described in [RFC7672], and another is provided in [MTA-STS].
The recommendations here don't replace the functionality of end-to-end encryption of electronic mail, and they aren't meant to be a substitute for it ๐.
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:
- By adding Implicit TLS ports as Standards Track ports for these protocols, as described in Section 3.
- 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 described in Sections 1 and 3 of this document. It also updates the 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 in Section 5.1 of this document ๐.
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" are to be read as described in BCP 14 [RFC2119] [RFC8174], but only when they appear in all capitals, exactly as shown here. That's the rule, bestie, so no sneaking them in lowercase ๐.
Here's what the key terms mean in this doc ๐ง:
"Implicit TLS" refers to TLS being negotiated automatically whenever a TCP connection is made on a particular TCP port that the server uses exclusively for TLS connections. It's called "Implicit" because it's the opposite of STARTTLS and similar commands in POP, IMAP, SMTP Message Submission, and other protocols. Those commands let the client and server explicitly negotiate TLS on a connection that started out cleartext ๐.
"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 ๐ฌ.
"Mail Submission Server" refers to a server for the protocol specified in [RFC6409] (or one of its predecessors or successors) that handles submission of outgoing messages for delivery to recipients โ๏ธ.
"Mail Service Provider" (or "MSP") refers to an operator of Mail Access Servers and/or Mail Submission Servers ๐ข.
"Mail Account" refers to a user's identity with an MSP, that user's authentication credentials, any user email that the MSP stores, and any other per-user configuration the MSP maintains (for example, instructions for filtering spam). Most MUAs can 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 the user specified. This information, which the MUA uses, is called "Mail Account Configuration" ๐๏ธ.
This specification writes its syntax in Augmented Backus-Naur Form (ABNF) as described in [RFC5234]. It uses the core rules from Appendix B of [RFC5234] and the rules from [RFC5322] ๐งฉ.
3. Implicit TLS ๐ฅ
Earlier standards for using email protocols with TLS relied on the STARTTLS mechanism: [RFC2595], [RFC3207], and [RFC3501]. With STARTTLS, the client starts a cleartext application session and decides whether to issue a STARTTLS command based on the server's capabilities and its own configuration. If the client sends STARTTLS, a TLS handshake follows that can upgrade the connection ๐.
Here's the plot twist: an alternate mechanism has been deployed more successfully. In that one, TLS gets negotiated right at connection start on a separate port, and this document calls it "Implicit TLS" ๐. To encourage wider use of TLS and more consistency in how it gets used, this specification now recommends 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 made to the pop3s service (default port 995), the TLS handshake starts immediately ๐. Clients MUST implement the certificate validation mechanism described in [RFC7817]. Once the TLS session is up, POP3 [RFC1939] protocol messages are exchanged as TLS application data for the rest 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 ๐ซถ.
For more on client certificate authentication, see Sections 5.5 and 4.2. For port registration info, see Section 7.1 ๐.
3.2. Implicit TLS for IMAP ๐ฌ
okay so when a TCP connection gets set up for the imaps service (default port 993), a TLS handshake starts RIGHT away ๐. Clients MUST implement the certificate validation mechanism described in [RFC7817]. Once the TLS session is up, IMAP [RFC3501] protocol messages get sent as TLS application data for the rest of the TCP connection ๐. If a client certificate was provided during the TLS handshake and the server finds it acceptable, the server MAY issue a PREAUTH greeting, and then both the server and the client enter the AUTHENTICATED state ๐. If the server issues an OK greeting instead, both the server and the client enter the NOT AUTHENTICATED state ๐ธ.
bestie, check out Sections 5.5 and 4.2 if you want more on client certificate authentication ๐ง. Section 7.2 has the port registration info ๐.
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 up, Message Submission protocol data [RFC6409] gets exchanged as TLS application data for the rest of the TCP connection โจ.
Quick aside: the submissions service name is defined in Section 7.3 of this document. It follows the usual pattern where a service layered on top of Implicit TLS is named like the plain service, but with an "s" added at the end ๐ง.
The STARTTLS mechanism on port 587 is pretty widely deployed, and that's because of what's going on with port 465 (more on that in Section 7.3) ๐. This is different from IMAP and POP, where Implicit TLS is more common on servers than STARTTLS. Long term, it's desirable to move the core protocols that MUA software uses over to Implicit TLS, for consistency and for the extra reasons in Appendix A ๐ฆ. But to get the most encryption out of submission, it's desirable to support both mechanisms for Message Submission over TLS during a transition period of several years ๐. So clients and servers SHOULD implement both STARTTLS on port 587 and Implicit TLS on port 465 for this transition period ๐ซถ.
Here's the tea: there's no significant difference in security between STARTTLS on port 587 and Implicit TLS on port 465, as long as the implementations are correct and both the client and the server are set to require successful TLS negotiation before Message Submission ๐ฅ.
Also, the submissions port gives you access to a Message Submission Agent (MSA) as defined in [RFC6409]. That means the requirements and recommendations for MSAs in that document apply here too, including the requirement to implement SMTP AUTH [RFC4954] and the requirements of Email Submission Operations [RFC5068] ๐ผ.
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 wants to close the connection, it SHOULD start the exchange of TLS close alerts before the TCP connection gets terminated ๐. The client MAY, after sending a TLS close alert, gracefully close the TCP connection without waiting for a TLS response from the server. That could look like calling the close() function on the TCP socket, or otherwise issuing a TCP CLOSE ([RFC793], Section 3.5) ๐ชโจ.
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 to MSPs when that's indicated ๐:
- MSPs that support POP, IMAP, and/or Message Submission MUST support TLS access for those protocol servers.
- 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.
- MSPs that support POP, IMAP, and/or Message Submission SHOULD provide and support instances of those services that use Implicit TLS. (See Section 3.)
- 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 lets legacy MUAs discover that TLS is newly available on servers, and it may increase how often those MUAs use TLS ๐ธ. However, servers SHOULD NOT advertise STARTTLS if a client using the STARTTLS command is likely to fail (for example, if the server has no server certificate configured) ๐.
- MSPs SHOULD advertise their Mail Access Servers and Mail Submission Servers using DNS SRV records according to [RFC6186]. (Besides making correct configuration easier for MUAs, this gives MUAs a way to notice when an MSP starts offering 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.)
- MSPs SHOULD deprecate the use of cleartext Mail Access Servers and Mail Submission Servers as soon as practicable. (See Section 4.1.) ๐งน
- MSPs currently supporting cleartext SMTP (on port 25) as a means of Message Submission by their users, whether or not authentication is required, SHOULD transition those users to using TLS (either Implicit TLS or STARTTLS) as soon as practicable ๐.
- Mail Access Servers and Mail Submission Servers MUST support TLS 1.2 or later ๐.
- 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 ๐.
- 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 ๐ฅฒ.
- Mail Submission Servers accepting mail using TLS SHOULD include in the
Receivedfield of the outgoing message the TLS ciphersuite of the session in which the mail was received. (See Section 4.3.) ๐จ - All Mail Access Servers and Mail Submission Servers implementing TLS SHOULD log TLS cipher information along with any connection or authentication logs they maintain ๐.
Additional considerations and details appear below ๐.
4.1. Deprecation of Services Using Cleartext and TLS Versions Less Than 1.1 ๐
The specific way cleartext Mail Access Servers and Mail Submission Servers get deprecated MAY vary from one MSP to the next, based on their user communities' needs and constraints ๐ฑ. For example, an MSP MAY roll out a gradual transition where, over time, more and more users are blocked from authenticating to cleartext instances of these servers. That nudges those users toward Implicit TLS ๐ฆ. Access to cleartext servers should eventually be either (a) disabled or (b) limited strictly to legacy systems that can't be upgraded.
After a user's ability to authenticate to a server using cleartext is revoked, the server denying that access MUST NOT provide any indication over a cleartext channel of whether the user's credentials were valid ๐. An attempt to authenticate as that user with invalid credentials or valid credentials MUST both result in the same indication of access being denied.
Also, users who were previously authenticating with passwords sent as cleartext SHOULD be required to change those passwords when they migrate to TLS, if the old passwords were likely to have been compromised. (For any large community of users accessing mail over the public Internet without encryption, the compromise of at least some of those passwords should be assumed ๐ญ.)
Moving users off SSL or TLS 1.0 to later versions of TLS MAY be done in a way similar to what's described above. There are multiple ways to do this ๐ ๏ธ. One way is for the server to refuse a ClientHello message from any client sending a ClientHello.version field that corresponds to any version of SSL or TLS 1.0. Another way is for the server to accept ClientHello messages from some client versions it doesn't want to support, and then refuse to let the user authenticate later. This second method may give the user a better idea of why things failed, but (depending on the protocol and authentication method used) it may also risk exposing the user's password over a channel that is known not to provide adequate confidentiality ๐ฌ.
Heads up: that second approach can accidentally leak a password over a channel that isn't secure, so think it through before you pick it ๐จ.
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 for some legacy systems that only support 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 can determine a mail server authorization identity matching those certificates. How to make that determination is currently 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 โจ
okay so the ESMTPS transmission type [RFC3848] already leaves trace info showing that TLS was used when mail got transferred ๐ฌ but bestie, TLS being used is NOT a guarantee of confidentiality or security ๐ the TLS ciphersuite tells you way more about how secure the connection actually is, so this section adds a brand new SMTP "tls" Received header additional-registered-clause to record which TLS ciphersuite got 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 in that clause SHOULD be the registered ciphersuite name (like TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) from the "TLS Cipher Suite Registry" ๐ if the implementation doesn't know the ciphersuite name (a situation that should be remedied promptly ๐ฅ), a four-digit hexadecimal ciphersuite identifier MAY be used ๐ฆ and the Diffie-Hellman group name tied to the ciphersuite MAY also be included (when it applies and is known), right after the ciphersuite name ๐ธ here's the ABNF for the field:
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 ๐
okay this one is serious bestie ๐ญ MSPs MUST maintain valid server certificates for all servers ๐ see [RFC7817] for the recommendations and requirements needed 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's acceptable to impose the constraint that the server and all clients support the Server Name Indication (SNI) extension to TLS [RFC6066] ๐ mail servers supporting SNI need to support the post-SRV hostname to interoperate with MUAs that haven't 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 talks about not just the DNS records that are recommended, but also what DNS records mean for server configuration and TLS server certificates ๐
4.5.1. MX Records ๐ฎ
it's recommended that MSPs advertise MX records for handling inbound mail (instead of relying entirely on A or AAAA records) and that those MX records be signed using DNSSEC [RFC4033] ๐ฅ this is only mentioned here for completeness, since handling inbound mail is out of scope for this document ๐
4.5.2. SRV Records ๐
MSPs SHOULD advertise SRV records to help MUAs figure out 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 an MSP advertises to help clients talk to 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's generally necessary to support the same and/or a newer version of TLS than the one previously used ๐ง
5. Use of TLS by Mail User Agents ๐ฑ
the following requirements and recommendations apply to MUAs ๐
- MUAs SHOULD be capable of using DNS SRV records to discover Mail Access Servers and Mail Submission Servers that are advertised by an MSP for an account being configured ๐ฆ other means of discovering server configuration info (like a database maintained by the MUA vendor) MAY also be supported ๐ธ (See Section 5.1 for more information.)
- MUAs SHOULD be configurable to require a minimum level of confidentiality for any particular Mail Account and refuse to exchange information via any service associated with that Mail Account if the session doesn't provide that minimum level of confidentiality ๐ฅ (See Section 5.2.)
- MUAs MUST NOT treat a session as meeting a minimum level of confidentiality if the server's TLS certificate cannot be validated ๐ (See Section 5.3.)
- MUAs MAY impose other minimum confidentiality requirements in the future, e.g., to discourage the use of TLS versions or cryptographic algorithms in which weaknesses have been discovered โจ
- MUAs SHOULD provide a prominent indication of the level of confidentiality associated with an account configuration that is appropriate for the user interface (for example, a "lock" icon or changed background color for a visual interface, or some sort of audible indication for an audio user interface) ๐ at appropriate times and/or locations, so the user knows how confidential the communications for that account are ๐ for example, this might happen whenever (a) the user is prompted for authentication credentials, (b) the user is composing mail that will be sent to a particular submission server, (c) a list of accounts is displayed (especially if the user can select from that list to read mail), or (d) the user is asking to view or update any configuration data that will be stored on a remote server ๐ง but if an MUA provides such an indication, it MUST NOT indicate confidentiality for any connection that doesn't at least use TLS 1.1 with certificate verification and also meet the minimum confidentiality requirements associated with that account ๐ญ
- MUAs MUST implement TLS 1.2 [RFC5246] or later ๐ earlier TLS and SSL versions MAY also be supported, so long as the MUA requires at least TLS 1.1 [RFC4346] when accessing accounts that are configured to impose minimum confidentiality requirements ๐
- All MUAs SHOULD implement the recommended TLS ciphersuites described in [RFC7525] or a future BCP or Standards Track revision of that document ๐
- MUAs that are configured to not require minimum confidentiality for one or more accounts SHOULD detect when TLS becomes available on those accounts (using [RFC6186] or other means) and offer to upgrade the account to require TLS ๐ซถ
Additional considerations and details appear below ๐
5.1. Use of SRV Records in Establishing Configuration ๐งญ
this document updates [RFC6186] by changing the preference rules and adding a new SRV service label _submissions._tcp to refer to Message Submission with Implicit TLS โจ
user-configurable MUAs SHOULD support the use of [RFC6186] for account setup ๐ however, when using configuration info obtained this way, MUAs SHOULD ignore advertised services that don't satisfy minimum confidentiality requirements, unless the user has explicitly requested reduced confidentiality ๐ฅ this means the MUA will default to ignoring advertised configurations that don't support TLS, even when those configurations have a higher priority than other advertised configurations ๐
when using configuration info per [RFC6186], MUAs SHOULD NOT automatically establish new configurations that don't require TLS for all servers, unless there are no advertised configurations using TLS ๐ธ if such a configuration is chosen, before attempting to authenticate to the server or use it for Message Submission, the MUA SHOULD warn the user that traffic to that server won't be encrypted and will therefore likely be intercepted by unauthorized parties ๐ฆ the exact wording is up to the implementation, but it should really capture the sense of risk, given how widespread mass surveillance of email traffic is ๐ญ
similarly, an MUA MUST NOT attempt to "test" a particular Mail Account configuration by submitting the user's authentication credentials to a server, unless a TLS session meeting minimum confidentiality levels has been established with that server ๐ if minimum confidentiality requirements haven't been satisfied, the MUA must explicitly warn that the user's password may be exposed to attackers before testing the new configuration ๐
when establishing a new configuration for connecting to an IMAP, POP, or SMTP submission server based on SRV records, an MUA SHOULD verify that either (a) the SRV records are signed using DNSSEC or (b) the target Fully Qualified Domain Name (FQDN) of the SRV record matches the original server FQDN for which the SRV queries were made ๐ง if the target FQDN isn't in the queried domain, the MUA SHOULD verify with the user that the SRV target FQDN is suitable for use before executing any connections to the host ๐ (See Section 6 of [RFC6186].)
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 check if an MSP's server configuration has changed and alert the user if it looks like it has ๐ this can also be a nice way to encourage users to upgrade their configurations to require TLS if and when their MSPs support it ๐ซถ
5.2. Minimum Confidentiality Level ๐
okay so by default, MUAs SHOULD demand a minimum level of confidentiality for the services each account touches ๐ . If your MUA can juggle multiple Mail Accounts, this requirement SHOULD be configurable on a per-account basis, so you can tweak it account by account ๐.
The baseline for all brand-new accounts MUST require successful validation of the server's certificate and SHOULD require negotiation of TLS version 1.1 or greater. (Future revisions might crank these up or add new requirements to patch newly discovered weaknesses in protocols or cryptographic algorithms.) ๐
MUAs MAY let the user switch off this minimum confidentiality requirement, either during initial account setup or later when editing an account configuration, but MUST warn users that such a configuration will not assure privacy for either passwords or messages. ๐
If an MUA is set to require a minimum confidentiality level for a Mail Account, it MUST NOT try any operation other than capability discovery (or STARTTLS, for servers that aren't using Implicit TLS), unless that connection actually provides the minimum level of confidentiality. ๐ซ
MUAs SHOULD NOT let users easily access or send mail over a connection, or log in with a password to any service, if that account is set to impose minimum confidentiality requirements and the connection doesn't meet all of them. An example of "easy access" would be a dialog that says the connection didn't meet the account's security requirements but lets the user "click through" to send mail or access the service anyway. Experience shows that people presented with that option often "click through" without understanding the risks they're accepting ๐ญ. Worse, users who keep having to "click through" to use an insecure connection can get so used to it that they do it out of habit, without stopping to ask whether the risks are reasonable in each specific instance ๐.
Even an MUA that isn't set to require a minimum confidentiality level for a Mail Account SHOULD still try to connect to that account's services the most secure way available, e.g., via Implicit TLS or STARTTLS. ๐ง
5.3. Certificate Validation ๐
First up, MUAs MUST validate TLS server certificates according to [RFC7817] and PKIX [RFC5280] ๐ซถ.
MUAs MAY also support DNS-Based Authentication of Named Entities (DANE) [RFC6698] as another way to validate server certificates when they need to meet minimum confidentiality requirements. ๐ธ
MUAs MAY support certificate pinning, but they MUST NOT count a connection whose server authenticity depends on certificate pinning as meeting the minimum confidentiality level. (See Section 5.4.) ๐
5.4. Certificate Pinning ๐
During account setup, the MUA will identify the servers that provide account services like mail access and mail submission (Section 5.1 describes one way to do this). The certificates for these servers are checked using the rules in [RFC7817] and PKIX [RFC5280]. If a certificate doesn't validate because it's expired, there's no appropriate chain of trust, or the identifier doesn't match, the MUA MAY offer to create a persistent binding between that certificate and the saved hostname for the server, for use when accessing that account's servers. This is called "certificate pinning" โจ.
(Note: This use of the term "certificate pinning" means something subtly different than HTTP Public Key Pinning as described in [RFC7469]. The dual use of the same term is confusing, but unfortunately both uses are well established.) ๐
Certificate pinning is only appropriate during Mail Account setup, and it MUST NOT be offered as an option in response to a failed certificate validation for an existing Mail Account. An MUA that allows certificate pinning MUST NOT let a certificate pinned for one account validate connections for other accounts. An MUA that allows certificate pinning MUST also let the user undo the pinning, i.e., revoke trust in a certificate that was previously pinned. ๐
A pinned certificate is open to a man-in-the-middle attack at account setup time, and it typically has no mechanism to automatically revoke or securely refresh itself. Also, a man-in-the-middle attack at account setup time will expose the user's password to the attacker (if a password is used). So using a pinned certificate does not meet the requirement for a minimum confidentiality level, and an MUA MUST NOT indicate to the user that such confidentiality is provided. ๐ค More advice on certificate pinning is in [RFC6125].
5.5. Client Certificate Authentication ๐
MUAs MAY implement client certificate authentication on the Implicit TLS port. An MUA MUST NOT provide a client certificate during the TLS handshake unless the server requests one and the MUA has been authorized to use that certificate with that account. The end user explicitly configuring a client certificate for a given account is enough to meet this requirement. However, installing a client certificate for one account MUST NOT automatically authorize its use with other accounts. This doesn't rule out site-specific authorization mechanisms, such as (a) a site-administrator-controlled mechanism to authorize a client certificate for a given account, or (b) a domain-name-matching mechanism. ๐ซ
Note: The requirement that the server request a certificate is just a restatement of the TLS protocol rules, e.g., Section 7.4.6 of [RFC5246]. The requirement that the client not send a certificate not known to be acceptable to the server is pragmatic in multiple ways: the current TLS protocol provides no way for the client to know which of the potentially multiple certificates it should use; also, when the client sends a certificate, it is potentially disclosing its identity (or its user's identity) to both the server and any party with access to the transmission medium, perhaps unnecessarily and for no useful purpose. ๐ต๏ธโโ๏ธ
A client that supports client certificate authentication with Implicit TLS MUST implement the SASL EXTERNAL mechanism [RFC4422], using the appropriate authentication command: AUTH for POP3 [RFC5034], AUTH for SMTP Submission [RFC4954], or AUTHENTICATE for IMAP [RFC3501]. ๐
6. Considerations Related to Antivirus/Antispam Software and Services ๐ก๏ธ
There are several ways to connect an AVAS service (e.g., "Antivirus & Antispam") to a mail server. Some mechanisms, like the de facto "milter" protocol, are out of scope for this specification. However, some services use an SMTP relay proxy that intercepts mail at the application layer to scan it and then proxy or forward it to another Mail Transfer Agent (MTA). Deploying AVAS services this way can cause lots of problems [RFC2979], including direct interference with this specification and other forms of confidentiality or security reduction ๐ โโ๏ธ. An AVAS product or service counts as compatible with this specification if all the IMAP, POP, and SMTP-related software it includes (including proxies) is compliant with this specification. ๐
Note that end-to-end email encryption stops AVAS software and services from using email content as part of a spam or virus assessment. Also, although a minimum confidentiality level can stop a man-in-the-middle from injecting spam or virus content between the MUA and the Submission server, it doesn't prevent other forms of client or account compromise. So AVAS services for submitted email are still necessary ๐งผ.
7. IANA Considerations ๐
7.1. POP3S Port Registration Update ๐ฎ
IANA has updated the registration of the TCP well-known port 995 using the following template [RFC6335]:
Service Name: pop3s
Transport Protocol: TCP
Assignee: IESG <iesg@ietf.org>
Contact: IETF Chair <chair@ietf.org>
Description: POP3 over TLS protocol
Reference: RFC 8314
Port Number: 995
7.2. IMAPS Port Registration Update ๐ฌ
IANA has updated the registration of the TCP well-known port 993 using the following template [RFC6335]:
Service Name: imaps
Transport Protocol: TCP
Assignee: IESG <iesg@ietf.org>
Contact: IETF Chair <chair@ietf.org>
Description: IMAP over TLS protocol
Reference: RFC 8314
Port Number: 993
No changes to existing UDP port assignments for pop3s or imaps are being requested. ๐
7.3. Submissions Port Registration ๐
IANA has assigned an alternate usage of TCP port 465, in addition to the current assignment, using the following template [RFC6335]:
Service Name: submissions
Transport Protocol: TCP
Assignee: IESG <iesg@ietf.org>
Contact: IETF Chair <chair@ietf.org>
Description: Message Submission over TLS protocol
Reference: RFC 8314
Port Number: 465
This is a one-time procedural exception to the rules in [RFC6335]. It requires explicit IESG approval and doesn't set a precedent. ๐ง
Note: The whole point of this alternate usage assignment is to line up with widespread existing practice, and there's no known use of UDP port 465 for Message Submission over TLS. So IANA has not assigned an alternate usage of UDP port 465. ๐คทโโ๏ธ
Historically, port 465 was briefly registered as the "smtps" port. That registration made no sense, because the SMTP transport MX infrastructure has no way to specify a port, so port 25 is always used. The registration was revoked and the port was later reassigned to a different service. In hindsight, the "smtps" registration should have been renamed or reserved instead of revoked. Unfortunately, some widely deployed mail software read "smtps" as "submissions" [RFC6409] and used that port for email submission by default whenever an end user asked for security during account setup ๐ฉ. If a new port gets assigned for the submissions service, then either (a) email software keeps using port 465 without registration (leaving the port registry out of sync with de facto practice and wasting a well-known port), or (b) confusion between the de facto and registered ports causes harmful interoperability problems that discourage the use of TLS for Message Submission. The authors believe both 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 been deployed, it has not replaced the deployed use of Implicit TLS submission on port 465. ๐ง
7.4. Additional Registered Clauses for "Received" Fields ๐งพ
Per the provisions in [RFC5321], IANA has added two additional-registered-clauses for Received fields, as defined in Section 4.3 of this document:
"tls": Indicates the TLS cipher used (if applicable)"group": Indicates the Diffie-Hellman group used with the TLS cipher (if applicable)
The descriptions and syntax of these additional clauses are provided in Section 4.3 of this document. โจ๐๐ฆ
8. Security Considerations ๐โจ
Okay bestie, this entire doc is literally about security considerations ๐ The goal is to level up mail confidentiality and block threats that live outside the email system, like network-level snooping or someone intercepting stuff on the wire. What it is not trying to do is stop active attackers who have already broken into service provider systems. That's a whole different boss fight ๐
Privacy alert ๐จ Implementers should know that using client certificates with TLS 1.2 reveals the user's identity to anyone who can read packets from the transmission medium, which means it may compromise the user's privacy ๐ญ There doesn't seem to be an easy fix with TLS 1.2 or earlier versions, other than avoiding presenting client certificates unless there's explicit authorization to do so. TLS 1.3 [TLS-1.3] seems to reduce this privacy risk somewhat ๐ซถ
9. References ๐
9.1. Normative References
- [RFC793] Postel, J., "Transmission Control Protocol", STD 7, RFC 793, DOI 10.17487/RFC0793, September 1981,
https://www.rfc-editor.org/info/rfc793. - [RFC1939] Myers, J. and M. Rose, "Post Office Protocol - Version 3", STD 53, RFC 1939, DOI 10.17487/RFC1939, May 1996,
https://www.rfc-editor.org/info/rfc1939. - [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997,
https://www.rfc-editor.org/info/rfc2119. - [RFC3207] Hoffman, P., "SMTP Service Extension for Secure SMTP over Transport Layer Security", RFC 3207, DOI 10.17487/RFC3207, February 2002,
https://www.rfc-editor.org/info/rfc3207. - [RFC3501] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1", RFC 3501, DOI 10.17487/RFC3501, March 2003,
https://www.rfc-editor.org/info/rfc3501. - [RFC4033] Arends, R., Austein, R., Larson, M., Massey, D., and S. Rose, "DNS Security Introduction and Requirements", RFC 4033, DOI 10.17487/RFC4033, March 2005,
https://www.rfc-editor.org/info/rfc4033. - [RFC5034] Siemborski, R. and A. Menon-Sen, "The Post Office Protocol (POP3) Simple Authentication and Security Layer (SASL) Authentication Mechanism", RFC 5034, DOI 10.17487/RFC5034, July 2007,
https://www.rfc-editor.org/info/rfc5034. - [RFC5234] Crocker, D., Ed., and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", STD 68, RFC 5234, DOI 10.17487/RFC5234, January 2008,
https://www.rfc-editor.org/info/rfc5234. - [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security (TLS) Protocol Version 1.2", RFC 5246, DOI 10.17487/RFC5246, August 2008,
https://www.rfc-editor.org/info/rfc5246. - [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R., and W. Polk, "Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile", RFC 5280, DOI 10.17487/RFC5280, May 2008,
https://www.rfc-editor.org/info/rfc5280. - [RFC5322] Resnick, P., Ed., "Internet Message Format", RFC 5322, DOI 10.17487/RFC5322, October 2008,
https://www.rfc-editor.org/info/rfc5322. - [RFC6186] Daboo, C., "Use of SRV Records for Locating Email Submission/Access Services", RFC 6186, DOI 10.17487/RFC6186, March 2011,
https://www.rfc-editor.org/info/rfc6186. - [RFC6409] Gellens, R. and J. Klensin, "Message Submission for Mail", STD 72, RFC 6409, DOI 10.17487/RFC6409, November 2011,
https://www.rfc-editor.org/info/rfc6409. - [RFC6698] Hoffman, P. and J. Schlyter, "The DNS-Based Authentication of Named Entities (DANE) Transport Layer Security (TLS) Protocol: TLSA", RFC 6698, DOI 10.17487/RFC6698, August 2012,
https://www.rfc-editor.org/info/rfc6698. - [RFC7525] Sheffer, Y., Holz, R., and P. Saint-Andre, "Recommendations for Secure Use of Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS)", BCP 195, RFC 7525, DOI 10.17487/RFC7525, May 2015,
https://www.rfc-editor.org/info/rfc7525. - [RFC7672] Dukhovni, V. and W. Hardaker, "SMTP Security via Opportunistic DNS-Based Authentication of Named Entities (DANE) Transport Layer Security (TLS)", RFC 7672, DOI 10.17487/RFC7672, October 2015,
https://www.rfc-editor.org/info/rfc7672. - [RFC7817] Melnikov, A., "Updated Transport Layer Security (TLS) Server Identity Check Procedure for Email-Related Protocols", RFC 7817, DOI 10.17487/RFC7817, March 2016,
https://www.rfc-editor.org/info/rfc7817. - [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017,
https://www.rfc-editor.org/info/rfc8174.
9.2. Informative References
- [CERT-555316] CERT, "Vulnerability Note VU#555316: STARTTLS plaintext command injection vulnerability", Carnegie Mellon University Software Engineering Institute, September 2011,
https://www.kb.cert.org/vuls/id/555316. - [Email-TLS] Moore, K., "Recommendations for use of TLS by Electronic Mail Access Protocols", Work in Progress, draft-moore-email-tls-00, October 2013.
- [MTA-STS] Margolis, D., Risher, M., Ramakrishnan, B., Brotman, A., and J. Jones, "SMTP MTA Strict Transport Security (MTA-STS)", Work in Progress, draft-ietf-uta-mta-sts-14, January 2018.
- [POP3-over-TLS] Melnikov, A., Newman, C., and M. Yevstifeyev, Ed., "POP3 over TLS", Work in Progress, draft-melnikov-pop3-over-tls-02, August 2011.
- [RFC2595] Newman, C., "Using TLS with IMAP, POP3 and ACAP", RFC 2595, DOI 10.17487/RFC2595, June 1999,
https://www.rfc-editor.org/info/rfc2595. - [RFC2979] Freed, N., "Behavior of and Requirements for Internet Firewalls", RFC 2979, DOI 10.17487/RFC2979, October 2000,
https://www.rfc-editor.org/info/rfc2979. - [RFC3848] Newman, C., "ESMTP and LMTP Transmission Types Registration", RFC 3848, DOI 10.17487/RFC3848, July 2004,
https://www.rfc-editor.org/info/rfc3848. - [RFC4346] Dierks, T. and E. Rescorla, "The Transport Layer Security (TLS) Protocol Version 1.1", RFC 4346, DOI 10.17487/RFC4346, April 2006,
https://www.rfc-editor.org/info/rfc4346. - [RFC4422] Melnikov, A., Ed., and K. Zeilenga, Ed., "Simple Authentication and Security Layer (SASL)", RFC 4422, DOI 10.17487/RFC4422, June 2006,
https://www.rfc-editor.org/info/rfc4422. - [RFC4954] Siemborski, R., Ed., and A. Melnikov, Ed., "SMTP Service Extension for Authentication", RFC 4954, DOI 10.17487/RFC4954, July 2007,
https://www.rfc-editor.org/info/rfc4954. - [RFC5068] Hutzler, C., Crocker, D., Resnick, P., Allman, E., and T. Finch, "Email Submission Operations: Access and Accountability Requirements", BCP 134, RFC 5068, DOI 10.17487/RFC5068, November 2007,
https://www.rfc-editor.org/info/rfc5068. - [RFC5321] Klensin, J., "Simple Mail Transfer Protocol", RFC 5321, DOI 10.17487/RFC5321, October 2008,
https://www.rfc-editor.org/info/rfc5321. - [RFC6066] Eastlake 3rd, D., "Transport Layer Security (TLS) Extensions: Extension Definitions", RFC 6066, DOI 10.17487/RFC6066, January 2011,
https://www.rfc-editor.org/info/rfc6066. - [RFC6125] Saint-Andre, P. and J. Hodges, "Representation and Verification of Domain-Based Application Service Identity within Internet Public Key Infrastructure Using X.509 (PKIX) Certificates in the Context of Transport Layer Security (TLS)", RFC 6125, DOI 10.17487/RFC6125, March 2011,
https://www.rfc-editor.org/info/rfc6125. - [RFC6335] Cotton, M., Eggert, L., Touch, J., Westerlund, M., and S. Cheshire, "Internet Assigned Numbers Authority (IANA) Procedures for the Management of the Service Name and Transport Protocol Port Number Registry", BCP 165, RFC 6335, DOI 10.17487/RFC6335, August 2011,
https://www.rfc-editor.org/info/rfc6335. - [RFC7469] Evans, C., Palmer, C., and R. Sleevi, "Public Key Pinning Extension for HTTP", RFC 7469, DOI 10.17487/RFC7469, April 2015,
https://www.rfc-editor.org/info/rfc7469. - [TLS-1.3] Rescorla, E., "The Transport Layer Security (TLS) Protocol Version 1.3", Work in Progress, draft-ietf-tls-tls13-23, January 2018.
Appendix A. Design Considerations
This section is not normative. ๐ธ
okay so this appendix is the "why did they do it this way" tea โ and it's giving honest-retrospective energy ๐ฆ The first version of this document was written totally independently from the October 2013 version of [Email-TLS] ("Recommendations for use of TLS by Electronic Mail Access Protocols"). Later versions merge ideas from both documents, so the two drafts kinda became besties ๐
One author of this document was also the author of RFC 2595, which became the standard for TLS usage with POP and IMAP ๐ And the other author was perhaps the first to propose that idea. Now here's the plot twist ๐ญ In hindsight, both authors now believe that that approach was a mistake. ๐ Lowkey iconic that they just admitted it, no cap.
At this point the authors believe that anything that makes it easier to deploy TLS is good ๐ซถ But 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 ciphersuite). However, they can result in TLS deployment where it would not otherwise happen, and that is a sufficiently important goal that it overrides any problems. ๐ฅ
Although STARTTLS appears only slightly more complex than separate-port TLS, we again learned the lesson that complexity is the enemy of security ๐ Exhibit A is the STARTTLS command injection vulnerability (Computer Emergency Readiness Team (CERT) vulnerability ID #555316 [CERT-555316]). Although there's nothing inherently wrong with STARTTLS, the fact that it resulted in a common implementation error (made independently by multiple implementers) suggests that it is a less secure architecture than Implicit TLS. ๐
Section 7 of RFC 2595 critiques the separate-port approach to TLS, so let's go through the bullets ๐ The first bullet was a correct critique. There are proposals in the HTTP community to address that, and the use of SRV records as described in RFC 6186 resolves that critique for email ๐ The second bullet is correct as well, but it's not very important, because useful deployment of security layers other than TLS in email is small enough to be effectively irrelevant. (Also, it's less correct than it used to be, because "export" ciphersuites are no longer supported in modern versions of TLS.) The third bullet is incorrect, because it misses the desirable option of "use TLS for all subsequent connections to this server once TLS is successfully negotiated". ๐ The fourth bullet may be correct, but it 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 that it should trump design purity considerations. ๐
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 already widely used for that purpose 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 deployments, server deployments, and software to change significantly, which is contrary to the goal of promoting the increased use of TLS. Encouraging the use of STARTTLS on port 587 would not create interoperability problems, but it is unlikely to have any impact on the current undocumented use of port 465, and it 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. โจ
Acknowledgements
Thanks to Ned Freed for discussion of the initial concepts in this document. ๐ Thanks to Alexey Melnikov for [POP3-over-TLS], 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. ๐ซถ
Authors' Addresses
Keith Moore Windrock, Inc. PO Box 1934 Knoxville, TN 37901 United States of America
Email: moore@network-heretics.com
Chris Newman Oracle 440 E. Huntington Dr., Suite 400 Arcadia, CA 91006 United States of America
Email: chris.newman@oracle.com
That's the whole RFC, bestie! ๐โจ Thanks for hanging with me through all six parts, you're literally the best ๐๐
๐ฆ where this page comes from
- ietf: rfc8314 2018-01
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms