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

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
}
}
}
export default {
async email(message, env, ctx) {
if (message.to != "[email protected]") {
message.forward("[email protected]")
} else {
// send the email, normally
}
}
}
1 Reply
Chaika
Chaika13mo ago
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

Did you find this page helpful?