Support Library
MTA-STS and TLS-RPT Explained
MTA-STS lets a domain tell sending mail servers to require valid TLS when delivering to its MX hosts, using a DNS record and an HTTPS policy file. TLS-RPT asks those senders to report daily on TLS successes and failures.
The short answer
Server-to-server email has used STARTTLS encryption for decades, but by default it is opportunistic. If the receiving server does not offer TLS, or offers a certificate that does not match, most senders deliver the message anyway in plain text. An attacker who can interfere with the connection can strip the STARTTLS offer and read the mail.
SMTP MTA Strict Transport Security, defined in RFC 8461, fixes that for receiving domains that opt in. It publishes a policy saying "only deliver to these MX hosts, and only over TLS with a valid certificate." SMTP TLS Reporting, defined in RFC 8460, gives you visibility by asking senders to send you summary reports of what happened when they tried.
Reports cost nothing to request and tell you whether enforcement would break anything. Turn them on before you publish an MTA-STS policy, and read them before you switch to enforce.
The problem with opportunistic TLS
When a sending server, or MTA, delivers mail to example.com, it looks up the MX records, connects to one of those hosts on port 25, and issues STARTTLS if the server advertises it. Two weaknesses follow from that design. First, the STARTTLS advertisement travels in clear text, so an active attacker can remove it and the sender will fall back to unencrypted delivery. Second, most senders do not check the certificate against the MX host name, because historically too many legitimate servers had self-signed or mismatched certificates.
Neither weakness can be fixed by the receiving server alone. The sender needs some trusted signal, obtained in advance, that says this domain always supports valid TLS. MTA-STS and DANE are the two standards that provide that signal. DANE uses DNSSEC and is covered in DANE for Email. MTA-STS uses HTTPS and the ordinary web certificate system instead.
How MTA-STS works
An MTA-STS deployment has two parts that must agree. A TXT record at _mta-sts.example.com announces that a policy exists and carries an id that changes whenever the policy changes. The policy itself is a small text file served over HTTPS at a fixed location on the host mta-sts.example.com.
_mta-sts TXT record
HTTPS with a valid certificate
max_age seconds
listed MX with valid TLS
$ dig +short TXT _mta-sts.example.com
"v=STSv1; id=20261015T090000;"
$ curl -s https://mta-sts.example.com/.well-known/mta-sts.txt
version: STSv1
mode: enforce
mx: mx1.example.com
mx: mx2.example.com
mx: *.mail.example.net
max_age: 1209600
Each mx line lists a host the sender may deliver to, and a leading *. matches one label, so *.mail.example.net covers hosts such as in1.mail.example.net. The max_age is in seconds; the example is two weeks, and RFC 8461 caps it at about one year. Because the policy is fetched over HTTPS from a host in your own domain, an attacker would need a valid certificate for mta-sts.example.com to forge it.
The model is trust on first use. A sender that has never seen your policy cannot be protected on that first delivery, but once it has cached a policy, a later attacker cannot remove it by tampering with DNS, because the cached policy stays valid until max_age runs out.
| Mode | Sender behavior | Use it when |
|---|---|---|
| testing | Delivers even if validation fails, but reports failures through TLS-RPT | Rolling out, or after a large MX change |
| enforce | Refuses delivery to MX hosts that are not listed or fail certificate validation | Reports are clean and certificate renewal is automated |
| none | Treats the domain as having no active policy | Retiring MTA-STS cleanly, so caches are replaced rather than left in enforce |
How TLS-RPT works
TLS-RPT is a single TXT record at _smtp._tls.example.com that names where reports should go. The destination can be a mailto: address or an https: endpoint.
$ dig +short TXT _smtp._tls.example.com
"v=TLSRPTv1; rua=mailto:tls-reports@example.com"
Participating senders send one aggregate report per day as compressed JSON. Each report lists the policy the sender applied, whether MTA-STS, DANE TLSA, or no policy found, together with counts of successful and failed sessions and a breakdown of the failures. An excerpt looks like this:
{
"policies": [{
"policy": {
"policy-type": "sts",
"policy-domain": "example.com",
"mx-host": ["mx1.example.com", "mx2.example.com"]
},
"summary": {
"total-successful-session-count": 4120,
"total-failure-session-count": 3
},
"failure-details": [{
"result-type": "certificate-expired",
"receiving-mx-hostname": "mx2.example.com",
"receiving-ip": "192.0.2.25",
"failed-session-count": 3
}]
}]
}
Result types tell you what to fix. certificate-host-mismatch means the certificate does not cover the MX name, certificate-expired and certificate-not-trusted point at the certificate itself, starttls-not-supported means a host did not offer TLS, and sts-policy-fetch-error or sts-policy-invalid mean the policy file could not be retrieved or parsed.
A safe rollout plan
- List every MX host and confirm each presents a certificate from a public CA that covers its exact MX name, with automated renewal.
- Publish the TLS-RPT record and confirm reports start arriving.
- Stand up mta-sts.example.com with a valid HTTPS certificate and publish the policy in testing mode with a short max_age, such as one day.
- Publish the _mta-sts TXT record with a new id.
- Read reports for a few weeks. Fix every recurring failure.
- Switch to enforce, raise max_age to weeks, and change the id.
Senders holding a cached enforce policy will refuse any MX host it does not list, and a sender only refreshes its copy when it next sends to you, so changing the id does not reach every cache at once. Plan the move around your current max_age, not around the day of the MX change.
- Well before the move, publish a policy that lists both the old and the new MX hosts, and change the id. RFC 8461 asks you to update the HTTPS policy file first and the TXT record second, so a sender that sees the new id can fetch the new file.
- Wait out the old policy. A sender that has not mailed you since it cached the old policy may still hold it until that policy's max_age runs out. If the old policy had a max_age of several weeks, start this step several weeks ahead. If you want a shorter wait, lower max_age (or switch to testing) early enough for the older, longer-lived copies to expire first.
- Make sure the new hosts pass, with certificates that cover their exact MX names, before any sender is told to use them.
- Change the MX records, and keep the old hosts accepting mail for at least the MX TTL, since senders with cached MX answers may still send there. The policy is an allow list, not a routing list: an old cached policy does not send mail to the old hosts, but if it does not list the new ones, delivery to them can be delayed until the sender fetches the new policy.
- Remove the old hosts from the policy last, with a new id, once reports show no deliveries are still going to them.
The same reasoning applies when you retire MTA-STS: RFC 8461 section 8.3 says to publish a policy with mode: none and a short max_age, wait for the longest old max_age to pass, and only then remove the TXT record and the HTTPS host.
Remember that the HTTPS host is now part of your mail path. If mta-sts.example.com becomes a dangling CNAME to a retired web service, the policy fetch fails and, worse, someone else may be able to serve a policy for your domain.
MTA-STS vs DANE
| MTA-STS | DANE for SMTP | |
|---|---|---|
| Trust anchor | Public web CAs and HTTPS | DNSSEC-signed TLSA records |
| Needs DNSSEC | No | Yes, for the domain and the MX host zones |
| First contact protected | No, trust on first use | Yes, if the sender validates DNSSEC |
| Extra infrastructure | HTTPS host for the policy file | TLSA records kept in sync with certificates |
| Reporting | TLS-RPT | TLS-RPT |
The two can coexist. RFC 8461 says a sender that implements both must not let an MTA-STS policy override a failing DANE validation, so DANE stays in charge wherever a sender uses it. Publishing both gives the widest coverage, since different large senders implement different subsets.
How DNS Panopticon helps
Domain Visualizer is the tool for mail records. Its scan asks public resolvers for the _mta-sts and _smtp._tls TXT records, the MX records and their addresses, SPF, DMARC, DKIM at two common selectors, and DANE TLSA records at _25._tcp for each MX host. A missing MTA-STS record is reported as an informational finding. Visualizer reads DNS only: it does not fetch the policy file or test STARTTLS, so use the curl command above to check that the policy is served and matches your MX list. Results are cached (24 hours by default), so look at the scan time after an MX change.
Website Recon covers websites and registration and deliberately leaves mail records to Visualizer. For signing, see DKIM Explained: Selectors and Key Rotation.
FAQ
Do I need DNSSEC to use MTA-STS?
No. MTA-STS relies on the public web certificate system and an HTTPS policy fetch instead of DNSSEC. That is its main difference from DANE, which requires a signed zone.
What happens if my MX certificate expires while MTA-STS is in enforce mode?
Senders that honor MTA-STS will refuse to deliver to that MX host and will queue and retry the mail. If the problem lasts longer than their retry period, the messages bounce, and your TLS-RPT reports will show certificate-expired failures.
Why do I have to change the id value?
Senders cache the policy for up to max_age seconds. They only fetch a new copy early when they see that the id in the _mta-sts TXT record has changed, so a policy edit without a new id may not be noticed for a long time.
Sources and further reading
- RFC 8461: SMTP MTA Strict Transport Security (MTA-STS): section 3.3 on caching, section 8 on policy updates and removal
- RFC 8460: SMTP TLS Reporting
- RFC 7672: SMTP Security via Opportunistic DANE TLS
- Google Workspace Admin Help: About MTA-STS and TLS reporting
- Microsoft Learn: Enhancing mail flow with MTA-STS