When another server delivers mail to you, it usually encrypts the connection with STARTTLS. But encryption is optional by default: an attacker in the middle can strip it, or present a fake certificate, and the sender falls back to plain text. MTA-STS (RFC 8461) lets you publish that your mail servers always support TLS with a valid certificate, so senders refuse to deliver otherwise.
What you publish
-
A TXT record announcing the policy and its version:
_mta-sts.example.com. TXT "v=STSv1; id=20261001" -
A policy file at exactly
https://mta-sts.example.com/.well-known/mta-sts.txt, served astext/plainwith a valid HTTPS certificate:version: STSv1 mode: testing mx: mx1.example.com mx: *.mail.protection.outlook.com max_age: 604800
mx:lists every MX host, as they appear in your MX records. Wildcards cover one label. A missing MX host becomes undeliverable in enforce mode.mode:testing(report problems, deliver anyway),enforce(refuse insecure delivery) ornone(switch off).max_age:how long senders cache the policy, in seconds. Use at least a week; up to a year (31557600) once stable.idin the TXT record must change every time you change the policy file, or senders keep using their cached copy.
Rolling it out
- Publish a TLS-RPT record first, so you receive reports about failed deliveries.
- Publish the policy in
mode: testingand read the TLS reports for a couple of weeks. - When the reports are clean, switch to
mode: enforceand update theid. - Keep the certificate of
mta-sts.example.comrenewed. If it expires, senders can't refresh the policy.
The mta-sts host only needs to serve this one small file. Any static hosting with a valid certificate will do.