FlowCrypt / flowcrypt-browser

FlowCrypt Browser extension for Chrome and Firefox
https://flowcrypt.com
Other
374 stars 46 forks source link

Update emailjs library files #5344

Open sosnovsky opened 1 year ago

sosnovsky commented 1 year ago

Yeah, but I've made various fixes in the library without upstreaming them. So it may be a messy process. Hopefully we have tests for that. But right now, I recommend to just bring the patch here and file updating the library for another issue.

Originally posted by @tomholub in https://github.com/FlowCrypt/flowcrypt-browser/issues/5310#issuecomment-1662204817

sosnovsky commented 1 year ago

emailjs library was deprecated and replaced by https://github.com/nodemailer/libmime/, so we should use it instead as it's already includes fixes for some issues which we fixed manually (like encoding filenames with utf-8 symbols and emojis)

tomholub commented 1 year ago

yeah but that sounds like quite the task. I'd wait at least until manifest v3 is implemented.

tomholub commented 1 year ago

and i'd wait me even after that, unless there is particular pain point with email js

sosnovsky commented 1 year ago

I was trying to fix encoding of attachment names with special symbols, but manually fixing emailjs code still caused other bugs. I checked https://github.com/nodemailer/libmime/ code and it's quite similar to emailjs, so I replaced functions related to attachments encoding with similar ones from libmime and it works well.

I tested encrypted messages and password-protected messages on FES - attachment names encoded well in both cases. Maybe for now it'll be enough, but if there will be any issues with mime encoding/decoding - we can just check updated code from libmime and test if it fixes found issue.

tomholub commented 1 year ago

i see. ok