我正在尝试在 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]>
希望以上内容对解决问题有所帮助。如果有人能指出我正确的方向,我真的很感激。