#[non_exhaustive]pub struct ReceiveContext {Show 13 fields
pub client_ip: IpAddr,
pub ehlo_domain: String,
pub sender: String,
pub recipient: String,
pub message: Vec<u8>,
pub hostname: String,
pub auth_results: AuthResults,
pub greylisted: bool,
pub virus_found: Option<String>,
pub content_score: f64,
pub matched_rules: Vec<String>,
pub ptr_score: f64,
pub ai_score: f64,
}Expand description
Aggregate state for one SMTP receive transaction.
Constructed at the start of the pipeline from the SMTP envelope + DATA
body. Stages take &mut ReceiveContext and mutate the signal fields
(auth_results, virus_found, content_score, etc.) as they execute.
At the end, the Pipeline executor materializes a
PipelineInput from the accumulated state and calls
make_delivery_decision.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.client_ip: IpAddrClient IP that connected and submitted the message.
ehlo_domain: StringDomain the client claimed in EHLO/HELO.
sender: StringEnvelope MAIL FROM (reverse path).
recipient: StringEnvelope RCPT TO (first / primary recipient).
message: Vec<u8>Raw RFC 5322 message body the client transmitted in DATA.
hostname: StringThis server’s own hostname (used in the Authentication-Results
header’s authserv-id).
auth_results: AuthResultsSPF / DKIM / ARC / DMARC verification summary. Stages typically fill
auth_results.spf first, then dkim, etc.
greylisted: booltrue when a greylisting stage decided to defer.
virus_found: Option<String>Some(signature_name) when a virus scanner found malware.
content_score: f64Rule-engine content score (higher = spammier).
matched_rules: Vec<String>Names of rules that fired. Surfaced in the Junk decision’s reason.
ptr_score: f64FCrDNS score from a PTR-check stage.
ai_score: f64Score from an AI / ML scoring stage.
Implementations§
Source§impl ReceiveContext
impl ReceiveContext
Sourcepub fn new(
client_ip: IpAddr,
ehlo_domain: impl Into<String>,
sender: impl Into<String>,
recipient: impl Into<String>,
message: Vec<u8>,
hostname: impl Into<String>,
) -> Self
pub fn new( client_ip: IpAddr, ehlo_domain: impl Into<String>, sender: impl Into<String>, recipient: impl Into<String>, message: Vec<u8>, hostname: impl Into<String>, ) -> Self
Construct a fresh context for one receive transaction. All signal fields start zeroed; stages fill them in as the pipeline runs.
Sourcepub fn to_pipeline_input(&self, spam_threshold: f64) -> PipelineInput
pub fn to_pipeline_input(&self, spam_threshold: f64) -> PipelineInput
Materialize a PipelineInput from the accumulated signals, ready
to hand to make_delivery_decision.
Trait Implementations§
Source§impl Clone for ReceiveContext
impl Clone for ReceiveContext
Source§fn clone(&self) -> ReceiveContext
fn clone(&self) -> ReceiveContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more