MTA-STS Setup Guide for Microsoft 365 & Exchange Online (*.mail.protection.outlook.com)
Configure RFC 8461 MTA-STS and RFC 8460 TLS-RPT for Microsoft 365 Exchange Online tenants using *.mail.protection.outlook.com, custom *.mx.microsoft endpoints, and safe testing-to-enforce rollout.
Zero Telemetry · Strict CSP (connect-src 'none')
Domain Trust & Email-TLS Configuration
RFC 8461 · 8460 · 8659 · 9116
Input sanitization applied: stripped disallowed newlines, control characters, semicolons, or invalid hostname characters.
Type Name Flags Tag Value TTL
CAA @ 0 issue letsencrypt.org Auto
CAA @ 0 issue pki.goog Auto
CAA @ 0 issuewild letsencrypt.org Auto
CAA @ 0 issuewild pki.goog Auto
CAA @ 0 iodef mailto:[email protected] Auto
CAA-ISSUE-OK: 2 authorized CA(s) pinned via RFC 8659PASS
Only letsencrypt.org, pki.goog may issue TLS certificates for example.com.
CAA-WILD-OK: Explicit issuewild records match authorized CAsPASS
Wildcard issuance (*.domain) is explicitly scoped to your selected CAs.
Verify Live DNS Records or Deploy All 9 ReadyCheck Fixes Together
In our N=140 B2B SaaS Readiness Benchmark, 95.2% (60/63) missed _mta-sts and 79.4% lacked valid RFC 9116 security.txt. Scan your live domain on ReadyCheck (https://audit.runglab.dev), order the tailored $49 9-File Domain Fix Pack, or automate via remote MCP Server dev.runglab/devtools.
# Inspect your actual Exchange Online MX target first:
dig +short MX example.com
# Standard: 0 example-com.mail.protection.outlook.com.
# If your tenant uses newer *.mx.microsoft or a third-party gateway (Proofpoint/Mimecast),
# add that exact MX pattern on a new "mx:" line in mta-sts.txt!
# Verify _mta-sts and _smtp._tls DNS records:
dig +short TXT _mta-sts.example.com
dig +short TXT _smtp._tls.example.com
Step-by-Step Deployment & Key Insights
Run dig +short MX <domain> to verify whether Exchange Online routes via <tenant>.mail.protection.outlook.com, *.mx.microsoft, or a security gateway (Mimecast/Proofpoint).
Create /.well-known/mta-sts.txt with mode: testing, max_age: 86400, and matching mx: patterns.
Deploy the policy on https://mta-sts.<domain>/.well-known/mta-sts.txt and publish _mta-sts and _smtp._tls TXT records.
Audit TLS-RPT reports for 7 days, then change mode to enforce, set max_age: 604800, and increment _mta-sts id=.
Organizations that route Microsoft 365 inbound mail through Mimecast, Proofpoint, or Cloudflare Area 1 MUST list the gateway's MX hostnames in mta-sts.txt instead of *.mail.protection.outlook.com.
Microsoft 365 supports both enforcing MTA-STS when sending outbound mail to external partners and receiving MTA-STS-protected mail when you publish mta-sts.<domain>.
If your tenant uses Exchange Online's newer *.mx.microsoft MX records, add mx: *.mx.microsoft to avoid inbound delivery rejections under enforce mode.
Common Configuration Pitfalls to Avoid
Copy-pasting *.mail.protection.outlook.com when an external spam filter sits in front of Microsoft 365 — sending MTAs will reject delivery when enforce is active.
Deploying mode: enforce with max_age: 31536000 before testing with TLS-RPT.
Using underscores or dashes in _mta-sts TXT id= (RFC 8461 permits only ASCII letters and digits).
Deploy RFC 8461 MTA-STS on Cloudflare in under 5 minutes without a separate origin server: host https://mta-sts.<domain>/.well-known/mta-sts.txt via Cloudflare Pages or a 12-line Worker plus _mta-sts TXT.
Exact RFC 8461 mta-sts.txt MX patterns for Google Workspace (both modern smtp.google.com and legacy 5-record aspmx.l.google.com setups), plus TLS-RPT validation and enforce rollout.
Publish RFC 8460 _smtp._tls.<domain> TXT records to receive daily compressed JSON reports from Gmail, Microsoft, and Yahoo detailing every successful STARTTLS/DANE/MTA-STS session and failure.
Build a compliant default._bimi.<domain> DNS TXT record and SVG Tiny 1.2 Portable/Secure (tiny-ps) logo, while avoiding the DMARC p=none and pct<100 traps that block Gmail and Apple Mail.
Compare Verified Mark Certificates (VMC) and Common Mark Certificates (CMC) for BIMI: trademark registration rules, DigiCert/Entrust issuance, Gmail blue checkmark vs logo-only display, and Apple Mail requirements.
Restrict which Certificate Authorities can issue TLS certificates for your domain with RFC 8659 CAA records: exact issue, issuewild, and iodef syntax for BIND and Cloudflare DNS.
Does Microsoft 365 host mta-sts.<domain> for me automatically?
No. You must host https://mta-sts.<domain>/.well-known/mta-sts.txt on your own web edge (such as Cloudflare Pages/Workers, Azure Static Web Apps, or Nginx) and publish the DNS TXT records.
What if we use Proofpoint or Mimecast in front of Exchange Online?
Your public DNS MX points to the secure email gateway, so your mta-sts.txt must list the gateway's exact MX hostnames (e.g., *.pphosted.com or *.mimecast.com) rather than Microsoft's MX.
Does Exchange Online check SPF lookups strictly alongside MTA-STS?
Yes — Microsoft 365 consumes 2 SPF lookups via include:spf.protection.outlook.com. Check your total SPF budget in Cluster 1A (/spf-dmarc/).