What This Result Means: 3 MTA-STS Policy Modes and Deployment Requirements
Every generated policy resolves into one of the deployment states below, plus the cache rule that governs when senders re-fetch it:
| State | Observed Condition | What Sending Servers Do | What It Means for Your Domain |
|---|---|---|---|
| 1. testing Mode (Safe Initial Rollout with TLS-RPT) | mode: testing with a working _smtp._tls reporting record | Senders apply the policy for reporting only: TLS/MX failures are reported via TLS-RPT but mail is still delivered | The correct first state: you see every violation before anything is dropped. |
| 2. enforce Mode (Mandatory TLS 1.2/1.3 & Valid X.509 Certificate) | mode: enforce after a clean reporting period | Senders refuse delivery over unauthenticated channels: the MX must present a valid certificate and match an mx: line | Full downgrade protection: active attackers cannot strip STARTTLS on your inbound mail. |
| 3. none Mode (Policy Decommissioning) | mode: none published while retiring MTA-STS | Senders stop enforcing immediately but keep the discovery record until max_age expires | The safe off switch: never just delete the records, publish none first. |
| 4. Policy ID (id=) Cache Invalidation Rule | The _mta-sts TXT id= value versus the cached policy copy | Senders re-fetch the HTTPS policy only when the DNS id= changes or their cached copy exceeds max_age | Every policy edit needs a new id=, or cached senders enforce the stale version. |
How to Deploy MTA-STS and TLS-RPT in 4 Steps
The generator produces the artifacts; deployment is a 4-step sequence:
- Host. Host the generated file at https://mta-sts.yourdomain/.well-known/mta-sts.txt with a valid TLS certificate and no redirects: a subdomain on Cloudflare Pages/Workers, an Nginx server block, or an S3 bucket behind CloudFront all work, as long as the response is 200 with Content-Type: text/plain (RFC 8461 section 3.3 forbids following 301/302 redirects).
- Verify. Verify every MX server in the policy presents a TLS 1.2 or 1.3 certificate whose SAN matches the MX hostname: senders check the certificate against the MX name they connect to, not against your domain.
- Publish. Publish both DNS records from the generator: the _mta-sts TXT discovery record and the companion _smtp._tls TLS-RPT record with your rua= mailbox.
- Advance. Advance from testing to enforce only after your TLS-RPT reports show a clean period: switch the mode, bump the id=, redeploy the policy file, and keep both records in sync.
Verify Your Generated MTA-STS Policy From the Command Line (dig and curl)
# The discovery record (id= must change whenever the policy changes):
dig TXT _mta-sts.example.com +short
# The TLS-RPT companion record:
dig TXT _smtp._tls.example.com +short
# The policy file: expect HTTP 200, text/plain, and no redirect:
curl -sI https://mta-sts.example.com/.well-known/mta-sts.txt
curl -s https://mta-sts.example.com/.well-known/mta-sts.txt Reference Table: MTA-STS Policy Keys, DNS Tags, and Provider MX Patterns (RFC 8461)
Two references in one: the keys each artifact can carry, and the standard mx: lines for the major mailbox platforms:
| Key / Tag | Artifact | Values | Meaning (RFC 8461 / RFC 8460) |
|---|---|---|---|
| version: STSv1 | mta-sts.txt | STSv1 (fixed) | Policy format version; required first key. |
| mode: | mta-sts.txt | testing, enforce, none | Enforcement level applied by sending servers. |
| mx: | mta-sts.txt | Hostname or leftmost wildcard, one per line | The only MX hostnames senders may deliver to in enforce mode. |
| max_age: | mta-sts.txt | Seconds (86400 to 31557600) | How long senders may cache the policy; 31557600 is the maximum. |
| v=STSv1 | _mta-sts TXT | STSv1 (fixed) | Discovery record version. |
| id= | _mta-sts TXT | Up to 32 alphanumeric ASCII characters | Policy version tag: change it on every policy edit to invalidate caches. |
| v=TLSRPTv1 | _smtp._tls TXT | TLSRPTv1 (fixed) | TLS reporting discovery record version (RFC 8460). |
| rua= | _smtp._tls TXT | mailto: or https: URI | Where TLS failure reports are delivered. |
| Provider | Standard mx: policy lines |
|---|---|
| Google Workspace | aspmx.l.google.com *.aspmx.l.google.com *.googlemail.com |
| Microsoft 365 | *.mail.protection.outlook.com |
| Proton Mail | mail.protonmail.ch mailsec.protonmail.ch |
| Zoho Mail | mx.zoho.com mx2.zoho.com mx3.zoho.com |
| Fastmail | in1-smtp.messagingengine.com in2-smtp.messagingengine.com |
What This Tool Does Not Check
- Generating the artifacts does not host them: the https://mta-sts.yourdomain/.well-known/mta-sts.txt file must be deployed on your own web infrastructure with a valid certificate.
- RFC 8461 section 3.3 forbids redirects: a 301/302 on the policy URL (a common side effect of www-redirect rules or HTTP-to-HTTPS hops on the wrong hostname) makes senders treat the policy as absent, and this generator cannot see your web server config.
- Every mx: server must present a valid X.509 TLS 1.2 or 1.3 certificate matching the MX hostname: the generator writes the lines, but certificate validation happens when senders connect.
- Live validation of a deployed policy is a different check: run the MTA-STS checker after hosting the file and publishing the records.
What We See Across Domains
The dominant real-world MTA-STS failure is not the policy content but the hosting: the mta-sts.yourdomain subdomain sits behind an HTTP-to-HTTPS or www redirect rule inherited from the apex web server, and RFC 8461 parsers reject the redirect as a missing policy. The second pattern is Microsoft 365 domains adopting the wildcard *.mail.protection.outlook.com mx: line, which is exactly what the leftmost-wildcard rule exists for: tenant MX hostnames change per datacenter, and the wildcard covers every variant.
Frequently Asked Questions
What is MTA-STS and why do I need both a DNS TXT record and an HTTPS file?+
The _mta-sts DNS TXT record is the discovery mechanism: it tells sending servers that your domain supports MTA-STS and carries an id= that changes whenever the policy changes. The actual rules (mode, allowed MX hosts, max_age) live in the mta-sts.txt file served over HTTPS on the mta-sts.
Which MTA-STS mode should I start with: testing or enforce?+
Start with testing. In testing mode, sending servers that fail the TLS or MX checks still deliver the mail but report the failure through TLS-RPT, so you can confirm every legitimate MX path passes before anything is dropped. Move to enforce only after the reports show a clean period.
Why must I change the id= value in _mta-sts TXT whenever I edit mta-sts.txt?+
Sending servers cache the policy file until the id= changes or max_age expires. If you edit mta-sts.txt without changing id=, cached senders keep enforcing the old policy, so new MX hosts stay unauthorized and enforcement can bounce legitimate mail.
Can the https://mta-sts.example.com/.well-known/mta-sts.txt URL use a 301 redirect?+
No, RFC 8461 section 3.3 forbids redirects: the policy must be served directly with HTTPS and a valid certificate on the mta-sts.
How do wildcard mx: rules work in an mta-sts.txt policy file?+
An mx: line may use a leftmost wildcard, such as *.mail.protection.outlook.com, which authorizes any hostname matching that pattern. The wildcard covers only one label at the leftmost position: mail.protection.outlook.com itself must be listed separately if your MX records point at the bare host.
Next Checks
- Validate a deployed policy with the MTA-STS checker.
- Read the protocol in the MTA-STS guide and the record format in the MTA-STS record guide.
- Watch the failure reports with the TLS-RPT checker, the TLS-RPT guide, and the TLS-RPT record guide.
- Trace the mail paths the policy protects with the MX record lookup.
- Run the full sending-stack preflight in the SMTP preflight.