试图找出在单个EC2上实现DKIM的最佳实践,它将具有多个弹性IPS。
# /etc/opendkim.conf
...
Mode sv
Canonicalization relaxed/simple
ExternalIgnoreList refile:/etc/opendkim/TrustedHosts
InternalHosts refile:/etc/opendkim/TrustedHosts
KeyTable refile:/etc/opendkim/KeyTable
SigningTable refile:/etc/opendkim/SigningTable
SignatureAlgorithm rsa-sha256
...
# /etc/opendkim/KeyTable
default._domainkey.example.com example.com:hp-hv-1:/etc/opendkim/keys/default.private
default._domainkey.example.com example.com:hp-hv-2:/etc/opendkim/keys/default.private
# /etc/opendkim/SigningTable
*@example.com default._domainkey.example.com然后我有两个DNS记录:
hp-hv-1._domainkey.example.com TXT "v=DKIM1;k=rsa;p=default.txt_key_goes_here"
hp-hv-2._domainkey.example.com TXT "v=DKIM1;k=rsa;p=default.txt_key_goes_here"对于同一个EC2实例上的两个后缀实例,每个实例都有以下$myhostname:
# postfixmulti instance #1
myhostname = hp-hv-1
# postfixmulti instance #2
myhostname = hp-hv-2两个后缀实例都位于同一个EC2实例上,因此它们共享相同的default.private/default.txt私钥/公钥对,因此不需要向KeyTable和SigningTable添加更多的行。据我所知,如果我想实现多个域(但我不需要),我只需要向KeyTable和SigningTable添加额外的行。
但是,当我测试我的DKIM设置时,我总是收到“pass:中性”的回复,说电子邮件没有签名,但它们是签名的,我可以在日志文件中看到:
# snippet from /var/log/maillog
Sep 25 15:15:31 service-a-4 opendkim[27420]: 5B4A3625F0: DKIM-Signature field added (s=hp-hv-1, d=example.com)我遗漏了什么?
版本:
CentOS 6.5
Postfix v2.6.6
Opendkim v2.9发布于 2015-09-25 16:51:13
好的,我显然很困惑,我一直在想,DKIM签名字段中的"s“应该从后缀配置中识别$myhostname,但实际上并非如此。在阅读了更多关于DKIM键旋转的内容后,我终于穿上了它,"s“只是KeyTable、SigningTable和DNS中的选择器。
检查一下这个:
# /etc/opendkim/KeyTable
# Format: selector(1) domain:selector(2):/path/to/key
# selector(1) is used in the /etc/opendkim/SigningTable
# selector(2) is built into the DKIM signature for every email sent, which is used to lookup the DNS TXT entry: mail-1_r-1._domainkey.example.com
mail-1_r-1._domainkey.example.com example.com:mail-1_r-1:/etc/opendkim/keys/mail-1_r-1.private现在,如果我想旋转键,我会这样做:
# /etc/opendkim/KeyTable
# Generate new private/public key pair, and rename accordingly
mail-1_r-1._domainkey.example.com example.com:mail-1_r-1:/etc/opendkim/keys/mail-1_r-1.private
mail-1_r-2._domainkey.example.com example.com:mail-1_r-2:/etc/opendkim/keys/mail-1_r-2.private然后在签名表中:
# /etc/opendkim/SigningTable
*@shouttag.com mail_r-1._domainkey.example.com
*@shouttag.com mail_r-2._domainkey.example.com然后,对于DNS条目,您将拥有以下内容
mail_r-1.domainkey.example.com "v=DKIM1;k=rsa;p=mail_r-1.txt_key_goes_here"
mail_r-2.domainkey.example.com "v=DKIM1;k=rsa;p=mail_r-2.txt_key_goes_here"这些DNS条目是用来帮助验证电子邮件是真正从您的域(因此,域密钥标识邮件)发送的。然后7天左右,您可以删除mail_r-1 domainkey.example.com。
https://serverfault.com/questions/724847
复制相似问题