Skip to content

Email routing rules and addresses

In Email routing, an email rule is a pair of a custom email address and a destination address, or a custom email address and an associated Worker. You can route emails to either:

  • Verified email addresses
  • Workers with the email handler

This allows you to route emails to your preferred inbox, or apply logic with Workers before deciding what should happen to your emails. You can have multiple custom addresses, to route email from specific providers to specific mail inboxes.

Custom addresses

  1. Log in to the Cloudflare dashboard and select your account and domain.

  2. Go to Compute > Email Service > Email Routing > Routing Rules.

    Go to Email Routing
  3. Select Create address.

  4. In Custom address, enter the custom email address you want to use (for example, my-new-email).

  5. In the Action drop-down menu, choose what this email rule should do. Refer to Email rule actions for more information.

  6. In Destination, choose the email address or Worker you want your emails to be forwarded to — for example, your-name@gmail.com. You can only choose a destination address you have already verified. To add a new destination address, refer to Destination addresses.

Email rule actions

When creating an email rule, you must specify an Action:

  • Send to an email: Emails will be routed to your destination address. This is the default action.
  • Send to a Worker: Emails will be processed by the logic in your Worker.
  • Drop: Deletes emails sent to the custom address without routing them. This can be useful if you want to make an email address appear valid for privacy reasons.

Disable an email rule

  1. In the Cloudflare dashboard, go to Email Routing.

    Go to Email Routing
  2. Select Routes.

  3. In Custom addresses, identify the email rule you want to pause, and toggle the status button to Disabled.

Your email rule is now disabled. It will not forward emails to a destination address or Worker. To forward emails again, toggle the email rule status button to Active.

Edit custom addresses

  1. In the Cloudflare dashboard, go to Email Routing.

    Go to Email Routing
  2. Select Routes.

  3. In Custom addresses, identify the email rule you want to edit, and select Edit.

  4. Make the appropriate changes to this custom address.

Delete a custom address

  1. Log in to the Cloudflare dashboard and select your account and domain.
  2. Go to Compute > Email Service > Email Routing > Routing Rules.
  3. In Custom addresses, identify the email rule you want to delete.
  4. Select Delete and confirm the action.

Deleting a custom address will permanently remove the routing rule. Emails sent to this address will no longer be routed. If you want to temporarily stop routing without deleting the rule, refer to Disable an email rule.

Catch-all address

When you enable this feature, Email Routing will catch variations of email addresses to make them valid for the specified domain. For example, if you created an email rule for info@example.com and a sender accidentally types ifno@example.com, the email will still be correctly handled if you have Catch-all addresses enabled.

To enable Catch-all addresses:

  1. In the Cloudflare dashboard, go to Email Routing.

    Go to Email Routing
  2. Select Routes.

  3. Enable Catch-all address, so it shows as Active.

  4. In the Action drop-down menu, select what to do with these emails. Refer to Email rule actions for more information.

  5. Select Save.

Subaddressing

Email Routing supports subaddressing, also known as plus addressing, as defined in RFC 5233. This enables using the "+" separator to augment your custom addresses with arbitrary detail information.

You can enable subaddressing at Email > Email Routing > Settings.

Once enabled, you can use subaddressing with any of your custom addresses. For example, if you send an email to user+detail@example.com it will be captured by the user@example.com custom address. The +detail part is ignored by Email Routing, but it can be captured next in the processing chain in the logs, a Worker or an Agent application.

If a custom address user+detail@example.com already exists, it will take precedence over user@example.com. This prevents breaking existing routing rules for users, and allows certain sub-addresses to be captured by a specific rule.

Destination addresses

This section lets you manage your destination addresses. It lists all email addresses already verified, as well as email addresses pending verification. You can resend verification emails or delete destination addresses.

Destination addresses are shared at the account level, and can be reused with any other domain in your account. This means the same destination address will be available to different domains in your account.

To prevent spam, email rules do not become active until after the destination address has been verified. Cloudflare sends a verification email to destination addresses specified in Custom addresses. You have to select Verify email address in that email to activate a destination address.