When another company's mail server sends email to your domain, encryption in transit is optional by default. An attacker in the middle can strip it. MTA-STS (RFC 8461) lets you publish a policy that says "only deliver to my real mail servers, and only over a verified encrypted connection". TLS-RPT (RFC 8460) sends you reports when delivery to you fails that test.
You need three things: a policy file, a DNS record announcing it, and (strongly recommended) a reporting record.
1. Write the policy file
For Microsoft 365, whose MX looks like yourdomain-com.mail.protection.outlook.com:
version: STSv1
mode: testing
mx: *.mail.protection.outlook.com
max_age: 604800For Google Workspace, list the MX hosts your domain actually uses. Older setups use aspmx.l.google.com and its alt hosts; newer ones use smtp.google.com:
version: STSv1
mode: testing
mx: smtp.google.com
mx: aspmx.l.google.com
mx: *.aspmx.l.google.com
max_age: 604800Check your real MX records first. Every MX host must match an mx: line, and a wildcard matches exactly one label (*.aspmx.l.google.com matches alt1.aspmx.l.google.com, not aspmx.l.google.com).
2. Host it over HTTPS
The file must be served at exactly:
https://mta-sts.yourdomain.com/.well-known/mta-sts.txtwith a valid, publicly trusted certificate for mta-sts.yourdomain.com, as text/plain, and without redirects. Any static host with HTTPS and a custom domain works:
- A small Cloudflare Worker or Pages project (free)
- GitHub Pages with a custom domain
- Azure Static Web Apps (Microsoft documents this route)
- Your existing website host, if it can serve a subdomain
3. Publish the DNS records
_mta-sts.yourdomain.com TXT "v=STSv1; id=20261018"
_smtp._tls.yourdomain.com TXT "v=TLSRPTv1; rua=mailto:tlsrpt@yourdomain.com"The id can be any short string. Change it every time you change the policy file. Senders only re-fetch the policy when the id changes.
4. Test, then enforce
- Leave
mode: testingfor one to two weeks. Mail is delivered as before, and TLS-RPT reports show whether any sender would have failed. - If the reports are clean, switch to
mode: enforce, raisemax_age(for example to31557600, one year), and update the id in the TXT record. - If you ever change mail provider, update the policy (and id) before you switch MX records. An enforced policy listing old MX hosts will make senders refuse to deliver.
Check your work
Run a free Hookgap check on the domain. The Email security section shows the MTA-STS mode it found and whether TLS reporting is enabled.
Keep reading
Google Yahoo sender requirements · 6 min read
Google, Yahoo and Microsoft sender rules, explained for small business owners
The authentication rules the big mailbox providers now enforce, translated into a short checklist for small businesses.
SPF too many DNS lookups · 6 min read
The SPF 10-lookup limit: why adding one more email tool breaks it
Why SPF silently fails after a few include: entries, how to count lookups, and how to fix it without breaking mail.
DMARC p=none vs reject · 5 min read
DMARC p=none vs quarantine vs reject, in plain English
What each DMARC policy does to fake email, and a safe path from p=none to p=reject.