Rev 23 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
.\" Title: SPFQUERY.\" Author: Magnus Holmgren <holmgren@debian.org>.\" Date: 2007-09-06.\" Manual: libspf2 manuals for Debian.\" Source: libspf2 1.2.5.\".TH "SPFQUERY" "1" "2007-09-06" "libspf2 1.2.5" "libspf2 manuals for Debian".\" disable hyphenation.nh.SH NAMEspfquery, spfquery.libspf2 \- checks if an IP address is an SPF-authorized SMTP sender for a domain..SH SYNOPSIS.ad l.HP 9.B spfquery.RB { \-i | \-\-ip }.I ip\-address.RB { -s | \-\-sender }.RI [ local-part \fB@\fP] domain.RB [{ \-h | \-\-helo }.IR domain-name ].RB [ \-\-rcpt\-to.IR email-address(es) ].RI [ CONTROL-OPTIONS ].HP 9.B spfquery.RB { \-f | \-\-file }.IR datafile " [" CONTROL-OPTIONS ].HP 9.B spfquery.RB { \-\-help | \-v | \-\-version }.ad b.SH DESCRIPTIONThis manual page documents briefly the\fBspfquery\fRcommand. It was written for theDebian\*[R] distribution because the original program does not have a manual page..PP\fBspfquery\fR performs Sender Policy Framework (SPF) authorizationchecks based on the command-line arguments or data given in a file oron standard input. For information on SPF see http://www.openspf.org...SH OPTIONSOptions are divided into two groups: Data options, which must begiven, though just enough of them to specify a query; and controloptions, which are optional and control the local policy, behaviourand output format of spfquery..PPThis programs follows the GNU \fBgetopt_long_only\fR(3) command linesyntax: Long options can be given with one or two dashes and can beabbreviated to a prefix long enough to be non-ambiguous. If an optionstarting with a single dash doesn't match a long option, it is takenas a short option with a following parameter, if applicable. An equalssign between the option name and the parameter is optional for bothshort and long options..SS Data optionsThe\fB\-\-file\fR option conflicts with all the other data options. The\fB\-\-helo\fR and \fB\-\-rcpt\-to\fR are optional..TP\fB\-f\fR, \fB\-\-file\fR \fIfilename\fRRead SPF data from \fIfilename\fR. Specify \(lq-\(rq to read from standard input..spThe file should consist of one line per query, each query line consisting of the IP address, sender adress, and optional HELO string, separated by spaces..sp\fBNote\fPLocal parts containing spaces are currently not supported..TP\fB\-i\fP, \fB\-\-ip\fP \fIip-address\fPSpecify the IP address of the remote host that is delivering the mail..TP\fB\-s\fP, \fB\-\-sender\fP [\fIlocal-part\fP\fB@\fP]\fIdomain\fPSpecify the email address that was used as the envelope sender. If nousername (local part) is given, \(lqpostmaster\(rq will be assumed..TP\fB\-h\fP, \fB\-\-helo\fP \fIdomain-name\fPSpecify that \fIdomain-name\fP was provided in the SMTP HELO (or EHLO) command..TP\fB\-r\fP, \fB\-\-rcpt-to\fP \fIrcpt-address\fP[,\fIrcpt-address\fP,...]Specify the recipients as comma-separated list. Any secondary mail exchangers of allrecipient domains are automatically authorized...SS Control options.TP\fB\-d\fP, \fB\-\-debug\fP[\fB=\fP\fIlevel\fP]Turn on debugging output..TP\fB\-l\fP, \fB\-\-local\fP \fIspf\-terms\fPTest against \fIspf\-terms\fR before the final (implicit or explicit)\(lqall\(rq in an SPF record. This can be used to implement a local policy for whitelisting..TP\fB\-t, \fB\-\-trusted\fR [\fB1\fR]Check the sender domain with trusted\-forwarder.org.\fBThis is a non\-standard feature.\fR.TP\fB\-t\fP \fB0\fP, \fB\-\-trusted\fR \fB0\fPDo not check the sender domain with trusted\-forwarder.org. This is the default..TP\fB\-g\fP, \fB\-\-guess\fP \fIspf-mechanisms\fPTest the sender domain against \fIspf\-mechanisms\fP if the domain has no SPF record..TP\fB\-e\fP, \fB\-\-default\-explanation\fP \fIstring\fPDefault explanation string to use if the SPF record does not specify an expla\%nation string itself..TP\fB\-m\fP, \fB\-\-max\-lookup\fP \fInumber\fPMaximum number of DNS lookups to allow..TP\fB\-c\fP, \fB\-\-sanitize\fP [\fB0\fP|\fB1\fP]Do [not] sanitize the output by condensing conse\%cutive white\%spaceinto a single space and replacing non-printable characters withquestion marks. Enabled by default..TP\fB\-n\fP, \fB\-\-name\fP \fIhostname\fPUse\fIhostname\fPas the name of the local system instead of\(lqspfquery\(rq(the name is used in the output)..TP\fB\-k\fP, \fB\-\-keep\-comments\fPPrint comments found when reading from a file..TP\fB\-a\fP, \fB\-\-override\fP \fI...\fP.TP\fB\-z\fP, \fB\-\-fallback\fP \fI...\fPProvide override and fallback SPF records for certain domains.\fBNot implemented yet.\fP\fBspfquery\fPwould act as if the speci\%fied records were present before and after any existing record, respectively, of those domains..TP\fB\-\-help\fPShow summary of options..TP\fB\-v\fP, \fB\-\-version\fPShow version of program..SH DIAGNOSTICSThe output ordinarily consists of four lines:.IP 1. 4the \fIresult code\fP;.IP 2. 4the \fIexplanation\fP, suitable for use in an SMTP response message, emptyexcept when a rejection (permanent or temporary) makes sense;.IP 3. 4the header comment on its own;.IP 4. 4the Received\-SPF header field as defined in RFC 4408 section 7,incorporating the header comment..PPIf errors (including no SPF record found!) occur during processing,one or more error blocks will be prepended.These start with \(lqStartError\(lq and end with \(lqEndError\(lq..PPThe result codes and their corresponding exit codes are as follows:.TP.B 1 \(en neutralThe sender domain explicitly makes no assertion about the \fIip-address\fP.This result must be interpreted exactly as if no SPF record at all existed..TP.B 2 \(en passThe \fIip-address\fP is authorized to send mail for the sender domain..TP.B 3 \(en failThe \fIip-address\fP is \fBunauthorized\fP to send mail for the sender domain..TP.B 4 \(en softfailThe \fIip-address\fP is not authorized to send mail for the sender domain, butthe sender domain cannot or does not wish to make a strong assertion that no such mail canever come from it..TP.B 5 \(en noneNo SPF record was found..TP.BR "6 \(en error" " (temporary)"A transient error occurred (e.g. failure to reach a DNS server), preventing aresult from being reached..TP.BR "7 \(en unknown" " (permanent error)"One or more SPF records could not be interpreted..SH EXAMPLES.nfspfquery \-ip=11.22.33.44 \-sender=user@aol.com \-helo=spammer.tldspfquery \-f test_dataecho "127.0.0.1 myname@mydomain.com helohost.com" | spfquery \-f \-.fi.SH SEE ALSO\fBspftest\fR(1), \fBspfd\fR(8).SH AUTHOR\fBspfquery\fP was written by Wayne Schlitt..PPThis manual page was written by Magnus Holmgren for the Debian\*[R]system (but may be used by others). Heavily inspired by the spfquery manpage oflibmail\-spf\-query\-perl (\fBspfquery.mail\-spf\-query\-perl\fR(1)) by Julian Mehnle.Also based on the command\-line help of spfquery..SH COPYRIGHTCopyright \(co 2007 Magnus Holmgren. Permission is granted to copy,distribute and/or modify this document under the terms of the two-clause BSDLicense. See /usr/share/doc/spfquery/copyright.