Skip to content

EmailSecurityBlockSender

Source: src/Cloudflare/EmailSecurity/BlockSender.ts

A Cloudflare Email Security (Area 1) blocked sender — messages matching the pattern are blocked before delivery.

All fields are mutable in place. Requires the Email Security enterprise add-on; accounts without the entitlement receive the typed EmailSecurityNotEntitled error.

Block a single email address

yield* Cloudflare.EmailSecurityBlockSender("KnownPhisher", {
pattern: "phisher@malicious.example.com",
patternType: "EMAIL",
comments: "reported in incident 1234",
});

Block a whole sending domain

yield* Cloudflare.EmailSecurityBlockSender("SpamDomain", {
pattern: "spam-source.example.net",
patternType: "DOMAIN",
});

Block by regular expression

yield* Cloudflare.EmailSecurityBlockSender("LookalikeSenders", {
pattern: ".*@examp1e\\.com$",
patternType: "EMAIL",
isRegex: true,
});