-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
mime: BEncoding and QEncoding don't respect the 76 character line limit in RFC2047 #19617
Comments
Looking at this a little more, it looks like it might just be changing this line from |
Oh, in that case I think this is working as intended. I don't think we want to start returning newlines here. We already broke it up into chunks so another layer can wrap it on the whitespace when putting it into a format requiring short lines. |
@alexcesaro, thoughts? |
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
This should be reopened. It is waiting on developer feedback. |
Reopening, but I don't think we can change the behavior here. We could document it, and/or we could add a new method to do the newline behavior perhaps. |
@bradfitz As far as what these encoders should do, I would think it would depend on if they are trying to implement RFC2047 or just be a QEncoder and BEncoder. I would think if they are just being a Q/BEncoder then they wouldn't add the spaces to break the encoded text into chunks and add "=?utf-8?q?=", etc. If they are trying to implement RFC2047, then they should break into chunks, line wrap, etc. Right now I think it is straddling the line. |
@bradfitz It looks like @alexcesaro may not be responding. Is this waiting on him or can someone else provide feedback on my previous comment? |
@bradfitz Just trying to move this somewhere again. Any response to my previous two comments? |
I no longer have RFC2047 and [QB]Encoder specs in my head, sorry. But I don't think this package should be in the business of adding line breaks. That seems like the job of something write headers. Even today if you try to write a header with newlines, the http package for instance will scrub your newlines (https://play.golang.org/p/vBkBjEU3M4H). I'm not sure anything else even writes them in the standard library? net/textproto only reads them it looks like. If we cared about where newlines go, we need a design for what layer inserts them and why, and maybe it's just automatic at 76, in which case the mime package needs no changes. |
I'm not quite clear on this part. This bug is about the fact that the [QB]Encoder doesn't insert newlines at 76 characters. |
Yeah, I understand. And I'm proposing that perhaps it should not, because adding newlines should be done at a different layer. We need to think about it. |
When you say:
Do you mean the Go developers? |
We are all Go developers. Anybody needs to think about it and propose a plan. |
As a continuation of Issue #12300, mime: BEncoding and QEncoding don't respect the 76 character line limit in RFC2047.
Here is the relevant part from Section 2 of RFC2047. (emphasis mine)
What version of Go are you using (
go version
)?1.8
What operating system and processor architecture are you using (
go env
)?set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=E:\gowork
set GORACE=
set GOROOT=C:\Go
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\graj04\AppData\Local\Temp\go-build930053034=/tmp/go-build -gno-record-gcc-switches
set CXX=g++
set CGO_ENABLED=1
What did you do?
https://play.golang.org/p/vO6pcZgesh
What did you expect to see?
What did you see instead?
The text was updated successfully, but these errors were encountered: