-
Notifications
You must be signed in to change notification settings - Fork 41
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
base64 decoding should not be "strict" #96
Comments
It seems that since |
@andir Did you file a PR against the |
I recently came across this issue while using mailparse with my personal email collection. Per #96 (comment) I filed ia0/data-encoding#102 ia0 responded with 3 possible options, one of which is adding code to I'd like to resolve this issue, but given none of the options are zero change for |
Hi @wathiede , thanks for following up on this! My personal preference would be to add the |
This was resolved with #126 |
I've encountered yet another mail where the base64 decoding using mailparse (with and without my recent change in #95) fails.
The reduced sample looks like this:
If you decode that string with a non-strict (as in not strictly requiring "normalized" base64) it will result in:
If you reencode that string with Python/Ruby/base64 on the CLI you'll get
Which then decodes properly with the mailparse crate.
The way I am currently working around this (with the
data_encoding
crate) is by definining my own BASE64 decoder:I've come to believe that parsing mail with "strict" base64 parsers is just not a good idea. It might work in an ideal world but sadly I've received tons of mails with edge cases over the years :(
My ask for this issue is that we should probably switch to a non-strict decoder for mails. This is perhaps something that is better suited as part of the
data_encoding
library instead?The text was updated successfully, but these errors were encountered: