Files
inbuxa-server/crates
jcoffey-dev c8280de9c3 DLP and mail flow rules: the rule model, the engine and the node cache
Phase 2e of the DLP and mail flow rules spec, in the features crate.

- rules.rs: a rule (§2.2) with its conditions (§2.3) and actions (§2.4),
  as JSON under R/r in the fork's subspace. validate() enforces the
  spec's shape: DLP rules check outgoing mail and have exactly one of
  block, warn or hold; transport rules have neither those nor
  detectors; lists, header names, header values (one line), addresses,
  texts, word lists, patterns and detector ids are checked.
- engine.rs: rules compiled once (word lists to automata, patterns to
  size-limited regexes) and run in priority order with exceptions and
  stop processing. Each detector runs at most once per message and
  only when a rule asks for it. The outcome lists what matched with
  each detector's count, and decides DLP strictest first: block, hold,
  warn; an override answers warnings only (§2.5).
- cache.rs: each node's compiled copy, refreshed after 30 seconds or at
  once when this node changes a rule.

Nothing calls this yet: the JMAP object and the check at DATA follow.
55 unit tests in mailflow.
2026-09-28 17:29:35 -07:00
..
2026-09-28 06:30:20 -07:00
2026-09-28 06:30:20 -07:00
2026-09-28 06:30:20 -07:00
2026-09-28 06:30:20 -07:00
2026-09-28 06:30:20 -07:00
2026-09-28 06:30:20 -07:00
2026-09-28 06:30:20 -07:00
2026-09-28 06:30:20 -07:00
2026-09-28 06:30:20 -07:00
2026-09-28 06:30:20 -07:00
2026-09-28 06:29:38 -07:00
2026-09-28 06:30:20 -07:00
2026-09-28 06:30:20 -07:00
2026-09-28 06:30:20 -07:00
2026-09-28 06:30:20 -07:00
2026-09-28 06:30:20 -07:00
2026-09-28 06:30:20 -07:00
2026-09-28 06:30:20 -07:00
2026-09-28 16:57:47 -07:00
2026-09-28 06:30:20 -07:00