Fail

The MTA-STS policy URL redirects

The short version

Serve the policy file directly at its URL; senders don't follow redirects.

What it means

When we asked for https://mta-sts.<your domain>/.well-known/mta-sts.txt, the server answered with a redirect (such as 301 or 302) instead of the file. The detail gives the status code.

Why it matters

The MTA-STS standard forbids senders from following redirects when they fetch a policy, so a redirect means the policy can't be read at all. This often happens when the mta-sts host is pointed at the main website, which redirects everything to www, or when a CDN rule sends all HTTP paths to a single page.

How to fix it

  1. Find out what serves mta-sts.<your domain>. If it is your main website, add an exception for the path /.well-known/mta-sts.txt before any redirect rule.
  2. Better still, give the mta-sts host its own small site or a static bucket that serves only that file.
  3. Make sure the file comes back with status 200 and Content-Type: text/plain.
  4. Test with a command-line tool that doesn't follow redirects, such as curl -sI, and check the first status line.

Check it worked

Run the MTA-STS checker on your domain again. Policy files are fetched fresh on every check, but senders cache the old policy for as long as its max_age says, so give real mail servers that long to notice. The policy row should show status 200 and the policy's mode.