Spf.Eval (Spfcheck v0.10.0) View Source
Functions to evaluate an SPF context.
Link to this section Summary
Link to this section Types
Specs
dns_result() :: Spf.DNS.dns_result()
Link to this section Functions
Specs
evaluate(Spf.Context.t()) :: Spf.Context.t()
Given a context retrieve and evaluate the associated SPF record.
After an (attempted) evaluation, returns an updated context where:
:verdictis anSpf.Context.verdict/0:reasonshows the SPF term responsible for the verdict:explanationis the expanded explain-string (if possible and applicable):errorshows what (last) error was seen (if any):iptwhich maps the prefixes seen during evaluation to their source:msgwhich lists log messages accumulated during evaluation
and other fields containing information gathered during the evaluation.
The context is passed around accumulating information and tracks the state of
the evaluation. Its :log is either nil or points to a log/4-function
that then called with the context, facility, severity and a message
so it can dump it to screen or somewhere else.
Specs
Say whether str contains the start of an SPF string.
Leading whitespace is not considered an error, although technically it is a syntax error.
Specs
Returns true if name is a validated name for given domain.
The dns_result should contain the ip addresses
associated with given name. If any of the ip adresss match the given ip,
the name is a validated domain name for given domain.
If the exact flag is true, then the name is also required to
end with given domain as well.
Note that when trying to validate names during the expansion of the p-macro, this flag will be false.