SPFレコードの設定

Sender Policy Framework
http://ja.wikipedia.org/wiki/Sender_Policy_Framework

自宅メールサーバから、Gmailにメールを送ると、

Received-SPF: neutral (google.com: 198.51.100.123 is neither permitted nor denied by best guess record for domain of hoge@mail.hoge.com) client-ip=198.51.100.123;
Authentication-Results: mx.google.com; spf=neutral (google.com: 198.51.100.123 is neither permitted nor denied by best guess record for domain of hoge@mail.hoge.com) smtp.mail=hoge@mail.hoge.com

Received-SPF: neutral
Authentication-Results: mx.google.com; spf=neutral
となるのでSPFに対応させてみようと思います。


BINDだけで設定できます。

ネームサーバ・・・BIND9
ドメイン名・・・hoge.com
MXレコード・・・mail.hoge.com
IPアドレス・・・198.51.100.123

SPFレコードの設定については
Sender ID Framework SPF Record Wizard
http://www.microsoft.com/mscorp/safety/content/technologies/senderid/wizard/default.aspx
こちらのウィザードに従えば作ってくれます。

Zoneファイルに以下を追記します。

# vi hoge.com.zone

          IN MX   10 mail.hoge.com.
mail      IN TXT  "v=spf1 ip4:198.51.100.123 mx:mail.hoge.com -all"
mail      IN A    198.51.100.123

「10」がプリファレンス値で数が多くなれば優先順位が下がります。

再起動して確認してみましょ。

# /etc/init.d/named restart
# dig hoge.com a txt +norec
;; Warning, extra type option

; <<>> DiG 9.6-ESV-R4-P3 <<>> hoge.com a txt +norec
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 56828
;; flags: qr aa ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;hoge.com.			IN	TXT

;; ANSWER SECTION:
hoge.com.		120	IN	TXT	"v=spf1 mx ip4:198.51.100.123 mx:mail.hoge.com -all"

;; AUTHORITY SECTION:
hoge.com.		120	IN	NS	ns.hoge.com.

;; ADDITIONAL SECTION:
ns.hoge.com.		120	IN	A	198.51.100.123

;; Query time: 8 msec
;; SERVER: 192.168.100.1#53(192.168.100.1)
;; WHEN: Sun Mar 25 17:30:51 2012
;; MSG SIZE  rcvd: 120
$ dig hoge.com mx

; <<>> DiG 9.6-ESV-R4-P3 <<>> hoge.com mx
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 64531
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;hoge.com.			IN	MX

;; ANSWER SECTION:
hoge.com.		120	IN	MX	10 mail.hoge.com.

;; AUTHORITY SECTION:
hoge.com.		120	IN	NS	ns.hoge.com.

;; ADDITIONAL SECTION:
ns.hoge.com.		120	IN	A	198.51.100.123

;; Query time: 2 msec
;; SERVER: 192.168.100.1#53(192.168.100.1)
;; WHEN: Sun Mar 25 19:19:43 2012
;; MSG SIZE  rcvd: 78

きちんと設定されています。

確認するには
http://www.sendmail.co.jp/sa/spfcheck.html
や、Gmailにメールを送ると確認することができます。

Received-SPF: pass (google.com: domain of hoge@mail.hoge.com designates 198.51.100.123 as permitted sender) client-ip=198.51.100.123;
Authentication-Results: mx.google.com; spf=pass (google.com: domain of hoge@mail.hoge.com designates 198.51.100.123 as permitted sender) smtp.mail=hoge@mail.hoge.com

Received-SPF: pass
Authentication-Results: mx.google.com; spf=pass
となります。

[tegaki]慎重にしないとね。。[/tegaki]

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

Enter code * Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.