DKIM密钥无效 - 错误的RSA签名

时间:2017-09-18 19:12:54

标签: linux email smtp dkim

我使用 opendkim postfix 在Ubuntu 14.04计算机上设置了DKIM。我生成了RSA密钥对并更新了TXT记录。

www.mail-tester.comwww.dkimvalidator.com等任何DKIM测试人员测试设置时,我会收到错误,例如"结果=失败,错误的RSA签名"。

这是一个示例邮件(来自dkimvalidator.com的信息)。我用mail.example.com替换了真实域名。

DKIM Signature


Message contains this DKIM Signature:
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mail.example.com;
     h=content-type:content-type:mime-version:subject:subject
    :message-id:to:reply-to:from:from; s=dkim; t=1505761379; x=
    1506625380; bh=xp3gKk5P39UaB7IV9Rj58h82gFaIiEDAqCbmUtWe2Yo=; b=s
    ErbZFhFhPQjrOz2dH2RlYMAaN0oUKT7SBJe/bQg5Uxq86VHr7HkHRnnqtw1lkRL6
    Ha6Qd2rXAV+ftc5vL3K3TYojBz8HFigZtmJetjgY1/evk9XnRHtTaRBD6/ZrXtii
    Rsa87O6RsoM7om9brPP8QW01/84nPSonJIIQtobLt0=


Signature Information:
v= Version:         1
a= Algorithm:       rsa-sha256
c= Method:          relaxed/simple
d= Domain:          mail.example.com
s= Selector:        dkim
q= Protocol:        
bh=                 xp3gKk5P39UaB7IV9Rj58h82gFaIiEDAqCbmUtWe2Yo=
h= Signed Headers:  content-type:content-type:mime-version:subject:subject
    :message-id:to:reply-to:from:from
b= Data:            s
    ErbZFhFhPQjrOz2dH2RlYMAaN0oUKT7SBJe/bQg5Uxq86VHr7HkHRnnqtw1lkRL6
    Ha6Qd2rXAV+ftc5vL3K3TYojBz8HFigZtmJetjgY1/evk9XnRHtTaRBD6/ZrXtii
    Rsa87O6RsoM7om9brPP8QW01/84nPSonJIIQtobLt0=
Public Key DNS Lookup


Building DNS Query for dkim._domainkey.mail.example.com
Retrieved this publickey from DNS: v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDIbe1WBW7hf4IbeW8acNXKzi6uQb2UXagkJoLWqGqLaXbnrLmwEjgxzoJQRR7iLq4/niGmI76Nzbc0aASTGYRdAK62/Enjove3W70vl92VSgGy1Tm0oZ+9/4+Z8qLiwikPs+HL961CshehcAMu1aLnVSyMwe77pOlf6ZPG7Lxj5QIDAQAB
Validating Signature


result = fail
Details: bad RSA signature

这是/etc/opendimk.conf

# 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

Domain                  mail.example.com
KeyFile                 /etc/dkimkeys/dkim.key
Selector                dkim

# Commonly-used options; the commented-out versions show the defaults.
#Canonicalization       simple
#Mode                   sv
#SubDomains             no


OversignHeaders         From

TrustAnchorFile       /usr/share/dns/root.key

可能会出现问题,因为我使用像johndoe@mail.example.com这样的子域名来发送电子邮件吗?

1 个答案:

答案 0 :(得分:0)

问题是因为 opendkim 没有侦听指定的套接字; Postfix无法访问opendkim,因此电子邮件未签名。

相关:https://serverfault.com/questions/847435/cant-change-opendkim-socket-in-debian-stretch-in-etc-default-opendkim