#redirect all mail from *@sagbot.com to [email protected] without creating a loop

5 messages · Page 1 of 1 (latest)

final dust
#

Is there a way to redirect all mails coming from *@sagbot.com to [email protected] without creating a loop? like this?

export default {
  async email(message, env, ctx) {
    if (message.to != "[email protected]") {
      message.forward("[email protected]")
    } else {
      // send the email, normally
    }
  }
}
full lotus
#

No

#

Because there’s no „send the email normally“ path

ionic dust
#

When you use CF Email Routing, it takes over the MX servers. It wouldn't know what origin to send it to

#

also you're not awaiting message.forward, failing to do so would make the forward be canceled and never work eitherway