Email Worker
Hi! I have a email worker set up to send a post request to my server when one of my emails recieves an email. For some reason the email is getting dropped instead of going to the worker. Is there any reason this might be happening?
21 Replies
Are you seeing dropped in the dashboard? That’s expected with workers
Yeah. when i send an email from my gmail to the email created on cloudflare just to see if it actually works, it doesn't get sent to my server. it just gets dropped.
here is the code that i have
Would you know any way to prevent the drop or is it just something I have to deal with?
Are you getting an tail logs from the worker?
this? sorry im new to worker
You seem to have an high error rate. I would suggest starting a real-time logging session then send an email to see what error you are getting
ok ill send the results in a sec.
Looks like you are getting the email fine but it seems you are being redirected by the server you are trying to send the webhook to
yeah. let me see if i can debug on my server
because currently this is how i am receiving the webhook
when i edit the worker an use the testing tool it works just fine. but them when i try it by actually emailing the email, it redirects to many times.
Oh are these both workers on your zone?
the app.post code is on my server that hosts my website.
the exports default code that i sent awaile ago is the worker code
sorry if im not understanding your questions
If it is a second worker then you want a service binding https://developers.cloudflare.com/workers/configuration/bindings/about-service-bindings/ as they are way to make requests between workers on the same account
it's not two different workers sorry.
this is the only worker that handles emails
while the following code is my servers code for my website.
Wait I'm confused. You have the same worker with two triggers and you are sending messages with POST between them?
no 😅
ok so the first set of code is the email worker that handles emails.
the second set of code is hosted on my vps that holds my website using express js. the app.post("/incoming") is what worker send a request to. the worker is on cloudflare. the app.post is on my own server separate from cloudflare
Ah sorry
its ok, i didn't explain it very well 😅
Do you have any code in the vps that does redirects? Something there is redirecting the worker
not that i see. let me take another look
nothing is redrecting. let me run a few test
i figured out the issue. i had to get creative and use iFTTT. my server wasnt wanting to accept the post from cloudflare
That's bizarre. Glad you got it fixed
ikr!! Thank you for all your help!!!!