Encryption between mail servers is usually opportunistic: if TLS fails, the message goes out in the clear, and an attacker can deliberately break the negotiation. MTA-STS gives the recipient a way to declare that its servers always support TLS, so a sending server must not accept anything less.
What it consists of
- A
_mta-stsTXT record in DNS with a version and a policy ID; the ID changes whenever the policy changes. - A policy file served over HTTPS from the
mta-stssubdomain at the path/.well-known/mta-sts.txt.
_mta-sts.example.com. IN TXT "v=STSv1; id=20261107T120000Z" # https://mta-sts.example.com/.well-known/mta-sts.txtversion: STSv1mode: enforcemx: mail.example.commax_age: 604800When a sender sees the _mta-sts record, it downloads the policy over HTTPS (so authenticity is verified with an ordinary web certificate) and caches it for max_age. On later deliveries it checks the server name from the MX record against the mx list and verifies the server’s certificate.
Modes
| Mode | What the sender does when validation fails |
|---|---|
enforce | does not deliver the message to that server and retries later |
testing | delivers the message but reports the failure through TLS-RPT reports |
none | the policy is treated as absent; this mode exists so that a policy can be withdrawn |
The maximum value of max_age is 31,557,600 seconds (about a year). Unlike DANE, MTA-STS does not require DNSSEC: trust is built on certificates, but the policy could be spoofed on first download, which is why it is cached for a long time. The standard is RFC 8461 (September 2018, with authors from Google, Comcast, Microsoft and Oath).
Sources
the term is written from these pagesVerified 9 Nov