Upon receipt of the REQUIRETLS option on a MAIL FROM command during the receipt of a message, an SMTP server
MUST tag that message as needing REQUIRETLS handling.
Upon receipt of a message not specifying the REQUIRETLS option on its MAIL FROM command but containing the TLS-Required header field in its message header, an SMTP server implementing this specification
MUST tag that message with the option specified in the TLS-Required header field. If the REQUIRETLS MAIL FROM parameter is specified, the TLS-Required header field
MUST be ignored but
MAY be included in the onward relay of the message.
The manner in which the above tagging takes place is implementation dependent. If the message is being locally aliased and redistributed to multiple addresses, all instances of the message
MUST be tagged in the same manner.
When sending a message tagged as requiring TLS for which the MAIL FROM return-path is not empty (an empty MAIL FROM return-path indicating a bounce message), the sending (client) MTA
MUST:
-
Look up the SMTP server to which the message is to be sent, as described in RFC 5321, Section 5.1.
-
If the server lookup is accomplished via the recipient domain's MX record (the usual case) and is not accompanied by a valid DNSSEC signature, the client MUST also validate the SMTP server name using MTA-STS, as described in RFC 8461, Section 4.1.
-
Open an SMTP session with the peer SMTP server using the EHLO verb.
-
Establish a TLS-protected SMTP session with its peer SMTP server and authenticate the server's certificate as specified in [RFC 6125] or [RFC 7672], as applicable. The hostname from the MX record lookup (or the domain name in the absence of an MX record where an A record is used directly) MUST match the DNS-ID or CN-ID of the certificate presented by the server.
-
Ensure that the response to the subsequent EHLO following establishment of the TLS protection advertises the REQUIRETLS capability.
The SMTP client
SHOULD follow the recommendations in [
RFC 7525] or its successor with respect to negotiation of the TLS session.
If any of the above steps fail, the client
MUST issue a QUIT to the server and repeat steps 2-5 with each host on the recipient domain's list of MX hosts in an attempt to find a mail path that meets the sender's requirements. The client
MAY send other, unprotected messages to that server if it has any such messages prior to issuing the QUIT. If there are no more MX hosts, the client
MUST NOT transmit the message to the domain.
Following such a failure, the SMTP client
MUST send a non-delivery notification to the reverse-path of the failed message, as described in
Section 3.6 of
RFC 5321. The following [
RFC 5248]
SHOULD be used:
-
REQUIRETLS not supported by server: 5.7.30 REQUIRETLS support required
-
Unable to establish TLS-protected SMTP session: 5.7.10 Encryption needed
Refer to
Section 5 for further requirements regarding non-delivery messages.
If all REQUIRETLS requirements have been met, transmit the message, issuing the REQUIRETLS option on the MAIL FROM command with the required option(s), if any.
Messages tagged "TLS-Required: No" are handled as follows. When sending such a message, the sending (client) MTA
MUST:
-
Look up the SMTP server to which the message is to be sent, as described in RFC 5321, Section 5.1.
-
Open an SMTP session with the peer SMTP server using the EHLO verb. Attempt to negotiate STARTTLS if possible, and follow any policy published by the recipient domain, but do not fail if this is unsuccessful.
Some SMTP servers may be configured to require STARTTLS connections as a matter of policy and not accept messages in the absence of STARTTLS. A non-delivery notification
MUST be returned to the sender if message relay fails due to an inability to negotiate STARTTLS when required by the server.
Since messages tagged with "TLS-Required: No" will sometimes be sent to SMTP servers not supporting REQUIRETLS, that option will not be uniformly observed by all SMTP relay hops.
A Mail User Agent (MUA) or other agent making the initial introduction of a message has the option to decide whether to require TLS. If TLS is to be required, it
MUST do so by negotiating STARTTLS and REQUIRETLS and including the REQUIRETLS option on the MAIL FROM command, as is done for message relay.
When TLS is not to be required, the sender
MUST include the TLS-Required header field in the message. SMTP servers implementing this specification
MUST interpret this header field as described in
Section 4.1.
In either case, the decision whether to specify REQUIRETLS
MAY be done based on a user interface selection or based on a ruleset or other policy. The manner in which the decision to require TLS is made is implementation dependent and is beyond the scope of this specification.
Messages are usually retrieved by end users using protocols other than SMTP such as [
RFC 3501], [
RFC 1939], or Web mail systems. Mail delivery agents supporting the REQUIRETLS SMTP option
SHOULD observe the guidelines in [
RFC 8314].