emersion / emersion/go-message

Textproto should handle missing boundary in a better way ?

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

Description

When dealing with spam you find lots of malformed messages like some missing the final boundary in multipart messages.
In cases like this the parser returns an encapsulated EOF error like so ` multipart: NextPart: EOF` from https://github.com/emersion/go-message/blob/b27fd96b0a989dd508c23531540704675d4d0ca1/textproto/multipart.go#L262
That is hard to detect in the calling code. It would be better to have a named error instead like missing boundary which can be detected in calling code because the message is actually parsed so the error should not fail the whole process

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.