centos6.3のサーバに、ココで書いた手順でopendkimの導入を行い、sa-test@sendmail.net に設定確認のメールを送ってみたのだが、DKIMの設定ができていないと言われてしまった。
SMTPのログを確認してみると
Feb 27 09:16:11 testserver opendkim[2204]: B9E002401C7: no signing table match for 'root@testserver.com' Feb 27 09:16:11 testserver opendkim[2204]: B9E002401C7: no signature data
のようなログを見つけました。
エラーどおり、/etc/opendkim.confのSigningTableで設定しているファイルをみてみると
# The following wildcard will work only if # refile:/etc/opendkim/SigningTable is included # in /etc/opendkim.conf. #*@example.com default._domainkey.example.com # If refile: is not specified in /etc/opendkim.conf, then full # user@host is checked first, then simply host, then user@.domain (with all # superdomains checked in sequence, so "foo.example.com" would first check # "user@foo.example.com", then "user@.example.com", then "user@.com"), then # .domain, then user@*, and finally *. See the opendkim.conf(5) man page # under "SigningTable". #example.com default._domainkey.example.com testserver.com default._domainkey.testserver.com
になっている。
どうも、/etc/opendkim.confのSigningTableのところを
SigningTable /etc/opendkim/SigningTable
としているなら、
testserver.com default._domainkey.testserver.com
というように設定する。あるいは、
SigningTable refile:/etc/opendkim/SigningTable
としているなら、
*@testserver.com default._domainkey.testserver.com
のように設定しなさいということらしい。
指示に従い、/etc/opendkim.confの
SigningTable refile:/etc/opendkim/SigningTable
を
SigningTable /etc/opendkim/SigningTable
に修正してopendkimとpostfixを再起動したら問題が解消されました。
なお、原因は、
- opendkim-2.7.3-2.el6.x86_64以前では、デフォルトの/etc/opendkim.confのSigningTableは
#SigningTable /etc/opendkim/SigningTable
となっているのに、opendkim-2.7.4-1.el6.x86_64では、
#SigningTable refile:/etc/opendkim/SigningTable
となっていたこと。
- 上記の違いに気が付かず、先頭のコメントを外しただけで終わっていたこと。
ということでした。