0
votes

I hope somebody can help me as I've been pulling my hair out and burning the candle at both ends for over a week now!

Ok, before anyone says anything, yes I will show all passwords and DKIM strings, I'm going to drop this domain once I get things working, I've just gone back to basics to test.

Basically, I have generated DKIM Keys from several sources, DKIM Core, openssl and worxware, I'm currently testing one from worxware, which is...

-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,3C3BC78B0311AA1A

+omRObgdkAdTAZZbWHvbf+E5S6swHoHUr4rW5yp+BmadMlUMT3Jpkm5HJc1Dd26I
bzDAHy9+m9xf3EQLkIcAdNXFwKmgll8AAcJoBRjPDLnt4zmJBgLAyPSZ3h8OI1UE
lHcDjoUVtIWqNDi1uQXwyi3DrftzyLdxeHDpbXDLcy/qyhZsrnvs4smWAvxcLo8g
Fwq1o1IpxQawariOH+C4oxbENCHoCh7WZi0qnECjyPbi4aqvf0SSDAc3eYH9x0+s
c9Ne2DXq7w4sX6md/pd8EChvo8g+OYcuTKSPKZborQibnvrvXs1G+e2kDSF78x/Y
SXhIyXL3WXcAuNwqeGVSKIUMd+HelSWAjnQYI3JI792nzuj0S78WlP0i+oUtcWy+
V+RsLJlWGZJql1KHrXFUdBvMdYhmBhmdNqdyUWOKxgYwHB7EHgvYP4Ho2ijxr3U1
qjczGAr4h5WtHTvBgUp25EwEyhcFAWX1MlAT9+C5qTsO8vDavi/uLI805WyKgwFN
jp7qx2CmlSmpIwPhvrV88ajf119yHveQHYPIfXg2ZOo2AGrJeDmvp0S3B6BSY4EU
1YODRaoZVMQCaJHPkTwEe4hc2IHrA1y6ZcnYpu1K1a81uvXVDzvfylqqG3SjLwfP
iZ6vhC2E/Ncjnvi4eJt9+j67HSA4CYhpxMTvOI+4zrdK/Pucar0saNeFQQnJ3sNM
0cnl+Z/XCH30ERi3GuDAJXWkUkJvKfbk2dwXW8QgdOZIdU+Gj0gDCevdR8wsO5Vr
yDUXIErZcdZvlaqEcviUOBbJ0LMm7d/1DL5QAvVl1an76YT/qChzZQ==
-----END RSA PRIVATE KEY-----

-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDD0IviVSEPKNE+79Ky5vASLiSk
gwuGik0Ct2eeuSxhhF7TJPNBI9BQl6FK3ggdwWcuB6kjCQPdivnuaZi7Ql9CI66T
V5AC/JSbx1D9wkg/jvwCiQIMCWqoIbAgu3SkxlfjzMLyIhZytzlqFQqUSyj4n6BU
IwwDLDviEJna1dj2iwIDAQAB
-----END PUBLIC KEY-----

For PhpMailer I have....

Tried with and without the ->Clear.... Tried Encoding base64, 7bit and without Tried Selector 'default' and 'phpmailer', both are configured in my DNS, however; even if I set to 'phpmailer' then it seems to send 'default'

The code is....

/* Configure PHP Mailer */
$vlMailMessage = new PHPMailer;
$vlMailMessage->ClearAddresses();
$vlMailMessage->ClearCCs();
$vlMailMessage->ClearBCCs();
$vlMailMessage->ClearReplyTos();
$vlMailMessage->ClearAllRecipients();
$vlMailMessage->ClearAttachments();
$vlMailMessage->ClearCustomHeaders();
$vlMailMessage->isSMTP();
$vlMailMessage->SMTPDebug = 2;
$vlMailMessage->Host = 'a2plcpnl0360.prod.iad2.secureserver.net';
$vlMailMessage->Username = '[email protected]';
$vlMailMessage->Password = 'R9#khthnQS';
$vlMailMessage->Port = 587;
$vlMailMessage->SMTPSecure = 'SSL';
$vlMailMessage->SMTPAuth = true;
$vlMailMessage->Encoding = 'base64';

/* Configure Email */
$vlMailMessage->From = '[email protected]';
$vlMailMessage->FromName = 'Admin';
$vlMailMessage->addAddress($em, 'Mail Test');
$vlMailMessage->addBcc('[email protected]');
//$vlMailMessage->addBcc('[email protected]');
$vlMailMessage->addReplyTo('[email protected]', 'Admin');
$vlMailMessage->isHTML(true);
$vlMailMessage->Subject = 'DKIM Test '.$sb;
$vlMailMessage->Body    = "<p style='font-family:Arial, Helvetica, sans-serif;'>Hi,<br /><br />Just trying to configure the DKIM Signature!</p>";
$vlMailMessage->AltBody = "Hi".chr(10).chr(10)."Just trying to configure the DKIM Signature!";

/* Configure Email DKIM */
$vlMailMessage->DKIM_domain = 'dubaidatabase.net';
$vlMailMessage->DKIM_private = 'Proc-Type: 4,ENCRYPTEDDEK-Info: DES-EDE3-CBC,3C3BC78B0311AA1A+omRObgdkAdTAZZbWHvbf+E5S6swHoHUr4rW5yp+BmadMlUMT3Jpkm5HJc1Dd26IbzDAHy9+m9xf3EQLkIcAdNXFwKmgll8AAcJoBRjPDLnt4zmJBgLAyPSZ3h8OI1UElHcDjoUVtIWqNDi1uQXwyi3DrftzyLdxeHDpbXDLcy/qyhZsrnvs4smWAvxcLo8gFwq1o1IpxQawariOH+C4oxbENCHoCh7WZi0qnECjyPbi4aqvf0SSDAc3eYH9x0+sc9Ne2DXq7w4sX6md/pd8EChvo8g+OYcuTKSPKZborQibnvrvXs1G+e2kDSF78x/YSXhIyXL3WXcAuNwqeGVSKIUMd+HelSWAjnQYI3JI792nzuj0S78WlP0i+oUtcWy+V+RsLJlWGZJql1KHrXFUdBvMdYhmBhmdNqdyUWOKxgYwHB7EHgvYP4Ho2ijxr3U1qjczGAr4h5WtHTvBgUp25EwEyhcFAWX1MlAT9+C5qTsO8vDavi/uLI805WyKgwFNjp7qx2CmlSmpIwPhvrV88ajf119yHveQHYPIfXg2ZOo2AGrJeDmvp0S3B6BSY4EU1YODRaoZVMQCaJHPkTwEe4hc2IHrA1y6ZcnYpu1K1a81uvXVDzvfylqqG3SjLwfPiZ6vhC2E/Ncjnvi4eJt9+j67HSA4CYhpxMTvOI+4zrdK/Pucar0saNeFQQnJ3sNM0cnl+Z/XCH30ERi3GuDAJXWkUkJvKfbk2dwXW8QgdOZIdU+Gj0gDCevdR8wsO5VryDUXIErZcdZvlaqEcviUOBbJ0LMm7d/1DL5QAvVl1an76YT/qChzZQ==';
//$vlMailMessage->DKIM_selector = 'phpmailer';
$vlMailMessage->DKIM_selector = 'default';
$vlMailMessage->DKIM_passphrase = '1447649625';
$vlMailMessage->DKIM_identity = '[email protected]';
//$vlMailMessage->DKIM_identifier = '[email protected]';

/* Send Email */
if($vlMailMessage->send()) {
    echo "Sent";
}

In my DNS Zone File TXT I have two entries

defult._domainkey
phpmailer._domainkey

Both with...

v=DKIM1; k=rsa; g=*; s=email; h=sha1; t=s; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDD0IviVSEPKNE+79Ky5vASLiSkgwuGik0Ct2eeuSxhhF7TJPNBI9BQl6FK3ggdwWcuB6kjCQPdivnuaZi7Ql9CI66TV5AC/JSbx1D9wkg/jvwCiQIMCWqoIbAgu3SkxlfjzMLyIhZytzlqFQqUSyj4n6BUIwwDLDviEJna1dj2iwIDAQAB;

And my tests through isnotspam.com and mail-tester.com both fail. The result from mail-tester.com being....

DomainKeys Identified Mail (DKIM) is a method for associating a domain name to an email message, thereby allowing a person, role, or organization to claim some responsibility for the message. The DKIM signature of your message is:

v=1;
a=rsa-sha256;
q=dns/txt;
c=relaxed/relaxed;
d=dubaidatabase.net;
s=default;
h=Content-Type:MIME-Version:Message-ID:Subject:Reply-To:From:To:Date;
bh=7tYFFZGWrvPk1/5Sfj/dbza6mTupPONFamO5Udr9ATs=;
b=Z58axwQs3S/MN7xmdWO1oS6SYEBwN9Pn3irSkpi3v6IiXpRTSvWddJVBZoELGpKeEac0bxzqXb986tfHv1llwSgv+dImQ7f5YM5R0SS3OQ7Q940gvYz6N1cnwwiFL+Ogn7DOfxL6nehn0Z/JM4yqs7K92UV+arm/n2954ZdwjnaSyKyfBiZaTRcBn6qaV/X6rmy8wVc5STawyHTIsxg3dAP+U3akBrt8cucqOaOByv8pPQPAOXRZdLLedN7ojS5ycJvQWzHsLbPBa9N2DXDvVr6fpRUxHEXiqPYRgwFGkdf+maSzeVCzpiMhDpsmdrcmUqTAxuLSVAlrBGUC2didiQ==;

Your public key is:

"v=DKIM1;
k=rsa;
g=*;
s=email;
h=sha1;
t=s;
p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDD0IviVSEPKNE+79Ky5vASLiSkgwuGik0Ct2eeuSxhhF7TJPNBI9BQl6FK3ggdwWcuB6kjCQPdivnuaZi7Ql9CI66TV5AC/JSbx1D9wkg/jvwCiQIMCWqoIbAgu3SkxlfjzMLyIhZytzlqFQqUSyj4n6BUIwwDLDviEJna1dj2iw""IDAQAB;

" Key length: 1024bits

Your DKIM signature is not valid

Can somebody pleaaaaaaaaaaaassssssssssssseeeeeeee help :)

1
Also posted on GitHubSynchro
DKIM_private should be a path like this $mail->DKIM_private = '/path/to/private_key'; - You can also test run a with mailtest, it displays a lot more information then the other two you are using.Henry

1 Answers

1
votes

If that's your real code, then the problem is a typo. You have:

$vlMailMessage->DKIM_selector = 'default';

and later

defult._domainkey

Notice that one has an "a" in "default" and the other does not.