MTA-STS Explained — TLS Encryption For Inbound Email

8 minutes
MTA-STS

MTA-STS (Mail Transfer Agent Strict Transport Security) tells sending servers that your domain only accepts email over encrypted TLS connections. Without it, the STARTTLS upgrade is optional — and attackers can force email to transmit in plaintext.

The protocol works through two components:

  • A DNS record announcing MTA-STS support
  • An HTTPS-hosted policy file specifying encryption requirements

When properly configured, sending servers must establish a verified TLS connection before delivering mail. If they can’t, the email doesn’t get delivered — protecting against interception and tampering.

MTA-STS is typically deployed alongside TLS-RPT (TLS Reporting), which sends you daily reports on connection failures. Together, they provide enforcement plus visibility into what’s actually happening between mail servers.

Why does MTA-STS exist?

SMTP was designed in an era when encryption wasn’t a concern. The STARTTLS extension added optional TLS later, but “optional” became the vulnerability.

The STARTTLS problem

If a sending server can’t establish TLS, it falls back to plaintext delivery. Attackers exploit this through downgrade attacks:

  • Intercept the connection between the sending and receiving servers
  • Read or modify email content undetected
  • Block the STARTTLS negotiation
  • Force plaintext transmission

STARTTLS also skips certificate validation. A sending server accepts any certificate — expired, self-signed, or belonging to an imposter. Man-in-the-middle attacks become trivial when nobody checks credentials.

VulnerabilityWhat happensMTA-STS solution
Opportunistic encryptionFalls back to plaintext if TLS failsTLS required or delivery fails
Downgrade attacksAttacker blocks TLS negotiationNo fallback permitted
No certificate validationAny certificate acceptedMust be valid, trusted, hostname-matched
DNS spoofingAttacker redirects MX to malicious serverAllowed MX hosts pinned in policy

MTA-STS closes these gaps by making TLS mandatory rather than hopeful.

How does MTA-STS work?

The mechanism relies on a two-part discovery and enforcement process that sending servers follow before delivering mail.

Discovery process

When a sending server wants to deliver email to your domain:

  1. DNS lookup — checks for a TXT record at _mta-sts.yourdomain.com
  2. Policy fetch — if the record exists, retrieves the policy file over HTTPS
  3. Validation — verifies the receiving server’s certificate matches the policy
  4. Delivery decision — delivers if validation passes; behavior on failure depends on policy mode

The HTTPS requirement for the policy file is intentional. DNS can be spoofed (attackers redirect queries to malicious servers). HTTPS with certificate validation prevents fake policies from being served — the policy host itself must prove its identity.

Major email providers support MTA-STS, including Gmail, Microsoft 365, and Yahoo. When you implement MTA-STS, mail from these senders arrives encrypted and verified.

What are the MTA-STS components?

Three pieces work together: a DNS record announcing support, a policy file defining rules, and (optionally) a reporting record for failure notifications.

DNS TXT record

The first component signals MTA-STS support. Publish a TXT record at _mta-sts.yourdomain.com:

v=STSv1; id=20241227001

FieldPurpose
v=STSv1Protocol version (always STSv1)
id=Unique identifier — change when policy updates

The id field matters more than it looks. Sending servers cache your policy (based on max_age). When you modify the policy file, increment the ID to force immediate re-fetch — otherwise, servers continue using stale cached versions.

Policy file

The second component defines enforcement rules. Host a plaintext file at:

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

Example policy:

version: STSv1

mode: testing

mx: mail.yourdomain.com

mx: mail2.yourdomain.com

max_age: 604800

FieldExamplePurpose
versionSTSv1Protocol version
modetestingEnforcement level
mxmail.yourdomain.comAllowed MX host (one per line)
max_age604800Cache duration in seconds (604800 = 1 week)

The web server hosting this file must present a valid TLS certificate for the mta-sts subdomain. Self-signed certificates won’t work — sending servers validate before trusting the policy.

TLS-RPT record

The third component (optional but strongly recommended) enables failure reporting. Publish a TXT record at _smtp._tls.yourdomain.com:

v=TLSRPTv1; rua=mailto:tlsrpt@yourdomain.com

Reports arrive daily in JSON format, detailing connection successes and failures. Without TLS-RPT, you’re enforcing blindly — problems remain invisible until someone complains about missing email.

What are the policy modes?

MTA-STS offers three enforcement levels, designed for phased rollout from monitoring to full enforcement.

ModeBehaviorUse case
noneDisables MTA-STSDecommissioning the policy
testingReports failures but delivers anywayInitial rollout, troubleshooting
enforceRejects email if TLS validation failsProduction enforcement

Testing mode

Start here. In testing mode, sending servers attempt TLS validation but deliver the email regardless of the outcome. Failures get reported via TLS-RPT.

The testing phase reveals misconfigurations you didn’t know existed:

  • Expired certificates on backup MX servers
  • MX hosts are missing from the policy file
  • Third-party services sending without TLS support

Fix issues during testing. Verify clean reports before enabling enforcement.

Enforce mode

After reviewing 4-6 weeks of clean TLS-RPT data, upgrade to enforce mode. Now, sending servers must establish validated TLS. If they can’t, email isn’t delivered — it bounces back to the sender.

When switching modes, update the policy file and increment the DNS record ID. Otherwise, sending servers continue using their cached testing-mode policy until max_age expires.

How do you implement MTA-STS?

Implementation follows a phased approach — setup, monitoring, then enforcement. Rushing to enforce mode before resolving certificate issues causes legitimate emails to bounce.

Prerequisites

Before deploying, verify your mail servers meet requirements:

  • Support TLS 1.2 or higher
  • Use valid certificates from recognized certificate authorities
  • Certificates match MX hostnames exactly

Run an email deliverability test to check the current authentication and encryption status before starting.

Setup steps

PhaseActionsTimeline
DNS setupPublish _mta-sts and _smtp._tls TXT recordsDay 1
Policy hostingCreate mta-sts.txt with mode: testingDay 1
MonitoringReview TLS-RPT reports for failures4-6 weeks
ResolutionFix certificate and MX issues revealed in reportsAs needed
EnforcementUpdate policy to mode: enforce, increment IDAfter clean reports

The testing period matters. Four to six weeks provides enough data to catch intermittent issues — backup servers that only activate during outages, seasonal sending patterns, forgotten third-party integrations.

What is TLS-RPT and why does it matter?

TLS-RPT (SMTP TLS Reporting) provides visibility into what happens when servers try to deliver mail to your domain. Without it, MTA-STS operates as a black box.

Report contents

Sending servers that support TLS-RPT deliver daily JSON reports detailing:

  • Failed connections with specific reasons
  • Successful TLS connections (count and details)
  • Policy information they retrieved from your domain

Common failure reasons reveal specific problems:

Failure typeMeaning
starttls-not-supportedSending server doesn’t support TLS
certificate-expiredYour mail server’s certificate expired
certificate-not-trustedCertificate not from recognized CA
certificate-host-mismatchCertificate doesn’t match MX hostname
validation-failureMX host not listed in your policy

These reports function similarly to DMARC reports — aggregated feedback about authentication and security outcomes. The difference is that DMARC covers sender authentication while TLS-RPT covers transport encryption.

Using reports

During testing mode, TLS-RPT catches problems before they cause mail loss:

  • Typo in your policy file’s MX list
  • Certificate expiring next week on a server you forgot about
  • Partner organization sending from infrastructure without TLS

Fix issues while testing mode still delivers the mail. Switch to enforce only after reports show consistent success.

How does MTA-STS relate to SPF, DKIM, and DMARC?

SPF, DKIM, and DMARC handle authentication — proving who sent the email and whether it was modified in transit.

MTA-STS handles transport — encrypting the email while it moves between servers.

ProtocolLayerFunction
SPFAuthenticationAuthorizes sending IP addresses
DKIMAuthenticationCryptographically signs message content
DMARCAuthenticationAligns SPF/DKIM, sets policy for failures
MTA-STSTransportEnforces TLS encryption between servers

A domain with DMARC but no MTA-STS proves sender identity, but transmits content where anyone between servers can read it. A domain with MTA-STS but no DMARC encrypts transit but can’t verify senders.

Authentication prevents spoofing and impersonation. Transport security prevents interception and eavesdropping. Implement both for complete protection — they address different attack vectors entirely.

For domains already running SPF, DKIM, and DMARC, adding MTA-STS completes the security stack. The protocols don’t conflict — they complement each other across different layers.

TLS is a must-have!

Combined with TLS-RPT, you get enforcement plus visibility into connection outcomes. 

For help implementing transport security alongside SPF, DKIM, and DMARC, an email deliverability consultant can configure the full authentication and encryption stack.

Frequently asked questions

Here are some commonly asked questions about MTA-STS:

Does MTA-STS protect outbound email?

No. MTA-STS protects inbound email to your domain — it tells sending servers how to deliver mail to you securely. Outbound security depends on whether recipient domains have implemented MTA-STS. You can’t force encryption on domains that haven’t configured it.

What happens if a sender doesn’t support MTA-STS?

Sending servers that don’t support MTA-STS ignore your policy entirely. They continue delivering via opportunistic STARTTLS (or plaintext if STARTTLS fails). MTA-STS only affects compliant senders — fortunately, major providers like Gmail, Microsoft, and Yahoo all support it.

Is MTA-STS the same as DANE?

Both enforce TLS for email transport, but they work differently. DANE (DNS-Based Authentication of Named Entities) requires DNSSEC for security. MTA-STS uses HTTPS and certificate authorities instead. Most organizations find MTA-STS easier to implement since DNSSEC adoption remains limited.

How long should max_age be?

One to four weeks (604800 to 2419200 seconds) works for most domains. Longer values reduce DNS lookups but delay policy updates. Shorter values increase lookup frequency but allow faster changes. A week is a reasonable default for most situations.

Email Deliverability Score
Enter Your Email Address To Check Your
Deliverability Score
Envelope
Invalid phone number

Domain Reputation 101 [What It Is, How To Check & How To Fix It]
Domain reputation is the opinion mailbox providers have of your sending domain — a score […]
December 28, 2025
Dedicated IP vs Shared IP — Which Is Better For Deliverability?
A dedicated IP gives you complete control over your sender reputation — no other company’s […]
December 28, 2025
Hard Bounce vs Soft Bounce [Prevention & Management]
When an email fails to reach someone’s inbox, it bounces. The failure comes in two […]
December 28, 2025