Email Worker to webhook POST fetch not working in production
Hello, I am trying to send a POST request to a webhook after receiving e-mails, using a Worker. This works in the edit environment; the webhook receives the POST request successfully. But as soon as I publish it live and send an e-mail to it, it doesn't do anything and it tells me Delivery Failed. I have looked at <#1185774979082637432>, and am doing the same approach. (The forward does work though if RegEx is not matched.) Here's some screenshots:
7 Replies
Can you stream the worker logs while reproducing? Should show he actual error
message.raw
, how do i handle it properly?
If I transfer message.raw
to not be a stream, i get "Too many redirects.", even tho I don't receive any incoming requests on the webhook and don't have any redirects configured anywhere. (And it also simply works in the test environment, but doesn't in production.)
Got this atm. Been trying to get it to work all day, I just can't seem to. Works in test env, doesn't in production: Too many redirects
I’m still having this issue. Does someone have an idea?On the zone you have the email worker attached to, go to ssl/tls -> overview and switch from Flexible to Full (Strict)
Magic link: https://dash.cloudflare.com/?to=/:account/:zone/ssl-tls/
That worked, thank you so much!
Sure, the "magic" is that all outgoing fetch requests from your worker "running" on your zone/website go through your zone's configuration, with "Flexible" they were being downgraded to http:// (even though you specified https://) and being infinitely redirected
Thanks, got into the same issue and spent several hour debugging it.. finally got it working thanks to the "strict" setting!
THANK YOU - I lost a day on this as well @Chaika THANK YOU - maybe this could make it's way into the documentation