Debian

OpenDKIM 無法啟動:“opendkim:必須指定 milter 套接字”

  • July 22, 2020

我正在嘗試使用 postfix、dovecot、amavis 和 opendkim 來設置伺服器進行簽名。

OpenDKIM 不會啟動,這是journalctl -xe停止並啟動 opendkim 後的輸出:

Jul 21 21:54:17 mail systemd[1]: Starting OpenDKIM DomainKeys Identified Mail (DKIM) Milter...
-- Subject: A start job for unit opendkim.service has begun execution
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- A start job for unit opendkim.service has begun execution.
--
-- The job identifier is 54385.
Jul 21 21:54:17 mail opendkim[108677]: opendkim: milter socket must be specified
Jul 21 21:54:17 mail systemd[1]: opendkim.service: Control process exited, code=exited, status=78/CONFIG
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- An ExecStart= process belonging to unit opendkim.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 78.
Jul 21 21:54:17 mail systemd[1]: opendkim.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit opendkim.service has entered the 'failed' state with result 'exit-code'.

我的 OpenDKIM (/etc/opendkim.conf) 配置如下所示:

Syslog              yes
LogResults          yes
LogWhy              yes
SyslogSuccess       yes
UMask               002
Canonicalization    relaxed/relaxed

# Only sign, don't verify (Amavis takes care of the verification)
Mode                s

KeyTable            /etc/opendkim/keytable
SigningTable        refile:/etc/opendkim/signingtable

正如您在配置中看到的,我只希望 OpenDKIM 簽名,而不是驗證。

正如錯誤所說,您應該指定套接字。強製配置參數可以在opendkim.conf文件中找到:

Socket (細繩)

指定過濾器應建立的套接字,以接收來自 sendmail(8) 的連接以提供服務。 socketspec 是以下兩種形式之一: 

  • local:path,它在指定路徑創建一個 UNIX 域套接字,或者
  • inet:port[@host]或者在指定的 和指定的協議族inet6:port[@host]中創建一個 TCP 套接字 。

如果 主機 沒有作為主機名或 IP 地址給出,則套接字將偵聽所有介面。文字 IP 地址必須用方括號括起來。此選項在配置文件或命令行中是必需的。

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