A law firm sends a client a draft contract containing personal data of counterparties. The administrators on both sides know that their mail servers support encryption, so they check nothing further. Yet it is enough for someone along the route to strip a single line offering encryption from the servers’ conversation, and the sending server, following the rules of the protocol, will send the message in plain text without telling anyone.
This gap in email cybersecurity is called opportunistic encryption. MTA-STS lets the recipient domain require sending servers to use encryption with a valid certificate and to refuse delivery when it is missing, while TLS-RPT delivers reports showing where that requirement fails. Both mechanisms are deployed with a DNS record and a file on a web server, but getting the order of steps wrong can stop inbound mail.
What is MTA-STS and what problem does it solve?
MTA-STS (SMTP MTA Strict Transport Security) is a mechanism described in RFC 8461 of September 2018 that lets the recipient domain declare that it receives mail over TLS with a trusted certificate and specify whether sending servers should refuse delivery to servers that do not offer such a connection. The authors of the specification represent Google, Oath, Comcast and Microsoft, and the IETF published it as a Standards Track document.
The problem it solves stems from how STARTTLS works. This SMTP extension lets servers negotiate an encrypted channel, but only when both sides offer it. According to RFC 8461, an attacker who can delete the “250 STARTTLS” response from the session or redirect the entire session, for example by overwriting the domain’s MX record, can force transmission without encryption or intercept it. RFC 8460 adds why this is dangerous: such attacks are not necessarily apparent to the receiving server.
MTA-STS turns this silent failure into a decision: the recipient domain states in advance which MX servers to expect and that each must present a certificate valid for its name. The basics of the TLS protocol are covered in the SSL/TLS glossary entry.
How does MTA-STS work step by step?
MTA-STS works in five steps on the sending server’s side, while the recipient domain only publishes a TXT record and a policy file. According to RFC 8461:
- Discovery. The sending server checks the TXT record
_mta-sts.<domain>, which contains the versionv=STSv1and the policy identifierid. - Policy fetch. If it has no cached policy or the identifier has changed, it fetches the file from
https://mta-sts.<domain>/.well-known/mta-sts.txt. The certificate of this host must be valid and chain to a trusted certification authority, and HTTP redirects must not be followed. - Caching. It keeps the policy for the time given in the
max_agefield. - Validation. At delivery time it checks whether the MX server matches a pattern in the policy, whether it offers STARTTLS and whether it presents a certificate valid for its name.
- Applying the mode. It handles the validation result according to the policy’s
modefield.
Behaviour on failure is described in section 3.3 of RFC 8461. If the TXT record exists but the policy cannot be fetched and the sender has no cached copy, it delivers mail as if the domain had not deployed MTA-STS. If, on the other hand, the policy cannot be refreshed but a valid copy is cached, the sender applies that copy.
What does the MTA-STS policy file contain?
The policy file is a short text file with four kinds of fields: version, mode, MX patterns and lifetime. The TXT record and a sample policy for the domain example.com may look like this:
_mta-sts.example.com. IN TXT "v=STSv1; id=20260928090000Z;"
version: STSv1
mode: testing
mx: mx1.example.com
mx: mx2.example.com
max_age: 604800
RFC 8461 provides only the value STSv1 for the version field. The mode field has three possible values: enforce, testing or none. Each MX server gets its own mx line, and a wildcard pattern matches only one, left-most label of the name, so *.example.com covers mail.example.com but not example.com or a.b.example.com.
The max_age field sets, in seconds, how long a sender may keep the policy in its cache. RFC 8461 allows at most 31557600 seconds, roughly one year, and expects typical values to be in the range of weeks or more, because a long cache lifetime makes attacks at policy refresh time harder.
The web server should serve the file with the text/plain media type, because senders should validate it, and with an HTTP 200 response. A policy fetched with any other response or after a redirect is not valid for the sender.
How do the testing, enforce and none modes differ?
The enforce mode forbids delivery to a server that fails validation, the testing mode only reports the problem, and the none mode means the domain is withdrawing its policy.
In enforce mode, the sending server must not deliver the message to a host that does not match the MX pattern, does not support STARTTLS or presents an invalid certificate. RFC 8461 recommends treating such a failure as transient and forbids permanently failing the message before the sender checks DNS for an updated policy at the domain.
In testing mode, senders that support TLS-RPT send a failure report if the recipient domain has also deployed it, and the message may be delivered as though validation had succeeded. This is the mode to start with.
The none mode is used for a clean withdrawal of MTA-STS. Section 8.3 of RFC 8461 describes the procedure: publish a policy with mode: none and a short max_age, change the identifier in the TXT record, wait until all previously served policies have expired, and only then remove the record and the file.
What is TLS-RPT and what do the reports tell you?
TLS-RPT (SMTP TLS Reporting) is a mechanism from RFC 8460 in which a domain asks sending servers for daily reports on successful and failed attempts to establish an encrypted connection with its mail servers. The request is published in the TXT record _smtp._tls.<domain>, for example v=TLSRPTv1; rua=mailto:tlsrpt@example.com.
The rua field points to an email address or an HTTPS address where reports should go. Reports sent by email must carry a valid DKIM signature of the reporting domain, and the recipient must ignore reports without one. The report itself is a JSON file which, according to RFC 8460, should cover a full day from 00:00 to 24:00 UTC.
A report contains the applied policy, the number of successful sessions and the number of failures broken down by type. The types defined in RFC 8460 include starttls-not-supported, certificate-host-mismatch, certificate-expired, sts-policy-fetch-error and sts-webpki-invalid. The number of successful sessions acts as a heartbeat: it shows that reporting works even when there are no failures.
TLS-RPT also covers DANE policies, so it is useful for any domain that wants to know whether its inbound mail is encrypted. Google warns in the Google Workspace help that you might not receive many reports until more mail providers use TLS reporting.
How do you deploy MTA-STS and TLS-RPT for a company domain?
Deployment starts with reports and ends with enforce mode, never the other way round. The sequence that limits the risk of stopping mail has four steps:
- Inventory of MX servers. List all hosts from the MX records, including backup servers and filtering gateways. Each must offer STARTTLS with a certificate valid for its name and support TLS 1.2 or later.
- TLS-RPT. Publish the
_smtp._tlsrecord with a reporting address and start reading the reports before you enforce anything. - Policy in testing mode. Set up the
mta-sts.<domain>host with a valid certificate, publish the policy file withmode: testing, and only then the_mta-stsrecord with an identifier. - Switching to enforce. When the reports show no errors, change the mode in the file and update the identifier in the TXT record.
According to the Microsoft Learn documentation, updated 21 July 2026, Exchange Online validates MTA-STS on every message sent to domains with a policy, with no configuration needed from the administrator, and when the recipient domain’s policy is in enforce mode and validation fails, it may return a non-delivery report to the sender with code 5.4.8 or 5.7.5. Microsoft does not, however, host the policy file for customers. A domain whose MX record points to Exchange Online publishes the policy itself, with the pattern *.mail.protection.outlook.com, and can first publish it in testing mode to check that it is valid.
According to the Google Workspace help, turning on MTA-STS means asking external servers to deliver mail only over connections with a valid public certificate and TLS 1.2 or higher encryption. Google also recommends testing mode and daily reports first, and enforce only afterwards.
What can go wrong when you deploy MTA-STS?
An MTA-STS deployment breaks on details: certificates, the policy identifier and backup servers, and each of these errors leaves a trace in TLS-RPT reports.
The mta-sts host certificate. The policy is valid only if the mta-sts.<domain> host presents a certificate valid for that name. An expired certificate or a web server that redirects to the www address means senders will not fetch a new policy.
An unchanged identifier. Senders recognise a new policy by a change of the id field in the TXT record. If you change the file but forget the record, senders will keep applying the old version for the whole max_age period. RFC 8461 also recommends the order: new policy file first, new record second.
Changing mail provider. Senders keep in their cache a policy with the old MX patterns. If you switch MX records in enforce mode before updating the policy, some mail will get stuck. It is safer to add the new servers to the policy first, wait, and only then change the MX records.
Backup MX. RFC 8461 warns that senders try MX servers in priority order, so a misconfiguration of a backup MX will surface only when the primary one fails.
A pattern that is too broad. The pattern *.example.com makes any host in the domain with a valid certificate a valid MX server in the eyes of MTA-STS. Section 10.4 of RFC 8461 describes this as a weak policy, so it is better to list servers by name. The exception is services whose provider documents such a pattern explicitly: Microsoft explains that in Exchange Online a wildcard does not weaken security, because the service accepts mail for a given domain for only one organisation.
What doesn’t MTA-STS protect against?
MTA-STS protects only the connection between mail servers, and only when the sender already knows the domain’s policy. It does not assess message content, does not confirm the sender’s identity and does not protect the first contact with a domain.
Section 10 of RFC 8461 states explicitly that the mechanism can thwart attacks only if the sender has previously obtained and cached the recipient domain’s policy. An attacker who blocks DNS responses can hide the policy from a server contacting the domain for the first time, which is why the RFC recommends long max_age values and regular policy refreshes by senders.
The second limit is certification authorities: an attacker who obtains a valid certificate for the victim’s mail server, for example by compromising a certification authority, will bypass the protection (RFC 8461, sections 10.1 and 10.5).
An encrypted channel says nothing about what travels through it: a fake invoice or a malicious attachment will pass through an MTA-STS-compliant connection just like ordinary correspondence. Sender authentication and content analysis protect against that.
Key takeaways:
- MTA-STS protects the hop between mail servers, not the message content or the mailbox.
- Protection works only once the sender knows and has cached the domain’s policy.
- TLS-RPT shows encryption failures that the receiving server cannot see on its own.
- Switch to enforce only after a period of clean reports in testing mode.
How does MTA-STS differ from DANE and from SPF, DKIM and DMARC?
MTA-STS and DANE protect encrypted transport between servers but base trust on different things, while SPF, DKIM and DMARC protect the identity of the sender’s domain, so you do not choose one of these mechanisms instead of another.
DANE for SMTP, described in RFC 7672 of October 2015, relies on TLSA records in DNS and requires DNSSEC. According to RFC 8461, MTA-STS was created for domains where deploying DNSSEC is undesirable or impractical. It relies on certification authorities and does not require DNSSEC, at the cost of risking malicious downgrades. When both mechanisms are in place, the sender must not let a successful MTA-STS validation override a failing DANE validation.
SPF, DKIM and DMARC answer the question of whether a message really comes from the domain it claims. MTA-STS answers the question of whether the message reached the right recipient server over an encrypted channel. We cover the configuration of the first three in the article on email security, SPF, DKIM and DMARC, and other articles on email protection are collected in the email security section.
How do you plan the deployment and maintenance of MTA-STS?
MTA-STS is best planned as a cycle with a clear signal for moving to the next stage rather than as a one-off DNS change. The map below lists the stages, and the last column shows the mistake that is easiest to make at each one.
| Stage | What you publish | What you check | Signal that you can move on | Typical mistake |
|---|---|---|---|---|
| Inventory | Nothing | All MX hosts, gateways and backup servers, certificates, TLS versions | Every MX presents a certificate valid for its name | A forgotten backup MX or an old gateway |
| Reports | _smtp._tls record | Whether reports arrive and can be read | First daily reports with a count of successful sessions | A report mailbox nobody reads |
| Testing | mta-sts host, file with mode: testing, _mta-sts record | Failure types in the reports for each MX | Successive reports with no failures | A redirect to www or the wrong file type |
| Enforce | File with mode: enforce, new id | Reports and bounced messages after the change | No new failures after the switch | Changed file without a changed id |
| Provider change | Policy with new MX patterns, new id | Whether senders have fetched the new policy | Reports show the new policy | Switching MX before updating the policy |
Maintenance comes down to three habits: monitoring certificate validity for the mta-sts host and the MX servers, reading TLS-RPT reports after every mail change, and updating the policy in every migration.
How can nFlo help you with email security?
MTA-STS and TLS-RPT are published by the domain owner or the mail provider. Message content is handled by email protection solutions that nFlo implements for its customers.
According to the product page, Check Point Harmony Email & Collaboration protects against phishing and BEC, including account takeover, checks URLs and attachments in the Threat Emulation sandbox, includes DLP and protects Microsoft 365, Google Workspace, Teams and Slack. It is deployed through an API, without changing MX records, so it does not change the list of hosts in the MTA-STS policy.
Trend Micro Email and Collaboration Security protects against phishing and BEC fraud, analyses attachments in a sandbox and, according to the product page, integrates with Microsoft 365 through an API or as a gateway, and with Google Workspace through an API. If a gateway deployment changes the domain’s MX records, the MTA-STS policy has to be updated before the switch, following the order described above.
If you want to match email protection to your environment, contact us.
What else is worth knowing about MTA-STS and TLS-RPT?
Does MTA-STS require DNSSEC?
No. RFC 8461 builds MTA-STS on certification authorities and a policy fetched over HTTPS, so DNSSEC is not needed. The price is the risk of malicious downgrades, which the RFC describes when comparing MTA-STS with DANE, which does require DNSSEC.
What happens if the certificate of the mta-sts host expires?
Senders cannot fetch a new policy. Those with a valid policy in their cache keep applying it, while those without one deliver mail as if the domain had not deployed MTA-STS. TLS-RPT reports will then show policy fetch or authentication errors.
How long should you keep the policy in testing mode?
RFC 8461 does not set a minimum period. The measure is TLS-RPT reports: it makes sense to move to enforce when successive daily reports from large senders show no failures for any of the domain’s MX servers, including backup ones.
Do Microsoft 365 and Google Workspace support MTA-STS?
Yes, according to both providers’ documentation. Exchange Online validates MTA-STS policies when sending to other domains, but it does not host the customer’s policy file. Google Workspace lets you turn on MTA-STS and TLS reporting for a domain and recommends starting in testing mode.
