Help with email routing for subdomains using email worker

New to using cloudflare and looking set up email routing to a domain and two subdomains where catch-all will forward to a different email address for the domain and each subdomain.

email to anything at:

I see how to setup the catch-all, but I don’t see options for the subdomains I created. I am assuming the way to do this is to email worker which would route the based on the domain or subdomain and then route the catch-all to the worker.

I have no idea what that worker should look like. I saw the template examples and am lost not knowing anything about workers. Any suggestions on create that worker or some alternative to accomplish my goal?

Thanks!

Hi there,

There is no catch-all all by subdomain, only the “regular” catch-all, that catches every email for any of the subdomains.

If you’re looking to forward a specific email addresses from a subdomain to a specific email, simply add whichever_email_you [email protected] to your custom addresses in email routing. While adding you’ll be able to select the destination email.

If you actually want to implement catch-all on a hostname basis, then the option would be to change the catch-all action to Send to a Worker:


And then, have the worker forwarding it.

Here’s something that might help:

Take care.