Switch MTA-STS from testing to enforce
Why it matters
In testing mode senders report TLS problems but still deliver, so a downgrade attack is not blocked. Enforce mode makes senders refuse to deliver over an insecure connection.
Staged change. Do this in stages and check each one before the next, so a mistake does not break your site or your mail.
The fix
- Read the TLS-RPT reports from the last few weeks. There must be no failures caused by your own mail servers, such as certificate name mismatches or expired certificates.
- Check that the mx: lines cover every MX host (including backup MX hosts) and that each one has a valid public certificate matching its own hostname. In enforce mode, mail to a host that fails this is not delivered. Replace the mx lines in the snippet with your own MX host names, written exactly as in your MX records.
- Change mode: testing to mode: enforce in the policy file, then change the id in the _mta-sts TXT record. Update the file before the TXT record.
- Keep max_age at 86400 for the first week so a mistake expires quickly, then raise it to a week or more (604800 or higher). To roll back, set mode: testing or none and change the id. Senders check the TXT id before they give up on a message and then fetch the new policy, but a sender may not see the new id until the TXT record's TTL has passed, so keep that TTL short during the rollout.
text
# Policy file https://mta-sts.example.com/.well-known/mta-sts.txt version: STSv1 mode: enforce mx: YOUR-MX-HOST.example mx: *.YOUR-MX-DOMAIN.example max_age: 86400 # Then change the id (this record is edited, not added) _mta-sts.example.com. IN TXT "v=STSv1; id=2026101001"
The examples use example.com. Replace it with your own domain.
Related
- Reported by the MTA-STS and TLS-RPT check
- Publish an MTA-STS policy, starting in testing mode
- Nothing to do for MTA-STS on a domain that accepts no mail
- Fix the MTA-STS TXT record
- Make the MTA-STS policy file reachable
- Fix the certificate on the MTA-STS policy host
- Fix the MTA-STS policy file
- Turn MTA-STS back on
- Make the MTA-STS policy cover every MX host
- Raise the MTA-STS max_age
- Publish a TLS-RPT record
- Fix the TLS-RPT record
Scan your domain to see whether this applies to you.