Closed rakoo closed 5 months ago
Thanks for the patch!
sometimes in the bodystructure the key is in upper case; the lib couldn't find it
Maybe we should lower-case keys when populating the map?
sometimes the filename is written as RFC2047-encoded words
Ideally we'd be using Client.options.decodeText
so that users can add support for additional charsets (by default mime.WordDecoder
only supports UTF-8).
Simon Ser @.***> wrote:
Maybe we should lower-case keys when populating the map?
Good idea, this'll make it available for other fields as well
sometimes the filename is written as RFC2047-encoded words
Ideally we'd be using
Client.options.decodeText
so that users can add support for additional charsets (by defaultmime.WordDecoder
only supports UTF-8).
Ah indeed ! I'll use that instead
-- Matthieu Rakotojaona
I didn't know what would be possible, and I was kinda afraid passing the options directly would mess up the clean separation of functionalities. But if that's ok for you, I'll do it :)
-- Matthieu Rakotojaona
Yeah, I'd prefer to pass the options. It's an internal function anyways.
Updated
Note that it's not strictly correct to decode all parameters, as encoded words are only allowed for some parameters and should be left as-is for others… But we do the same in go-message for simplicity's sake and haven't received a bug report about this yet.
Thanks for your patience !
Are there really cases where some values are encoded but we don't want them decoded ? I can't imagine any, but let's see when that happens
This PR fixes two issues: