-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve the tolerance of base64Cleaner #47
Conversation
Inspired by table_a2b_base64 in binascii module of python source code
The PAD will be stripped in cleaning process.
1 similar comment
Thanks, I hadn't seen that python table before. I like this idea, but I don't like that we are not capturing any errors to send back to the software using enmime. From my comment on #46 - It would make sense to add an Errors slice to the base64Cleaner struct, and an errorMalformedBase64 const to errors.go, plus whatever other plumbing is required to surface those errors to the consumer. Perhaps we can keep the original Let me know if you are interested in pursuing this, otherwise I can merge this PR into a feature branch and add the error part myself. |
Maybe we can add a switch that controls the strategy of enmime.For example, if use Strict mode, enmime will generate more errors when meets malformed strings.And use Tolerant mode, enmime will try it best to rebuild the content while only generates some necessary errors. |
Take a closer look at https://github.com/jhillyerd/enmime/blob/master/error.go#L19 We don't need the flag, as the client can filter on |
Inspired by python, for this issure