Email Routing workers sending multiple copies of the same e-mail non-stop

What is the name of the domain?

example.com

What is the issue you’re encountering

I have a worker set to forward e-mails sent to my Email Routing to two different addresses, it does this fine, but it then does it again and again non-stop.

What steps have you taken to resolve the issue?

I setup a worker to forward any e-mail sent to my Email Routing address to two separate e-mail addresses by following the directions in a post here. I was quite glad to get the first e-mail straight to my mailboxes without issue, but then the second, third, fourth, and so on copies of the same message arrived. I changed the code based on a second post I found here and it does the same thing. I’m not a coder. I am not really familiar with workers at all and I could really use some help please.

What are the steps to reproduce the issue?

Send an e-mail to the Email Routing address routed to the worker.

First worker code I used:

export default {
  async email(message, env, ctx) {
    const forwardList = ["[email protected]", "[email protected]"];
    for(const email of forwardList){
      await message.forward(email);
    }
  }
}

Second worker code I used:

export default {
  async email(message, env, ctx) {
    await message.forward("[email protected]");
    await message.forward("[email protected]");
  }
}

Well, I figured it out so I thought I’d share my solution. I thought my second e-mail address was getting the messages because I saw e-mail going to that address at the same time it was going to the first, but it turns out it was a coincidence. The e-mails were not making it there because the second address was never verified. Once I verified it the issues went away.

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.