.\" 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 "SPFQUERY 1p" .TH SPFQUERY 1p "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" spfquery \- (Mail::SPF) \- Checks if a given set of e\-mail parameters matches a domain's SPF policy .SH "VERSION" .IX Header "VERSION" 2.501 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .IP "\fBPreferred usage:\fR" 4 .IX Item "Preferred usage:" \&\fBspfquery\fR [\fB\-\-versions\fR|\fB\-v\fR \fB1\fR|\fB2\fR|\fB1,2\fR] [\fB\-\-scope\fR|\fB\-s\fR \fBhelo\fR|\fBmfrom\fR|\fBpra\fR] \&\fB\-\-identity\fR|\fB\-\-id\fR \fIidentity\fR \fB\-\-ip\-address\fR|\fB\-\-ip\fR \fIip-address\fR [\fB\-\-helo\-identity\fR|\fB\-\-helo\-id\fR \fIhelo-identity\fR] [\fI\s-1OPTIONS\s0\fR] .Sp \&\fBspfquery\fR [\fB\-\-versions\fR|\fB\-v\fR \fB1\fR|\fB2\fR|\fB1,2\fR] [\fB\-\-scope\fR|\fB\-s\fR \fBhelo\fR|\fBmfrom\fR|\fBpra\fR] \&\fB\-\-file\fR|\fB\-f\fR \fIfilename\fR|\fB\-\fR [\fI\s-1OPTIONS\s0\fR] .IP "\fBLegacy usage:\fR" 4 .IX Item "Legacy usage:" \&\fBspfquery\fR \fB\-\-helo\fR \fIhelo-identity\fR \fB\-\-ip\-address\fR|\fB\-\-ip\fR \fIip-address\fR [\fI\s-1OPTIONS\s0\fR] .Sp \&\fBspfquery\fR \fB\-\-mfrom\fR \fImfrom-identity\fR \fB\-\-ip\-address\fR|\fB\-\-ip\fR \fIip-address\fR [\fB\-\-helo\fR \fIhelo-identity\fR] [\fI\s-1OPTIONS\s0\fR] .Sp \&\fBspfquery\fR \fB\-\-pra\fR \fIpra-identity\fR \fB\-\-ip\-address\fR|\fB\-\-ip\fR \fIip-address\fR [\fI\s-1OPTIONS\s0\fR] .IP "\fBOther usage:\fR" 4 .IX Item "Other usage:" \&\fBspfquery\fR \fB\-\-version\fR|\fB\-V\fR .Sp \&\fBspfquery\fR \fB\-\-help\fR .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\fBspfquery\fR checks if a given set of e\-mail parameters (e.g., the \s-1SMTP\s0 sender's \&\s-1IP\s0 address) matches the responsible domain's Sender Policy Framework (\s-1SPF\s0) policy. For more information on \s-1SPF\s0 see . .SS "Preferred Usage" .IX Subsection "Preferred Usage" The following usage forms are preferred over the legacy forms used by older \fBspfquery\fR versions: .PP The \fB\-\-identity\fR form checks if the given \fIip-address\fR is an authorized \s-1SMTP\s0 sender for the given \f(CW\*(C`helo\*(C'\fR hostname, \f(CW\*(C`mfrom\*(C'\fR envelope sender e\-mail address, or \f(CW\*(C`pra\*(C'\fR (so-called purported resonsible address) e\-mail address, depending on the value of the \fB\-\-scope\fR option (which defaults to \fBmfrom\fR if omitted). .PP The \fB\-\-file\fR form reads "\fIip-address\fR \fIidentity\fR [\fIhelo-identity\fR]" tuples from the file with the specified \fIfilename\fR, or from standard input if \&\fIfilename\fR is \fB\-\fR, and checks them against the specified scope (\fBmfrom\fR by default). .PP Both forms support an optional \fB\-\-versions\fR option, which specifies a comma-separated list of the \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. .SS "Legacy Usage" .IX Subsection "Legacy Usage" \&\fBspfquery\fR versions before 2.500 featured the following usage forms, which are discouraged but still supported for backwards compatibility: .PP The \fB\-\-helo\fR form checks if the given \fIip-address\fR is an authorized \s-1SMTP\s0 sender for the \f(CW\*(C`HELO\*(C'\fR hostname given as the \fIidentity\fR (so-called \f(CW\*(C`HELO\*(C'\fR check). .PP The \fB\-\-mfrom\fR form checks if the given \fIip-address\fR is an authorized \s-1SMTP\s0 sender for the envelope sender email-address (or domain) given as the \&\fIidentity\fR (so-called \f(CW\*(C`MAIL FROM\*(C'\fR check). If a domain is given instead of an e\-mail address, \f(CW\*(C`postmaster\*(C'\fR will be substituted for the localpart. .PP The \fB\-\-pra\fR form checks if the given \fIip-address\fR is an authorized \s-1SMTP\s0 sender for the \s-1PRA\s0 (Purported Responsible Address) e\-mail address given as the identity. .SS "Other Usage" .IX Subsection "Other Usage" The \fB\-\-version\fR form prints version information of spfquery. The \fB\-\-help\fR form prints usage information for spfquery. .SH "OPTIONS" .IX Header "OPTIONS" .SS "Standard Options" .IX Subsection "Standard Options" The preferred and legacy forms optionally take 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\-\-keep\-comments\fR" 4 .IX Item "--keep-comments" .PD 0 .IP "\fB\-\-no\-keep\-comments\fR" 4 .IX Item "--no-keep-comments" .PD Do (not) print any comments found when reading from a file or from standard input. .IP "\fB\-\-sanitize\fR (currently ignored)" 4 .IX Item "--sanitize (currently ignored)" .PD 0 .IP "\fB\-\-no\-sanitize\fR (currently ignored)" 4 .IX Item "--no-sanitize (currently ignored)" .PD Do (not) sanitize the output by condensing consecutive white-space into a single space and replacing non-printable characters with question marks. Enabled by default. .IP "\fB\-\-debug\fR (currently ignored)" 4 .IX Item "--debug (currently ignored)" Print out debug information. .SS "Black Magic Options" .IX Subsection "Black Magic Options" Several options that were supported by earlier versions of \fBspfquery\fR are considered black magic (i.e. potentially dangerous for the innocent user) and are thus disabled by default. If the \fBMail::SPF::BlackMagic\fR Perl module is installed, they may be enabled by specifying \fB\-\-enable\-black\-magic\fR. .IP "\fB\-\-max\-dns\-interactive\-terms\fR \fIn\fR" 4 .IX Item "--max-dns-interactive-terms n" Evaluate a maximum of \fIn\fR DNS-interactive mechanisms and modifiers per \s-1SPF\s0 check. Defaults to \fB10\fR. Do \fInot\fR override the default unless you know what you are doing! .IP "\fB\-\-max\-name\-lookups\-per\-term\fR \fIn\fR" 4 .IX Item "--max-name-lookups-per-term n" Perform a maximum of \fIn\fR \s-1DNS\s0 name look-ups per mechanism or modifier. Defaults to \fB10\fR. Do \fInot\fR override the default unless you know what you are doing! .IP "\fB\-\-authorize\-mxes\-for\fR \fIemail-address\fR|\fIdomain\fR\fB,\fR..." 4 .IX Item "--authorize-mxes-for email-address|domain,..." Consider all the MXes of the comma-separated list of \fIemail-address\fRes and \&\fIdomain\fRs as inherently authorized. .IP "\fB\-\-tfwl\fR" 4 .IX Item "--tfwl" Perform \f(CW\*(C`trusted\-forwarder.org\*(C'\fR accreditation checking. .IP "\fB\-\-guess\fR \fIspf-terms\fR" 4 .IX Item "--guess spf-terms" Use \fIspf-terms\fR as a default record if no \s-1SPF\s0 record is found. .IP "\fB\-\-local\fR \fIspf-terms\fR" 4 .IX Item "--local spf-terms" Process \fIspf-terms\fR as local policy before resorting to a default result (the implicit or explicit \f(CW\*(C`all\*(C'\fR mechanism at the end of the domain's \s-1SPF\s0 record). For example, this could be used for white-listing one's secondary MXes: \f(CW\*(C`mx:mydomain.example.org\*(C'\fR. .IP "\fB\-\-override\fR \fIdomain\fR\fB=\fR\fIspf-record\fR" 4 .IX Item "--override domain=spf-record" .PD 0 .IP "\fB\-\-fallback\fR \fIdomain\fR\fB=\fR\fIspf-record\fR" 4 .IX Item "--fallback domain=spf-record" .PD Set overrides and fallbacks. Each option can be specified multiple times. For example: .Sp .Vb 3 \& \-\-override example.org=\*(Aqv=spf1 \-all\*(Aq \& \-\-override \*(Aq*.example.net\*(Aq=\*(Aqv=spf1 a mx \-all\*(Aq \& \-\-fallback example.com=\*(Aqv=spf1 \-all\*(Aq .Ve .SH "RESULT CODES" .IX Header "RESULT CODES" .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. .SH "EXIT CODES" .IX Header "EXIT CODES" .Vb 9 \& Result | Exit code \& \-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\- \& pass | 0 \& fail | 1 \& softfail | 2 \& neutral | 3 \& permerror | 4 \& temperror | 5 \& none | 6 .Ve .SH "EXAMPLES" .IX Header "EXAMPLES" .Vb 3 \& spfquery \-\-scope mfrom \-\-id user@example.com \-\-ip 1.2.3.4 \& spfquery \-\-file test_data \& echo "127.0.0.1 user@example.com helohost.example.com" | spfquery \-f \- .Ve .SH "COMPATIBILITY" .IX Header "COMPATIBILITY" \&\fBspfquery\fR has undergone the following interface changes compared to earlier versions: .IP "\fB2.500\fR" 4 .IX Item "2.500" .RS 4 .PD 0 .IP "\(bu" 4 .PD A new preferred usage style for performing individual \s-1SPF\s0 checks has been introduced. The new style accepts a unified \fB\-\-identity\fR option and an optional \fB\-\-scope\fR option that specifies the type (scope) of the identity. In contrast, the legacy usage style requires a separate usage form for every supported scope. See \*(L"Preferred usage\*(R" and \*(L"Legacy usage\*(R" for details. .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. .IP "\(bu" 4 The \fB\-\-debug\fR and \fB\-\-(no\-)sanitize\fR options are currently ignored by this version of \fBspfquery\fR. They will again be supported in the future. .IP "\(bu" 4 Several features that were supported by earlier versions of \fBspfquery\fR are considered black magic and thus are now disabled by default. See \*(L"Black Magic Options\*(R". .IP "\(bu" 4 Several option names have been deprecated. This is a list of them and their preferred synonyms: .Sp .Vb 9 \& Deprecated options | Preferred options \& \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \& \-\-sender, \-s | \-\-mfrom \& \-\-ipv4, \-i | \-\-ip\-address, \-\-ip \& \-\-name | \-\-hostname \& \-\-max\-lookup\-count, | \-\-max\-dns\-interactive\-terms \& \-\-max\-lookup | \& \-\-rcpt\-to, \-r | \-\-authorize\-mxes\-for \& \-\-trusted | \-\-tfwl .Ve .RE .RS 4 .RE .SH "SEE ALSO" .IX Header "SEE ALSO" Mail::SPF, \fBspfd\fR\|(8) .PP .SH "AUTHORS" .IX Header "AUTHORS" This version of \fBspfquery\fR is a complete rewrite by Julian Mehnle , based on an earlier version written by Meng Weng Wong and Wayne Schlitt .