Make the MTA-STS policy cover every MX host
Why it matters
Some of your mail servers are not named in the policy, so in enforce mode senders refuse to deliver to them and in testing mode they only report it. The mx lines must match the MX records.
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
- List your MX records and compare them with the mx: lines in the policy. The finding names the hosts that are not covered.
- Add an mx: line for each missing host, or a wildcard such as mx: *.example.com that covers exactly one extra label (it does not match the bare domain or deeper names). Remove lines for hosts you no longer use. Replace the mx lines in the snippet with your own MX host names, written exactly as they appear in your MX records.
- Change the id in the _mta-sts TXT record after changing the file. Upload the file first, then change the TXT.
- When you add a new MX host in DNS later, put it in the policy first and change the id; senders may keep using the old policy until they see the new id.
- If you are in enforce mode and mail is being refused now, switch to mode: testing as an emergency step while you fix the list, and change the id in the _mta-sts TXT record as well, otherwise senders keep the old policy.
text
# Policy file https://mta-sts.example.com/.well-known/mta-sts.txt # One mx line per MX host (or pattern) of your own domain version: STSv1 mode: testing mx: YOUR-MX-HOST.example mx: YOUR-SECOND-MX-HOST.example mx: *.YOUR-MX-DOMAIN.example max_age: 86400 # Then change the id _mta-sts.example.com. IN TXT "v=STSv1; id=2026100503"
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
- Switch MTA-STS from testing to enforce
- Turn MTA-STS back on
- 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.