MTA-STS Explained: SMTP MTA Strict Transport Security (RFC 8461), Policy Modes, and TLS-RPT Integration

Everything a domain owner needs to publish, validate, and maintain an MTA-STS policy — from the DNS TXT format and the HTTPS-served policy file to the testing → enforce migration path — with worked examples and an MTA-STS vs DANE comparison.

This reference is provided in English. MTA-STS is specified in English-language RFCs (RFC 8461, RFC 8460) and the canonical syntax (v=STSv1, _mta-sts, mode: enforce, mx:) does not translate. We keep the body in the source language so technical terms remain consistent with the specifications.

TL;DR

  • MTA-STS (SMTP MTA Strict Transport Security) is the standard that forces inbound SMTP to use authenticated TLS. Defined in RFC 8461 (the protocol) and RFC 8460 (companion TLS-RPT reporting).
  • MTA-STS is two artefacts: a DNS TXT record at _mta-sts.<domain> carrying v=STSv1; id=<policy-id>, and an HTTPS-served policy file at https://mta-sts.<domain>/.well-known/mta-sts.txt.
  • The policy file declares version, mode (none / testing / enforce), mx hosts, and max_age (cache lifetime in seconds, typically 86400 to 604800).
  • STARTTLS alone is downgradable: an active attacker can strip the STARTTLS advertisement. MTA-STS closes that gap by telling sending MTAs that TLS is mandatory, the certificate must validate against the public PKI, and the hostname must match a declared MX.
  • The migration path is mode: none → mode: testing → mode: enforce. Pair with TLS-RPT from day one so failures surface before they bite production.
  • MTA-STS is the web-PKI alternative to DANE (RFC 7672). DANE requires DNSSEC; MTA-STS requires HTTPS. Senders that support both prefer DANE when a TLSA record exists and fall back to MTA-STS otherwise.

1. What is MTA-STS?

MTA-STS (SMTP MTA Strict Transport Security) is an email transport-security standard that lets a receiving domain publish a policy requiring sending Mail Transfer Agents (MTAs) to use authenticated TLS for inbound SMTP. MTA-STS is specified in RFC 8461 - SMTP MTA Strict Transport Security (MTA-STS) and is typically deployed alongside its companion standard RFC 8460 - SMTP TLS Reporting (TLS-RPT), which provides the operational feedback channel.

MTA-STS closes a specific gap in STARTTLS (RFC 3207). STARTTLS upgrades a plaintext SMTP session to TLS when both sides advertise it, but the advertisement itself is in the cleartext SMTP handshake - an active network attacker can strip the STARTTLS keyword from the server's EHLO response, and the session silently falls back to plaintext. MTA-STS tells supporting senders that TLS is mandatory: certificate validation against the public PKI, hostname match against one of the declared MX hosts, and refusal to deliver mail if the requirements are not met.

Critically, MTA-STS is NOT an authentication mechanism for the message itself. It does not sign messages, does not authorise senders, does not produce a DMARC verdict. It is purely a transport-security control - it ensures the SMTP envelope crosses the network inside a properly authenticated TLS session. Message authentication is the job of SPF, DKIM, and DMARC; MTA-STS is the parallel transport layer.

2. How MTA-STS works, step by step

  1. The recipient domain publishes a DNS TXT record at _mta-sts.<domain> containing v=STSv1; id=<policy-id>. The id is an opaque identifier that senders use as a cache key for the HTTPS policy file - changing the policy MUST also change the id.
  2. The recipient hosts an HTTPS policy file at https://mta-sts.<domain>/.well-known/mta-sts.txt. The TLS certificate on this host MUST chain to a public-PKI root - this is the trust anchor that makes MTA-STS a "web-PKI" mechanism. The policy file lists the version, the mode, the allowed MX hosts, and the cache lifetime.
  3. When a sending MTA has mail for the recipient domain, it queries the _mta-sts DNS record. If found, the MTA fetches the policy file via HTTPS (re-fetching only when its cached id differs from the DNS id= tag or the cache has expired).
  4. For the SMTP connection, the sending MTA enforces: the connecting hostname matches one of the policy's mx entries (with wildcard support for a single leftmost label), the TLS handshake succeeds, and the presented certificate validates against the public-PKI roots with the hostname present in the SAN.
  5. If the policy mode is enforce, any failure of those checks causes the sender to REFUSE delivery and report the failure via TLS-RPT if configured. If the policy mode is testing, the sender STILL delivers the mail but reports the failure - the operator gets feedback without breaking mail flow.
  6. The sending MTA caches the policy for up to max_age seconds. Cache TTLs of 1 day to 1 week are typical - aggressive caching is part of the design so a transient DNS or HTTPS outage on the recipient side does not immediately drop mail.

3. MTA-STS DNS syntax

The MTA-STS DNS record is a single TXT record at the well-known label _mta-sts under the recipient domain.

_mta-sts.example.com.  IN  TXT  "v=STSv1; id=20260518T120000"

Tag-by-tag anatomy of the MTA-STS DNS record:

v=STSv1
Version tag. MUST appear first; receivers that find a missing or invalid v= ignore the record. STSv1 is the only defined version at the time of writing.
id=<policy-id>
Opaque policy identifier (1-32 alphanumeric characters per RFC 8461 §3.1). Sending MTAs use this as a cache key for the HTTPS policy file: when the DNS id differs from the cached one, the sender refetches the policy. A common convention is an ISO-8601 timestamp (20260518T120000) - readable, monotonic, and trivially unique per policy change.

The DNS record is required but is NOT the policy itself - it is a pointer that tells senders an MTA-STS policy exists and that the current version of that policy can be identified by id=. The actual rules live in the HTTPS policy file (next section).

4. HTTPS policy file

The MTA-STS policy file is plain text served over HTTPS at the well-known path /.well-known/mta-sts.txt on the mta-sts subdomain of the recipient. The server MUST present a certificate that validates against the public-PKI root store for the mta-sts.<domain> hostname; HTTP fallback is forbidden.

https://mta-sts.example.com/.well-known/mta-sts.txt

version: STSv1
mode: enforce
mx: mail.example.com
mx: *.mail.example.com
max_age: 604800

Key-by-key anatomy of the policy file:

version: STSv1
REQUIRED. Pins the policy to the MTA-STS v1 grammar. Lines use the format key: value (colon-separated, one per line).
mode: none | testing | enforce
REQUIRED. The operational mode of the policy. none retracts a previously published policy (senders SHOULD treat the domain as if it had never published one). testing means senders evaluate the policy and report failures via TLS-RPT but still deliver the mail. enforce means senders refuse to deliver mail when policy checks fail.
mx: <hostname>
REQUIRED in testing and enforce modes. Each mx: line declares one acceptable MX hostname. Wildcards (*.example.com) match exactly one leftmost label; deeper subdomains do NOT match (*.example.com matches mx1.example.com but NOT a.mx1.example.com). MUST be present at least once.
max_age: <seconds>
REQUIRED. Cache lifetime of the policy at the sender, in seconds. RFC 8461 caps the value at 31 557 600 (about 1 year). Typical production values are 86 400 (1 day) for early testing rollouts and 604 800 (1 week) once enforce is stable. High max_age is part of the design: it protects against transient DNS/HTTPS outages on the recipient side that would otherwise drop mail.

The policy file MUST be served with Content-Type: text/plain. Newlines may be CRLF or LF. Unknown keys are ignored per RFC 8461 §3.2, which keeps the format forward-compatible.

5. Policy modes: none, testing, enforce

Mode Sender behaviour on policy failure When to use
none Treat the domain as if no policy were published. Cached previous policies are discarded. Retraction. Use to back out of a misfired policy without leaving senders with a stale cached version.
testing Evaluate the policy. On failure, deliver the mail anyway but emit a TLS-RPT failure report. Initial rollout. The operator gets production feedback on certificate issues, MX-list gaps, or TLS handshake failures without dropping any mail.
enforce Evaluate the policy. On failure, REFUSE to deliver and emit a TLS-RPT failure report. Steady state. After testing has run for at least a few weeks with zero unexpected failures.

The typical migration path is mode: testing with max_age: 86400 for 4-8 weeks while TLS-RPT is reviewed weekly, then a switchover to mode: enforce with max_age: 604800. Skipping testing and going straight to enforce is the leading cause of self-inflicted mail outages with MTA-STS - any legitimate sender that the operator missed (a forwarding service, a hosted helpdesk, a CRM integration) starts bouncing on the next send.

6. MTA-STS vs DANE for SMTP

Aspect MTA-STS (RFC 8461) DANE for SMTP (RFC 7672)
Trust anchor Public web PKI (the CA root store) DNSSEC chain of trust
Server-side dependency HTTPS server for the policy file + public-PKI certificate on mta-sts.<domain> DNSSEC-signed zone + TLSA record published under each MX host
Defends against STARTTLS stripping, weak/expired certificates, hostname mismatch STARTTLS stripping, weak/expired certificates, MITM with a different valid PKI cert
Cache model Aggressive client-side caching via max_age (typically 1 week) DNS TTL on the TLSA record + DNSSEC validity window
Failure semantics Policy modes none/testing/enforce Hard fail when TLSA published and validation fails
Operational burden Needs an HTTPS endpoint; no DNSSEC required; works on any registrar Requires DNSSEC at both the recipient zone and the registry; rekey workflows need TLSA updates

The two mechanisms are complementary, not competing. The recommended deployment posture for high-assurance domains is BOTH: a DNSSEC-signed zone with TLSA records (DANE) and an MTA-STS policy at enforce. A sending MTA that supports both prefers DANE when a TLSA record is present (it is the cryptographically stronger signal when DNSSEC validates) and falls back to MTA-STS for recipients that lack DNSSEC.

7. MTA-STS examples

7.1 Minimal enforce policy

# DNS:
_mta-sts.example.com.  IN  TXT  "v=STSv1; id=20260518T120000"

# https://mta-sts.example.com/.well-known/mta-sts.txt
version: STSv1
mode: enforce
mx: mail.example.com
max_age: 604800

A single-MX domain in steady-state enforce with a one-week cache. Replacing the certificate on mail.example.com requires no MTA-STS change as long as the new certificate's SAN still covers the hostname.

7.2 Multiple MX hosts

# DNS:
_mta-sts.example.com.  IN  TXT  "v=STSv1; id=20260518T120000"

# Policy file:
version: STSv1
mode: enforce
mx: mx1.example.com
mx: mx2.example.com
mx: mx3.example.com
max_age: 604800

Multi-MX domain. Each MX is listed explicitly. The order is informational only - selection is driven by DNS MX preference, not by policy order.

7.3 Wildcard MX matching

version: STSv1
mode: enforce
mx: mail.example.com
mx: *.mail.example.com
max_age: 604800

A wildcard *.mail.example.com entry matches a single leftmost label (edge1.mail.example.com, edge2.mail.example.com) but NOT a deeper-nested host (a.edge1.mail.example.com). Useful for Office 365 / Google Workspace tenant MX shapes that use a generated leftmost label.

7.4 Testing-mode rollout

version: STSv1
mode: testing
mx: mail.example.com
max_age: 86400

Initial rollout. max_age: 86400 (1 day) keeps the iteration loop short while operators review TLS-RPT reports. Switch to mode: enforce with max_age: 604800 only after a few weeks of clean reports.

7.5 Retract a policy

# DNS keeps a record so caches expire:
_mta-sts.example.com.  IN  TXT  "v=STSv1; id=20260518T180000"

# Policy file:
version: STSv1
mode: none
max_age: 86400

Publishing mode: none tells senders to treat the domain as having no MTA-STS policy. Crucially, keep the DNS record in place for at least max_age of the previous policy so cached enforce policies expire cleanly instead of locking out senders that did not see the retraction.

7.6 Companion TLS-RPT record

_smtp._tls.example.com.  IN  TXT  "v=TLSRPTv1; rua=mailto:tlsrpt@example.com"

TLS-RPT (RFC 8460) is the operational feedback loop for MTA-STS. Publish it at the well-known label _smtp._tls with an rua= destination (a mailto: address or a https: endpoint that accepts the JSON report). DMARC Analyzer ingests TLS-RPT reports alongside DMARC aggregate reports - see the TLS-RPT guide for the full report format.

8. MTA-STS best practices

  • Always start in mode: testing. Run for at least 4 weeks while watching TLS-RPT. Switching straight to enforce is the leading cause of self-inflicted MTA-STS outages.
  • Publish TLS-RPT alongside MTA-STS from day one. Without TLS-RPT, an enforce policy failure is invisible - mail simply does not arrive and there is no report. See help_tls_rpt_explained.php.
  • Use a real certificate on mta-sts.<domain>. Public-PKI roots only - self-signed certs do not validate. Let's Encrypt is the typical zero-cost choice. Automate renewal with certbot or acme.sh.
  • Change the DNS id= on every policy change. The id is the cache key. If operators update the HTTPS policy file but forget to bump id=, senders with a cached policy continue using the stale rules for up to max_age seconds.
  • Pick conservative max_age values during rollouts, long ones for steady state. Start at 86 400 (1 day) so misconfigurations bounce out of caches quickly; move to 604 800 (1 week) or higher once enforce is stable.
  • List every legitimate MX in mx: entries. A missing MX in enforce mode causes every send to that MX to be refused. Audit the recipient's MX list from external resolvers (not just the authoritative server) before committing to enforce.
  • Match the certificate SAN to the MX hostname. MTA-STS validates the TLS certificate hostname against the mx: entries, not the recipient domain. example.com is irrelevant on the certificate; what matters is that mail.example.com (or whatever the MX is) appears in the SAN.
  • Watch DNSSEC-on-MX cases. If any of your MX hosts have published TLSA records, DANE-supporting senders prefer DANE. Keep the TLSA records and the MTA-STS policy consistent (same hostnames, compatible TLS certificate chains) to avoid one mechanism delivering while the other refuses.
  • Monitor the mta-sts.<domain> HTTPS endpoint. A 5xx error or expired certificate on that subdomain causes senders to fall back to whatever cached policy they have - if the cache window is short, mail starts bouncing. Add the endpoint to your standard uptime monitoring.
  • Plan retractions through mode: none, not by deleting the DNS record. Deleting the DNS record leaves senders with cached enforce policies until their max_age expires. Publishing mode: none explicitly tells supporting senders to discard the cache.

9. Common MTA-STS mistakes

  • Going straight to enforce. Without a testing phase, the operator has no visibility into the senders that will start bouncing. Always run testing with TLS-RPT for several weeks first.
  • Forgetting to bump the id= tag. Operators update the policy file but leave the DNS id unchanged; senders keep using the cached old policy for up to max_age. Treat the DNS id and the policy file as a single atomic deploy.
  • Self-signed certificate on mta-sts.<domain>. The MTA-STS trust anchor is the public web PKI; self-signed certs fail validation and the policy fetch fails. Always use a CA-issued certificate.
  • HTTP redirect instead of HTTPS direct. The policy URL MUST be https://. RFC 8461 forbids following any HTTP 3xx redirect when fetching the policy. Serve directly over HTTPS.
  • Missing a legitimate MX from mx: entries. The operator's documented MX list is out of date; a hosted-helpdesk MX or a backup-MX still accepts mail and now fails policy. Always enumerate the actual MX records from public resolvers before locking down.
  • Using DNS wildcard for the _mta-sts record itself. Only one MTA-STS record is meaningful per domain; _mta-sts.* wildcards cause undefined behaviour. Publish the record for each domain explicitly.
  • Setting max_age: 0. Some operators try to "disable" a policy via max_age: 0 - RFC 8461 allows the value (max_age is a non-negative integer), but it does not retract the policy. Retract via mode: none instead.
  • Publishing the DNS record without the HTTPS policy file. Senders see the DNS record, fetch the policy URL, get a 404, and treat the policy as broken. Deploy in the opposite order: HTTPS file first, then DNS record.
  • Confusing MTA-STS with DMARC. MTA-STS protects transport; DMARC protects message authentication. They are independent controls and both should be deployed.

10. MTA-STS troubleshooting

Mail to my domain is bouncing with TLS errors after I switched to mode: enforce
Switch back to mode: testing immediately (bump the DNS id= at the same time so caches refresh). Review the last 24-48 hours of TLS-RPT reports for the failure reason - the most common causes are a missing mx: entry, a certificate SAN that does not cover the MX hostname, or a recently rotated certificate that has not propagated to all MX hosts.
Senders never fetch the policy file
Verify the DNS record exists with dig +short txt _mta-sts.<domain> and that it starts with v=STSv1;. Then test the HTTPS endpoint with curl -v https://mta-sts.<domain>/.well-known/mta-sts.txt - confirm a 200 response, a valid public-PKI certificate, and the Content-Type: text/plain header.
The DNS record exists but dig +short txt _mta-sts.<domain> returns nothing
Some DNS providers split the _mta-sts label across multiple records or stash it on the apex. Confirm with dig +trace that the authoritative server returns the record. Also check that the TXT value is not split across multiple quoted strings without proper concatenation.
Certificate validation fails on mta-sts.<domain>
Check the certificate chain order with openssl s_client -connect mta-sts.<domain>:443 -servername mta-sts.<domain>. The full intermediate chain must be served, and the leaf certificate's SAN must contain mta-sts.<domain>.
Policy fetch returns 200 but TLS-RPT still reports policy errors
Confirm the file uses LF (or CRLF) line endings with key: value format (colon- space-value), declares a valid version: STSv1 as the FIRST line, and ends each line with a newline. Some editors silently emit BOM (byte-order-mark) bytes at the file head which break the version-line parser.
I rotated the certificate and now senders are refusing delivery
If the new certificate's SAN no longer matches an mx: entry, MTA-STS refuses delivery. Either restore the SAN to cover the listed MX hostname, or update the mx: entries in the policy file AND bump the DNS id= tag so senders refetch.
How do I verify my MTA-STS deployment end-to-end?
Use a free third-party validator (Aykira MTA-STS tester, CheckTLS, DMARC Analyzer's Domain Security Checker), then confirm an end-to-end mail flow by sending from a TLS-RPT-supporting sender (Google Workspace, Microsoft 365, Postmark, SparkPost) and watching the next-day TLS-RPT report.

11. Frequently Asked Questions

What is MTA-STS?
MTA-STS (SMTP MTA Strict Transport Security, RFC 8461) is a DNS- and HTTPS-based mechanism that lets a receiving domain publish a policy requiring that inbound SMTP connections use authenticated TLS. Sending mail servers fetch the policy from a well-known HTTPS URL on the recipient domain and refuse to deliver mail over a plaintext or unauthenticated session when the policy is in enforce mode.
How is MTA-STS different from STARTTLS?
STARTTLS (RFC 3207) opportunistically upgrades an SMTP connection to TLS but provides no protection against a downgrade attack: a network attacker can strip the STARTTLS advertisement and the session falls back to plaintext. MTA-STS layers a policy on top of STARTTLS that tells sending servers TLS is mandatory, the certificate must validate against the public PKI, and the hostname must match one of the declared MX hosts. A sender that supports MTA-STS refuses to deliver mail when the TLS requirements are not met.
What does an MTA-STS DNS record look like?
An MTA-STS DNS record is a TXT record at _mta-sts.<domain> containing two tags: v=STSv1 and id=<policy-id>. A typical record is: _mta-sts.example.com. IN TXT "v=STSv1; id=20260518T120000" - declaring the MTA-STS version and a policy identifier that changes whenever the HTTPS policy file is updated.
Where is the MTA-STS policy file served from?
The MTA-STS policy file is served at https://mta-sts.<domain>/.well-known/mta-sts.txt over HTTPS with a certificate that validates against the public PKI. The file is plain text with one key: value pair per line, declaring version, mode, mx hosts, and max_age (cache lifetime in seconds). Sending servers fetch the policy and cache it for up to max_age seconds.
What are the three MTA-STS policy modes?
MTA-STS defines three modes: none (no policy in effect - used to retract a previous policy), testing (senders evaluate the policy and report failures via TLS-RPT but still deliver the mail), and enforce (senders refuse to deliver mail over a TLS session that fails the policy). The migration path is none → testing → enforce, with TLS-RPT enabled throughout so the domain owner can detect misconfiguration before enforcement bites.
What is the difference between MTA-STS and DANE?
Both MTA-STS (RFC 8461) and DANE for SMTP (RFC 7672) protect SMTP transport from downgrade attacks, but use different trust anchors. MTA-STS trusts the public web PKI - the receiving server's certificate must chain to a CA in the standard root store, and the policy is fetched over HTTPS. DANE trusts DNSSEC - the recipient publishes a TLSA record signed by DNSSEC declaring the expected certificate or public-key hash. DANE requires DNSSEC on the recipient side; MTA-STS does not. The two mechanisms coexist - a sender that supports both prefers DANE when a TLSA record is present and falls back to MTA-STS otherwise.
How do I monitor MTA-STS deployment?
Pair MTA-STS with TLS-RPT (RFC 8460) - the SMTP TLS Reporting standard. Publish a TLS-RPT DNS record at _smtp._tls.<domain> declaring a mailto: or https: report destination, and senders that support TLS-RPT will send daily JSON reports describing successful TLS sessions, certificate failures, STARTTLS failures, and policy lookup errors. DMARC Analyzer ingests these reports alongside DMARC aggregate reports so you can track MTA-STS rollout health in one dashboard.

13. Audit your MTA-STS setup now

DMARC Analyzer's free Domain Security Checker performs live MTA-STS lookups: it queries the _mta-sts DNS record, fetches the /.well-known/mta-sts.txt policy file over HTTPS, validates the version, mode, MX list, and max_age, and confirms that the certificate on mta-sts.<domain> chains to a public-PKI root. It also flags missing TLS-RPT records so you can spot the most common monitoring gap before it bites production.

Check my MTA-STS record Sign up — Free plan