emersion / emersion/go-message

Support fallback/ignore encoding

Open
#192 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

Hey there! 👋

I'm using go-message for an email archiving application and ran into a challenge with emails that have invalid encoding.

The problem happens in the encodingReader function (https://github.com/emersion/go-message/blob/master/encoding.go) when it encounters malformed content.
For example, this email snippet:
```
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

===

Hello, World!


This has some =ZZ invalid quoted-printable stuff.


Another example: =


This text after the invalid parts never gets processed.

```
The reader fails at the first invalid sequence, and we can't get any of the content.

For archiving purposes, I'd love an option to just get whatever content is available, even if some parts can't be decoded perfectly. I'm prioritizing content preservation over perfect rendering.

Maybe an option to skip encoding validation via Options?

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.