因此,我已经使用 Postfix 设置了 OpenDKIM,并且我仍然可以发送电子邮件,但是当我这样做时:
opendkim-testkey -d example.com -s mail -vvv
我回复说:
opendkim-testkey: using default configfile /etc/opendkim.conf opendkim-testkey: checking key 'mail._domainkey.example.com' opendkim-testkey: No key
如果我用[电子邮件保护]它说
DKIM check: permerror
和result: permerror (no usable key records)
但在电子邮件中,我可以在电子邮件标题中看到我的公钥,其中 s=mail 和 d=mydomain.com 等...
/etc/opendkim/ 将用户和组的设置为 opendkim:opendkim。
我的opendkim.conf:
# This is a basic configuration that can easily be adapted to suit a standard
# installation. For more advanced options, see opendkim.conf(5) and/or
# /usr/share/doc/opendkim/examples/opendkim.conf.sample.
# Log to syslog
Syslog yes
# Required to use local socket with MTAs that access the socket as a non-
# privileged user (e.g. Postfix)
UMask 002
# Sign for example.com with key in /etc/mail/dkim.key using
# selector '2007' (e.g. 2007._domainkey.example.com)
#Domain example.com
#KeyFile /etc/mail/dkim.key
Selector mail
# Commonly-used options; the commented-out versions show the defaults.
#Canonicalization simple
#Mode sv
#SubDomains no
#ADSPAction continue
# Always oversign From (sign using actual From and a null From to prevent
# malicious signatures header fields (From and/or others) between the signer
# and the verifier. From is oversigned by default in the Debian pacakge
# because it is often the identity key used by reputation systems and thus
# somewhat security sensitive.
OversignHeaders From
# List domains to use for RFC 6541 DKIM Authorized Third-Party Signatures
# (ATPS) (experimental)
#ATPSDomains example.com
###########################
# My Config Setup Below #
###########################
AutoRestart Yes
AutoRestartRate 10/1h
SyslogSuccess Yes
LogWhy Yes
Canonicalization relaxed/simple
ExternalIgnoreList refile:/etc/opendkim/TrustedHosts
InternalHosts refile:/etc/opendkim/TrustedHosts
KeyTable /etc/opendkim/KeyTable
SigningTable refile:/etc/opendkim/SigningTable
Mode sv
PidFile /var/run/opendkim/opendkim.pid
SignatureAlgorithm rsa-sha256
UserID opendkim:opendkim
Socket inet:12301@localhost
我的 KeyTable 文件:
example.com example.com:mail:/etc/opendkim/keys/example.com/mail.private
我的签名表文件:
*@example.com example.com
任何帮助我都会非常感激。
答案1
現在已整理好。
我将公钥放在主部分的 DNS 记录中,而我应该将其放在子域部分,并以 mail._domainkey.example.com 作为名称/子域。