-
-
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 replace boundary tab with whitespace #1714
Conversation
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 .
Do you have a reference for this? The DKIM RFC does not say this, neither in the definition of simple body canonicalization nor in the examples, which show tabs in headers and body remaining untouched in canonicalized versions. |
UPDATE: RFC Reference in the next comment The error lies in the bodyhash, I did test it against https://www.appmaildev.com/en/dkim (they add a header for the Expected-Body-Hash, so you can check ), https://www.mail-tester.com/ and gmail. This is the body that gets tested in
These is the body that got send and the validators match against:
Here my little test script, the function
|
Okay I had another look. As stated in PHPMailer.php on Line 4296 we are using: So if we take a look in RFC 6376 3.4.4. a) (2)
|
We are not using relaxed body canonicalization, so that does not apply. The |
Well than I really do not know. The question for you all then is, why the |
Being very keen on Postel's law, I'm also very averse to generating contra-RFC output. If DKIM evaluators are not handling tabs for folding correctly, I think a better approach would perhaps be to not use tabs for folding at all. Email RFCs generally assume that whitespace is What would be extra cool is to have some DKIM evaluation built into the unit tests, perhaps using something like this... |
I've just pushed a switch from tabs to spaces in header folding and param separation in master - please give it try and see if it helps. |
It works indeed @SynchroM, thanks for that :) |
The boundary for DKIM is not correct, at the moment it´s a tab it should be a whitespace.
This fixes #1352 and fixes #1655 .