Issue with Cloudflare Workers and Mailchannels - Unauthorized Sender Error

I've encountered an issue with my contact form implementation using Cloudflare Workers and Mailchannels. The system was functioning correctly until Cloudflare added extra protections, which seem to have disrupted the process.

The error message I'm receiving is:

{"errors":["Failed to send email: 550 5.7.1 This sender is not authorized to send from co-medic.com. See https://bit.ly/domain-lockdown. cfid=co-medic.com"]}


To resolve this, I've added a TXT record: _mailchannels.co-medic.com with the content v=mc1 cfid=co-medic.com. However, the error persists.

I also tried with the domain of my worker: v=mc1 cfid=co-medic-email.meals-app.workers.dev, but this didn't resolve the issue either.

When I call my worker directly in the online worker editing dashboard (screenshot 1), it does work. The problem arises only when the request passes via my front-end (screenshot 2).

You can check the _mailchannels record here: https://dnschecker.org/all-dns-records-of-domain.php?query=_mailchannels.co-medic.com&rtype=TXT&dns=google

Also, note that calling the worker directly in the front-end (instead of passing through /api/contact) results in CORS problems, so switching to callling the worker directly from the browser is also not an easy fix :/

I'm currently unsure of the next steps to take, as adding the cfid TXT record doesn't seem to resolve the issue. Any guidance would be greatly appreciated.
image.png
image.png
Was this page helpful?