先前工作的dovecot/postfix/dkim设置,多个域正确工作了几个月。
我试图添加一个新的域名。追溯我为原始的工作。一旦遇到了大多数问题,所有配置文件,键,文本记录等都可以毫无问题地收到电子邮件,但不会在新的电子邮件/域中发送电子邮件。
收到以下错误:
Mar 23 02:48:49 MainFrame-2017 opendkim[4225]: can't load key from /etc/opendkim/keys/zaehlas.com/mail.private: Permission denied
Mar 23 02:48:49 MainFrame-2017 opendkim[4225]: DF0CF5C4CC0: error loading key 'mail._domainkey.zaehlas.com'
安装了以下版本:
Distributor ID: Ubuntu
Description: Ubuntu 16.04.6 LTS
Release: 16.04
Codename: xenial
root@MainFrame-2017:/etc/opendkim/keys/zaehlas.com# dpkg -s opendkim | grep '^Version:'
Version: 2.10.3-3build1
root@MainFrame-2017:/etc/opendkim/keys/zaehlas.com# dpkg -s postfix | grep '^Version:'
Version: 3.1.0-3ubuntu0.3
我检查了权限和配置文件。为4个域名完美工作,而不是与最后一个域一起工作。最终按照我可以找到的(许多)指南,重新启动整个服务器,多个服务重新启动的所有权限,现在我的域都不会使用DKIM
发送电子邮件。我的opendkim.conf(删除了评论和空白空间)
OversignHeaders From
TrustAnchorFile /usr/share/dns/root.key
AutoRestart Yes
AutoRestartRate 10/1h
UMask 002
Syslog yes
SyslogSuccess Yes
LogWhy Yes
Canonicalization relaxed/simple
ExternalIgnoreList refile:/etc/opendkim/TrustedHosts
InternalHosts refile:/etc/opendkim/TrustedHosts
KeyTable refile:/etc/opendkim/KeyTable
SigningTable refile:/etc/opendkim/SigningTable
Mode sv
PidFile /var/run/opendkim/opendkim.pid
SignatureAlgorithm rsa-sha256
UserID opendkim:opendkim
Socket inet:12301@localhost
Opendkim和KeyFiles中的权限
root@MainFrame-2017:/etc/opendkim# ls -l
total 16
drw------- 9 opendkim opendkim 4096 Mar 23 00:31 keys
-rw-r--r-- 1 opendkim opendkim 772 Mar 23 02:10 KeyTable
-rw-r--r-- 1 opendkim opendkim 394 Mar 23 00:28 SigningTable
-rw-r--r-- 1 opendkim opendkim 286 Mar 23 02:42 TrustedHosts
root@MainFrame-2017:/etc/opendkim# namei -l /etc/opendkim/keys/zaehlas.com/mail.private
f: /etc/opendkim/keys/zaehlas.com/mail.private
drwxr-xr-x root root /
drwxr-xr-x root root etc
drwxr-xr-x opendkim opendkim opendkim
drw------- opendkim opendkim keys
drw------- opendkim opendkim zaehlas.com
-rw------- opendkim opendkim mail.private
键入文件:
mail._domainkey.zaehlas.com zaehlas.com:mail:/etc/opendkim/keys/zaehlas.com/mail.private
mail._domainkey.bglancesglass.com bglancesglass.com:mail:/etc/opendkim/keys/bglancesglass.com/mail.private
mail._domainkey.millenniumlarp.com millenniumlarp.com:mail:/etc/opendkim/keys/millenniumlarp.com/mail.private
mail._domainkey.pittsburghglassclub.com pittsburghglassclub.com:mail:/etc/opendkim/keys/pittsburghglassclub.com/mail.private
mail._domainkey.pittsburghglassclub.org pittsburghglassclub.org:mail:/etc/opendkim/keys/pittsburghglassclub.org/mail.private
mail._domainkey.chataboutdg.com chataboutdg.com:mail:/etc/opendkim/keys/chataboutdg.com/mail.private
mail._domainkey.lostvalleylegacy.com lostvalleylegacy.com:mail/etc/opendkim/keys/lostvalleylegacy.com/mail.private
和DKIM测试工作:
root@MainFrame-2017:/etc/opendkim# opendkim-testkey -d zaehlas.com -s mail -vvv
opendkim-testkey: using default configfile /etc/opendkim.conf
opendkim-testkey: checking key 'mail._domainkey.zaehlas.com'
opendkim-testkey: key not secure
opendkim-testkey: key OK
我已经完全干燥了想法。它起作用了,现在没有,而且没有任何关键改变。我尝试了几个不同的权限,经过验证的OpendKim使用了正确的组和用户名。
提前感谢您错过的事情,或者提到任何其他指南都没有提及的东西。
有点迟了,但是问题可能是用密钥的文件所有者,应该是opendkim。用命令检查文件所有者:
ls -la /etc/opendkim/keys/{domain-name}/
输出应该是这样的:
-rw------- 1 opendkim opendkim 1679 30. bře 21.17 default.private
您可以使用命令更改所有者:
chown opendkim:opendkim /etc/opendkim/keys/{domain-name}/default.private
我遇到了相同的问题,并通过制作键和配置文件(keytable,signingtable等)来修复它。
sudo chmod -R ug+x /etc/opendkim
我备份了我的配置文件。apt-get净化的opendkim,重新安装了opendkim,还原了我的确切配置文件,并且起作用。
我不知道为什么。
PFM