DNS Settings for Email Routing
I need help how i need to configure email routing for the following scenario:
I want to to route the mail noreply@example.com to an email worker, but all other mails like name@example.com to gmail. For both I need to configure different MX records. I guess I need to point the MX records to cloudflare, but how can I achieve then that I can read and write emails for other addresses to gmail? Is there a workaround or best practice?
4 Replies
#general-help
You can just configure/enable Email Routing though, and setup specific routes to forward to gmail vs workers
Cloudflare Docs
Configure rules and addresses
An email rule is a pair of a custom email address and a destination address, or a custom email address with an Email Worker. This allows you to route emails to your preferred inbox, or apply logic through Email Workers before deciding what should happen to your emails. You can have multiple custom addresses, to route email from specific provider...
You can have a catch-all to gmail and just a specific route to a worker for noreply, sounds like what you're looking for
Thank you for your answer! If i have a catch-all to google it's simply a redirection. It redirects name@example.com to name@otherexample.com whith otheexample.com having MX records to gmail. But that means if I answer in gmail the mai get's send from otherexample.com and NOT from example.com which is what I want.
I could also configure gmail to send from a different email address, but then I need to enter smtp server credentials to were to send from. Since Cloudflare doesn't provide an SMTP sever, I cant do that either.
The only way I see is point the MX records for example.com to gmail, then redirect noreply@example.com to noreply@otherexample.com and have the MX records of otheexample.com point to Cloudflare.
Is this best practice? Are there better solutions?