【问题标题】:can't load key in OpenDKIM Permission denied无法在 OpenDKIM 中加载密钥 权限被拒绝
【发布时间】:2019-08-14 04:02:38
【问题描述】:

以前工作的 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(删除了 cmets 和空格)

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 和密钥文件中的权限

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 使用了正确的组和用户名。

提前感谢您提供我错过的东西,或者提到一些其他指南都没有提到的东西。

【问题讨论】:

    标签: email server postfix-mta dkim


    【解决方案1】:

    我遇到了同样的问题,并通过使密钥和配置文件(KeyTable、SigningTable 等)可执行来解决它。

    sudo chmod -R ug+x /etc/opendkim
    

    【讨论】:

    • 这个命令对我有用。谢谢@tgodan。
    【解决方案2】:

    我备份了我的配置文件。 apt-get 清除了 opendkim,重新安装了 opendkim,恢复了我的确切配置文件,并且成功了。

    我不知道为什么。

    PFM

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-10-15
      • 2020-02-11
      • 2012-10-19
      • 1970-01-01
      • 1970-01-01
      • 2013-07-23
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多