-
-
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
Header lines can be too long #36
Comments
Hi, is there any update on this issue? Using PHPMailer in combination with Sendgrid via (SMTPAPI) and am encountering lots of issues, as the recipients are stored in a custom header. After 72 characters, newlines are inserted, which results in broken e-mail addresses... |
Line breaks in headers are not a problem because they are folded, but that's not what this issue is about - it's about headers being allowed to get too long before they are folded. Can you open a new ticket and be more specific about your problem, provide examples etc? |
Thanks so much for your follow-up. I've posted my issue here: #726 It's a long one. Sorry in advance :-) |
The EncodeHeader function has two problems:
This makes me think that the folding is applied at the wrong point. Header values should be encoded and returned, and folded later after combining with their keys. That said, I don't know if Q and B encoded headers really need their prefixes applied on every line, which is what they are doing at present.
Update: Q and B encodings do need their prefixes repeating on each line because an RFC 2047 'encoded-word' may not contain white space, and thus cannot be folded.
The text was updated successfully, but these errors were encountered: