Leopard 上带有Postfix,配置domainkey需要安装dk-milter, dk-milter需要libmilter, postfix没有提供libmilter, 需要从sendmail上build出来。
$ gzcat sendmail-x.y.z .tar.gz | tar xf -
$ cd sendmail-x.y.z /libmilter
$ make
[...lots of output omitted ...]
After building your own libmilter library, follow the installation instructions in the Milter application source distribution to specify the location of the libmilter include files and object library. Typically, these settings are configured in a file named sid-filter/Makefile.m4 or similar:
APPENDDEF(`confINCDIRS', `-I/some/where/sendmail-x.y.z/include')
APPENDDEF(`confLIBDIRS', `-L/some/where/sendmail-x.y.z/obj.systemtype /libmilter')
下载dk-filter
http://sourceforge.net/projects/dk-milter/
$tar xzvf dk-milter-1.0.0.tar.gz
$cd dk-milter-1.0.0
$cp site.config.m4.dist devtools/Site/site.config.m4
编辑site.config.m4,添加
APPENDDEF(`confINCDIRS', `-I/some/where/sendmail-x.y.z/include')
APPENDDEF(`confLIBDIRS', `-L/some/where/sendmail-x.y.z/obj.systemtype /libmilter')
例如:
APPENDDEF(`confINCDIRS', `-I/Users/wenxin/Downloads/sendmail-8.14.3/include')
APPENDDEF(`confLIBDIRS', `-L/Users/wenxin/Downloads/sendmail-8.14.3/obj.Darwin.9.5.0.i386/libmilter')
$sh Build -c
$sh Build install
编辑main.cf
添加:
smtpd_milters = inet:localhost:8891
non_smtpd_milters = inet:localhost:8891
启动dkfilter
/usr/bin/dk-filter -l -p inet:8891@localhost -d postfix.cn -s /tmail/dkim-milter/postfix.cn_default.key.pem -S default
发邮件到yahoo.com.cn去测试domainkey是否pass
如果一切正常你在yahoo.com.cn的邮件头中看到
Authentication-Results: mta133.mail.cnb.yahoo.com from=postfix.cn; domainkeys=pass (ok)
DomainKey-Signature: a=rsa-sha1; s=default; d=postfix.cn;
c=simple; q=dns;
b=oycNtAJ+tFHP74qVuB7J5qUz0sKYfAE5AadtDCacA61tJCeXScitWAXXUB6e44bq1
Cf0XPFxOQrAI1tnZoJabA==
发件人: "test@postfix.cn" <[email]test@postfix.cn[/email]>
Yahoo!域名密钥已经确认这封邮件来自于 postfix.cn. 了解更多、