出站电子邮件没有在Centos上使用Postfix进行DKIM签名

我一直在使用phpmailer来处理我的电子邮件,而且我已经正确使用了dkim。 我有一个关键的mail._domainkey.domain.com。 我已经使用http://www.mail-tester.com/validation了我以前的电子邮件,并且我为phpmailer电子邮件收到了9.4。 我有安装postfix和opendkim。 我已经设置他们使用相同的密钥我已经设置以前,但我跑了一个testing邮件发送从后缀,它只得到9.0。 没有dkim就输了-1。 我应该可以像这样的分数不被垃圾邮件过滤,但因为我有DKIM设置和工作在过去的id喜欢用它来获得10/10。

有一个简单的方法,我可以用现有的私钥文件和匹配的DNS条目签名电子邮件。 我使用roundcube作为客户端,但它看起来不像它可以在这个级别configuration。

我检查了发送到Gmail的电子邮件的来源,并没有提及数据中的dkim。 (它仍然是它的收件箱,但我想要得到这个sorting)。

这里是我configuration设置的所有东西

的/ etc / opendkim /的Keytable

mail._domainkey.domain.com domain.com :default:/etc/opendkim/keys/domain.com/default 

/etc/opendkim.conf

 AutoRestart Yes AutoRestartRate 10/1h Canonicalization relaxed/simple ExternalIgnoreList refile:/etc/opendkim/TrustedHosts InternalHosts refile:/etc/opendkim/TrustedHosts KeyTable refile:/etc/opendkim/KeyTable LogWhy Yes Mode sv PidFile /var/run/opendkim/opendkim.pid SignatureAlgorithm rsa-sha256 SigningTable refile:/etc/opendkim/SigningTable Socket inet:8891@localhost Syslog Yes SyslogSuccess Yes TemporaryDirectory /var/tmp UMask 022 UserID opendkim:opendkim 

的/ etc / opendkim / SigningTable

 *@domain.com mail._domainkey.domain.com 

的/ etc / opendkim / TrustedHosts

 127.0.0.1 domain.com 

/etc/opendkim/keys/domain.com/default.txt

 k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDOWKEVTS6FJXogB66ls9OmtD7GRCE0FxTGR+n1sBUmp1Zj/eosMNSWGfwPEfSZVjY/VrQszi/MrdYF7VTLGCKiVxlYrhjSqtqWw93ODmrIsBnTd/IIbIHLOI2yNmegHFIWEvOGFsMqCnQ4IZMtVdwUQtEvSVtjDmNe2PXqvwlzRQIDAQAB 

你需要添加opendkim作为一个更老的后缀。

确保这两行在postfix的main.cf

 milter_protocol = 2 milter_default_action = accept 

然后添加opendkim到你的米尔特人:

 smtpd_milters = inet:localhost:8891 non_smtpd_milters = inet:localhost:8891 

我还将localhost添加到TrustedHosts文件的opendkim中,因为postfix可能会通过IPv6(:: 1)而不是IPv4(127.0.0.1)连接到它。 拥有TrustedHosts文件中的localhost应该就足够了。

有关更多详细信息,请参阅https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-dkim-with-postfix-on-debian-wheezy