mail icon indicating copy to clipboard operation
mail copied to clipboard

When parsing UTF-7, do not raise exceptions (except for B encodings)

Open pdg137 opened this issue 4 years ago • 6 comments

Fixes #1404 by removing UTF-7 encoding exceptions, calling transcode_to_scrubbed_utf8 like most of the other code, without changing the behavior of B encodings.

Note: it's kind of ugly to have two versions of such an unusual decoding method, and I'm not sure that the kind of UTF-7 encoding supported by the Mail gem is valid for email bodies, but this at least should allow email to be processed without raising exceptions.

pdg137 avatar Aug 15 '20 20:08 pdg137

Hi there @pdg137, first of all, thank you so much for this! We've dropped the lib/mail/version_specific/ruby_1_9.rb file now, could you please rebase these changes onto latest master and I'll look to merge then (if indeed still needed)

mikel avatar Dec 03 '22 09:12 mikel

Sure! I can get to that in a day or two. But do you have any thoughts about just abandoning UTF-7 support for email bodies? I can look into it some more but expect it's only used for spam and even then just for a tiny fraction of it.

pdg137 avatar Dec 04 '22 04:12 pdg137

Okay, how does this look?

pdg137 avatar Dec 07 '22 20:12 pdg137

Could you remove the "More work needed" label or let me know what else you are looking for?

pdg137 avatar Apr 26 '23 03:04 pdg137

Please let me know if you have more comments on this PR.

pdg137 avatar Feb 06 '24 22:02 pdg137