pub struct DmarcOutput { /* private fields */ }Expand description
The outcome of DMARC evaluation.
Returned by
MessageAuthenticator::verify_dmarc.
It holds the Author Domain, the policy to apply, the aligned SPF and DKIM
results and the DMARC Policy Record that was applied, if any.
Implementations§
Source§impl DmarcOutput
impl DmarcOutput
Sourcepub fn domain(&self) -> &str
pub fn domain(&self) -> &str
Returns the Author Domain (the RFC5322.From domain, as an A-label), or an empty string when none could be determined.
Sourcepub fn into_domain(self) -> String
pub fn into_domain(self) -> String
Consumes the output and returns the Author Domain.
Sourcepub fn policy(&self) -> Policy
pub fn policy(&self) -> Policy
Returns the policy to apply to a failing message: p, sp or np
of the applied record depending on where it was found, lowered by one
level in test mode (t=y). Policy::None when DMARC does not
apply.
Sourcepub fn dkim_result(&self) -> &DmarcResult
pub fn dkim_result(&self) -> &DmarcResult
Returns the DKIM alignment result: Pass when a passing DKIM (or
DKIM2 instance 1) signature is aligned, Fail when signatures passed
but none aligned, TempError on a DNS error affecting an aligned
identifier, None when no signature passed.
Sourcepub fn spf_result(&self) -> &DmarcResult
pub fn spf_result(&self) -> &DmarcResult
Returns the SPF alignment result: Pass when SPF passed for an
aligned MAIL FROM domain, Fail when SPF passed but the domain is not
aligned, TempError when SPF returned temperror for an aligned
domain or alignment hit a DNS error, None otherwise.
Sourcepub fn result(&self) -> DmarcResult
pub fn result(&self) -> DmarcResult
Returns the overall DMARC result: the best of the SPF and DKIM
results, ranked Pass, TempError, PermError, Fail. When both
are None, returns Fail with Error::NotAligned if a record was
applied and None otherwise.
Sourcepub fn record(&self) -> Option<&Arc<DmarcRecord>>
pub fn record(&self) -> Option<&Arc<DmarcRecord>>
Returns the DMARC Policy Record that was applied, if any.
Sourcepub fn requests_reports(&self) -> bool
pub fn requests_reports(&self) -> bool
Returns true when the applied record has a rua= or ruf= tag
with at least one destination.
Sourcepub fn failure_report(&self) -> Option<FailureOptions>
pub fn failure_report(&self) -> Option<FailureOptions>
Returns the fo= options of the applied record when a failure report
(RFC 9991) should be sent for this message: the record has ruf=
destinations, the result is not a temporary error, and the failed
mechanisms match fo=. Returns None otherwise.
Trait Implementations§
Source§impl Clone for DmarcOutput
impl Clone for DmarcOutput
Source§impl Debug for DmarcOutput
impl Debug for DmarcOutput
Source§impl Default for DmarcOutput
impl Default for DmarcOutput
impl Eq for DmarcOutput
Source§impl PartialEq for DmarcOutput
impl PartialEq for DmarcOutput
impl StructuralPartialEq for DmarcOutput
Auto Trait Implementations§
impl Freeze for DmarcOutput
impl RefUnwindSafe for DmarcOutput
impl Send for DmarcOutput
impl Sync for DmarcOutput
impl Unpin for DmarcOutput
impl UnsafeUnpin for DmarcOutput
impl UnwindSafe for DmarcOutput
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more