mail
spf

spfquery の使い方

迷惑メール対策の SPF(Sender Policy Framework)について確認する spfquery の使い方です。

Arch Linux でのインストール

sudo pacman -S perl-mail-spf-query

pass となるケース

SPFQUERY=/usr/bin/vendor_perl/spfquery
#
$SPFQUERY --ip 133.130.98.29 --mail-from from@ekzemplaro.org --helo gmail.com
#
echo
$SPFQUERY -i 133.130.98.29 -m from@ekzemplaro.org -h gmail.com

実行結果

pass
Please see http://www.openspf.org/why.html?sender=from%40ekzemplaro.org&ip=133.130.98.29&receiver=spfquery: 133.130.98.29 contains 133.130.98.29
spfquery: domain of from@ekzemplaro.org designates 133.130.98.29 as permitted sender
Received-SPF: pass (spfquery: domain of from@ekzemplaro.org designates 133.130.98.29 as permitted sender) client-ip=133.130.98.29; envelope-from=from@ekzemplaro.org; helo=gmai.com;

none となるケース

SPFQUERY=/usr/bin/vendor_perl/spfquery
#
$SPFQUERY -i 133.130.98.29 -m from@www.ekzemplaro.org -h gmail.com

実行結果

none
SPF: domain of sender from@www.ekzemplaro.org does not designate mailers
spfquery: domain of from@www.ekzemplaro.org does not designate permitted sender hosts
Received-SPF: none (spfquery: domain of from@www.ekzemplaro.org does not designate permitted sender hosts) client-ip=133.130.98.29; envelope-from=from@www.ekzemplaro.org; helo=gmai.com;

softfail となるケース

SPFQUERY=/usr/bin/vendor_perl/spfquery
#
$SPFQUERY -i 133.130.98.28 -m from@ekzemplaro.org -h gmail.com

実行結果

softfail
Please see http://www.openspf.org/why.html?sender=from%40ekzemplaro.org&ip=133.130.98.28&receiver=spfquery
spfquery: transitioning domain of from@ekzemplaro.org does not designate 133.130.98.28 as permitted sender
Received-SPF: softfail (spfquery: transitioning domain of from@ekzemplaro.org does not designate 133.130.98.28 as permitted sender) client-ip=133.130.98.28; envelope-from=from@ekzemplaro.org; helo=gmai.com;

SPF のチェックをするページ

SPF Record Testing Tools
Mx TOOLBOX