Skip to content

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

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pdg137
Copy link

@pdg137 pdg137 commented Aug 15, 2020

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.

@mikel
Copy link
Owner

mikel commented Dec 3, 2022

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 mikel added this to the 2.9.0 milestone Dec 3, 2022
@pdg137
Copy link
Author

pdg137 commented Dec 4, 2022

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
Copy link
Author

pdg137 commented Dec 7, 2022

Okay, how does this look?

@pdg137
Copy link
Author

pdg137 commented Apr 26, 2023

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

@pdg137
Copy link
Author

pdg137 commented Feb 6, 2024

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

@pdg137
Copy link
Author

pdg137 commented Sep 24, 2024

I looked into this a little more and made #1618.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Invalid utf-7 data in body causes exceptions
2 participants