Create Mail Transfer Agent Strict Transport Security (MTA-STS) records to enhance email security
MTA-STS (Mail Transfer Agent Strict Transport Security) enables policy-driven authentication, encryption, and verification for SMTP connections, preventing man-in-the-middle attacks and downgrade attacks.
Policy will be published at: https://mta-sts.yourdomain.com/.well-known/mta-sts.txt
MTA-STS (Mail Transfer Agent Strict Transport Security) is a security standard defined in RFC 8461 that enables policy-driven authentication, encryption, and verification for SMTP connections between mail servers.
It helps prevent man-in-the-middle attacks and TLS downgrade attacks by ensuring that email delivery to your domain always uses encrypted connections and validates server certificates.
MTA-STS works through a two-part system:
Published at _mta-sts.yourdomain.com, this record indicates that MTA-STS is enabled and provides a policy ID for cache management.
v=STSv1; id=20241201120000Z;Hosted at https://mta-sts.yourdomain.com/.well-known/mta-sts.txt, this file contains the actual policy rules and authorized MX servers.
version: STSv1
mode: enforce
mx: mail.example.com
mx: *.google.com
max_age: 604800| Mode | Behavior | Use Case |
|---|---|---|
| none | Policy exists but provides no security benefit. Equivalent to having no MTA-STS policy. | Disabling MTA-STS temporarily or initial setup testing |
| testing | Policy violations are reported via TLS-RPT but email delivery continues normally. | Recommended first step: Monitor for potential issues before enforcement |
| enforce | Policy is actively enforced. Non-compliant email delivery attempts will be rejected. | Production deployment after successful testing period |
_mta-sts.yourdomain.commta-sts.yourdomain.com with a valid SSL certificatehttps://mta-sts.yourdomain.com/.well-known/mta-sts.txtSymptoms: Legitimate emails are being rejected or bouncing
Causes:
Solutions:
Symptoms: DNS record exists but policy file returns 404 or SSL errors
Solutions:
/.well-known/mta-sts.txtmta-sts.yourdomain.com has a valid SSL certificateContent-Type: text/plainCause: Sending servers cache policies based on max_age and policy ID
Solutions:
Use these tools to test and validate your MTA-STS implementation:
https://mxtoolbox.com/mta-sts.aspxhttps://easydmarc.com/tools/mta-sts-checkerhttps://www.hardenize.com/curl https://mta-sts.yourdomain.com/.well-known/mta-sts.txt