MTA-STS check: is mail to your domain delivered encrypted?
We read the record at _mta-sts on your domain, fetch the policy from mta-sts.your-domain and check that it lists every one of your mail servers. Plus TLS-RPT, MX, SPF, DKIM and DMARC.
What the MTA-STS check tests
- TXT record. Is there v=STSv1 with an id at _mta-sts on your domain?
- Policy. Can https://mta-sts.your-domain/.well-known/mta-sts.txt be fetched with a valid certificate, with version, mode and max_age?
- Mail servers. Does the policy list every MX server of your domain? One missing in enforce mode is red: mail through it does not arrive.
- TLS-RPT. Is there a record for reports at _smtp._tls?
Set up MTA-STS
- Create the file mta-sts.txt, one mx line per mail server from the check:
version: STSv1 mode: testing mx: mail.your-domain.com max_age: 604800 - Serve it at https://mta-sts.your-domain.com/.well-known/mta-sts.txt with a valid certificate for mta-sts.your-domain.com (create the subdomain with your host).
- Add two TXT records:
_mta-sts.your-domain.com TXT "v=STSv1; id=20261203" _smtp._tls.your-domain.com TXT "v=TLSRPTv1; rua=mailto:tlsrpt@your-domain.com" - Check here. Once the TLS reports are clean for a few weeks: set mode to enforce, raise max_age (at most 31557600), change the id.
The check also reads SPF, DKIM and DMARC. More on that: SPF, DKIM and DMARC check.
Questions
What is MTA-STS?
Mail servers usually encrypt delivery between each other with STARTTLS, but that can be downgraded to plain text. With MTA-STS (RFC 8461) your domain publishes a policy: sending servers that honour it deliver only encrypted and only to the mail servers it lists.
What is TLS-RPT?
A TXT record at _smtp._tls on your domain with an address (RFC 8460). Sending servers send daily reports there on whether encrypted delivery worked. Without it you do not notice when it fails.
testing or enforce?
Start with testing: failures show up in the TLS reports, but mail is still delivered. Once the reports are clean for a few weeks, switch to enforce. none withdraws a policy.
Why must every MX be in the policy?
In enforce mode, sending servers only deliver to mail servers listed under mx:. If one is missing, mail through it does not arrive. Wildcards such as *.your-domain.com are allowed and cover exactly one label in front.
What is the id in the TXT record for?
Sending servers cache the policy for max_age. A new id tells them to fetch the file again. Change the id after every edit to mta-sts.txt, for example to the date.
Do I have to set up MTA-STS?
No, it is optional. It protects incoming mail against reading and rerouting in transit. Missing is not an error in the report; announced but broken is.