<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rfc SYSTEM 'rfc2629.dtd' []>
<rfc ipr="trust200902" category="std" docName="draft-ietf-uta-mta-sts-01">
<?rfc toc="yes"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<?rfc private=""?>
<?rfc topblock="yes"?>
<?rfc comments="no"?>
<front>
<title abbrev="MTA-STS">SMTP MTA Strict Transport Security</title>

<author initials="D." surname="Margolis" fullname="Daniel Margolis">
<organization>Google, Inc</organization>
<address>
<postal>
<street></street>
<city></city>
<code></code>
<country></country>
<region></region>
</postal>
<phone></phone>
<email>dmargolis (at) google.com</email>
<uri></uri>
</address>
</author>
<author initials="M." surname="Risher" fullname="Mark Risher">
<organization>Google, Inc</organization>
<address>
<postal>
<street></street>
<city></city>
<code></code>
<country></country>
<region></region>
</postal>
<phone></phone>
<email>risher (at) google (dot com)</email>
<uri></uri>
</address>
</author>
<author initials="N." surname="Lidzborski" fullname="Nicolas Lidzborski">
<organization>Google, Inc</organization>
<address>
<postal>
<street></street>
<city></city>
<code></code>
<country></country>
<region></region>
</postal>
<phone></phone>
<email>nlidz (at) google (dot com)</email>
<uri></uri>
</address>
</author>
<author initials="W." surname="Chuang" fullname="Wei Chuang">
<organization>Google, Inc</organization>
<address>
<postal>
<street></street>
<city></city>
<code></code>
<country></country>
<region></region>
</postal>
<phone></phone>
<email>weihaw (at) google (dot com)</email>
<uri></uri>
</address>
</author>
<author initials="B." surname="Long" fullname="Brandon Long">
<organization>Google, Inc</organization>
<address>
<postal>
<street></street>
<city></city>
<code></code>
<country></country>
<region></region>
</postal>
<phone></phone>
<email>blong (at) google (dot com)</email>
<uri></uri>
</address>
</author>
<author initials="B." surname="Ramakrishnan" fullname="Binu Ramakrishnan">
<organization>Yahoo!, Inc</organization>
<address>
<postal>
<street></street>
<city></city>
<code></code>
<country></country>
<region></region>
</postal>
<phone></phone>
<email>rbinu (at) yahoo-inc (dot com)</email>
<uri></uri>
</address>
</author>
<author initials="A." surname="Brotman" fullname="Alexander Brotman">
<organization>Comcast, Inc</organization>
<address>
<postal>
<street></street>
<city></city>
<code></code>
<country></country>
<region></region>
</postal>
<phone></phone>
<email>alexander_brotman (at) cable.comcast (dot com)</email>
<uri></uri>
</address>
</author>
<author initials="J." surname="Jones" fullname="Janet Jones">
<organization>Microsoft, Inc</organization>
<address>
<postal>
<street></street>
<city></city>
<code></code>
<country></country>
<region></region>
</postal>
<phone></phone>
<email>janet.jones (at) microsoft (dot com)</email>
<uri></uri>
</address>
</author>
<author initials="F." surname="Martin" fullname="Franck Martin">
<organization>LinkedIn</organization>
<address>
<postal>
<street></street>
<city></city>
<code></code>
<country></country>
<region></region>
</postal>
<phone></phone>
<email>fmartin (at) linkedin (dot com)</email>
<uri></uri>
</address>
</author>
<author initials="K." surname="Umbach" fullname="Klaus Umbach">
<organization>1&amp;1 Mail &amp; Media Development &amp; Technology GmbH</organization>
<address>
<postal>
<street></street>
<city></city>
<code></code>
<country></country>
<region></region>
</postal>
<phone></phone>
<email>klaus.umbach (at) 1und1 (dot de)</email>
<uri></uri>
</address>
</author>
<author initials="M." surname="Laber" fullname="Markus Laber">
<organization>1&amp;1 Mail &amp; Media Development &amp; Technology GmbH</organization>
<address>
<postal>
<street></street>
<city></city>
<code></code>
<country></country>
<region></region>
</postal>
<phone></phone>
<email>markus.laber (at) 1und1 (dot de)</email>
<uri></uri>
</address>
</author>
<date year="2016" month="July" day="8"/>

<area>Applications</area>
<workgroup>Using TLS in Applications</workgroup>
<keyword></keyword>


<abstract>
<t>SMTP MTA-STS is a mechanism enabling mail service providers to declare their
ability to receive TLS-secured connections, to declare particular methods for
certificate validation, and to request that sending SMTP servers report upon
and/or refuse to deliver messages that cannot be delivered securely.
</t>
</abstract>


</front>

<middle>

<section anchor="introduction" title="Introduction">
<t>The STARTTLS extension to SMTP <xref target="RFC3207"/> allows SMTP clients and hosts to
establish secure SMTP sessions over TLS. In its current form, however, it fails
to provide (a) message confidentiality — because opportunistic STARTTLS is
subject to downgrade attacks — and (b) server authenticity — because the trust
relationship from email domain to MTA server identity is not cryptographically
validated.
</t>
<t>While such <spanx style="emph">opportunistic</spanx> encryption protocols provide a high barrier against
passive man-in-the-middle traffic interception, any attacker who can delete
parts of the SMTP session (such as the &quot;250 STARTTLS&quot; response) or who can
redirect the entire SMTP session (perhaps by overwriting the resolved MX record
of the delivery domain) can perform such a downgrade or interception attack.
</t>
<t>This document defines a mechanism for recipient domains to publish policies
specifying:
</t>
<t>
<list style="symbols">
<t>whether MTAs sending mail to this domain can expect TLS support</t>
<t>how MTAs can validate the TLS server certificate presented during mail
 delivery</t>
<t>the expected identity of MXs that handle mail for this domain</t>
<t>what an implementing sender should do with messages when TLS cannot be
 successfully negotiated</t>
</list>
</t>
<t>The mechanism described is separated into four logical components:
</t>
<t>
<list style="numbers">
<t>policy semantics: whether senders can expect a server for the
  recipient domain to support TLS encryption and how to validate the TLS
  certificate presented</t>
<t>policy discovery &amp; authentication: how to discover a domain's published
  STS policy and determine the authenticity of that policy</t>
<t>failure report format: a mechanism for informing recipient domains about
  aggregate failure statistics</t>
<t>failure handling: what sending MTAs should do in the case of policy
  failures</t>
</list>
</t>

<section anchor="terminology" title="Terminology">
<t>The keywords MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT,
SHOULD, SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL, when
they appear in this document, are to be interpreted as described in <xref target="RFC2119"/>.
</t>
<t>We also define the following terms for further use in this document:
</t>
<t>
<list style="symbols">
<t>STS Policy: A definition of the expected TLS availability and behavior, as
well as the desired actions for a given domain when a sending MTA encounters
different results.</t>
<t>Policy Domain: The domain against which an STS Policy is defined.</t>
<t>Policy Authentication: Authentication of the STS policy retrieved for a recipient
domain by the sender.</t>
</list>
</t>
</section>
</section>

<section anchor="related-technologies" title="Related Technologies">
<t>The DANE TLSA record <xref target="RFC7672"/> is similar, in that DANE is also designed to
upgrade opportunistic encryption into required encryption. DANE requires DNSSEC
<xref target="RFC4033"/> for the secure delivery of policies; the mechanism described here
presents a variant for systems not yet supporting DNSSEC.
</t>

<section anchor="differences-from-dane" title="Differences from DANE">
<t>The primary difference between the mechanism described here and DANE is that
DANE requires the use of DNSSEC to authenticate DANE TLSA records, whereas SMTP
STS relies on the certificate authority (CA) system to avoid interception. (For
a thorough discussion of this trade-off, see the section <spanx style="emph">Security</spanx>
<spanx style="emph">Considerations</spanx>.)
</t>
<t>In addition, SMTP MTA-STS introduces a mechanism for failure reporting and a
report-only mode, enabling offline (&quot;report-only&quot;) deployments and auditing for
compliance.
</t>

<section anchor="advantages-of-smtp-mtasts-when-compared-to-dane" title="Advantages of SMTP MTA-STS when compared to DANE">
<t>SMTP MTA-STS offers the following advantages compared to DANE:
</t>
<t>
<list style="symbols">
<t>Infrastructure: In comparison to DANE, this proposal does not require
 DNSSEC be deployed on either the sending or receiving domain. In addition,
 the reporting feature of SMTP MTA-STS can be deployed to perform offline
 analysis of STARTTLS failures, enabling mail providers to gain insight into
 the security of their SMTP connections without the need to modify MTA
 codebases directly.</t>
<t>Offline or report-only usage: DANE does not provide a reporting
 mechanism and does not have a concept of &quot;report-only&quot; for failures; as a
 result, a service provider cannot receive metrics on TLS acceptability
 without asking senders to enforce a given policy; similarly, senders who
 cannot enforce DANE constraints at send-time have no mechanism to provide
 recipients such metrics from an offline (and potentially easier-to-deploy)
 logs-analysis batch process.</t>
</list>
</t>
</section>

<section anchor="advantages-of-dane-when-compared-to-smtp-mtasts" title="Advantages of DANE when compared to SMTP MTA-STS">
<t>
<list style="symbols">
<t>Infrastructure: DANE may be easier for some providers to deploy. In
particular, for providers who already support DNSSEC, SMTP MTA-STS would
additionally require they host a HTTPS webserver and obtain a CA-signed
X.509 certificate for the recipient domain.</t>
<t>Security: DANE offers an advantage against policy-lookup DoS attacks; that is,
while a DNSSEC-signed NXDOMAIN response to a DANE lookup authoritatively
indicates the lack of a DANE record, such an option to authenticate policy
non-existence does not exist when looking up a policy over plain DNS.</t>
</list>
</t>
</section>
</section>
</section>

<section anchor="policy-semantics" title="Policy Semantics">
<t>SMTP MTA-STS policies are distributed via a &quot;well known&quot; HTTPS endpoint in the
Policy Domain. A corresponding TXT record in the DNS alerts sending MTAs to
the presence of a policy file.
</t>
<t>(Future implementations may move to alternate methods of policy discovery or
distribution. See the section <spanx style="emph">Future</spanx> <spanx style="emph">Work</spanx> for more discussion.)
</t>
<t><spanx style="strong">The MTA-STS TXT record MUST specify the following fields:</spanx>
</t>
<t>
<list style="symbols">
<t><spanx style="verb">v</spanx>: (plain-text, required). Currently only &quot;STSv1&quot; is supported.</t>
<t><spanx style="verb">id</spanx>: (plain-text, required). A short string used to track policy updates.
This string MUST uniquely identify a given instance of a policy, such that
senders can determine when the policy has been updated by comparing to the <spanx style="verb">id</spanx>
of a previously seen policy, and must also match the <spanx style="verb">policy_id</spanx> value of the
distributed policy.</t>
</list>
</t>
<t>A lenient parser SHOULD accept a policy file implementing a superset of this
specification, in which case unknown values SHALL be ignored.
</t>
<t><spanx style="strong">Policies MUST specify the following fields in JSON</spanx> <xref target="RFC4627"/> <spanx style="strong">format:</spanx>
</t>
<t>
<list style="symbols">
<t><spanx style="verb">version</spanx>: (plain-text, required). Currently only &quot;STSv1&quot; is supported.</t>
<t><spanx style="verb">mode</spanx>: (plain-text, required). If &quot;enforce&quot;, the receiving MTA requests that
messages be delivered only if they conform to the STS policy. If &quot;report&quot; the
receiving MTA requests that failure reports be delivered, as specified
by the <spanx style="verb">rua</spanx> parameter.</t>
<t><spanx style="verb">mx</spanx>: MX patterns (list of plain-text MX match patterns, required). One or
more comma-separated patterns matching the expected MX for this domain. For
example, <spanx style="verb">["*.example.com", "*.example.net"]</spanx> indicates that mail for this
domain might be handled by any MX whose hostname is a subdomain of
&quot;example.com&quot; or &quot;example.net&quot;. The semantics for these patterns should be the
ones found in the &quot;Checking of Wildcard Certificates&quot; rules in Section 6.4.3
of <xref target="RFC6125"/>.</t>
<t><spanx style="verb">max_age</spanx>: Max lifetime of the policy (plain-text integer seconds). Well-behaved
clients SHOULD cache a policy for up to this value from last policy fetch
time.</t>
<t><spanx style="verb">policy_id</spanx>: A short string used to track policy updates. This string MUST
uniquely identify a given instance of a policy, such that senders can
determine when the policy has been updated by comparing to the <spanx style="verb">policy_id</spanx> of
a previously seen policy.</t>
</list>
</t>
<t>A lenient parser SHOULD accept a policy file which is valid JSON implementing a
superset of this specification, in which case unknown values SHALL be ignored.
</t>

<section anchor="formal-definition" title="Formal Definition">

<section anchor="txt-record" title="TXT Record">
<t>The formal definition of the <spanx style="verb">_mta_sts</spanx> TXT record, defined using <xref target="RFC5234"/>,
is as follows:
</t>

<figure align="center"><artwork align="center">
sts-text-record = sts-version *WSP %x3B *WSP sts-id

sts-version     = "v" *WSP "=" *WSP %x53 %x54        ; "STSv1" 
                  %x53 %x76 %x31

sts-id          = "id" *WSP "=" *WSP 1*32(ALPHA / DIGIT) 
</artwork></figure>
</section>

<section anchor="smtp-mtasts-policy" title="SMTP MTA-STS Policy">
<t>The formal definition of the SMTP MTA-STS policy, using <xref target="RFC5234"/>, is as
follows:
</t>

<figure align="center"><artwork align="center">
sts-record      = WSP %x7B WSP  ; { left curly bracket
                  sts-element   ; comma-separated
                  [             ; list
                  WSP %x2c WSP  ; of
                  sts-element   ; sts-elements
                  ]
                  WSP %x7d WSP  ; } right curly bracket

sts-element     = sts-version / sts-mode / sts-id / sts-mx / sts-max_age

sts-version     = %x22 "version" %x22 *WSP %x3a *WSP ; "version":
                  %x22 %x53 %x54 %x53 %x76 %x31      ; "STSv1"

sts-mode        = %x22 "mode" %x22 *WSP %x3a *WSP    ; "mode":
                  %x22 ("report" / "enforce") %x22   ; "report"/"enforce"

sts-id          = %x22 "policy_id" %x22 *WSP %x3a *WSP ; "policy_id":
                  %x22 1*32(ALPHA / DIGIT) %x22        ; some chars

sts-mx          = %x22 "mx" $x22 *WSP %x3a *WSP      ; "mx":
                  %x5B                               ; [
                  domain-match                       ; comma-separated list
                  [WSP %x2c domain-match WSP]        ; of domain-matches
                  %x5B                               ; ]

sts-max_age     = %x22 "max_age" %x22 *WSP $x3a *WSP ; "max_age":
                  1*10DIGIT                          ; some digits

domain-match    = %x22 1*(dtext / "*") *("."         ; wildcard or label
                  1*dtext) %x22                      ; with 0+ more labels

dtext           = ALPHA / DIGIT / %2D                ; A-Z, a-z, 0-9, "-" 
</artwork></figure>
<t>A size limitation in a sts-uri, if provided, is interpreted as a
count of units followed by an OPTIONAL unit size (&quot;k&quot; for kilobytes,
&quot;m&quot; for megabytes, &quot;g&quot; for gigabytes, &quot;t&quot; for terabytes).  Without a
unit, the number is presumed to be a basic byte count.  Note that the
units are considered to be powers of two; a kilobyte is 2^10, a
megabyte is 2^20, etc.
</t>
</section>
</section>

<section anchor="policy-expirations" title="Policy Expirations">
<t>In order to resist attackers inserting a fraudulent policy, SMTP MTA-STS
policies are designed to be long-lived, with an expiry typically greater than
two weeks.  Policy validity is controlled by two separate expiration times: the
lifetime indicated in the policy (&quot;max_age=&quot;) and the TTL on the DNS record
itself. The policy expiration will ordinarily be longer than that of the DNS
TTL, and senders SHOULD cache a policy (and apply it to all mail to the
recipient domain) until the policy expiration.
</t>
<t>An important consideration for domains publishing a policy is that senders will
see a policy expiration as relative to the fetch of a policy cached by their
recursive resolver. Consequently, a sender MAY treat a policy as valid for up to
{expiration time} + {DNS TTL}. Publishers SHOULD thus continue to expect senders
to apply old policies for up to this duration.
</t>

<section anchor="policy-updates" title="Policy Updates">
<t>Updating the policy requires that the owner make changes in two places: the
<spanx style="verb">_mta_sts</spanx> RR record in the Policy Domain's DNS zone and at the corresponding
HTTPS endpoint. In the case where the HTTPS endpoint has been updated but the
TXT record has not been, senders will not know there is a new policy released
and may thus continue to use old, previously cached versions.  Recipients should
thus expect a policy will continue to be used by senders until both the HTTPS
and TXT endpoints are updated and the TXT record's TTL has passed.
</t>
</section>
</section>

<section anchor="policy-discovery--authentication" title="Policy Discovery &amp; Authentication">
<t>Senders discover a recipient domain's STS policy, by making an attempt to fetch
TXT records from the recipient domain's DNS zone with the name &quot;_mta_sts&quot;. A
valid TXT record presence in &quot;_mta_sts.example.com&quot; indicates that the recipent
domain supports STS.  To allow recipient domains to safely serve new policies,
it is important that senders are able to authenticate a new policy retrieved for
a recipient domain.
</t>
<t>Web PKI is the mechanism used for policy authentication. In this mechanism, the
sender fetches a HTTPS resource (policy) from a host at <spanx style="verb">policy.mta-sts</spanx> in the
Policy Domain. The policy is served from a &quot;well known&quot; URI:
<spanx style="verb">https://policy.mta-sts.example.com/.well-known/mta-sts/current</spanx>. To consider
the policy as valid, the <spanx style="verb">policy_id</spanx> field in the policy MUST match the <spanx style="verb">id</spanx>
field in the DNS TXT record under <spanx style="verb">_mta_sts</spanx>.
</t>
<t>When fetching a new policy or updating a policy, the new policy MUST be
fully authenticated (HTTPS certificate validation + peer verification) before
use.  A policy which has not ever been successfully authenticated MUST NOT be
used to reject mail.
</t>
</section>

<section anchor="policy-validation" title="Policy Validation">
<t>When sending to an MX at a domain for which the sender has a valid and
non-expired SMTP MTA-STS policy, a sending MTA honoring SMTP MTA-STS MUST
validate that the recipient MX supports STARTTLS, and offers a valid PKIX based
TLS certificate. The certificate presented by the receiving MX MUST be valid
for the MX name and chain to a root CA that is trusted by the sending MTA. The
certificate MUST have a CN or SAN matching the MX hostname (as described in
<xref target="RFC6125"/>) and be non-expired.
</t>
</section>

<section anchor="policy-application" title="Policy Application">
<t>When sending to an MX at a domain for which the sender has a valid non-expired
SMTP MTA-STS policy, a sending MTA honoring SMTP MTA-STS MAY apply the result
of a policy validation one of two ways:
</t>
<t>
<list style="symbols">
<t><spanx style="verb">report</spanx>: In this mode, sending MTAs merely send a report to the designated
report address indicating policy application failures. This can be done
&quot;offline&quot;, i.e. based on the MTA logs, and is thus a suitable low-risk option
for MTAs who wish to enhance transparency of TLS tampering without making
complicated changes to production mail-handling infrastructure.</t>
<t><spanx style="verb">enforce</spanx>: In this mode, sending MTAs SHOULD treat STS policy failures, in
which the policy action is &quot;reject&quot;, as a mail delivery error, and SHOULD
terminate the SMTP connection, not delivering any more mail to the recipient
MTA.</t>
</list>
</t>
<t>In <spanx style="verb">enforce</spanx> mode, however, sending MTAs MUST first check for a new
authenticated policy before actually treating a message failure as fatal.
</t>
<t>Thus the control flow for a sending MTA that does online policy application
consists of the following steps:
</t>
<t>
<list style="numbers">
<t>Check for cached non-expired policy. If none exists, fetch the latest,
authenticate and cache it.</t>
<t>Validate recipient MTA against policy. If valid, deliver mail.</t>
<t>If not valid and the policy specifies reporting, generate report.</t>
<t>If not valid and policy specifies rejection, perform the following
steps:
<list style="symbols">
<t>Check for a new (non-cached) authenticated policy.</t>
<t>If one exists and the new policy is different, update the current policy and
go to step 2.</t>
<t>If one exists and the new policy is same as the cached policy, treat the
delivery as a failure.</t>
<t>If none exists and cached policy is not expired, treat the delivery as a
failure.</t>
</list></t>
</list>
</t>
<t>Understanding the details of step 4 is critical to understanding the behavior of
the system as a whole.
</t>
<t>Remember that each policy has an expiration time (which SHOULD be long, on the
order of days or months) and a validation method. With these two mechanisms and
the procedure specified in step 4, recipients who publish a policy have, in
effect, a means of updating a cached policy at arbitrary intervals, without the
risks (of a man-in-the-middle attack) they would incur if they were to shorten
the policy expiration time.
</t>
</section>
</section>

<section anchor="failure-reporting" title="Failure Reporting">
<t>Aggregate statistics on policy failures MAY be reported using the <spanx style="verb">TLSRPT</spanx>
reporting specification (TODO: Add Ref).
</t>
</section>

<section anchor="iana-considerations" title="IANA Considerations">
<t>There are no IANA considerations at this time.
</t>
</section>

<section anchor="security-considerations" title="Security Considerations">
<t>SMTP Strict Transport Security protects against an active attacker who wishes to
intercept or tamper with mail between hosts who support STARTTLS. There are two
classes of attacks considered:
</t>
<t>
<list style="symbols">
<t>Foiling TLS negotiation, for example by deleting the &quot;250 STARTTLS&quot; response
from a server or altering TLS session negotiation. This would result in the
SMTP session occurring over plaintext, despite both parties supporting TLS.</t>
<t>Impersonating the destination mail server, whereby the sender might deliver
the message to an impostor, who could then monitor and/or modify messages
despite opportunistic TLS. This impersonation could be accomplished by
spoofing the DNS MX record for the recipient domain, or by redirecting client
connections intended for the legitimate recipient server (for example, by
altering BGP routing tables).</t>
</list>
</t>
<t>SMTP Strict Transport Security relies on certificate validation via PKIX based TLS
identity checking <xref target="RFC6125"/>. Attackers who are able to obtain a valid certificate
for the targeted recipient mail service (e.g. by compromising a certificate authority)
are thus out of scope of this threat model.
</t>
<t>Since we use DNS TXT record for policy discovery, an attacker who is able to
block DNS responses can suppress the discovery of an STS Policy, making the
Policy Domain appear not to have an STS Policy. The caching model described in
<spanx style="emph">Policy</spanx> <spanx style="emph">Expirations</spanx> is designed to resist this attack, and there is
discussion in the <spanx style="emph">Future</spanx> <spanx style="emph">Work</spanx> section around future distribution mechanisms
that are robust against this attack.
</t>
</section>

<section anchor="future-work" title="Future Work">
<t>The authors would like to suggest multiple considerations for future discussion.
</t>
<t>
<list style="symbols">
<t>Certificate pinning: One potential improvement in the robustness of the
certificate validation methods discussed would be the deployment of public-key
pinning as defined for HTTP in <xref target="RFC7469"/>. A policy extension supporting
these semantics would enable Policy Domains to specify certificates that MUST
appear in the MX certificate chain, thus providing resistence against
compromised CA or DNSSEC zone keys.</t>
<t>Policy distribution: As with Certificate Transparency (<xref target="RFC6962"/>), it may be
possible to provide a verifiable log of policy <spanx style="emph">observations</spanx> (meaning which
policies have been observed for a given Policy Domain). This would provide
insight into policy spoofing or faked policy non-existence. This may be
particularly useful for Policy Domains not using DNSSEC, since it would
provide sending MTAs an authoritative source for whether a policy is expected
for a given domain.</t>
<t>Receive-from restrictions: Policy publishers may wish to also indicate to
domains <spanx style="emph">receiving</spanx> mail from the Policy Domain that all such mail is expected
to be sent via TLS. This may allow policy publishers to receive reports
indicating sending MTA misconfigurations. However, the security properties of
a &quot;receiver-enforced&quot; system differ from those of the current design; in
particular, an active man-in-the-middle attacker may be able to exploit
misconfigured sending MTAs in a way that would not be possible today with a
sender-enforced model.</t>
<t>Cipher and TLS version restrictions: Policy publishers may also wish to
restrict TLS negotiation to specific ciphers or TLS versions.</t>
</list>
</t>
</section>

<section anchor="appendix-1-validation-pseudocode" title="Appendix 1: Validation Pseudocode">

<figure align="center"><artwork align="center">
policy = policy_from_cache()
if not policy or is_expired(policy):
  policy = policy_from_https_endpoint()  // fetch and authenticate!
  update_cache = true
if policy:
  if invalid_mx_or_tls(policy):  // check MX and TLS cert
    if rua:
      generate_report()
    if p_reject():
      policy = policy_from_https_endpoint()  // fetch and authenticate #2!
      update_cache = true
      if invalid_mx_or_tls(policy):
        reject_message()
        update_cache = false
  if update_cache:
    cache(policy)
</artwork></figure>
</section>

<section anchor="appendix-2-domain-owner-sts-example-record" title="Appendix 2: Domain Owner STS example record">

<section anchor="example-1" title="Example 1">
<t>The owner of example.com wishes to begin using STS with a policy that will
solicit aggregate feedback from receivers without affecting how the messages are
processed, in order to:
</t>
<t>
<list style="symbols">
<t>Verify the identity of MXs that handle mail for this domain</t>
<t>Confirm that its legitimate messages are sent over TLS</t>
<t>Verify the validity of the certificates</t>
<t>Determine how many messages would be affected by a strict policy</t>
</list>
</t>
<t>DNS STS policy indicator TXT record:
</t>

<figure align="center"><artwork align="center">
_mta_sts  IN TXT ( "v=STSv1; id=randomstr;" )
</artwork></figure>
<t>STS policy served from HTTPS endpoint of the policy (recipient) domain, and
is authenticated using Web PKI mechanism. The policy is fetched using HTTP
GET method.
</t>

<figure align="center"><artwork align="center">
{
  "version": "STSv1",
  "mode": "report",
  "policy_id": "randomstr",
  "mx": ["*.mail.example.com"],
  "max_age": 123456
}
</artwork></figure>
<t>The policy is authenticated using Web PKI mechanism.
</t>
</section>
</section>

<section anchor="appendix-3-deep-registration-elements" title="Appendix 3: DEEP Registration Elements">

<figure align="center"><artwork align="center">
Name: mx-mismatch
Description: This indicates that the MX resolved for the recipient domain
             did not match the MX constraint specified in the policy.
Intended Usage:  COMMON
Reference:  RFC XXXX (this document once published)
Submitter:  Authors of this document
Change Controller:  IESG

Name: certificate-name-mismatch
Description: This indicates that the subject CNAME/SAN in the certificate
             presented by the receiving MX did not match the MX hostname
Intended Usage:  COMMON
Reference:  RFC XXXX (this document once published)
Submitter:  Authors of this document
Change Controller:  IESG

Name: invalid-certificate
Description: This indicates that the certificate presented by the receiving MX
             did not validate according to the policy validation constraint.
             (Either it was not signed by a trusted CA or did not match the
             DANE TLSA record for the recipient MX.)
Intended Usage:  COMMON
Reference:  RFC XXXX (this document once published)
Submitter:  Authors of this document
Change Controller:  IESG

Name: certificate-name-constraints-not-permitted
Description: The certificate request contains a name that is not listed as
             permitted in the name constraints extension of the cert issuer.
Intended Usage:  COMMON
Reference:  RFC XXXX (this document once published)
Submitter:  Authors of this document
Change Controller:  IESG

Name: certificate-name-constraints-excluded
Description: The certificate request contains a name that is listed as 
             excluded in the name constraints extension of the issuer.
Intended Usage:  COMMON
Reference:  RFC XXXX (this document once published)
Submitter:  Authors of this document
Change Controller:  IESG

Name: expired-certificate
Description: This indicates that the certificate has expired.
Intended Usage:  COMMON
Reference:  RFC XXXX (this document once published)
Submitter:  Authors of this document
Change Controller:  IESG

Name: starttls-not-supported
Description: This indicates that the recipient MX did not support STARTTLS.
Intended Usage:  COMMON
Reference:  RFC XXXX (this document once published)
Submitter:  Authors of this document
Change Controller:  IESG

Name: tlsa-invalid
Description: This indicates a validation error for Policy Domain specifying
             "tlsa" validation.
Intended Usage:  COMMON
Reference:  RFC XXXX (this document once published)
Submitter:  Authors of this document
Change Controller:  IESG

Name: dnssec-invalid
Description: This indicates a failure to validate DNS records for a Policy
             Domain specifying "tlsa" validation or "dnssec" authentication.
Intended Usage:  COMMON
Reference:  RFC XXXX (this document once published)
Submitter:  Authors of this document
Change Controller:  IESG

Name: sender-does-not-support-validation-method
Description: This indicates the sending system can never validate using the
             requested validation mechanism.
Intended Usage:  COMMON
Reference:  RFC XXXX (this document once published)
Submitter:  Authors of this document
Change Controller:  IESG
</artwork></figure>
</section>

</middle>
<back>
<references title="Normative References">
<?rfc include="http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.2119.xml"?>
<?rfc include="http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.3207.xml"?>
<?rfc include="http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4033.xml"?>
<?rfc include="http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.4627.xml"?>
<?rfc include="http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.5234.xml"?>
<?rfc include="http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6125.xml"?>
<?rfc include="http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.6962.xml"?>
<?rfc include="http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7469.xml"?>
<?rfc include="http://xml2rfc.ietf.org/public/rfc/bibxml/reference.RFC.7672.xml"?>
</references>

</back>
</rfc>
