GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  SPFQUERY.PL (1)

.ds Aq ’

NAME

spfquery - (Mail::SPF) - Checks if a given set of e-mail parameters matches a domain’s SPF policy

CONTENTS

VERSION

2.501

SYNOPSIS

<B>Preferred usage:B> <B>spfqueryB> [<B>--versionsB>|<B>-vB> <B>1B>|<B>2B>|<B>1,2B>] [<B>--scopeB>|<B>-sB> <B>heloB>|<B>mfromB>|<B>praB>] <B>--identityB>|<B>--idB> identity <B>--ip-addressB>|<B>--ipB> ip-address [<B>--helo-identityB>|<B>--helo-idB> helo-identity] [OPTIONS]

<B>spfqueryB> [<B>--versionsB>|<B>-vB> <B>1B>|<B>2B>|<B>1,2B>] [<B>--scopeB>|<B>-sB> <B>heloB>|<B>mfromB>|<B>praB>] <B>--fileB>|<B>-fB> filename|<B>-B> [OPTIONS]

<B>Legacy usage:B> <B>spfqueryB> <B>--heloB> helo-identity <B>--ip-addressB>|<B>--ipB> ip-address [OPTIONS]

<B>spfqueryB> <B>--mfromB> mfrom-identity <B>--ip-addressB>|<B>--ipB> ip-address [<B>--heloB> helo-identity] [OPTIONS]

<B>spfqueryB> <B>--praB> pra-identity <B>--ip-addressB>|<B>--ipB> ip-address [OPTIONS]

<B>Other usage:B> <B>spfqueryB> <B>--versionB>|<B>-VB>

<B>spfqueryB> <B>--helpB>

DESCRIPTION

<B>spfqueryB> checks if a given set of e-mail parameters (e.g., the SMTP sender’s IP address) matches the responsible domain’s Sender Policy Framework (SPF) policy. For more information on SPF see <http://www.openspf.org>.

    Preferred Usage

The following usage forms are preferred over the legacy forms used by older <B>spfqueryB> versions:

The <B>--identityB> form checks if the given ip-address is an authorized SMTP sender for the given helo hostname, mfrom envelope sender e-mail address, or pra (so-called purported resonsible address) e-mail address, depending on the value of the <B>--scopeB> option (which defaults to <B>mfromB> if omitted).

The <B>--fileB> form reads "ip-address identity [helo-identity]" tuples from the file with the specified filename, or from standard input if filename is <B>-B>, and checks them against the specified scope (<B>mfromB> by default).

Both forms support an optional <B>--versionsB> option, which specifies a comma-separated list of the SPF version numbers of SPF records that may be used. <B>1B> means that v=spf1 records should be used. <B>2B> means that spf2.0 records should be used. Defaults to <B>1,2B>, i.e., uses any SPF records that are available. Records of a higher version are preferred.

    Legacy Usage

<B>spfqueryB> versions before 2.500 featured the following usage forms, which are discouraged but still supported for backwards compatibility:

The <B>--heloB> form checks if the given ip-address is an authorized SMTP sender for the HELO hostname given as the identity (so-called HELO check).

The <B>--mfromB> form checks if the given ip-address is an authorized SMTP sender for the envelope sender email-address (or domain) given as the identity (so-called MAIL FROM check). If a domain is given instead of an e-mail address, postmaster will be substituted for the localpart.

The <B>--praB> form checks if the given ip-address is an authorized SMTP sender for the PRA (Purported Responsible Address) e-mail address given as the identity.

    Other Usage

The <B>--versionB> form prints version information of spfquery. The <B>--helpB> form prints usage information for spfquery.

OPTIONS

    Standard Options

The preferred and legacy forms optionally take any of the following OPTIONS:
<B>--default-explanationB> string
<B>--def-expB> string Use the specified string as the default explanation if the authority domain does not specify an explanation string of its own.
<B>--hostnameB> hostname Use hostname as the host name of the local system instead of auto-detecting it.
<B>--keep-commentsB>
<B>--no-keep-commentsB> Do (not) print any comments found when reading from a file or from standard input.
<B>--sanitizeB> (currently ignored)
<B>--no-sanitizeB> (currently ignored) 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.
<B>--debugB> (currently ignored) Print out debug information.

    Black Magic Options

Several options that were supported by earlier versions of <B>spfqueryB> are considered black magic (i.e. potentially dangerous for the innocent user) and are thus disabled by default. If the <B>Mail::SPF::BlackMagicB> Perl module is installed, they may be enabled by specifying <B>--enable-black-magicB>.
<B>--max-dns-interactive-termsB> n Evaluate a maximum of n DNS-interactive mechanisms and modifiers per SPF check. Defaults to <B>10B>. Do not override the default unless you know what you are doing!
<B>--max-name-lookups-per-termB> n Perform a maximum of n DNS name look-ups per mechanism or modifier. Defaults to <B>10B>. Do not override the default unless you know what you are doing!
<B>--authorize-mxes-forB> email-address|domain<B>,B>... Consider all the MXes of the comma-separated list of email-addresses and domains as inherently authorized.
<B>--tfwlB> Perform trusted-forwarder.org accreditation checking.
<B>--guessB> spf-terms Use spf-terms as a default record if no SPF record is found.
<B>--localB> spf-terms Process spf-terms as local policy before resorting to a default result (the implicit or explicit all mechanism at the end of the domain’s SPF record). For example, this could be used for white-listing one’s secondary MXes: mx:mydomain.example.org.
<B>--overrideB> domain<B>=B>spf-record
<B>--fallbackB> domain<B>=B>spf-record Set overrides and fallbacks. Each option can be specified multiple times. For example:



    --override example.org=v=spf1 -all
    --override *.example.net=v=spf1 a mx -all
    --fallback example.com=v=spf1 -all



RESULT CODES

<B>passB> The specified IP address is an authorized SMTP sender for the identity.
<B>failB> The specified IP address is not an authorized SMTP sender for the identity.
<B>softfailB> The specified IP address is not an authorized SMTP sender for the identity, however the authority domain is still testing out its SPF policy.
<B>neutralB> The identity’s authority domain makes no assertion about the status of the IP address.
<B>permerrorB> 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.
<B>temperrorB> A temporary error occurred while evaluating the authority domain’s policy (e.g., a DNS error). Try again later.
<B>noneB> There is no applicable SPF policy for the identity domain.

EXIT CODES



  Result    | Exit code
 -----------+-----------
  pass      |     0
  fail      |     1
  softfail  |     2
  neutral   |     3
  permerror |     4
  temperror |     5
  none      |     6



EXAMPLES



    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 -



COMPATIBILITY

<B>spfqueryB> has undergone the following interface changes compared to earlier versions:
<B>2.500B>
o A new preferred usage style for performing individual SPF checks has been introduced. The new style accepts a unified <B>--identityB> option and an optional <B>--scopeB> 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 Preferred usage and Legacy usage for details.
o The former unknown and error result codes have been renamed to permerror and temperror, respectively, in order to comply with RFC 4408 terminology.
o SPF checks with an empty identity are no longer supported. In the case of an empty MAIL FROM SMTP transaction parameter, perform a check with the helo scope directly.
o The <B>--debugB> and <B>--(no-)sanitizeB> options are currently ignored by this version of <B>spfqueryB>. They will again be supported in the future.
o Several features that were supported by earlier versions of <B>spfqueryB> are considered black magic and thus are now disabled by default. See Black Magic Options.
o Several option names have been deprecated. This is a list of them and their preferred synonyms:



  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



SEE ALSO

Mail::SPF, spfd(8)

<http://tools.ietf.org/html/rfc4408>

AUTHORS

This version of <B>spfqueryB> is a complete rewrite by Julian Mehnle <julian@mehnle.net>, based on an earlier version written by Meng Weng Wong <mengwong+spf@pobox.com> and Wayne Schlitt <wayne@schlitt.net>.
Search for    or go to Top of page |  Section 1 |  Main Index


perl v5.20.3 SPFQUERY (1) 2016-04-03

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.