I have a very simple, static website that I host on cloudflare via Pages. Because of the way Pages works, the DNS record for wwwcom is a CNAME for cloudflare’s pages.dev site.
This redirect is not allowed per the MTA-STS RFC, and so I’m unable to use MTA-STS.
Am I overlooking some other way to make this work? I tried setting up a Worker to dynamically write the mta-sts.txt file every time it’s requested, but that’s still being flagged as a redirect.
The MTA checkers I have used (multiple, different ones) all complain when retrieving the mta-sts.txt file. They say redirects are not allowed and reference the RFC for the standard.
" The policy file always needs to be hosted at https://mta-sts.<domain.tld>/.well-known/mta-sts.txt. Note that this is mta-sts.domain needs to be an A/AAAA record in DNS. If you use a CNAME record this will fail MTA-STS validation checks in Exchange Online."
The “_mta-sts” record MAY return a CNAME that points (directly or via other CNAMEs) to a TXT record, in which case senders MUST follow the CNAME pointers. This can be used for policy delegation, as described in Section 8.2.
I recommend against chaining CNAMEs. While technically allowable, it adds unnecessary complexity. RFC 1912 2.4 and RFC 1034 3.6.2 offer more detail on why it is a practice best avoided.