Centos
OpenDKIM 報告“簽名表引用未知密鑰”(CentOS 8)
我正在嘗試在 CentOS 8 上使用 PostFix 配置 OpenDKIM。
我在中設置了以下內容
/etc/opendkim.conf
:PidFile /run/opendkim/opendkim.pid Mode sv Syslog yes SyslogSuccess yes LogWhy yes UserID opendkim:opendkim Socket inet:8891@localhost Umask 002 SendReports yes SoftwareHeader yes Canonicalization relaxed/relaxed Selector default KeyTable /etc/opendkim/KeyTable SigningTable refile:/etc/opendkim/SigningTable ExternalIgnoreList refile:/etc/opendkim/TrustedHosts InternalHosts refile:/etc/opendkim/TrustedHosts OversignHeaders From
我的
/etc/opendkim/KeyTable
文件如下:mta1._domainkey.esfs.info esfs.info:mta1:/etc/opendkim/keys/esfs.info/mta1.private
$$ Edit $$
我的
/etc/opendkim/SigningTable
文件包含:*@esfs.info default._domainkey.esfs.info
$$ /Edit $$
我的
/etc/opendkim/TrustedHosts
文件是:127.0.0.1 ::1 *.esfs.info
我使用以下命令生成了我的域密鑰:
sudo opendkim-genkey -b 2048 -d your-domain.com -D /etc/opendkim/keys/your-domain.com -s mta1 -v
我將 , 的內容複製
/etc/opendkim/keys/esfs.info/mta1.txt
到我的 dns 條目中。但是,當我測試密鑰時,我會收到一條警告說它不安全:
$ sudo opendkim-testkey -d esfs.info -s mta1 -vvv opendkim-testkey: using default configfile /etc/opendkim.conf opendkim-testkey: checking key 'mta1._domainkey.esfs.info' opendkim-testkey: key not secure opendkim-testkey: key OK
當我檢查伺服器狀態時,我得到以下資訊:
$ sudo systemctl status opendkim ● opendkim.service - DomainKeys Identified Mail (DKIM) Milter Loaded: loaded (/usr/lib/systemd/system/opendkim.service; enabled; vendor preset: disabled) Active: active (running) since Mon 2021-02-08 23:15:12 GMT; 5 days ago Docs: man:opendkim(8) man:opendkim.conf(5) man:opendkim-genkey(8) man:opendkim-genzone(8) man:opendkim-testadsp(8) man:opendkim-testkey http://www.opendkim.org/docs.html Main PID: 80340 (opendkim) Tasks: 3 (limit: 4947) Memory: 2.8M CGroup: /system.slice/opendkim.service └─80340 /usr/sbin/opendkim -x /etc/opendkim.conf -P /run/opendkim/opendkim.pid Feb 14 12:57:17 wp2.lostcarpark.com opendkim[80340]: CA0EC5E150: signing table references unknown key 'default._domainkey.esfs.info' Feb 14 12:57:17 wp2.lostcarpark.com opendkim[80340]: CB0C55E150: signing table references unknown key 'default._domainkey.esfs.info' Feb 14 12:57:17 wp2.lostcarpark.com opendkim[80340]: CBF885E150: signing table references unknown key 'default._domainkey.esfs.info' Feb 14 12:57:17 wp2.lostcarpark.com opendkim[80340]: CCDDA5E150: signing table references unknown key 'default._domainkey.esfs.info'
以下來自
/var/log/maillog
:Feb 14 14:52:24 wp2 postfix/pickup[279532]: warning: 374135E150: message has been queued for 1 days Feb 14 14:52:24 wp2 postfix/pickup[279532]: 374135E150: uid=0 from=<root> Feb 14 14:52:24 wp2 postfix/cleanup[279857]: 374135E150: message-id=<20210214145224.374135E150@esfs.info> Feb 14 14:52:24 wp2 opendkim[80340]: 374135E150: signing table references unknown key 'default._domainkey.esfs.info' Feb 14 14:52:24 wp2 postfix/cleanup[279857]: 374135E150: milter-reject: END-OF-MESSAGE from localhost[127.0.0.1]: 4.7.1 Service unavailable - try again later; from=<root@esfs.info> to=<root@esfs.info>
希望以上內容對解決問題有所幫助。如果有人能指出我正確的方向,我真的很感激。
看著:
dig default._domainkey.esfs.info. txt +short
這返回空,這是出乎意料的。相反,您使用不同的名稱
mta1
:dig mta1._domainkey.esfs.info txt +short "v=DKIM1; k=rsa; " "p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAzPW/qEl5jIpReXwxZ8WaS07dn3QLwa4/OWFn17bh84SM0ac7jMvo8jbBmotuO0o0oFeoODPFEYUyvXx0TScrkhycRuKqlhraBNOiPiLgRgP9L0/5Z4VdWdAhASgFMfa4mK7lfuZ85dMdyshp/SN9R3zNOvExEtuHNvQ0eUkTBcuY4UneAHhlx5SlRORdSzq02eCsgEskMLzBd7" "tEJargXaRjSLdMLnML8yJVtDHhPBH/G8AJsOWOPoXDyt6vI0pWW1o6A7BEleXYouYlge4w6S2Kgzv+QSBJoLxlCyNDo1kBG2lag5Jos4BjlahIYh1gzI5aDozG5VlVeLAq3B7QMQIDAQAB"