Hello Everyone

RFC 5322 (https://www.rfc-editor.org/rfc/rfc5322#section-3.5) allows for 
messages without bodies.
` A message consists of header fields, optionally followed by a message body 
`

However, the net/mail . ReadMessage returns an error when an email does not 
contain a body.
To demonstrate this I have written a small program (attached) that shows 
the difference in values returned by mail.ReadMessage when the input email 
message ends in
1. a 'field' where field is defined as in RFC5322. with focus on the fact 
that 'field' ends in  a single CRLF
2. a body. In this specific case, I have chosen to use an empty body. Email 
is constructed by appending 2 consecutive CRLFs to the message from (1). 
The first CRLF is to separate the header from the body and the second to 
terminate an empty body

Is this a bug in the go standard library?

-Karan

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/23603880-d5c8-415c-b467-ba42e09cdb10n%40googlegroups.com.

Attachment: email.go
Description: Binary data

Reply via email to