pub struct SpfParameters<'x> { /* private fields */ }Expand description
Input of an SPF check: the client IP, the identity to check and the values used for macro expansion.
Built with SpfParameters::helo, SpfParameters::mail_from,
SpfParameters::helo_and_mail_from or SpfParameters::new, and
passed to MessageAuthenticator::verify_spf or
MessageAuthenticator::check_host, optionally wrapped in Parameters
to supply a DNS cache.
Implementations§
Source§impl<'x> SpfParameters<'x>
impl<'x> SpfParameters<'x>
Sourcepub fn helo(
ip: IpAddr,
helo_domain: &'x str,
host_domain: &'x str,
) -> SpfParameters<'x>
pub fn helo( ip: IpAddr, helo_domain: &'x str, host_domain: &'x str, ) -> SpfParameters<'x>
Checks the HELO identity (RFC 7208, Section 2.3).
The SPF record of helo_domain is evaluated with <sender> set to
postmaster@<helo_domain>. host_domain is the name of the host
performing the check (the r macro).
Sourcepub fn mail_from(
ip: IpAddr,
helo_domain: &'x str,
host_domain: &'x str,
sender: &'x str,
) -> SpfParameters<'x>
pub fn mail_from( ip: IpAddr, helo_domain: &'x str, host_domain: &'x str, sender: &'x str, ) -> SpfParameters<'x>
Checks the MAIL FROM identity (RFC 7208, Section 2.4).
The SPF record of the domain of sender is evaluated; when sender
has no @, helo_domain is used instead. An empty sender (null
reverse-path) is replaced by postmaster@<domain>. host_domain is
the name of the host performing the check (the r macro).
Sourcepub fn helo_and_mail_from(
ip: IpAddr,
helo_domain: &'x str,
host_domain: &'x str,
sender: &'x str,
) -> SpfParameters<'x>
pub fn helo_and_mail_from( ip: IpAddr, helo_domain: &'x str, host_domain: &'x str, sender: &'x str, ) -> SpfParameters<'x>
Checks the HELO identity and then, unless it fails, the MAIL FROM identity.
Only MessageAuthenticator::verify_spf runs both checks; given to
MessageAuthenticator::check_host, these parameters check the MAIL
FROM identity alone. Arguments are those of SpfParameters::mail_from.
Sourcepub fn new(
ip: IpAddr,
domain: &'x str,
helo_domain: &'x str,
host_domain: &'x str,
sender: &'x str,
) -> Self
pub fn new( ip: IpAddr, domain: &'x str, helo_domain: &'x str, host_domain: &'x str, sender: &'x str, ) -> Self
Parameters for MessageAuthenticator::check_host.
ip: the SMTP client IP address (<ip>).domain: the domain whose SPF record is evaluated (<domain>).helo_domain: the domain given in the HELO or EHLO command.host_domain: the name of the host performing the check (thermacro).sender: the MAIL FROM address (<sender>); an empty string is replaced bypostmaster@<domain>.
Given to MessageAuthenticator::verify_spf, these parameters behave
like SpfParameters::helo_and_mail_from and domain is ignored.
Trait Implementations§
Source§impl<'x> Clone for SpfParameters<'x>
impl<'x> Clone for SpfParameters<'x>
impl<'x> Copy for SpfParameters<'x>
Source§impl<'x> Debug for SpfParameters<'x>
impl<'x> Debug for SpfParameters<'x>
impl<'x> Eq for SpfParameters<'x>
Source§impl<'x> From<SpfParameters<'x>> for Parameters<'x, SpfParameters<'x>, NoCache>
impl<'x> From<SpfParameters<'x>> for Parameters<'x, SpfParameters<'x>, NoCache>
Source§fn from(params: SpfParameters<'x>) -> Self
fn from(params: SpfParameters<'x>) -> Self
Source§impl<'x> PartialEq for SpfParameters<'x>
impl<'x> PartialEq for SpfParameters<'x>
impl<'x> StructuralPartialEq for SpfParameters<'x>
Auto Trait Implementations§
impl<'x> Freeze for SpfParameters<'x>
impl<'x> RefUnwindSafe for SpfParameters<'x>
impl<'x> Send for SpfParameters<'x>
impl<'x> Sync for SpfParameters<'x>
impl<'x> Unpin for SpfParameters<'x>
impl<'x> UnsafeUnpin for SpfParameters<'x>
impl<'x> UnwindSafe for SpfParameters<'x>
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