Hi all!
We’ve been trying out Email Workers, but we’ve run into a snag.
We have a custom address, let’s call [email protected], that redirects to say [email protected], for the purpose of having a mailbox some applications that fetch from. The email address has been verified via the AWS mailbox, and this seems to work fine.
We hosts our own email relays, which effectively just manage distribution lists. Email get sent to them, it matches a list, and the mail gets dispersed to the distribution list members.
What I’ve tried to do is maintain these distribution lists so that they remain on the same example.com domain. I have a sub.example.com subdomain, and simply wanted to use the Email Routing catch-all feature to remap example.com to sub.example.com so that the emails make their way to our personal email relays.
export default {
async email(message, env, ctx) {
// define the relevant domains
const origDomain = "example.com";
const newDomain = "sub.example.com";
// split the "to" address into an array seperated by @
var toAddressSplit = message.to.split("@");
// set $username to be the left side of the original email address
var username = toAddressSplit[0];
// forward the email to the newly formed email address
await message.forward(username+"@"+newDomain);
}
}
But this splits out “destination address not verified” in the Real-time Logs for the Worker. This is a problem, because the idea is that Cloudflare shouldn’t have to know what my distribution lists are. I don’t want to have to “verify” them on the Cloudflare side. There’s quite a few of them, they have non-technical users on them, and would be frankly disruptive and time-consuming to manage.
Can anyone offer any solutions to this? Maybe this could be an explicit feature for the catch-all? “domain re-mapping” or something?
Cheers