DusanKasan / parsemail

Simple email parsing for Golang
MIT License
212 stars 138 forks source link

Content-Transfer-Encoding in multipart not respected #23

Open mrtnjcl opened 4 years ago

mrtnjcl commented 4 years ago

I've tried to parse an email where the Content-Transfer-Encoding was specified in the multipart headers, but it was not respected; the Email struct had both TextBody and HTMLBody as raw, undecoded base64 strings.

--_004_LO2P123MB191986C7932A77EC22F3974AA4290LO2P123MB1919GBRP_
Content-Type: multipart/alternative;
    boundary="_000_LO2P123MB191986C7932A77EC22F3974AA4290LO2P123MB1919GBRP_"

--_000_LO2P123MB191986C7932A77EC22F3974AA4290LO2P123MB1919GBRP_
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64

DQpNeSBhY2NvdW50IElEIGlzIDMxNzgyLg0KDQpSZWdhcmRzDQpBaWRhbg0KDQpGcm9tOiBTdXBw
b3J0IHwgR3Vlc3RwbGFuIDxzdXBwb3J0QGd1ZXN0cGxhbi5jb20+DQpTZW50OiAwNyBKdWx5IDIw
xhit commented 1 year ago

Fixed here https://github.com/OfimaticSRL/parsemail