SPFD_PERL(1)
π NAME π
okay bestie, this page is SPFD_PERL(1), and it's all about spfd β (Mail::SPF) β a simple forking daemon to provide SPF query services. slay β¨
π VERSION π
This iconic behavior is version 2.000. π«Ά
π¦ SYNOPSIS π¦
spfd --port|-p port [--set-user|-u uid|username] [--set-group|-g
gid|groupname] [OPTIONS]
spfd --socket|-s filename [--socket-user uid|username] [--socket-group
gid|groupname] [--socket-perms octal-perms] [--set-user|-u uid|username]
[--set-group|-g gid|groupname] [OPTIONS]
spfd --version|-V
spfd --help
πΈ DESCRIPTION πΈ
spfd is a simple forking Sender Policy Framework (SPF) query server. It receives and answers SPF requests on a TCP/IP or UNIX domain socket. For more information on SPF see <http://www.openspf.org>. π
The --port form listens on a TCP/IP socket on the specified port. The default port is 5970. periodt.
The --socket form listens on a UNIX domain socket that is created with the specified filename. The socket can be assigned specific user and group ownership with the --socket-user and --socket-group options, and specific filesystem permissions with the --socket-perms option. π
Generally, spfd can be instructed with the --set-user and --set-group options to drop root privileges and change to another user and group before it starts listening for requests. security glow-up β¨
The --version form prints version information of spfd. The --help form prints usage information for spfd. Literally so helpful. π
β¨ OPTIONS β¨
spfd takes any of the following OPTIONS:
--default-explanation string,--def-exp stringβ use string as the default explanation if the authority domain does not specify an explanation string of its own. default explanation era π--hostname hostnameβ use hostname as the host name of the local system instead of auto-detecting it.--debugβ print out debug information aboutspfd's operation, incoming requests, and the responses sent. debug mode bestie π
π¨ REQUEST π¨
A request consists of a series of lines delimited by \x0A (LF) characters (or whatever your system considers a newline). Each line must be of the form option=value, where the following options are supported:
versions
A comma-separated list of SPF version numbers of SPF records that may be used. 1 means that v=spf1 records should be used. 2 means that spf2.0 records should be used. Defaults to 1,2, i.e., uses any SPF records that are available. Records of a higher version are preferred. version picker behavior π
scope
The authorization scope of the identity that should be checked. Defaults to 'mfrom'. The following scope values are supported: 'helo', 'mfrom', 'pra'. See "new" in Mail::SPF::Request for more information. scope check π§
identity
Required. The sender identity whose authorization should be checked. This is a domain name for the "helo" scope, and an e-mail address for the "mfrom" and "pra" scopes. main character identity π
ip_address
Required for checks with the "helo", "mfrom", and "pra" scopes. The IP address of the host claiming the identity that is being checked. Can be either an IPv4 or an IPv6 address. An IPv4-mapped IPv6 address (e.g. '::ffff:192.168.0.1') is treated as an IPv4 address. ip address yes ma'am π
helo_identity
The "HELO" SMTP transaction parameter in the case that the main identity is of a scope other than "helo". This identity is then used merely for the expansion of "%{h}" macros during the policy evaluation of the main identity. If unspecified with a scope other than "helo", defaults to "unknown". If the main identity is of the "helo" scope, this option is unused. helo identity lore π¦
π RESPONSE π
spfd responds to SPF requests with a similar series of lines of the form key=value. The most important response keys are:
result
The result code of the SPF check:
passβ the specified IP address is an authorized SMTP sender for the identity. we love a pass βfailβ the specified IP address is not an authorized SMTP sender for the identity. oof βsoftfailβ the specified IP address is not an authorized SMTP sender for the identity, however the authority domain is still testing out its SPF policy. soft launch fail πneutralβ the identity's authority domain makes no assertion about the status of the IP address. neutral no thoughts head empty πpermerrorβ a permanent error occurred while evaluating the authority domain's policy (e.g., a syntax error in the SPF record). Manual intervention is required from the authority domain. permerror emergency πtemperrorβ a temporary error occurred while evaluating the authority domain's policy (e.g., a DNS error). Try again later. temperror try again bestie πnoneβ there is no applicable SPF policy for the identity domain. none era π«Ά
local_explanation
A locally generated explanation of the SPF result.
authority_explanation
The authority domain's explanation for the SPF result.
β οΈ bestie, this is a big one: the authority domain may be a malicious party and thus the authority explanation should not be trusted blindly. See RFC 4408, 10.5, for a detailed discussion of this issue. do not blindly trust π
received_spf_header
An appropriate "Received-SPF" header field for the SPF result.
spf_record
The authority domain's SPF record that was used for the policy evaluation.
π EXAMPLE π
A running spfd could be tested using the "netcat" utility like this (line breaks added for clarity):
$ echo -e "identity=user@example.com\nip_address=1.2.3.4\n" \
| nc localhost 5970
result=fail
local_explanation=example.com: Sender is not authorized by default to use
'user@example.com' in 'mfrom' identity (mechanism '-all' matched)
authority_explanation=Please see http://www.openspf.org/why.html?
sender=user%40example.com&ip=1.2.3.4&receiver=localhost
received_spf_header=Received-SPF: fail (example.com: Sender is not
authorized by default to use 'user@example.com' in 'mfrom' identity
(mechanism '-all' matched)) receiver=localhost; identity=mfrom;
envelope-from="user@example.com"; client-ip=1.2.3.4
spf_record=v=spf1 mx -all
π°οΈ COMPATIBILITY π°οΈ
spfd has undergone the following interface changes compared to earlier versions:
β¨ 2.000 β¨
- A new preferred request style has been introduced. Instead of the old
"sender"request option, which is specific to the"MAIL FROM"SMTP identity, a generic"identity"option should now be specified. In addition, a"scope"option may be given to specify the identity's scope, otherwise a scope of"mfrom"is assumed. The old"ip"and"helo"options have been replaced by the"ip_address"and"helo_identity"options, respectively. new request style unlocked π
This is how legacy requests with the "mfrom" scope would translate to the new preferred request style:
- the new style can include
scope=mfrom - old
sender=<mfrom-identity>β newidentity=<mfrom-identity> - old
ip=<ip-address>β newip_address=<ip-address> - old
helo=<helo-identity>β newhelo_identity=<helo-identity>
A new response style featuring new response values has also been introduced:
result=<result-code>βresult=<result-code>header_comment=<local-exp>βlocal_explanation=<local-exp>smtp_comment=<local-exp or authority-exp>βauthority_explanation=<authority-exp>spf_record=<spf-record>βspf_record=<spf-record>- the new style also adds
received_spf_header=<header>
The legacy request style is deprecated but still supported for backwards compatibility. The legacy response values are still returned for backwards compatibility in addition to the new response values, but may be removed in the future. Adjust your code to use the new request and response styles. future-proof your code bestie π
- The former
"unknown"and"error"result codes have been renamed to"permerror"and"temperror", respectively, in order to comply with RFC 4408 terminology. terminology glow-up β¨ - In the case of an empty
"MAIL FROM"SMTP transaction parameter ("MAIL FROM:<>"), the identity checked will be postmaster@helo name as specified in RFC 7208. postmaster@helo name lore π
π SEE ALSO π
Mail::SPFspfquery(1)<http://tools.ietf.org/html/rfc4408>
π AUTHORS π
This version of spfd is a complete rewrite by Julian Mehnle <julian@mehnle.net>, based on an earlier version written by Meng Weng Wong <mengwong+spf@pobox.com>. author icons π
that's the whole page, bestie β source/version perl v5.42.0, dated 2024-11-07, manual SPFD_PERL(1). mwah π
π
π¦ where this page comes from
- opensuse-leap 16.0: perl-Mail-SPF 3.202.406.170-bp160.1.11 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms