大网数据广告活动
服务器运维问答

opendkim error loading key

· 52CE 我爱测

I am having a hard time in debugging this error: Syslog: Apr 24 06:18:08 abcex opendkim[24223]: abcex: key data is not secure: /etc/opendkim/keys/abcex.private Apr 24 06:18:08 abcex opendkim[24223]: 28E1C29C5FB: error loading key…

问题原文

原帖链接 · Optionfan Bob · CC BY-SA 3.0

I am having a hard time in debugging this error:

Syslog:

Apr 24 06:18:08 abcex opendkim[24223]: abcex: key data is not secure: /etc/opendkim/keys/abcex.private
Apr 24 06:18:08 abcex opendkim[24223]: 28E1C29C5FB: error loading key 'abcex'
pr 24 06:18:08 abcex postfix/cleanup[24394]: A21DE29C5FB: milter-reject: END-OF-MESSAGE from localhost[127.0.0.1]: 4.7.1 Service unavailable - try again later; from=<[email omitted]> to=<[email omitted]>

Here is the output from namei -l /etc/opendkim/keys/abcex.private

drwxr-xr-x root     root     /
drwxr-xr-x root     root     etc
drwxr-xr-x opendkim opendkim opendkim
drwxr-xr-- opendkim opendkim keys
-rwxr-xr-- opendkim opendkim abcex.private

However testing is working fine:

opendkim-testkey -d abcex.com -s 201804 -vvv

opendkim-testkey: using default configfile /etc/opendkim.conf
opendkim-testkey: /etc/opendkim/keys/abcex.private: WARNING: unsafe permissions
opendkim-testkey: key loaded from /etc/opendkim/keys/abcex.private
opendkim-testkey: checking key '201804._domainkey.abcex.com'
opendkim-testkey: key not secure
opendkim-testkey: key OK

Output from dig is also fine

dig 201804._domainkey.abcex.com txt +short

"v=DKIM1; h=sha256; k=rsa; s=email; p=...."

I have looked at similar questions but not finding solutions. I have changed permissions as per OpenDKIM errors.

Also looked at https://sourceforge.net/p/opendkim/support-requests/19/, https://sourceforge.net/p/opendkim/support-requests/13/ but not finding any solution.

Please help.

社区高分解答

原帖链接 · HBruijn · CC BY-SA 3.0

The error message is quite clear "key data is not secure:" which indicates incorrect permissions on the key file, what is confirmed by the output of your ls command:

-rwxr-xr-- opendkim opendkim abcex.private
       ^
       |__ world readable 

Change the permissions for instance to:

chmod 0600 /etc/opendkim/keys/abcex.private

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-04-24)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。