Skip to content

spfquery.1

Manvendra Bhangui edited this page Dec 13, 2024 · 6 revisions

NAME

spfquery - SPF query tool

SYNOPSIS

spfquery sender-ip sender-helo/ehlo envelope-from [ local_rules guess_rules spfexp ]

DESCRIPTION

spfquery is a tool that can be used for checking if a sender-ip is authorized to send emails for the domain in envelope-from.

OPTIONS

sender-ip
The IP address to verify if it is authorized to send emails for domain specfied in envelope-from.

sender-helo
Substitute the domain used in the most recent SMTP HELO or EHLO with sender-helo in case there is a SPF expansion

envelope-from
Use domain from envelope_from

local_rules
Rules that are executed before the real SPF rules for a domain would fail (fail, softfail, neutral). This can be used to always allow certain machines to send certain mails.

guess_rules
SPF rules that will be checked if a sender domain doesn't have a SPF record. The local spfrules are always executed afterwards.

spfexp
Use spfexp as explanation in case of a reject

EXIT STATUS

spfquery exits with a code depicting success or failure as below.

0  - SPF_OK       IP is authorized to send email for the domain
1  - SPF_NONE     No SPF records found for the domain
2  - SPF_UNKNOWN  Unknown SPF failure
3  - SPF_NEUTRAL  happens when the domain owner doesn’t want to assert
                  that the sending IP addresses are authorized.
4  - SPF_SOFTFAIL The sender is either authorized or not authorized to
                  send email from the domain.
5  - SPF Failure  sending IP address is NOT authorized to send from the
                  domain.
6  - SPF_ERROR    Temporary error in getting SPF records from DNS
7  - SPF_NOMEM    Out of memory failure

SEE ALSO

qmail-smtpd(8)

Clone this wiki locally