Mail servers encrypt with STARTTLS when they can, and fall back to plaintext when they cannot. An attacker who can interfere with the connection can make it "cannot". MTA-STS (RFC 8461) closes that gap, and TLS-RPT (RFC 8460) tells you when it bites.
1. Publish TLS-RPT first
_smtp._tls.example.com. TXT "v=TLSRPTv1; rua=mailto:tls-reports@example.com"
From now on, senders such as Google and Microsoft send a daily report of TLS successes and failures delivering to you. It costs nothing and is the only way you will learn that a policy is blocking mail.
2. Host the policy file
Serve this as text/plain at https://mta-sts.example.com/.well-known/mta-sts.txt, with a valid certificate for mta-sts.example.com:
version: STSv1
mode: testing
mx: mx1.example.com
mx: *.mail.example.net
max_age: 604800
- One
mx:line per MX host, or a wildcard covering one label. If your mail is hosted, use the names your provider gives you. max_ageis how long senders cache the policy, in seconds, up to a year. A week is a sensible start.- The server must not redirect: senders do not follow redirects.
3. Publish the DNS record
_mta-sts.example.com. TXT "v=STSv1; id=20261028T000000"
The id is how senders know the policy changed. Change it every time you edit the policy file.
4. Read the reports, then enforce
After a couple of weeks of clean TLS-RPT reports in testing mode, change mode: testing to mode: enforce and update the id. Senders that support MTA-STS will now refuse to deliver over a connection without valid TLS.
Keeping it working
- When you change mail provider or add an MX host, update the policy before the MX records.
- Certificate expiry on
mta-sts.stops senders refreshing the policy; on an MX host, it stops delivery. Monitor both. - If your DNS is DNSSEC-signed, DANE offers the same protection without depending on certificate authorities.
