-
-
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
Use Q-encode to wrap too long headers #1840
Conversation
This comment has been minimized.
This comment has been minimized.
The test case should be updated for the new format, however I'd say that it's not quite correct anyway - that example should be using |
As for the test case, this is fixed in Regarding the charset selection, isn't this a separate issue of |
Yes, exactly that (though 7bit is a CTE, not a charset). A call to |
I wonder if this will fix #1525 as well?! |
Can you illustrate why UTF-8 is more excessive in this case:
Isn't |
While the content is indeed identical and compatible, marking it as UTF-8 requires firing up a complete unicode engine to decode it on the receiver, which is unnecessary overhead if we know in advance it's plain ASCII. In PHP for example, we would not be able to decode it easily if we didn't have the It's like putting literal IPs first in SPF records; it's not a requirement, but it makes life easier for receivers. |
Previously, headers were Q-encoded using the message charset, e.g. UTF-8. This is excessive for ASCII values, as it requires a unicode engine. Now, we use ASCII if we only find 7-bit characters.
I think so. @Synchro Maybe you could have a
|
Previously, we calculated the maximum line length for header encoding both for B- and Q-encoding, even though they share the same limits. Now, we calculate these once for both.
This was a great bit of work, solving several long-standing bugs that I'd been procrastinating about! Thank you very much for all your effort. This set of changes and other things that have happened lately mean that I will release this as PHPMailer 6.1 soon. Would you be interested in joining the PHPMailer org? |
@Synchro Thank you for your reviews and the merge. And sure, feel free to add me to the org. I might like to tackle the header name vs. header value line length limitation at some point. |
Fixes #1469.
Fixes #1525.