Reputation: 11
I've just install PHPMailer and DKIM and everything seems to be ok. DNS are replicated with DKIM record, RSA key are generated and placed at the right place. But.. result when I send a message is : invalid.
Message contains this DKIM Signature:
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; l=1713; s=dkim;
t=1465233482; c=relaxed/simple;
h=From:To:Date:Subject;
d=xxxxx.xxx; i=root@localhost;
z=From:=20=3D?UTF-8?Q?La_Mod=3DC3=3DA9ration_de_CA?=3D=20
|To:[email protected]
|Date:=20Mon,=206=20Jun=202016=2019:18:02=20+0200
|Subject:=20Suppression=20de=20votre=20compte;
bh=IzoJggwtPQOV/aIyy0WsyBQ2qKwcfHgljU7aOHPA+JI=;
b=
Signature Information:
v= Version: 1
a= Algorithm: rsa-sha256
c= Method: relaxed/simple
d= Domain: xxxxx.xxx
s= Selector: dkim
q= Protocol: dns/txt
bh= IzoJggwtPQOV/aIyy0WsyBQ2qKwcfHgljU7aOHPA+JI=
h= Signed Headers: From:To:Date:Subject
b= Data:
Public Key DNS Lookup
Building DNS Query for dkim._domainkey.xxxxx.xxx
Retrieved this publickey from DNS: v=DKIM1; k=rsa;p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCh4qoAjuc4qrO01aWQ2wjRnbyuI3wKliRsjbPvGE4neh2ac8WiOyZeuPPoq6LuqNLQbzgkpB49b7Za88D5AOACx7RxY0ahjDF+H76us1BI62yZnAiwhS27aLNlI7DqbbcNURjRNIod/zRs/i1Empgpqf2WFLqneNS/lcADiEA7GQIDAQAB
Validating Signature
result = invalid
Details: bad identity
Something wrong.. but what ? Is it normal that "b= Data:" is empty ? When I have a look inside de PHPMailer Class, it's pretty normal, code is 'b=;' and nothing else.
Could someone be able to give me more explanations ?
Thanks a lot
FZ
Upvotes: 1
Views: 982
Reputation: 37730
Something is up with your config = the b
param should not be empty. If you look at the code you'll see that the base64-encoded signature appended to that string via the response from the DKMIN_sign
function, which must mean that something is going wrong inside that function, specifically, the call to openssl_sign
must be failing, most likely that it's failing to get your private key.
Upvotes: 1