MTA-STS tells sending servers they MUST use TLS encryption when delivering email to your domain — preventing downgrade attacks where an attacker forces unencrypted delivery. Setup: 1) Create a policy file at https://mta-sts.yourdomain.com/.well-known/mta-sts.txt, 2) Add a DNS TXT record at _mta-sts.yourdomain.com with your policy ID, 3) Optionally add TLS-RPT for reporting. MTA-STS protects incoming email to your domain. It's complementary to SPF/DKIM/DMARC which protect outgoing email.
MTA-STS Setup: Enforce TLS Encryption for Your Email
What MTA-STS Protects Against
Without MTA-STS, email delivery between servers can be downgraded from encrypted (TLS) to unencrypted (plaintext) by a network attacker. This is called a downgrade attack.
MTA-STS tells senders: "When you deliver email to my domain, you MUST use TLS. If TLS negotiation fails, don't deliver — don't fall back to plaintext."
This protects the content of email in transit to your domain.
Setup (15 Minutes)
Step 1: Create the Policy File
Create a text file with this content:
version: STSv1
mode: testing
mx: mail.yourdomain.com
mx: *.mail.protection.outlook.com
max_age: 86400
Fields:
version:AlwaysSTSv1mode:Start withtesting(report but don't enforce). Change toenforceafter verifying.mx:Your MX hostnames (one per line). Must match your actual MX records.max_age:Cache duration in seconds. 86400 = 1 day for testing. 604800 (1 week) for production.
Step 2: Host the Policy File
The file must be accessible at:
https://mta-sts.yourdomain.com/.well-known/mta-sts.txt
Hosting options:
Cloudflare Workers (free):
Create a Worker that serves the policy text at the correct path. Bind it to mta-sts.yourdomain.com.
GitHub Pages (free):
- Create a GitHub repo
- Add
.well-known/mta-sts.txtwith your policy - Enable GitHub Pages
- Add CNAME for
mta-sts.yourdomain.com→ your GitHub Pages URL
Your web server:
If you control a web server, create the file at the correct path and point mta-sts.yourdomain.com to it with a valid SSL certificate.
Step 3: Add DNS Records
MTA-STS record:
_mta-sts.yourdomain.com TXT v=STSv1; id=20260331
The id is a version string you update whenever the policy changes (forces senders to re-fetch).
A/CNAME record:
mta-sts.yourdomain.com CNAME your-hosting-target
(Or A record pointing to your server.)
Step 4: Add TLS-RPT (Optional but Recommended)
_smtp._tls.yourdomain.com TXT v=TLSRPTv1; rua=mailto:[email protected]
This tells senders to email you TLS connection failure reports, similar to DMARC RUA reports. Use a dedicated address — these can generate volume.
Step 5: Verify
Use MXToolbox MTA-STS Lookup or sts.dmarcian.com to verify your setup.
Step 6: Advance to Enforce
After 1-2 weeks in testing mode with no issues:
- Change
mode: testingtomode: enforcein the policy file - Increase
max_ageto 604800 (1 week) or higher - Update the
idin your DNS TXT record (triggers re-fetch)
Why This Matters
MTA-STS is part of the complete email security stack:
| Protocol | Protects | Direction |
|---|---|---|
| SPF | Sender authorization | Outgoing |
| DKIM | Message integrity | Outgoing |
| DMARC | Policy enforcement | Outgoing |
| MTA-STS | Transport encryption | Incoming |
| TLS-RPT | Encryption failure reporting | Incoming |
| BIMI | Brand display | Outgoing |
MTA-STS is the only protocol in this stack that protects incoming email to your domain.
Practitioner note: MTA-STS takes 15 minutes to set up with Cloudflare Workers or GitHub Pages. It adds genuine security — not just compliance signaling. As Microsoft moves toward requiring it, setting it up now is forward-looking. It's also a differentiator when clients ask "what makes your email infrastructure more secure?"
Practitioner note: Start in testing mode. If your MX records are misconfigured in the policy (don't match actual MX), enforce mode will cause legitimate email delivery to fail. Testing mode lets you verify without risk.
For background on MTA-STS, see what is MTA-STS. For the complete authentication stack, see the email authentication guide. For DNS configuration details, see the DNS configuration for email guide. If you want the complete email security stack configured (SPF, DKIM, DMARC, MTA-STS, BIMI), schedule a consultation.
Sources
- RFC 8461: MTA-STS
- RFC 8460: TLS-RPT
- Google: MTA-STS Support
v1.0 · March 2026
Frequently Asked Questions
What is MTA-STS?
MTA-STS (RFC 8461) tells sending mail servers that they must use TLS (encrypted connection) when delivering email to your domain. Without MTA-STS, a man-in-the-middle attacker could force a downgrade to unencrypted delivery, intercepting email content.
Do I need MTA-STS if I have SPF/DKIM/DMARC?
MTA-STS serves a different purpose. SPF/DKIM/DMARC authenticate the sender. MTA-STS encrypts the transport (delivery channel). They're complementary. SPF/DKIM/DMARC is higher priority. Add MTA-STS after authentication is solid.
Is MTA-STS required?
Not yet mandated by Gmail/Yahoo/Microsoft for bulk senders, but Microsoft has signaled it may become required. It's a security best practice. Implementation takes 15 minutes and adds meaningful protection.
Where do I host the MTA-STS policy file?
The policy file must be served via HTTPS at https://mta-sts.yourdomain.com/.well-known/mta-sts.txt. Options: Cloudflare Workers (free), GitHub Pages (free), your web server, or any HTTPS-capable hosting. The subdomain mta-sts.yourdomain.com must have a valid SSL certificate.
What is TLS-RPT?
TLS-RPT (RFC 8460) is the reporting companion to MTA-STS. Senders report TLS connection failures to your specified email address, similar to DMARC aggregate reports. Publish a DNS TXT record at _smtp._tls.yourdomain.com to receive reports.
Want this handled for you?
Free 30-minute strategy call. Walk away with a plan either way.