DMARC ([RFC7489]) implementation
rust
let policy: Option<dmarc::Policy> = dmarc::load_policy(&logger, &from_domain).await?;
The load_policy
arguments are the following:
- logger
: [slog]::Logger
- from_domain
: &str ([RFC5322].From's domain)
```rust let dkimresult: cfdkim::DKIMResult = ...; let spfresult: SPFResult = ...;
let ctx = dmarc::PolicyContext { fromdomain: &fromdomain, logger: &logger, dkimresult, spfresult, };
let res: DMARCResult = policy.apply(&ctx); println!("dmarc={}", res.to_str()); ```
dkim_result
is the result of verifying DKIM using the [cfdkim] crate. In the future it should be a trait.
spf_result
is the result of verifying SPF.
Not planned yet.