mail
mail copied to clipboard
When parsing UTF-7, do not raise exceptions (except for B encodings)
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.
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)
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.
Okay, how does this look?
Could you remove the "More work needed" label or let me know what else you are looking for?
Please let me know if you have more comments on this PR.