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

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


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 in action 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 the message parameter.