12 Replies
Did you ever find a solution to this? Currently having the same problem...
There was a similar thread on the Cloudflare Community, which can be found here: https://community.cloudflare.com/t/workers-for-mta-sts-not-getting-correct-url/537873.
If the actual error says:
mta-sts.example.com
is not defined in the mta-sts worker
Then you simply need to add a policy for mta-sts.example.com
:
^
Alone changing "mta-sts.yourdomain.tld
" to "mta-sts.example.com
" at the line after const stsPolicies = {
may be what you want.
If you need to cover multiple ones at the same time, the code seems to me to indicate that you simply need to copy the "mta-sts.yourdomain.tld
" key and it's value, and adjust them accordingly, for example like this:
In the above example:
- example.com
uses Microsoft Office 365 / Outlook.
- example.net
uses Google Workspace
- example.org
uses their own two mail servers.
TL;DR: If it doesn't find a matching policy for the accessed domain under "stsPolicies
", it will return the error code from above.Thanks for your response, and I had a look at the thread in Cloudflare Community as well
That doesn't seem to be my problem though. I believe I have the correct domain inside stsPolicies:

Can you see anything wrong in any of that @DarkDeviL?
That address seems to work fine from here?

Huh
Still not working for me, even with new browser, cleared cache, etc
But awesome that it's working for you
Maybe it just a DNS propagation lag (even though it's been several hours)
I'll leave it until tomorrow and try again... hopefully it will be fine by then!
Thanks for your help!
DNS shouldn't be the problem if you're seeing the "is not defined in the mta-sts worker" error text, as OP originally mentioned though.
So that makes me curious, ... what exact error (or issue) do you see on your end?
By reaching a couple of different Cloudflare PoPs within the European continent, such as Paris/France, Hamburg/Germany and London/UK, I do see consistent results, just like the one I was showing above.
Good question. I was getting that error originally in preview, until I realised that the preview mode was testing the .workers.dev URL… and that one WASN’T in stsPolicies.
Now I’m testing the right domain and I’m getting a domain not found error.
Sorry for the confusion… I’ve been changing multiple things over the past hour or so to try to get it to work and wasn’t explaining it all here, so thats my fault.
And I just tried it again on mobile, and got this:

Looks like it was a combination of confusion on my part re what was being tested, and very slow DNS propagation…
Thanks again for your help, and sorry for the hassle!