-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dkim fails with Altbody #1352
Comments
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$subject = 'TEST';
$HTMLmessage = '
<html>
<body>
<p>
<b>Message</b> de test en html
</p>
</body>
</html>';
$TEXTmessage = 'Message de test en text';
$mail = new PHPMailer();
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'xxxxxxxx'; // Specify main and backup SMTP servers ns0.ovh.net
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'xxxxxxxx'; // SMTP username
$mail->Password = 'xxxxxxxx'; // SMTP password
$mail->SMTPSecure = 'tls'; // tls sur port 587, ssl sur port 465
$mail->Port = 587; // TCP port to connect to
$mail->From = "xxxxxxxx";
$mail->FromName = "xxxxxxxx";
$mail->AddAddress("xxxxxxxx");
$mail->Subject = $subject;
$mail->IsHTML(TRUE);
$mail->Body = $HTMLmessage;
$mail->AltBody = $TEXTmessagetext; //if I disable this, it pass
$mail->Encoding = "base64";
$mail->DKIM_domain = 'xxxxxxxxx';
$mail->DKIM_private = 'dkim/dkim.private';
$mail->DKIM_selector = 'xxxxxxx';
$mail->DKIM_passphrase = '';
$mail->DKIM_identity = $mail->From;
if(!$mail->Send())
{
$error_message = "Mailer Error: " . $mail->ErrorInfo;
echo $error_message;
} else
{
$error_message = "Successfully sent!";
echo $error_message;
} |
When it pass (without altbody) I have :
But with altBody it fail and I have :
|
Strange. Those headers are correct – if you have an Can you try without |
I test without $header variable and without Encoding or with quoted-printable but it always fail. |
Thank you for helping me, do you have another idea ? |
Hello @Synchro , I have the same problem on one server.
Validation of the above code on DKIM is fail. If I set as an empty string I have a problem only on one server, on the other not (they have different configurations). I tried setting DKIM_copyHeaderFields to true / false, but it did not help. Similarly, the presence of DKIM_extraHeaders did not help. I'm testing on the released version 6.0.5 and on the current Master. Is it possible that this may cause updating the post server (Postfix) or something? Any version about June this year? Because everything worked at the beginning of the year. Do you have any idea where can be a problem please? Thanks! |
@zdenekvecera : Just a passing thought (I could be completely off-base here), but are you using Gmail to send emails by any chance? I've seen some weird, unexpected behaviour there before, which sometimes needed outbound emails to be formed in non-recommended or non-standard ways in order to work properly in some weird cases. (Not having a go at Gmail here of course.. I actually use Gmail myself, have done so for many years, and I like their service.. but just sharing it as a possible idea, as it is something I've encountered before). |
Addition to this post #1352 (comment): Headers (returned by site http:https://www.appmaildev.com/en/dkim):
DKIM fail:
|
@Maikuolan: I'm sorry but I do not use Gmail for sending. |
When I set a empty Headers (returned by site http:https://www.appmaildev.com/en/dkim):
DKIM pass:
|
Hm, okay. It was an idea, anyhow. Must be something else then. :-) |
As an FYI, I have the same issue. Nothing more to add however. Just want to stay informed if a fix every comes. I can be a tester if you want. Thanks in advance. Just can't use DKIM and AltBody. |
I'm using the version '6.1.7', still the same problem. Doesn't works if there is an AltBody, To not add a text version of the body lower the score of the email :/ |
Same issue with 6.6.0. When I add an AltBody, the DKIM check fails. |
I was also suffering from this problem. I finally found a solution - at some point, the "mime preamble" was being removed from my messages - either by my outgoing mail server or the receiving ones, who knows. My fix was to remove the mime preamble from ever entering the message in the first place.
change to:
|
Hi,
When I use phpmailer (6.0.3) without AltBody DKIM pass but when I add AltBody DKIM fail.
Would you know why ?
Best regards,
My code :
The text was updated successfully, but these errors were encountered: