package spf
import "git.sr.ht/~shulhan/pakakeh.go/lib/spf"
Package spf implement Sender Policy Framework (SPF) per RFC 7208.
Index ¶
Constants ¶
const ( // A "pass" result is an explicit statement that the client is // authorized to inject mail with the given identity. ResultCodePass byte = iota // A result of "none" means either, // (a) no syntactically valid DNS domain name was extracted from the // SMTP session that could be used as the one to be authorized, or // (b) no SPF records were retrieved from the DNS. ResultCodeNone // A "neutral" result means the ADMD has explicitly stated that it is // not asserting whether the IP address is authorized. ResultCodeNeutral // A "fail" result is an explicit statement that the client is not // authorized to use the domain in the given identity. ResultCodeFail // A "softfail" result is a weak statement by the publishing ADMD that // the host is probably not authorized. // It has not published a stronger, more definitive policy that // results in a "fail". ResultCodeSoftfail // A "temperror" result means the SPF verifier encountered a transient // (generally DNS) error while performing the check. // A later retry may // succeed without further DNS operator action. ResultCodeTempError // A "permerror" result means the domain’s published records could not // be correctly interpreted. // This signals an error condition that definitely requires DNS // operator intervention to be resolved. ResultCodePermError )
List of possible result code as described in RFC 7208 section 2.6.
Types ¶
type Result ¶
type Result struct { IP net.IP // The IP address of sender. Err string Domain []byte // The domain address of sender from SMTP EHLO or MAIL FROM command. Sender []byte // The email address of sender. Hostname []byte Code byte // Result of check host. // contains filtered or unexported fields }
Result contains the output of CheckHost function.
func CheckHost ¶
CheckHost fetches SPF records, parses them, and evaluates them to determine whether a particular host is or is not permitted to send mail with a given identity.
func (*Result) Error ¶
Error return the string representation of the result as error message.
Source Files ¶
directive.go macro.go modifier.go result.go spf.go
- Version
- v0.60.0 (latest)
- Published
- Feb 1, 2025
- Platform
- linux/amd64
- Imports
- 11 packages
- Last checked
- 12 minutes ago –
Tools for package owners.