Skip to content
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

net/mail: ReadMessage fails with messages that have an empty body #24256

Closed
hbbio opened this issue Mar 5, 2018 · 3 comments
Closed

net/mail: ReadMessage fails with messages that have an empty body #24256

hbbio opened this issue Mar 5, 2018 · 3 comments
Milestone

Comments

@hbbio
Copy link

@hbbio hbbio commented Mar 5, 2018

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

1.10

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

Could do, but not relevant

What did you do?

Parsing emails from Apple Mail with net/mail.ReadMessage fails with EOF. Indeed some emails (typically: Calendar invites) have no body. This might violate the spec, but still is common.

What did you expect to see?

As described in #15632, ReadMessage should accept a missing body.

What did you see instead?

Returns error EOF.

@hbbio hbbio changed the title Duplicate of #15632 ReadMessage fails with messages that have an empty body (#15632) Mar 5, 2018
@bradfitz bradfitz changed the title ReadMessage fails with messages that have an empty body (#15632) net/mail: ReadMessage fails with messages that have an empty body Mar 5, 2018
@bradfitz bradfitz added this to the Unplanned milestone Mar 5, 2018
@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Mar 5, 2018

Again, like in #15632, we need more information.

Where/how do you get such emails? How does this arise?

@hbbio
Copy link
Author

@hbbio hbbio commented Mar 6, 2018

Here is a sample message, this being the full message (some parts redacted). As I said, this is a calendar invitation sent from Exchange which contains strictly no body.

BEGIN:VCALENDAR
METHOD:PUBLISH
PRODID:Microsoft Exchange Server 2010
VERSION:2.0
BEGIN:VTIMEZONE
TZID:Romance Standard Time
BEGIN:STANDARD
DTSTART:16010101T030000
TZOFFSETFROM:+0200
TZOFFSETTO:+0100
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10
END:STANDARD
BEGIN:DAYLIGHT
DTSTART:16010101T020000
TZOFFSETFROM:+0100
TZOFFSETTO:+0200
RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3
END:DAYLIGHT
END:VTIMEZONE
BEGIN:VEVENT
ORGANIZER;CN=Henri Binsztok:MAILTO:(redacted)
SUMMARY;LANGUAGE=en-US:(redacted)
DTSTART;TZID=Romance Standard Time:20161103T093000
DTEND;TZID=Romance Standard Time:20161103T100000
UID:040000008200E00074C5B7101A82E00800000000412CFA04FE25D201000000000000000
 01000000036A5936C5FB86A4394645DFA5DB4A769
CLASS:PUBLIC
PRIORITY:5
DTSTAMP:20161014T093334Z
TRANSP:OPAQUE
STATUS:CANCELLED
SEQUENCE:0
LOCATION;LANGUAGE=en-US:
X-MICROSOFT-CDO-APPT-SEQUENCE:0
X-MICROSOFT-CDO-OWNERAPPTID:2114613569
X-MICROSOFT-CDO-BUSYSTATUS:FREE
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
X-MICROSOFT-CDO-ALLDAYEVENT:FALSE
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-CDO-INSTTYPE:0
X-MICROSOFT-DISALLOW-COUNTER:FALSE
BEGIN:VALARM
DESCRIPTION:REMINDER
TRIGGER;RELATED=START:-PT15M
ACTION:DISPLAY
END:VALARM
END:VEVENT
END:VCALENDAR

Edit: I scanned all my mailboxes, and these calendar messages are the only instances where EOF happens.

@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Mar 6, 2018

That's not an email MIME message.

@hbbio hbbio closed this Mar 6, 2018
@golang golang locked and limited conversation to collaborators Mar 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.