我正在尝试在 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
[编辑]
我的/etc/opendkim/SigningTable
文件包含:
*@esfs.info default._domainkey.esfs.info
[/编辑]
我的/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=<[email protected]>
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=<[email protected]> to=<[email protected]>
希望以上内容对诊断问题有帮助。如果有人能给我指明正确的方向,我将不胜感激。
答案1
看着:
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"