net/mail: Reading messages with empty bodies returns error (EOF) #15632
Labels
FrozenDueToAge
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
Milestone
go version go1.6.1 linux/amd64
Can't read mail messages which are empty. ReadMessage() returns with err = "EOF"
This is due to net/textproto/ReadMIMEHeader -> readContinuedLineSlice() returning an EOF.
Example here:
https://play.golang.org/p/6AYSIRzlwE
Note that mail clients which produce these mail messages are available in the wild, and this specific bug/implementation choice was produced by:
X-Mailer: Apple Mail (2.3124)
A simple fix would probably be to let ReadMIMEHeader in net/textproto/reader.go check if the buffer is empty or not around line 480 instead of just seeing if len(kv) == 0.
The text was updated successfully, but these errors were encountered: