emersion / go-imap

📥 An IMAP library for clients and servers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

v2: `Envelope.Subject` sometimes gets `=?` encoded data

Vovan-VE opened this issue · comments

2.0.0-alpha.4

Using imapclient to fetch messages, Envelope.Subject sometimes returns encoded subject like:

=?koi8-r?B?UkU6IPrE0sHX09TX1crUxS4=?=

instead of RE: Здравствуйте. in this example. Exact conditions are unknown yet, unfortunely, because it's very rare.

The same messages in the same app instance parsed with github.com/emersion/go-message/mail CreateReader()... have correct results. Charsets are imported:

import _ "github.com/emersion/go-message/charset"

Do you also set imapclient.Options.WordDecoder to &mime.WordDecoder{CharsetReader: message.CharsetReader}?

This is probably something which should be added to the docs or the wiki.

No, didn't discover it yet. I'll try, thanks.

It looks like WordDecoder helped. Thanks!