SPFD(8p) | User Contributed Perl Documentation | SPFD(8p) |
spfd - (Mail::SPF) - Simple forking daemon to provide SPF query services
2.000
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
spfd is a simple forking Sender Policy Framework (SPF) query server. spfd receives and answers SPF requests on a TCP/IP or UNIX domain socket. For more information on SPF see <https://tools.ietf.org/html/rfc7208>.
The --port form listens on a TCP/IP socket on the specified port. The default port is 5970.
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.
The --version form prints version information of spfd. The --help form prints usage information for spfd.
spfd takes any of the following OPTIONS:
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:
spfd responds to SPF requests with similar series of lines of the form key=value. The most important response keys are:
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=Rejected by SPF record 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
spfd has undergone the following interface changes compared to earlier versions:
This is how legacy requests with the "mfrom" scope would translate to the new preferred request style:
Legacy request style | New request style ----------------------------+--------------------------------------- | scope=mfrom sender=<mfrom-identity> | identity=<mfrom-identity> ip=<ip-address> | ip_address=<ip-address> helo=<helo-identity> | helo_identity=<helo-identity>
A new response style featuring new response values has also been introduced:
Legacy response style | New response style ----------------------------+--------------------------------------- result=<result-code> | result=<result-code> header_comment=<local-exp> | local_explanation=<local-exp> smtp_comment=<local-exp | authority_explanation=<authority-exp> or authority-exp> | spf_record=<spf-record> | spf_record=<spf-record> | 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.
Mail::SPF, spfquery(1)
<http://tools.ietf.org/html/rfc4408>
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>.
2021-01-02 | perl v5.32.0 |