On Tue, Jul 18, 2023 at 4:36 PM Karan Gupta <karan.gupt...@gmail.com> wrote: > > 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?
I think you are describing https://go.dev/issue/33823, which, as it happens, is fixed in the upcoming Go 1.21 release. Ian -- 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/CAOyqgcW_MRGDG%3Dq832pO69gjVA9MXY5sEF_dRz-LP3SYTrQ8Ag%40mail.gmail.com.