SPFQUERY(1)

๐Ÿ“ฆ
version 3.202.406.170 ยท 2 versions
, in opensuse-leap 16.0

๐Ÿฆ‹ SPFQUERY(1) ๐Ÿฆ‹

okay so this is the SPFQUERY(1) manual page for spfquery, straight out of the User Contributed Perl Documentation, and itโ€™s here to spill the tea on SPF checks. bestie, itโ€™s giving โ€œsmall tool, big DNS energyโ€ ๐Ÿ’….

๐Ÿ’– NAME ๐Ÿ’–

spfquery โ€” (Mail::SPF) โ€” checks if a given set of e-mail parameters matches a domainโ€™s SPF policy.

๐ŸŒธ VERSION ๐ŸŒธ

2.501 โ€” yes, thatโ€™s the version, no cap.

โœจ SYNOPSIS โœจ

๐ŸŒŸ Preferred usage ๐ŸŒŸ

spfquery [--versions|-v 1|2|1,2] [--scope|-s helo|mfrom|pra]
--identity|--id identity --ip-address|--ip ip-address
[--helo-identity|--helo-id helo-identity] [OPTIONS]

spfquery [--versions|-v 1|2|1,2] [--scope|-s helo|mfrom|pra]
--file|-f filename|- [OPTIONS]

๐Ÿ’€ Legacy usage ๐Ÿ’€

spfquery --helo helo-identity --ip-address|--ip ip-address [OPTIONS]

spfquery --mfrom mfrom-identity --ip-address|--ip ip-address [--helo
helo-identity] [OPTIONS]

spfquery --pra pra-identity --ip-address|--ip ip-address [OPTIONS]

๐Ÿฆ‹ Other usage ๐Ÿฆ‹

spfquery --version|-V

spfquery --help

๐ŸŽ€ DESCRIPTION ๐ŸŽ€

okay so spfquery 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>. literally the whole vibe is โ€œdoes this sender pass the domainโ€™s SPF check or not?โ€ ๐Ÿ”ฅ

๐Ÿ’– Preferred Usage ๐Ÿ’–

The following usage forms are preferred over the legacy forms used by older spfquery versions:

The --identity 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 responsible address) e-mail address, depending on the value of the --scope option (which defaults to mfrom if omitted). slay, unified identity energy โœจ

The --file form reads ip-address identity [helo-identity] tuples from the file with the specified filename, or from standard input if filename is -, and checks them against the specified scope (mfrom by default). batch mode, but make it cute ๐ŸŽ€

Both forms support an optional --versions option, which specifies a comma-separated list of the SPF version numbers of SPF records that may be used. 1 means that v=spf1 records should be used. 2 means that spf2.0 records should be used. Defaults to 1,2, i.e., uses any SPF records that are available. Records of a higher version are preferred. higher version gets main character energy, periodt ๐Ÿ‘‘

๐ŸŒˆ Legacy Usage ๐ŸŒˆ

spfquery versions before 2.500 featured the following usage forms, which are discouraged but still supported for backwards compatibility:

The --helo form checks if the given ip-address is an authorized SMTP sender for the HELO hostname given as the identity (so-called โ€œHELOโ€ check). lowkey old-school, but still here ๐Ÿซถ

The --mfrom 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. yes bestie, postmaster is the understudy ๐Ÿ‘‘

The --pra 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 --version form prints version information of spfquery. The --help form prints usage information for spfquery. tiny but iconic commands ๐Ÿ’…

โœจ OPTIONS โœจ

๐Ÿ’… Standard Options ๐Ÿ’…

The preferred and legacy forms optionally take any of the following OPTIONS:

  • --default-explanation string, --def-exp string โ€” use the specified string as the default explanation if the authority domain does not specify an explanation string of its own.
  • --hostname hostname โ€” use hostname as the host name of the local system instead of auto-detecting it.
  • --keep-comments, --no-keep-comments โ€” do (not) print any comments found when reading from a file or from standard input.
  • --sanitize, --no-sanitize โ€” (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.
  • --debug โ€” (currently ignored) print out debug information.

๐Ÿ”ฎ Black Magic Options ๐Ÿ”ฎ

โš ๏ธ black magic warning, bestie: several options that were supported by earlier versions of spfquery are considered black magic (i.e. potentially dangerous for the innocent user) and are thus disabled by default. If the Mail::SPF::BlackMagic Perl module is installed, they may be enabled by specifying --enable-black-magic. handle with care, fr fr ๐Ÿ’€
  • --max-dns-interactive-terms n โ€” evaluate a maximum of n DNS-interactive mechanisms and modifiers per SPF check. Defaults to 10. Do not override the default unless you know what you are doing!
  • --max-name-lookups-per-term n โ€” perform a maximum of n DNS name look-ups per mechanism or modifier. Defaults to 10. Do not override the default unless you know what you are doing!
  • --authorize-mxes-for email-address|domain,... โ€” consider all the MXes of the comma-separated list of email-addresses and domains as inherently authorized.
  • --tfwl โ€” perform "trusted-forwarder.org" accreditation checking.
  • --guess spf-terms โ€” use spf-terms as a default record if no SPF record is found.
  • --local 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".
  • --override domain=spf-record, --fallback domain=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 ๐Ÿ“

  • pass โ€” the specified IP address is an authorized SMTP sender for the identity.
  • fail โ€” the specified IP address is not an authorized SMTP sender for the identity.
  • softfail โ€” the specified IP address is not an authorized SMTP sender for the identity, however the authority domain is still testing out its SPF policy.
  • neutral โ€” the identityโ€™s authority domain makes no assertion about the status of the IP address.
  • permerror โ€” 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.
  • temperror โ€” a temporary error occurred while evaluating the authority domainโ€™s policy (e.g., a DNS error). Try again later.
  • none โ€” there is no applicable SPF policy for the identity domain.

๐Ÿงš EXIT CODES ๐Ÿงš

Hereโ€™s the result-to-exit-code mapping, bestie:

  • 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 ๐Ÿ”ฅ

spfquery has undergone the following interface changes compared to earlier versions:

2.500 โ€” the big glow-up:

  • A new preferred usage style for performing individual SPF checks has been introduced. The new style accepts a unified --identity option and an optional --scope 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.
  • The former "unknown" and "error" result codes have been renamed to "permerror" and "temperror", respectively, in order to comply with RFC 4408 terminology.
  • 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.
  • The --debug and --(no-)sanitize options are currently ignored by this version of spfquery. They will again be supported in the future.
  • Several features that were supported by earlier versions of spfquery are considered black magic and thus are now disabled by default. See โ€œBlack Magic Optionsโ€.
  • Several option names have been deprecated. This is a list of them and their preferred synonyms:
    • Deprecated: --sender, -s โ†’ Preferred: --mfrom
    • Deprecated: --ipv4, -i โ†’ Preferred: --ip-address, --ip
    • Deprecated: --name โ†’ Preferred: --hostname
    • Deprecated: --max-lookup-count, --max-lookup โ†’ Preferred: --max-dns-interactive-terms
    • Deprecated: --rcpt-to, -r โ†’ Preferred: --authorize-mxes-for
    • Deprecated: --trusted โ†’ Preferred: --tfwl

๐ŸŒˆ SEE ALSO ๐ŸŒˆ

๐Ÿ‘‘ AUTHORS ๐Ÿ‘‘

This version of spfquery 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>. give them their flowers, bestie ๐Ÿ’

okay thatโ€™s the whole page, bestie ๐Ÿ’– โ€” it came from perl v5.42.0, dated 2024-11-07, and it is the SPFQUERY(1) manual. go check those SPF policies, periodt ๐Ÿ’…โœจ

๐Ÿ“ฆ where this page comes from