Abstract
- Email routing is the process of directing emails from a sender to the intended recipient’s inbox. It involves a series of rules that ensure emails reach the correct destination
Security
Filter spam and potentially harmful emails.
Email distribution to corresponding category
Manages a high volume of emails, sorting them into different inboxes for customer support, sales, marketing, etc.
Privacy
Creates custom addresses without revealing your primary email.
Flexibility
We have the freedom to switch the destination email providers and use our custom domain name to receive emails without paying a fee
Whitelist sender emails in Gmail
If you are routing emails to Gmail inbox, some senders may be blocked. You can refer to here to whitelist those emails.
Email Routing Mechanism
- We set the MX Record of Domain Name to point to the Email Routing server. So when a sender sends an email to the domain name, the email routing server is able to receive and apply the routing rules and forward to the destination email inbox if all rules are met
Cloudflare Email Routing
- Cloudflare’s offering for Email Routing. Refer to Cloudflare Email Routing docs for setup guide
Free!!!
It is totally to free to use. Comes with free Custom domain support and Routing Analytics!
However, there is a message limit of 25MB, 200 email routing rules and 200 destination emails. Refer to Cloudflare Email Routing Limits for more details.
Attention
Each custom address can only have one routing rule. You will get a ‘Duplicated Zone rule’ error if you try to create another.
If you are using Terraform to create the routing rule, the
value
inaction
is an array. However, you should only input a single email string. If you provide multiple strings in the array, Cloudflare will concatenate them into one.
Process emails programmatically
Route to Cloudflare Workers to program any logic you can dream of for processing your emails.
Cloudflare Email Worker
- A custom script built using Cloudflare Workers that allows developers to process, forward, or manage emails directly within the Cloudflare network. It enables flexible and serverless email handling, such as filtering, parsing, or routing emails to different destinations based on specific rules
- Refer to Cloudflare Email Workers for more details
Worker parameters
You can access the environment variables of the email worker via the
env
parameter. The screenshot above shows the structure of themessage
parameter.