emersion / emersion/go-message

Not multipart mime spec compliant: Disallows non-whitespace epilogues

Open
#200 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
458
Forks
129
PR merge metrics
No merged PRs in 30d

Description

Here is an [example of an email](https://lore.kernel.org/grub-devel/42C2B09C.1050007@yahoo.fr/raw) that should be successfully parsed. I believe what ends up happening is that [`isFinalBoundary`](https://github.com/emersion/go-message/blob/b9039e0d248fca44779a1653069a855e309d6d18/textproto/multipart.go#L302) never returns true, so the epilogue, the part after the last boundary line, it treated as a part. According to [RFC2046](https://www.rfc-editor.org/rfc/rfc2046#section-5.1.1) the epilogue should be ignored.

`isFinalBoundary`, as the comments above the declaration say, only considered the boundary final only if the boundary is followed by whitespace. But the spec allows for non-white space characters after the final boundary line.

https://github.com/emersion/go-message/blob/b9039e0d248fca44779a1653069a855e309d6d18/textproto/multipart.go#L302-L312

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.