Skip to main content

evaluate

Function evaluate 

Source
pub fn evaluate(rules: &MailRules, msg: &InboundMessage) -> MailVerdict
Expand description

Evaluate rules against msg and produce a MailVerdict.

Decision order:

  1. If the rules require a verified sender and the sender is not verified, the message is rejected (not delivered) and the function returns early.
  2. Otherwise the message is delivered. If the rules quarantine incoming mail, it is delivered to quarantine rather than the inbox.
  3. The priority and notify hints are carried through from the rules, with reasons recorded for a non-zero priority and for quarantine.
  4. Optional semantic_route (agreement / credential / values id, or a small DSL):
    • quarantine — force quarantine
    • require_verified — same as require_verified_sender for this evaluation
    • priority:N — override priority
    • anything else — recorded as audit trail (hook for rights/agreement engines)