-
-
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 signature fails with attachment #1655
Comments
The boundary for DKIM is not correct, at the moment it´s a tab it should be a witespace. This fixes PHPMailer#234 and PHPMailer#1655 .
I have been using DKIM icw attachments without any problems.
|
I'm also having the problem that emails with attachments are failing the dkim checks.
DKIM Verifier for TB is JavaScript, I found this function in it: I assume we should compare that with: But to be honest I'm running out of steam having spent 2 days on this topic, and not at all sure that I have quoted relevant code above, mayhap the problem is elsewhere. But I hope I can trigger some help / feedback. And of course, many thanks to all involved in PHPMailer! Tim |
I now also tested the email with https://dkimvalidator.com/ - same result, fail, body has been altered. |
@timreeves are you using 6.1.5? |
@Synchro wow you are quick! No, 6.1.4 - but I only picked it up from Github a few days ago, is there a new version already? |
I released it just a few days ago, and there are quite a lot of DKIM changes in it. See release notes. |
I fetched 6.1.5, restarted FPM to be sure no php in cache, and tried it again - unfortunately no, still failing with attachments. If you tell me exactly what you need I can upload files / excerpts. Thanks! |
I have now tested 6.1.5 with HTML and Plain Text bodies, without attachment, the signature is valid. I will proceed with my PHPMailer Wrapper suppressing signing when an attachment is present. It's not great, but I can move on. |
To add an AltBody make the DKIM fail too, I suppose that it's linked |
As you will have no doubt noticed, testing DKIM is quite difficult, time consuming, and largely depends on using external tools, often with annoying limitations. To make that easier I've been working on the PHPMailer DKIM Validator, and eventually this should allow DKIM tests to become part of the test suite without involving any external domains or DNS. It's still not quite there yet but once that's working properly it will be much easier to diagnose DKIM problems, unit test, and prevent regressions. It's likely that it would be useful for other PHP mail libraries too as they all suffer the same testability problem. |
@Synchro wish you good luck, can't wait that all of this go forward. 👍🏻 |
Same here. Signature fails when adding Image (AddEmbeddedImage). |
Same error here with latest PHPMailer (6.2) on debian 9 Stretch server (OVH VPS). DKIM signature is OK without attachment but fails when using addAttachment or addStringAttachment with a pdf file. Anyone found a fix for this? |
Hi, thank you for phpmailer! I use exim to handle DKIM preparation, works even faster, because process dedicated and optimised for email sending/receiving is handling it. So in case you do not have it working. You can do the same by following these docs: https://exim.org/exim-html-4.93/doc/html/spec_html/ch-dkim_spf_and_dmarc.html until this gets fixed. But you can do the same with postfix and sendmail, by following these guides:
Or any other, there are plenty of them online. :-) Hope it helps :-) |
I would always recommend getting your mail server to do DKIM signing for you if you can! |
Hi, first of all thank you for your work.
It's been a few months now that I haven't been able to solve my problem even with the most recent PHPMailer. Sending an email without an attachment is always correctly done but I've never been able to have a valid signature when adding a PDF as attachment. I even tried the
mentionned by gothge on 30/11/2017
Also I have seen there was an issue before with attachments that seemed to even having been tested but no luck on my side. Maybe I'm missing something? Even though I did read the recently added example.
By just removing the 2 lines that adds my attachment I get a correctly signed DKIM email.
The text was updated successfully, but these errors were encountered: