Postfix

OpenDKIM 錯誤

  • April 30, 2021

發送郵件時,Outlook 錯誤4.7.1 Service unavailable - try again later。我已經安裝了 postfix、dovecot 和 openDKIM,但是 OpenDKIM 給了我錯誤:

Mar 30 10:19:32 x opendkim[16762]: can't load key from /etc/ssl/private/mail.x.nl.key: Permission denied
Mar 30 10:19:32 x opendkim[16762]: A058440C14: error loading key '_domainkey.x.nl'
Mar 30 10:20:27 x opendkim[16762]: can't load key from /etc/ssl/private/mail.x.nl.key: Permission denied
Mar 30 10:20:27 x opendkim[16762]: 6A4FF40C14: error loading key '_domainkey.x.nl'
Mar 30 11:45:42 x opendkim[16762]: can't load key from /etc/ssl/private/mail.x.nl.key: Permission denied
Mar 30 11:45:42 x opendkim[16762]: 0EDB640845: error loading key '_domainkey.x.nl'
Mar 30 11:47:48 x postfix/postfix-script[1373]: error: unknown command: 'restart'
Mar 30 11:47:48 x postfix/postfix-script[1374]: fatal: usage: postfix start (or stop, reload, abort, flush, check, status, set-permissions, upgrade-configuration)
Mar 30 11:51:41 x opendkim[1888]: can't load key from /etc/ssl/private/mail.x.nl.key: Permission denied
Mar 30 11:51:41 x opendkim[1888]: BF89E40845: error loading key '_domainkey.x.key

** Output from namei -l ** 
f: /etc/ssl/private/mail.x.nl.key
drwxr-xr-x root      root     /
drwxr-xr-x root      root     etc
drwxr-xr-x root      root     ssl
drwx--x--- root      ssl-cert private
-rw-r--r-- opendkim  opendkim mail.x.nl.key

我嘗試將 .key 文件設置為0755with owner opendkim:opendkim。我可以解決這個問題嗎?

你的權限太嚴格了。使用者/組無權訪問該

文件夾。 根據您的設置,它應該歸該組所有,並且該組還應該對該文件夾具有讀取/執行權限。 opendkim``/etc/ssl/private
opendkim

您的密鑰文件的權限也太開放了。

它應該有0600權限,在任何情況下都不應該是世界可讀的。

在我的情況下幫助這個

chown -R opendkim:opendkim /etc/opendkim
chmod 0750 /etc/opendkim/keys
chmod 0600 /etc/opendkim/keys/default.private

引用自:https://serverfault.com/questions/679271