MTA-STS · TLS reporting · Email encryption
MTA-STS + TLS-RPT setup: stop your mail being downgraded to unencrypted delivery
Nothing in SPF, DKIM or DMARC requires encryption. Without MTA-STS, a sender that cannot negotiate TLS may simply deliver your mail in plain text — or an attacker in the middle may strip the encryption offer away.
MTA-STS closes that gap: it tells senders which hosts may receive your mail, and that TLS with a valid certificate is required.
The fast answer
Do not jump to enforce. Publish TLS reporting first, then an MTA-STS policy in testing mode, watch the reports, and only then switch to enforce. The order is: find your real MX hosts → host the policy file over HTTPS → publish both TXT records → test → enforce. A policy that lists the wrong MX host will bounce your mail once enforced, so testing is not optional.
What you are looking at, in plain words
Normal SMTP delivery tries encryption opportunistically: the sender asks “do you support STARTTLS?” and, if the answer is no or the negotiation fails, it usually delivers anyway in plain text. That fallback is what downgrade attacks exploit. MTA-STS (RFC 8461) replaces the guess with a published rule: a small policy file, fetched over HTTPS from mta-sts.yourdomain, that names your mail hosts and says whether TLS is merely preferred or mandatory. TLS reporting (RFC 8460) is the feedback loop: senders email you daily JSON summaries of what failed, so you can see a bad MX entry or an expired certificate before it costs you mail.
| Piece | Where it lives | What it does |
|---|---|---|
| TLS-RPT record | TXT at _smtp._tls | Tells senders where to send failure reports |
| MTA-STS record | TXT at _mta-sts | Announces a policy exists, with an id you change on every edit |
| Policy file | https://mta-sts.yourdomain/.well-known/mta-sts.txt | Lists MX hosts, mode and cache lifetime |
MTA-STS only protects mail to your domain. It does nothing for mail you send out — that depends on the recipient’s own policy.
Step 0 — Prove which part is failing
- Look up your MX records (
dig MX yourdomainor your DNS host’s record list) and write down every host that genuinely receives your mail, including any gateway or filtering service in front of your mailbox provider. The policy file must list all of them; a missing host becomes undeliverable in enforce mode. - Check that you can serve HTTPS from
mta-sts.yourdomainwith a valid certificate from a public certificate authority. A self-signed or expired certificate means senders cannot trust the policy at all. - Decide where TLS reports will go: a dedicated mailbox such as
tls-report@yourdomainthat you actually monitor. Reports arrive as JSON attachments, so a mailbox nobody reads is no feedback loop.
Fix 1 — Turn on TLS reporting first
Google’s documented order is TLS reporting first, then MTA-STS. Add this TXT record at _smtp._tls:
v=TLSRPTv1; rua=mailto:tls-report@yourdomainReplace the address with your own reporting mailbox. Multiple addresses are separated by commas, each with its own mailto: prefix — for example rua=mailto:tls-report@yourdomain,mailto:reports@yourdomain. This record alone changes nothing about delivery — it only asks senders to report failures to you.
Fix 2 — Write the policy file with your real MX hosts
Host this exact-shaped file at https://mta-sts.yourdomain/.well-known/mta-sts.txt. Start in testing mode with a short cache lifetime:
version: STSv1
mode: testing
mx: your-real-mx-host.example
max_age: 86400One mx: line per host, exactly as it appears in your MX records. Wildcards cover one label only (for example *.mail.protection.outlook.com for Microsoft 365 tenants whose MX hosts sit under that pattern — some newer Microsoft 365 domains instead use an mx.microsoft hostname — check your own MX records rather than copying a pattern from a blog). The max_age is in seconds: 86400 is one day, 604800 is one week. A short value while testing means a mistake stops hurting you quickly; raise it later.
Fix 3 — Announce the policy in DNS
Add this TXT record at _mta-sts:
v=STSv1; id=20261027000000The id must be 1–32 alphanumeric characters, and you must change it to a new unique value every time you change the policy file — senders use it to know the policy changed. Using the current date and time, as Google recommends, makes that easy to remember. Until this record exists, no sender will look for your policy file.
Fix 4 — Run in testing, read the reports, then enforce
- Wait for TLS reports to arrive at your reporting mailbox and read them: look for policy-fetch failures, certificate failures and MX mismatches, and fix each one at its source (usually a missing MX line or a certificate problem on the policy host).
- Only when reports are clean, change
mode: testingtomode: enforcein the policy file, raisemax_age(a week or more is the usual enforce value), and change the_mta-stsTXTidto a new value so senders pick up the change. - Keep monitoring reports after the switch. In enforce mode a sender that cannot match an MX host or validate TLS will not deliver to you, so a later MX change that you forget to mirror in the policy file will bounce mail.
Prove it worked
- Open
https://mta-sts.yourdomain/.well-known/mta-sts.txtin a browser and confirm the file loads with no certificate warning and shows your current mode and MX lines. - Query both TXT records from outside your network (
dig TXT _mta-sts.yourdomain +shortanddig TXT _smtp._tls.yourdomain +short) and confirm the values match what you published. - Send test mail from an outside account and, after a day, check the TLS report mailbox: reports arriving at all proves the reporting record works; a report with no failures for your hosts proves the policy is sound.
Still not working? Work this ladder in order
- Policy file not found or certificate warning. The subdomain does not point at your server, the file path is wrong (it must be exactly
/.well-known/mta-sts.txt), or the certificate is self-signed or expired. Fix hosting before touching DNS. - Reports show an MX mismatch. Compare the report’s host against your MX records line by line. A gateway host, a legacy MX host or a wildcard that does not cover the real host is the usual culprit — add the missing host and bump the
id. - Mail bounces after switching to enforce. Drop back to
testingimmediately (and bump theid), then read the reports: enforce mode is doing exactly what you asked, so the policy — not the sender — is wrong. - No reports arrive at all. Check the
_smtp._tlsrecord spelling, check the reporting mailbox and its spam folder, and remember reports are daily aggregates from senders that support TLS reporting — silence from one sender is not proof of a broken record.
Mistakes that make it worse
- Switching to enforce on day one, before any report has been read.
- Listing only the mailbox provider’s MX and forgetting a gateway or filtering service that actually receives your mail.
- Changing the policy file without changing the
_mta-stsTXTid, so senders keep using the cached old policy. - Publishing the policy on a subdomain with a self-signed certificate and wondering why nobody honours it.
FAQ
Does MTA-STS encrypt my outgoing mail?
No. Your MTA-STS policy protects mail sent to your domain by other senders. Your outgoing mail is protected by the recipient domain’s policy, if it has one, and otherwise by opportunistic TLS.
How long should I stay in testing mode?
Until your TLS reports are clean for your real sending population — for most small businesses, at least a few weeks of reports. There is no fixed number in the standard; the reports, not the calendar, are the signal.
What happens if I stop publishing the policy?
Set mode to none, publish that file, bump the _mta-sts id so senders fetch the new policy, and keep it up until the old max_age expires — only then remove the records and the policy host. Deleting the file and records at once leaves senders with a cached enforce policy that can no longer be fetched.
Sources
Google Workspace Help — Turn on MTA-STS and TLS reporting (TXT records at _smtp._tls and _mta-sts, TLS reporting first, id rules) · RFC 8461 (SMTP MTA Strict Transport Security) and RFC 8460 (SMTP TLS Reporting) — policy format, modes testing / enforce / none, max_age.
Did this fix work for you?
Your reaction is stored only in your own browser — it is not sent to us.