Skip to content

Rule

Source: src/Cloudflare/Email/Rule.ts

A Cloudflare Email Routing rule.

Rules forward inbound mail matching matchers to the listed actions (forward to a verified destination, drop, or hand off to a Worker).

const rule = yield* Cloudflare.Email.Rule("InfoForward", {
zone: "example.com",
matchers: [{ type: "literal", field: "to", value: "info@example.com" }],
actions: [{ type: "forward", value: ["ops@example.com"] }],
});