-
Notifications
You must be signed in to change notification settings - Fork 18k
mime: BEncoding and QEncoding don't respect the 75 character limit in RFC2047 #12300
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
Comments
Are you noticing bugs because of it? Automatically breaking encoded-words is complicated because of this:
Users can use the charset they want so we cannot be sure where to break encoded-words. Also:
That is why the 75-char limit was not implemented. |
|
Again, are you getting bugs with an email client because of long encoded-words? |
I have not done extensive testing yet. I think at the very least the functions should do folding for UTF-8. |
I don't understand your last question. What do you mean by "header field value"? |
For example: To: "Test" test@test.com "To" and "Subject" would be what I was referring to. Some of the popular languages allow for passing of 4 for the "To" header and 9 for the "Subject" header. So they can take that into account when folding to 75 chars. |
After looking at this a little more, I am not sure that line folding is optional. You seem to think it is optional because of the use of "may" in the excerpt above. However, I believe that whenever they indicate requirement levels, they are capitalizing the keywords. If you notice in RFC 2047, there are several instances where may is capitalized (along with other keywords). Also in RFC 2119 the keywords are capitalized (Event though it does say "These words are often capitalized"). So, it is suspect that it isn't capitalized in the referred to instance. |
I may be wrong, but I believe in English, while "may" is a "soft" qualifier, "may not" is a "hard" qualifier (similar as for "can" and "can not"). The RFC 2119 mentions MAY, but it doesn't mention MAY NOT, while it does mention both SHOULD and SHOULD NOT, etc. Also, in the specific RFC 2047 discussed here, there's (among others) another fragment with "may not", which I believe hints at the "hard"/"can not" meaning (emphasis added by me):
and another similar one just below it:
|
I MAY do a CL to break words in UTF-8 😄 |
CL https://golang.org/cl/14957 mentions this issue. |
@alexcesaro or @bradfitz, do either of you know which release this fix will be included? |
1.6 |
Thanks. |
The new mime.BEncoding.Encode and mime.QEncoding.Encode functions documented here, don't respect the 75 character line limit.
Excerpt from RFC2047:
The text was updated successfully, but these errors were encountered: