.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "SPFD 8p" .TH SPFD 8p "2021-01-02" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" spfd \- (Mail::SPF) \- Simple forking daemon to provide SPF query services .SH "VERSION" .IX Header "VERSION" 2.000 .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&\fBspfd\fR \fB\-\-port\fR|\fB\-p\fR \fIport\fR [\fB\-\-set\-user\fR|\fB\-u\fR \fIuid\fR|\fIusername\fR] [\fB\-\-set\-group\fR|\fB\-g\fR \fIgid\fR|\fIgroupname\fR] [\fI\s-1OPTIONS\s0\fR] .PP \&\fBspfd\fR \fB\-\-socket\fR|\fB\-s\fR \fIfilename\fR [\fB\-\-socket\-user\fR \fIuid\fR|\fIusername\fR] [\fB\-\-socket\-group\fR \fIgid\fR|\fIgroupname\fR] [\fB\-\-socket\-perms\fR \fIoctal-perms\fR] [\fB\-\-set\-user\fR|\fB\-u\fR \fIuid\fR|\fIusername\fR] [\fB\-\-set\-group\fR|\fB\-g\fR \fIgid\fR|\fIgroupname\fR] [\fI\s-1OPTIONS\s0\fR] .PP \&\fBspfd\fR \fB\-\-version|\-V\fR .PP \&\fBspfd\fR \fB\-\-help\fR .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\fBspfd\fR is a simple forking Sender Policy Framework (\s-1SPF\s0) query server. spfd receives and answers \s-1SPF\s0 requests on a \s-1TCP/IP\s0 or \s-1UNIX\s0 domain socket. For more information on \s-1SPF\s0 see . .PP The \fB\-\-port\fR form listens on a \s-1TCP/IP\s0 socket on the specified \fIport\fR. The default port is \fB5970\fR. .PP The \fB\-\-socket\fR form listens on a \s-1UNIX\s0 domain socket that is created with the specified \fIfilename\fR. The socket can be assigned specific user and group ownership with the \fB\-\-socket\-user\fR and \fB\-\-socket\-group\fR options, and specific filesystem permissions with the \fB\-\-socket\-perms\fR option. .PP Generally, spfd can be instructed with the \fB\-\-set\-user\fR and \fB\-\-set\-group\fR options to drop root privileges and change to another user and group before it starts listening for requests. .PP The \fB\-\-version\fR form prints version information of spfd. The \fB\-\-help\fR form prints usage information for spfd. .SH "OPTIONS" .IX Header "OPTIONS" spfd takes any of the following \fI\s-1OPTIONS\s0\fR: .IP "\fB\-\-default\-explanation\fR \fIstring\fR" 4 .IX Item "--default-explanation string" .PD 0 .IP "\fB\-\-def\-exp\fR \fIstring\fR" 4 .IX Item "--def-exp string" .PD Use the specified \fIstring\fR as the default explanation if the authority domain does not specify an explanation string of its own. .IP "\fB\-\-hostname\fR \fIhostname\fR" 4 .IX Item "--hostname hostname" Use \fIhostname\fR as the host name of the local system instead of auto-detecting it. .IP "\fB\-\-debug\fR" 4 .IX Item "--debug" Print out debug information about spfd's operation, incoming requests, and the responses sent. .SH "REQUEST" .IX Header "REQUEST" A request consists of a series of lines delimited by \ex0A (\s-1LF\s0) characters (or whatever your system considers a newline). Each line must be of the form \&\fIoption\fR\fB=\fR\fIvalue\fR, where the following options are supported: .IP "\fBversions\fR" 4 .IX Item "versions" A comma-separated list of \s-1SPF\s0 version numbers of \s-1SPF\s0 records that may be used. \&\fB1\fR means that \f(CW\*(C`v=spf1\*(C'\fR records should be used. \fB2\fR means that \f(CW\*(C`spf2.0\*(C'\fR records should be used. Defaults to \fB1,2\fR, i.e., uses any \s-1SPF\s0 records that are available. Records of a higher version are preferred. .IP "\fBscope\fR" 4 .IX Item "scope" The authorization scope of the identity that should be checked. Defaults to \&\fB'mfrom'\fR. The following scope values are supported: \fB'helo'\fR, \fB'mfrom'\fR, \&\fB'pra'\fR. See \*(L"new\*(R" in Mail::SPF::Request for more information. .IP "\fBidentity\fR" 4 .IX Item "identity" \&\fIRequired\fR. The sender identity whose authorization should be checked. This is a domain name for the \f(CW\*(C`helo\*(C'\fR scope, and an e\-mail address for the \f(CW\*(C`mfrom\*(C'\fR and \f(CW\*(C`pra\*(C'\fR scopes. .IP "\fBip_address\fR" 4 .IX Item "ip_address" \&\fIRequired\fR for checks with the \f(CW\*(C`helo\*(C'\fR, \f(CW\*(C`mfrom\*(C'\fR, and \f(CW\*(C`pra\*(C'\fR scopes. The \s-1IP\s0 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 "\fBhelo_identity\fR" 4 .IX Item "helo_identity" The \f(CW\*(C`HELO\*(C'\fR \s-1SMTP\s0 transaction parameter in the case that the main identity is of a scope other than \f(CW\*(C`helo\*(C'\fR. This identity is then used merely for the expansion of \f(CW\*(C`%{h}\*(C'\fR macros during the policy evaluation of the main identity. If unspecified with a scope other than \f(CW\*(C`helo\*(C'\fR, defaults to \fB\*(L"unknown\*(R"\fR. If the main identity is of the \f(CW\*(C`helo\*(C'\fR scope, this option is unused. .SH "RESPONSE" .IX Header "RESPONSE" spfd responds to \s-1SPF\s0 requests with similar series of lines of the form \&\fIkey\fR\fB=\fR\fIvalue\fR. The most important response keys are: .IP "\fBresult\fR" 4 .IX Item "result" The result code of the \s-1SPF\s0 check: .RS 4 .IP "\fBpass\fR" 12 .IX Item "pass" The specified \s-1IP\s0 address is an authorized \s-1SMTP\s0 sender for the identity. .IP "\fBfail\fR" 12 .IX Item "fail" The specified \s-1IP\s0 address is not an authorized \s-1SMTP\s0 sender for the identity. .IP "\fBsoftfail\fR" 12 .IX Item "softfail" The specified \s-1IP\s0 address is not an authorized \s-1SMTP\s0 sender for the identity, however the authority domain is still testing out its \s-1SPF\s0 policy. .IP "\fBneutral\fR" 12 .IX Item "neutral" The identity's authority domain makes no assertion about the status of the \s-1IP\s0 address. .IP "\fBpermerror\fR" 12 .IX Item "permerror" A permanent error occurred while evaluating the authority domain's policy (e.g., a syntax error in the \s-1SPF\s0 record). Manual intervention is required from the authority domain. .IP "\fBtemperror\fR" 12 .IX Item "temperror" A temporary error occurred while evaluating the authority domain's policy (e.g., a \s-1DNS\s0 error). Try again later. .IP "\fBnone\fR" 12 .IX Item "none" There is no applicable \s-1SPF\s0 policy for the identity domain. .RE .RS 4 .RE .IP "\fBlocal_explanation\fR" 4 .IX Item "local_explanation" A locally generated explanation of the \s-1SPF\s0 result. .IP "\fBauthority_explanation\fR" 4 .IX Item "authority_explanation" The authority domain's explanation for the \s-1SPF\s0 result. Be aware that the authority domain may be a malicious party and thus the authority explanation should not be trusted blindly. See \s-1RFC 4408, 10.5,\s0 for a detailed discussion of this issue. .IP "\fBreceived_spf_header\fR" 4 .IX Item "received_spf_header" An appropriate \f(CW\*(C`Received\-SPF\*(C'\fR header field for the \s-1SPF\s0 result. .IP "\fBspf_record\fR" 4 .IX Item "spf_record" The authority domain's \s-1SPF\s0 record that was used for the policy evaluation. .SH "EXAMPLE" .IX Header "EXAMPLE" A running spfd could be tested using the \f(CW\*(C`netcat\*(C'\fR utility like this (line breaks added for clarity): .PP .Vb 11 \& $ echo \-e "identity=user@example.com\enip_address=1.2.3.4\en" \e \& | nc localhost 5970 \& result=fail \& local_explanation=example.com: Sender is not authorized by default to use \& \*(Aquser@example.com\*(Aq in \*(Aqmfrom\*(Aq identity (mechanism \*(Aq\-all\*(Aq matched) \& authority_explanation=Rejected by SPF record \& received_spf_header=Received\-SPF: fail (example.com: Sender is not \& authorized by default to use \*(Aquser@example.com\*(Aq in \*(Aqmfrom\*(Aq identity \& (mechanism \*(Aq\-all\*(Aq matched)) receiver=localhost; identity=mfrom; \& envelope\-from="user@example.com"; client\-ip=1.2.3.4 \& spf_record=v=spf1 mx \-all .Ve .SH "COMPATIBILITY" .IX Header "COMPATIBILITY" \&\fBspfd\fR has undergone the following interface changes compared to earlier versions: .IP "\fB2.000\fR" 4 .IX Item "2.000" .RS 4 .PD 0 .IP "\(bu" 4 .PD A new preferred \fIrequest\fR style has been introduced. Instead of the old \&\f(CW\*(C`sender\*(C'\fR request option, which is specific to the \f(CW\*(C`MAIL FROM\*(C'\fR \s-1SMTP\s0 identity, a generic \f(CW\*(C`identity\*(C'\fR option should now be specified. In addition, a \f(CW\*(C`scope\*(C'\fR option may be given to specify the identity's scope, otherwise a scope of \&\f(CW\*(C`mfrom\*(C'\fR is assumed. The old \f(CW\*(C`ip\*(C'\fR and \f(CW\*(C`helo\*(C'\fR options have been replaced by the \f(CW\*(C`ip_address\*(C'\fR and \f(CW\*(C`helo_identity\*(C'\fR options, respectively. .Sp This is how legacy requests with the \f(CW\*(C`mfrom\*(C'\fR scope would translate to the new preferred request style: .Sp .Vb 6 \& Legacy request style | New request style \& \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \& | scope=mfrom \& sender= | identity= \& ip= | ip_address= \& helo= | helo_identity= .Ve .Sp A new \fIresponse\fR style featuring new response values has also been introduced: .Sp .Vb 8 \& Legacy response style | New response style \& \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \& result= | result= \& header_comment= | local_explanation= \& smtp_comment= \& or authority\-exp> | \& spf_record= | spf_record= \& | received_spf_header=
.Ve .Sp 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. .IP "\(bu" 4 The former \f(CW\*(C`unknown\*(C'\fR and \f(CW\*(C`error\*(C'\fR result codes have been renamed to \f(CW\*(C`permerror\*(C'\fR and \f(CW\*(C`temperror\*(C'\fR, respectively, in order to comply with \s-1RFC 4408\s0 terminology. .IP "\(bu" 4 \&\s-1SPF\s0 checks with an empty identity are no longer supported. In the case of an empty \f(CW\*(C`MAIL FROM\*(C'\fR \s-1SMTP\s0 transaction parameter, perform a check with the \f(CW\*(C`helo\*(C'\fR scope directly. .RE .RS 4 .RE .SH "SEE ALSO" .IX Header "SEE ALSO" Mail::SPF, \fBspfquery\fR\|(1) .PP .SH "AUTHORS" .IX Header "AUTHORS" This version of \fBspfd\fR is a complete rewrite by Julian Mehnle , based on an earlier version written by Meng Weng Wong .