SPF/Sender ID 検証機能の実装 by ENMA


送信ドメイン認証技術「SPF/Sender ID」を実装するメールフィルタプログラムとして IIJ が開発・公開した ENMA download | SourceForge.netCentOS 5.2 + Postfix 環境に導入してみました。

 環境がメジャーな組み合わせだからか入手から導入までは非常に簡単で、ダウンロードページから rpm パッケージを入手して以下の手順でインストール・設定変更他を実施するだけでした。

# rpm -ivh enma-1.0.0-1.i386.rpm
# vi /etc/enma.conf
# /sbin/service enma start
# cd /etc/postfix
# vi master.cf
# vi main.cf
# /sbin/service postfix reload

設定変更ですが、/etc/enma.conf に関しては

milter.postfix: false

milter.postfix: true

に変更しました。また Postfix の main.cf は

# ENMA(SPF/SenderID verifier)
smtpd_milters = inet:127.0.0.1:10025
non_smtpd_milters =
milter_default_action = accept

を追記し、master.cf については

submission inet n       -       n       -       -       smtpd
  -o smtpd_enforce_tls=yes
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
  -o smtpd_milters=
(省略)
scan      unix  -       -       n       -      10    smtp
  -o smtp_send_xforward_command=yes
  -o smtpd_milters=
127.0.0.1:8026 inet  n       -       n       -       10      smtpd
  -o content_filter=
  -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
  -o smtpd_helo_restrictions=
  -o smtpd_client_restrictions=
  -o smtpd_sender_restrictions=
  -o smtpd_recipient_restrictions=permit_mynetworks,reject
  -o mynetworks=127.0.0.0/8
  -o smtpd_authorized_xforward_hosts=127.0.0.0/8
  -o smtpd_milters=

と、SPF/Sender ID の検証の必要の無い transport では ENMA を使用しないようにしました。


実際にテストして見るとこんな感じでヘッダに記載されます。

Authentication-Results: localhost; spf=none smtp.mailfrom=xxxxx@xxxx.xxx; senderid=none
	 header.From=xxxxx@xxxx.xxx

このドメインSPF/Sender ID レコードが登録されていませんでした。登録されていると

Authentication-Results: localhost; spf=pass smtp.mailfrom=yyyy@yyyy.yyy; senderid=pass
	 header.From=yyyy@yyyy.yyy

とか

Authentication-Results: localhost; spf=hardfail smtp.mailfrom=zzz@zzzz.zzz; senderid=hardfail
	 header.From=zzz@zzzz.zzz

と、spf と senderid の結果が変わります。なるほど~、といった感じですね。


 ただ、検証をはじめてスグに来た迷惑メールは pass になってましたし、今更 SPF/Sender ID を見たところでどうなんだろう? という気がします。Google とか Yahoo! のアドレスを騙るような迷惑メールの判定には有用ですが、今時の迷惑メール送信者は GoogleYahoo! のアカウントを取得して迷惑メールを送ってくるため SPF/Sender ID の判定は pass になってしまいます。

 うむむ、これはどう使えばよいのでしょうか ^^;)?