Skip to content

fix(email-routing): plan for an existing MTA-STS policy before changing MX providers #36026

In review

Description

@coygeek

Existing documentation URL(s)

What changes are you suggesting?

Add an MTA-STS check to the instructions for switching to or from Cloudflare Email Routing. For a domain already using an enforce policy, explain how to update the allowed MX hosts before cutover, change the discovery record's policy ID, and account for senders still applying the previous policy. This protects mail delivery even when the sender already sees the replacement MX records.

Additional information

Summary

The provider migration instructions omit a domain's existing MTA-STS policy. An MTA-STS sender can resolve the new provider's MX correctly and still defer delivery if the applicable mode: enforce policy only permits the old MX hosts.

Steps to reproduce

  1. For a move away from Email Routing, read Remove a domain from Email Routing and assume the domain uses Cloudflare's documented shared policy with mode: enforce, mx: *.mx.cloudflare.net, and max_age: 86400.
  2. Walk the documented provider switch with a fresh MX answer containing only mail.example.net and a sender still applying the old policy. Compare the new hostname with the old policy's allowed MX patterns.
  3. Repeat the comparison for a move to Email Routing, with the old provider's enforce policy allowing only mail.example.net and a fresh MX answer containing Cloudflare hosts such as route1.mx.cloudflare.net. Both comparisons are documentation and protocol checks using an example external hostname. No live DNS, policy, or mail delivery was changed or tested.

Expected behavior

The guide should help operators with an existing enforce policy keep the receiving MX hosts authorized throughout the cutover. It should explain how to publish a policy that covers the hosts needed during the transition, advertise a new _mta-sts policy id after publishing the policy, and allow for senders that still apply a valid cached copy using the previous policy's max_age when planning the cutover.

Actual behavior

The Domain configuration guide covers changing MX records in both directions, and the MTA-STS guide shows a shared policy limited to Cloudflare MX hosts. The migration steps omit the policy transition in both directions. In the example, each replacement hostname fails MX matching under the applicable enforce policy, even with a fresh DNS answer. RFC 8461 requires the sender to withhold delivery to a failing host and recommends treating policy failures as transient. The delivery outcome depends on policy refresh and sender retries.

Evidence

Restoration check

Walk the revised migration instructions in both directions with an enforcing sender that receives the new provider's MX on its first lookup. The instructions identify the old policy and explain how to time the transition so an applicable old-only policy does not block delivery to the new MX. A transition policy that lists both example host patterns passes the same MX comparison for both hosts. Keep the existing TLS and certificate requirements in the check.

Runtime or environment

Published Cloudflare Developer Docs and the matching production source revision cd5bf82ac1d0d34fe13997eb15c6727b498cd926.

Triage assessment

  • Impact level: P2
  • Assessment status: supported
  • Impact basis: A fresh MX answer can still result in deferred legitimate inbound mail for migrations with a previously enforcing policy that excludes the new hosts. Reach and duration depend on senders' MTA-STS support, policy cache state, and retries.
  • Workaround status: unverified
  • Workaround basis: Where an operator can publish a transition policy, it can authorize both providers' MX hosts and the cutover can account for the previous policy's lifetime. This was checked against the RFC host-matching rules with example inputs, without an end-to-end provider migration.

References

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions