我正在尝试在运行Debian和Postfix的邮件服务器上设置OpenDKIM。这是我完成的配置:
- 生成了两个密钥(对于我需要为其发送邮件的两个域)
- 配置的KeyTable,SigningTable和TrustedHosts文件:
关键表:
mail._domainkey.domain1.com domain1.com:mail:/etc/opendkim/keys/domain1.com/mail.private
mail._domainkey.domain2.com domain2.com:mail:/etc/opendkim/keys/domain2.com/mail.private
签名表:
*.domain1.com mail._domainkey.domain1.com
*.domain2.com mail._domainkey.domain2.com
TrustedHosts:
127.0.0.1
::1
localhost
我的opendkim.conf
读物:
# This is a basic configuration that can easily be adapted to suit a standard
# installation. For more advanced options, see opendkim.conf(5) and/or
# /usr/share/doc/opendkim/examples/opendkim.conf.sample.
# Log to syslog
Syslog yes
# Required to use local socket with MTAs that access the socket as a non-
# privileged user (e.g. Postfix)
UMask 002
LogWhy yes
OversignHeaders From
TrustAnchorFile /usr/share/dns/root.key
KeyTable /etc/opendkim/KeyTable
SigningTable refile:/etc/opendkim/SigningTable
ExternalIgnoreList /etc/opendkim/TrustedHosts
InternalHosts /etc/opendkim/TrustedHosts
最后,我使用milter套接字将其连接到Postfix:
后缀main.cf:
# Milters
smtpd_milters =
unix:/opendkim/opendkim.sock,
unix:/clamav/clamav-milter.ctl,
unix:/spamass/spamass.sock
non_smtpd_milters = unix:/opendkim/opendkim.sock
在此当前状态下,OpenDKIM会正确验证传入邮件的签名,但由于某种原因它不会对传出邮件进行签名。mail.log
尝试发送消息时已登录:
Nov 8 16:35:02 illium opendkim[30142]: 826DF501F39: %clienthostname% %clientip% not internal
Nov 8 16:35:02 illium opendkim[30142]: 826DF501F39: not authenticated
Nov 8 16:35:02 illium opendkim[30142]: 826DF501F39: no signature data
我相信这not authenticated
部分是不正确的,因为该邮件是使用身份验证的SMTP从客户端提交到Postfix的。