Cloudflare Email Routing Rule

Route incoming mail for a zone: match by recipient (or all) and drop, forward, or hand to an Email Worker.

What Gets Created

  • A cloudflare_email_routing_rule on the zone.

Prerequisites

  • Email Routing enabled on the zone (a CloudflareEmailRoutingZone).
  • Verified destination addresses for forward actions.

Configuration Reference

Required

  • zoneId — zone ID or a reference to a CloudflareDnsZone.
  • matchers — one or more match patterns.
  • action — drop / forward / worker.

Optional

  • name, enabled (default true), priority (default 0).

Stack Outputs

OutputDescription
rule_idThe routing rule identifier
zone_idThe zone the rule belongs to
  • CloudflareEmailRoutingZone
  • CloudflareEmailRoutingAddress
  • CloudflareWorker

Next article

Cloudflare Email Routing (Zone)

Cloudflare Email Routing (Zone) Enable Email Routing on a zone and (optionally) configure its catch-all rule. What Gets Created cloudflareemailroutingsettings (enables routing; provisions required DNS). cloudflareemailroutingcatchall (folded; only when catchAll is set). cloudflareemailroutingdns (only when lockDnsRecords is true). Prerequisites A Cloudflare zone (a CloudflareDnsZone). Configuration Reference Required zoneId — zone ID, or a reference to a CloudflareDnsZone. Optional catchAll —...
Read next article