Before Changing Email Providers, Check Your MTA-STS Policy URL

Check your MTA-STS policy URL, DNS identifier, MX hosts, and cached policies before changing email providers to help avoid delivery failures.

Published
Reading time
7 min read
Before Changing Email Providers, Check Your MTA-STS Policy URL
On this page

Changing your inbound email provider can change your domain’s MX records. If sending mail servers have cached an MTA-STS policy that does not allow the new MX hosts, some senders may be unable to deliver mail while that policy remains in effect. Before the change, check the MTA-STS policy URL, its contents, and the DNS record that identifies the policy.

This checklist uses example.com as a fictional domain. Replace it with your live receiving domain. RFC 8461 and current provider documentation could not be consulted in this environment, so confirm the procedure and your provider’s MX and TLS requirements against those sources before making production changes. The commands below were not executed here.

Key Takeaways

  • The policy for example.com is fetched over HTTPS from https://mta-sts.example.com/.well-known/mta-sts.txt.
  • An HTTP 200 response is only the start: review the TLS connection and policy contents as well.
  • The _mta-sts DNS TXT record contains an id that signals a policy change; the identifier is not an MX hostname or the policy itself.
  • Plan for senders that still have an older policy cached. Publishing an updated policy does not immediately replace every sender’s cached copy.
  • Test the live domain separately from any staging domain, and coordinate MX, policy, DNS, and certificate changes with both providers.

1. Identify the live policy and DNS records

For the receiving domain, inspect these three pieces together:

ItemExample for example.comWhat to check
MX recordsexample.comThe actual inbound mail hostnames and priorities
MTA-STS TXT record_mta-sts.example.comA record containing v=STSv1 and an id
HTTPS policyhttps://mta-sts.example.com/.well-known/mta-sts.txtThe mode, permitted MX patterns, and cache lifetime

The policy hostname is based on the receiving domain, not necessarily on the hostname of your website or mail provider. DNS may delegate or alias hosting arrangements, but the sender still requests the domain-specific HTTPS URL. The endpoint needs a publicly trusted certificate valid for that policy hostname.

From a machine with dig, query the public-facing records:

dig +short MX example.com
dig +short TXT _mta-sts.example.com

Record the results before making changes. If the TXT record appears absent or differs across resolvers, investigate the authoritative DNS configuration and propagation before assuming the policy is inactive everywhere. Cached policies can outlive the current DNS response.

Advertisement

2. Check the MTA-STS policy URL over HTTPS

Use a normal GET request and retain the response body for inspection:

curl --show-error --verbose --max-time 15 \
  --output mta-sts-policy.txt \
  --write-out '\nHTTP status: %{http_code}\n' \
  'https://mta-sts.example.com/.well-known/mta-sts.txt'

Check the status and the diagnostic messages, then open mta-sts-policy.txt in a text editor. Curl should validate the HTTPS certificate using its normal trust configuration; do not add --insecure to make a failing check appear successful.

A 200 response does not establish that the body is a valid or appropriate MTA-STS policy. For example, a hosting platform might return an HTML error page with a successful status. Also review the actual body, hostname, certificate, and MX records.

Do not use -L for this check: it follows redirects and can hide a redirect at the policy URL. MTA-STS policy retrieval must not rely on redirects. If you get a 3xx response, configure the exact policy URL to serve the policy directly over HTTPS. Investigate certificate errors, DNS failures, non-200 responses, and timeouts before proceeding.

3. Review the policy contents

A policy body can look like this illustrative example:

version: STSv1
mode: enforce
mx: mx1.mail.example.net
mx: mx2.mail.example.net
max_age: 604800

The mx values above are fictional, not provider settings. Compare your actual policy with the hostnames your providers give you:

  • version identifies the policy format.
  • mode determines the policy’s intended enforcement behavior. In enforce mode, an MTA-STS-capable sender is expected to enforce the policy when delivering mail. testing is useful for evaluation but does not provide the same enforcement; none signals that enforcement is disabled.
  • mx entries specify permitted receiving MX hostname patterns. Check every active MX hostname, including backup hosts, against the policy. An MX record that points to an unlisted host can cause delivery problems under enforcement.
  • max_age is the policy cache lifetime in seconds. It matters during a migration because a sender may continue using an earlier cached policy.

The policy is about receiving mail for your domain. An outbound-only provider change does not necessarily change inbound MX hosts, but still verify which services and records are affected.

Advertisement

4. Plan the TXT identifier and cache transition

An illustrative DNS TXT value is:

v=STSv1; id=policy2026a

The id is a change indicator for the published policy. When the policy changes, publish a new identifier so senders can recognize that they should refresh it. The identifier does not appear in the policy body and does not itself specify allowed MX hosts. Changing only the identifier does not fix an incorrect policy; changing only the policy risks leaving senders unaware that it changed.

Use a migration sequence coordinated with your providers:

  1. Inventory the old and new MX hostnames. Confirm that the new provider is ready to accept mail for the domain and supports the required TLS behavior.
  2. Review the existing policy’s mode and max_age. If you intend to shorten the cache lifetime, plan ahead: a sender that already cached the older policy may retain it for the older lifetime. Lowering max_age today does not retroactively shorten that cached copy.
  3. Publish a transition policy that permits both the old and new MX hosts, where appropriate, and update the TXT id. Confirm that the exact HTTPS URL serves the intended new policy.
  4. Allow for cached older policies before switching MX records. Keep the old receiving service available during the agreed overlap. DNS TTLs and policy cache lifetimes are separate concerns; neither change is instantaneous for every sender.
  5. Switch MX records and monitor delivery. After the overlap, remove obsolete MX permissions when appropriate, update the id again, and retain the old service long enough for the planned transition.

A policy permitting both sets of hosts does not make an old cached policy permit the new hosts immediately. The waiting period must account for the previously published cache lifetime and your providers’ migration guidance. Monitor delivery reports and mail logs where available, but do not assume they show every sender’s cached state.

5. Check staging and production separately

A successful test for a staging domain does not prove that the live domain works. Each domain has its own _mta-sts TXT lookup, policy hostname, certificate, policy body, and MX configuration. Repeat the checks using the exact production domain from a network that can reach its public DNS and HTTPS endpoint.

Also confirm who controls each component: DNS, the mta-sts web endpoint, the old mail service, and the new one may be managed by different teams or vendors. A provider-managed staging setup may not match production DNS, certificates, redirects, or cached sender policies.

Common Mistakes

  • Checking only the HTTP status. A successful response can contain the wrong or invalid policy.
  • Following a redirect silently. A browser or curl -L can show a policy from another location while concealing that the required URL redirects.
  • Switching MX before accounting for cached policies. Some senders may still enforce a policy that permits only the old hosts.
  • Forgetting the TXT id. Update it when publishing a changed policy, and verify both DNS and the served body.
  • Testing only staging. Use the live domain’s exact hostname and public records for the final check.
  • Disabling certificate verification during diagnosis. Fix the certificate or trust problem instead of treating an insecure fetch as a pass.

Best Practices

Keep a record of the pre-change DNS answers, policy body, identifier, and cache lifetime. Assign owners for DNS, policy hosting, and mail delivery, and agree on the overlap and rollback plan before changing MX records. After each policy update, fetch the live URL again and compare its contents with the intended configuration.

Conclusion

Check the policy URL, TXT identifier, MX hostnames, and cached-policy transition as one migration task. A direct HTTPS response with the right policy helps prevent avoidable delivery failures, but the old policy’s lifetime still needs to be part of the cutover plan.

What would your domain sell for?

A free TidyURLs account unlocks the Domain Estimator. It prices a name from 191,011 real domain sales.