Skip to content
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

Bug in Base64MailCodec #247

Open
sinxwal opened this issue Sep 23, 2024 · 1 comment
Open

Bug in Base64MailCodec #247

sinxwal opened this issue Sep 23, 2024 · 1 comment

Comments

@sinxwal
Copy link

sinxwal commented Sep 23, 2024

In several mail accounts i have noticed this error with message body decoding:
Exception has occurred. FormatException (FormatException: Invalid character (at character 999) ...JuYWxDbGFzcyB0ZCwKLkV4dGVybmFsQ2xhc3 MgZGl2IHsKbGluZS1oZWlnaHQ6IDEwMCU7C...

Error occurs in messages with base64 encoded boundary, see the space symbol here 3 M.

Here is the current decodeData impl (Base64MailCodec decodeData method).
var cleaned = part.replaceAll('\r\n', '');

My workaround is to rewrite it like this:
var cleaned = part.replaceAll(RegExp('\r\n| '), '');

Example message:
boundary

@sinxwal
Copy link
Author

sinxwal commented Sep 23, 2024

@robert-virkus Maybe we can override Base64MailCodec with a custom implementation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant