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/quotedprintable: move quoted printable reader/writer to dedicated package #4943
Comments
They look different. In net/mail, it's used for headers and references RFC 2047, which says: 4.2. The "Q" encoding The "Q" encoding is similar to the "Quoted-Printable" content- transfer-encoding defined in RFC 2045. It is designed to allow text containing mostly ASCII characters to be decipherable on an ASCII terminal without decoding. The one in mime/multipart is only a decoder (of RFC 2045, not 2047) and doesn't have an encoder. |
I would prefer that textproto did not transparently decode quoted-printable for me. I would prefer to have an encoding package and do it myself. Reason being that I'm reading an email template where the Content-Transfer-Encoding header is used to specify what to encode the body to, and the body it unencoded because it contains variables. |
I made a CL concerning this issue: https://golang.org/cl/101330049 |
CL https://golang.org/cl/101330049 mentions this issue. |
There is nothing in the standard library yet. For the time being, you can use my package here: http://godoc.org/github.com/alexcesaro/mail/quotedprintable |
CL https://golang.org/cl/132680044 mentions this issue. |
The implementation of quotedprintable.go at https://golang.org/cl/132680044 seems to violate RFC2045. It allows lines greater than 76 characters. Shouldn't these get split with "=\n"? |
That is right. However the 76-characters limit also applies to messages using base64 encoding. That is why I don't think this limit should be enforced in the quoted-printable encoding functions. It should be in a new writer like |
The 76 characters limit is an integral part of the quoted-printable standard, whereas it's only imposed on base64 within a MIME message. So basically, it's a violation for one, and a contextual adaptation for the other. RFC2045:
|
@alexcesaro, et al, the tree is now open for changes. See https://groups.google.com/forum/#!topic/golang-dev/otCULnOjs7I for details. Let's work on MIME early in this dev cycle, instead of at the very end like last time, where we missed it (largely my fault due to holiday schedules). |
Thanks, I just submitted the change: https://go-review.googlesource.com/#/c/1810/ |
@mohamedattahri You are right. Also I had a look at Gomail where I implemented the limit for both base64 and quoted-printable encoding: I used two different writers because the code was too different to be reusable. |
The code concerning quoted-printable encoding (RFC 2045) and its variant for MIME headers (RFC 2047) is currently spread in mime/multipart and net/mail. It is also not exported. This commit is the first step to fix that issue. It moves the quoted-printable decoding code from mime/multipart to mime/internal/quotedprintable. The exposed API is unchanged. Concerns #4943. Change-Id: I11352afbb2edb4d6ef62870b9bc5c87c639eff12 Reviewed-on: https://go-review.googlesource.com/1810 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
The code concerning quoted-printable encoding (RFC 2045) and its variant for MIME headers (RFC 2047) is currently spread in mime/multipart and net/mail. It is also not exported. This commit is the second step to fix that issue. It moves the RFC 2047 encoding and decoding functions from net/mail to internal/mime. The exported API is unchanged. Updates #4943 Change-Id: I5f58aa58e74bbe4ec91b2e9b8c81921338053b00 Reviewed-on: https://go-review.googlesource.com/2101 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit creates the mime/quotedprintable package. It moves and exports the QP reader of mime/internal/quotedprintable. The code is almost unchanged to preserve the commit history. Updates #4943 Change-Id: I4b7b5a2a40a4c84346d42e4cdd2c11a91b28f9e3 Reviewed-on: https://go-review.googlesource.com/5940 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Updates #4943 Change-Id: I082b97ccd787cf91245d39b8d93783732db6f42c Reviewed-on: https://go-review.googlesource.com/6171 Reviewed-by: Nigel Tao <nigeltao@golang.org>
CL https://golang.org/cl/7890 mentions this issue. |
The text was updated successfully, but these errors were encountered: