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: accept invalid quoted-printable as unquoted #13219
Comments
Please provide a sample of such an invalid input. |
Attached. This attachment (was *.eml) can be opened with Thunderbird but when parse through Golang, will give the error: quotedprintable: invalid hex byte 0x22 string as below will fail. |
Relevant bits below. Looks like "Microsoft CDO for Exchange 2000" basically just lies about quoted printable.
|
I encountered another bad email which need these lines to be commented out too. In fact, I noticed many of Golang stdlib (mostly on email parsing as I am using these frequently) return error once they encounter error and do not try whether it can do something else. I reported once which was closed #13448. After that actually I found there are many of them too. Another example will be this, why must return? why not finish all first? and return everything that you find good as well as the error - some special error to indicate there are still some useful data. User of this library can then decide whether to ignore the error or not and take whatever good. I understand this is not some kind error but the fact is the Golang stdlib returning nil or insufficient data once it encounters error (some avoidable or recoverable errors) forced me to move away from stdlib because the need to create compatible email client as Thunderbird using Golang. Still, I believe Golang can do better. |
@cention-sany This specific issue is not the place to discuss the general handling of format errors in the Go standard library. That is appropriate for the golang-dev mailing list. |
CL https://golang.org/cl/32174 mentions this issue. |
golang version: 1.5.1
There are some emails use the equal sign in-appropriately without escape it with =3D. This will make golang library fail to parse this kind of email. But some mail clients such as Thunderbird able can parse these malformed emails.
If this line change to
break
then more emails can be successfully parsed. Or return certain error which indicate it is safe to bypass it.The text was updated successfully, but these errors were encountered: