40. pepsi-stage-check-whitelist¶
Mark mail from trusted senders as non-spam.
40.1. Role¶
pepsi-stage-check-whitelist consults a named whitelist of trusted senders and,
when the message’s From: header matches, records state.spam = false so a
later pepsi-stage-anti-spam lets the message through without payment. Place
it ahead of the anti-spam stage. It only annotates the state and advances — it
never drops, bounces or pauses a message. Reference:
pepsi-stage-check-whitelist(1).
40.2. Features¶
Database-backed whitelists: the
pepsi.whitelisttable groups rows under awhitelist_name; the stage’sWHITELIST_NAMEoption selects the group.POSIX ERE matching: each
whitelist_regexis an extended POSIX regular expression matched case-insensitively against theFrom:header (evaluated by PostgreSQL’s~*operator, in a single round-trip). The expression is unanchored; anchor it with^/$to match the whole value.Optional signature conditions per row:
dkim_required→ matches only if theFrom:domain is authenticated:state.auth.dkim = pass, or an ARC pass that DMARC also confirms (state.auth.arc = passandstate.auth.dmarc = pass). ARC pass alone is only chain integrity (a one-hop chain can be self-minted over a forgedFrom:), so it does not satisfy the row by itself.signature_required→ matches only ifstate.signature_verifiedistrue, which pepsi-stage-decrypt sets for a message whose end-to-end signature verified against a trusted key. Avalid-untrustedverdict deliberately does not set it, so such a row is a genuine “this correspondent signs, verifiably” gate rather than a “someone signed this” one. Place a decrypt stage before this one, or the row never matches.
Non-destructive: on a match it merges
spam: falseand advances toNEXT_STAGE; on no match it advances unchanged. A message with noFrom:header matches nothing.
40.3. Configuration¶
[stage-<name>]: PROGRAM = pepsi-stage-check-whitelist, WHITELIST_NAME
(required — the whitelist_name group to consult) and NEXT_STAGE. See
pepsi-stage-check-whitelist(1).
40.4. State¶
Inputs:
state.auth.dkim/state.auth.arc/state.auth.dmarc(fordkim_requiredrows) andstate.signature_verified(forsignature_requiredrows; written by pepsi-stage-decrypt). TheFrom:header comes from thefrom_headercolumn.Outputs: on a match,
spam: falsemerged intostate; otherwisestateis unchanged.
40.5. See also¶
pepsi-stage-anti-spam, pepsi-stage-arc, Supported Features, pepsi-stage-check-whitelist(1).