1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//! `sieve-kit` — rule-based mail filtering engine.
//!
//! Defines filter rules (conditions + actions), evaluates them against
//! messages implementing the [`Filterable`] trait, and produces action plans
//! for a mail engine to execute. This crate is synchronous and I/O-free: all
//! rule evaluation is deterministic and testable without storage.
//!
//! # Security
//!
//! Regex evaluation is bounded (100 ms post-check). Invalid patterns are
//! treated as non-matching (never panic). Actions are returned as values;
//! executing them is the caller's responsibility.
//!
//! # Example
//!
//! ```
//! use sieve_kit::eval::{evaluate_rule, RegexCache};
//! use sieve_kit::types::{
//! Condition, ConditionField, FilterRule, LogicOp, MailEnvelope, Operator,
//! };
//!
//! let rule = FilterRule {
//! id: "r1".into(),
//! name: "Newsletters".into(),
//! enabled: true,
//! priority: 0,
//! conditions: vec![Condition {
//! field: ConditionField::Subject,
//! operator: Operator::Contains,
//! value: "digest".into(),
//! negate: false,
//! }],
//! condition_logic: LogicOp::And,
//! actions: vec![],
//! };
//! let msg = MailEnvelope {
//! subject: "Weekly digest".into(),
//! ..MailEnvelope::default()
//! };
//! assert!(evaluate_rule(&rule, &msg, &RegexCache::default()));
//! ```
pub use ;
pub use FilterError;
pub use RegexCache;
pub use ;