RFC 8314

Cleartext Considered Obsolete: Use of Transport Layer Security (TLS) for Email Submission and Access

๐Ÿ“… published January 2018, from ietf

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 โœจ.

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:

  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 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 Received field 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] ๐Ÿซถ

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]. ๐Ÿ”‘


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

9.2. Informative References

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