Skip to content

net/textproto: fails to parse headers without a body #53854

Description

@kayrus

What version of Go are you using (go version)?

$ go version
go version go1.18.3 linux/amd64

Does this issue reproduce with the latest release?

Yes.

What did you do?

See example: https://go.dev/play/p/q5lkQ1V0vBa

What did you expect to see?

I expect that mail.ReadMessage will return parsed headers with an empty body.

What did you see instead?

No body, no headers, just error:

2009/11/10 23:00:00 EOF

Program exited.

I'm not sure if this behavior aligns with RFC, but I receive emails with zero body from postfix, which should align with RFC.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions