MTA-STS record
Learn what an MTA-STS record is, where the _mta-sts TXT and HTTPS policy file live, and how mode, mx, and max_age tell senders to use TLS.
TL;DR
An MTA-STS record tells other mail servers to deliver mail to your domain over TLS, and which MX hostnames are allowed to receive it. The DNS part is a TXT record at _mta-sts. The policy itself is a text file served over HTTPS.
STARTTLS is optional. A sender that cannot complete TLS can fall back to cleartext, and an attacker on the path can strip the STARTTLS offer. MTA-STS is the published instruction to stop doing that.
MTA-STS uses two names. DNS only holds a short pointer. The policy is not a DNS record.
TXT pointer.
_mta-sts.{domain}_mta-sts.example.com. TXT "v=STSv1; id=2026111401;"Policy file. HTTPS only, on the host mta-sts.{domain}:
https://mta-sts.example.com/.well-known/mta-sts.txtThe certificate for that host has to match mta-sts.example.com. A certificate for example.com alone is not enough.
| Tag | Required | Meaning |
|---|---|---|
v=STSv1 | Yes | Must be first. Any other version is ignored. |
id= | Yes | 1 to 32 letters or digits. Change it when the policy file changes so senders fetch the new file. |
The MTA-STS checker treats a missing id= as an error.
version: STSv1
mode: enforce
mx: mail.example.com
mx: *.example.net
max_age: 604800| Field | Meaning |
|---|---|
version | STSv1. |
mode | enforce, testing, or none. |
mx | One hostname pattern per line. A leading *. matches one label. |
max_age | Seconds a sender may cache the policy. |
testing still publishes the policy, and senders can report failures, but they do not refuse cleartext. enforce is the mode that stops a downgrade. none is how you take the policy back.
The checker fetches the file and flags a version other than STSv1, a mode outside those three values, a fetch that is not HTTP 200, and a max_age greater than 0 but shorter than one day, 86400 seconds. It does not compare the mx lines to your published MX records. Those lines still have to name the hosts that actually receive your mail, or enforcing senders will refuse delivery.
dig _mta-sts.example.com TXTcurl https://mta-sts.example.com/.well-known/mta-sts.txtEnter _mta-sts.example.com in the lookup above. A TXT query for the bare domain will not show this record.
Publish TLS-RPT at the same time if you want senders to tell you when the policy fails. MTA-STS itself does not send reports.
Related: TLS-RPT Record · MX Record · DANE Record · DMARC Record · MTA-STS Checker