Skip to main content

Module email

Module email 

Source
Expand description

Inbound email: the from email("addr") service protocol (#3328, slice 1).

The checker side of the protocol’s seventh member: address validation, handler shape (on message(mail: InboundEmail) -> Effect[EmailVerdict]), the one-claim-per-address rule (DECISION A), and the slice-1 refusal to emit a from email service as a Worker (slice 2 builds the email() export).

InboundEmail, EmailVerdict and the rest are first-party types exported by bynk.cloudflare, so the handler-shape checks compare type names; the body is then type-checked against the real declarations like any other.

Constants§

EMAIL_VERDICT
The first-party verdict a from email handler returns.
INBOUND_EMAIL
The first-party type a from email handler receives.

Functions§

address_problem
Why an address is not a claimable recipient, or None if it is.
check_email_services
Check every from email service of one context: address, handler shape and the one-service-per-address rule.
phase_duplicate_addresses
#3328 slice 2: two contexts claiming one address is an error too. Slice 1 checks each context on its own (check_email_services); routing is project-wide (one rule per address, on the account), so this sees every context. A claim inside one context is that check’s, so only a claim by a different context is reported here, on the later one (contexts in name order, so the report does not depend on discovery order).
routed_addresses
The addresses a context’s from email services claim, lower-cased (Email Routing matches without regard to case, ADR 0805 A), sorted and de-duplicated: what the Worker’s wrangler.toml lists as its top-level addresses.