A library implementing the Sender Policy Framework (SPF) specification, version 1, described in RFC 7208.
This library provides an API for checking whether an email sending host is authorised to use some mail domain according to SPF policy published in the DNS.
evaluate_sender is the main public API item. It allows
checking the MAIL FROM and HELO identities according to the specification.
In addition, the function
expand_explain_string allows performing macro
expansion on explain strings (macro strings).
The above functions both require to be passed a
which serves as a DNS resolver. The
allows you to plug in any DNS resolver yourself, by providing an appropriate
implementation. See the module
lookup for more.
As a convenience, a
Lookup implementation for the Trust-DNS resolver can
be made available by enabling the Cargo feature
The default feature
tokio-timeout enables timeout logic using the
time module. With this feature, the query functions will abort
after the configured timeout. If you want to use a different async runtime,
you can disable this feature and implement timeouts yourself (for example,
as part of the
Lookup implementation). Thus you can use this library
without depending on Tokio at all.
An SPF query configuration.
A builder for SPF query configurations.
A syntactically valid, normalised domain name.
The result of macro-expanding an explain string.
An error indicating that a query parameter could not be parsed.
The result of evaluating an SPF query.
A sender identity.
Causes of an SPF query error result.
Errors that may occur during query evaluation.
The result of an SPF evaluation.
The cause that led to an SPF result.