MTA-STS and TLS-RPT explained: policy, mode and MX
Updated 2026-10-25 ยท Draft, not yet reviewed
SMTP between mail servers can use TLS through STARTTLS, but by default it is opportunistic: if the encryption cannot be set up, mail is sent anyway, and certificates are rarely checked. MTA-STS, defined in RFC 8461, lets a receiving domain declare that its MX hosts support TLS with valid certificates. TLS-RPT, defined in RFC 8460, lets the same domain ask senders for reports about TLS problems they run into.
The two parts of MTA-STS
MTA-STS has a DNS record and a policy file.
The DNS record is a TXT record at _mta-sts.<domain>, for example:
_mta-sts.example.com. TXT "v=STSv1; id=20261025T120000;"
v=STSv1 must come first. id is 1 to 32 letters and digits that identify the current version of the policy. Senders compare it with the id of the policy they have cached; when it changes, they fetch the policy again. The record does not contain the policy itself.
If the record is missing, MTA-STS is simply not in use (MTASTS_NOT_FOUND). If there is more than one record that starts with v=STSv1, senders treat the domain as having no policy (MTASTS_MULTIPLE_RECORDS). A record with the wrong syntax, such as a missing id or an id with other characters, is reported as MTASTS_INVALID_RECORD.
The policy file
The policy is served at a fixed URL:
https://mta-sts.example.com/.well-known/mta-sts.txt
It is a short text file of key: value lines:
version: STSv1
mode: enforce
mx: mail.example.com
mx: *.backup.example.net
max_age: 604800
versionmust beSTSv1.modeisenforce,testingornone.mxappears once for each allowed MX host. A pattern may start with*., which matches exactly one label:*.example.netmatchesmx1.example.netbut nota.b.example.netorexample.netitself.max_ageis the number of seconds a sender may cache the policy, at most 31557600 (about one year).
The HTTPS fetch has its own rules in RFC 8461 section 3.3. The certificate for mta-sts.<domain> must be valid for that name and chain to a trusted root. The response must be status 200 with a text/plain media type. Senders must not follow HTTP redirects. ProbeKit fetches the file with the same rules and reads at most 64 KB. When the fetch fails for any of these reasons, the check reports MTASTS_POLICY_UNAVAILABLE with the reason in the evidence, such as a certificate error, a timeout, a redirect, a wrong status or content type, or a file that is too large. A file that arrives but does not parse is MTASTS_INVALID_POLICY.
Modes
enforce tells senders to deliver only to MX hosts that match the policy and that offer TLS with a valid certificate for the host name. If that is not possible, the message is not delivered to that host.
testing tells senders to apply the same checks but deliver the message anyway, and to report failures through TLS-RPT. It is the safe way to start (MTASTS_MODE_TESTING).
none means the domain has no active policy. It exists mainly so a domain can withdraw a policy: senders that still have the old one cached replace it with none the next time they fetch (MTASTS_MODE_NONE).
The policy must cover your MX hosts
Under enforce, a sender only delivers to MX hosts that match one of the mx lines. An MX host that is missing from the policy will not receive mail from senders that apply MTA-STS. This happens easily after a provider change or when a backup MX is added. The check compares each MX host of the domain with the patterns and reports hosts that match none of them, as an error under enforce (MTASTS_MX_NOT_COVERED) and as a warning under testing (MTASTS_MX_NOT_COVERED_TESTING).
Choosing max_age
A long max_age is what gives MTA-STS its protection: a sender that has fetched the policy once keeps it, even if an attacker later blocks the HTTPS fetch or the DNS record. RFC 8461 suggests values of weeks or more. A very short value means the cached policy runs out quickly and gives little protection, so the check warns when max_age is below one day (MTASTS_LOW_MAX_AGE).
The flip side is that a mistake in an enforce policy also stays cached. Change the id in the TXT record whenever you change the policy file, so senders fetch the new version.
TLS-RPT
TLS-RPT is a TXT record at _smtp._tls.<domain>:
_smtp._tls.example.com. TXT "v=TLSRPTv1; rua=mailto:[email protected]"
v=TLSRPTv1 comes first. rua lists one or more report destinations separated by commas, each a mailto: or an https: URI. Senders that support TLS-RPT send a daily aggregate report in JSON with the number of successful TLS sessions and the failures they saw, for example certificate errors, a missing STARTTLS or a policy that could not be fetched.
TLS-RPT is independent of MTA-STS, but the two belong together. Without reports you do not see when senders fail to deliver because of your policy. A missing record is reported as TLSRPT_NOT_FOUND. If there are several records with v=TLSRPTv1, RFC 8460 says senders must assume TLS-RPT is not implemented; that and other syntax problems are reported as TLSRPT_INVALID.
A safe rollout
- Publish a TLS-RPT record so reports start arriving.
- Put a policy with
mode: testing, all your MX hosts and a moderatemax_ageonhttps://mta-sts.<domain>/.well-known/mta-sts.txt. - Publish the
_mta-stsTXT record with a newid. - Read the reports for a few weeks. Fix certificates and add missing MX hosts.
- Change the mode to
enforce, raisemax_age, and change theidagain.
Common mistakes
- The
mta-stshost serves a certificate for a different name, or redirects to another URL. - The web server returns
text/htmlor a login page instead of the policy. - A new MX host is added without updating the
mxlines. - The policy file is changed but the
idin the TXT record is not. - Two
_mta-stsrecords are left behind after a change.
Use the MTA-STS and TLS-RPT check to read both records, fetch the policy and compare it with your MX hosts, or the domain health check to see it next to SPF, DMARC, DKIM and DNSSEC. The MX records themselves are explained in MX records explained.
MTA-STS findings
- Error
MTASTS_INVALID_POLICYThe MTA-STS policy file is not valid. - Error
MTASTS_INVALID_RECORDThe MTA-STS record has invalid syntax. - Warning
MTASTS_LOW_MAX_AGEThe MTA-STS policy has a max_age below one day. - Info
MTASTS_MODE_NONEThe MTA-STS policy is in mode none. - Warning
MTASTS_MODE_TESTINGThe MTA-STS policy is in testing mode. - Error
MTASTS_MULTIPLE_RECORDSMore than one MTA-STS record is published. - Error
MTASTS_MX_NOT_COVEREDAn MX host is not covered by the enforced MTA-STS policy. - Warning
MTASTS_MX_NOT_COVERED_TESTINGAn MX host is not covered by the MTA-STS policy in testing mode. - Info
MTASTS_NOT_FOUNDThe domain publishes no MTA-STS record. - Error
MTASTS_POLICY_UNAVAILABLEThe MTA-STS policy file could not be fetched.
TLS-RPT findings
- Warning
TLSRPT_INVALIDThe TLS-RPT record is not valid. - Info
TLSRPT_NOT_FOUNDThe domain publishes no TLS-RPT record.
Frequently asked questions
Do I need MTA-STS if my mail server already supports STARTTLS?
STARTTLS on its own is opportunistic. An attacker on the path can strip the STARTTLS offer or present any certificate, and most senders then deliver in plain text. MTA-STS tells senders in advance that your MX hosts support TLS with a valid certificate, so they can refuse to deliver when that is not the case.
Why does the policy file have to be on HTTPS?
The policy is the part an attacker would want to change, and DNS alone is not authenticated for most domains. RFC 8461 puts the policy on an HTTPS host, mta-sts.<domain>, with a certificate that senders validate. The TXT record only says that a policy exists and which version it is.
Should I start with mode testing or enforce?
RFC 8461 offers testing so you can see failures without losing mail. Together with a TLS-RPT record you receive daily reports from senders. Once the reports show that all your MX hosts negotiate TLS with valid certificates, you can move the policy to enforce.
How do I remove MTA-STS safely?
Senders cache a policy for up to max_age seconds. RFC 8461 describes publishing a policy with mode: none and a new id in the TXT record, waiting until the old max_age has passed, and only then removing the record and the policy file.
Does the check test my mail servers over port 25?
No. The MTA-STS check reads the DNS records and fetches the policy file. It compares the policy with your MX records, but it does not open SMTP connections to the MX hosts.