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

Incorrect handling of body_text_encoded results in lots of NULL chars #24

Open
FlyingDR opened this issue Jun 2, 2022 · 2 comments · May be fixed by #25
Open

Incorrect handling of body_text_encoded results in lots of NULL chars #24

FlyingDR opened this issue Jun 2, 2022 · 2 comments · May be fixed by #25

Comments

@FlyingDR
Copy link

FlyingDR commented Jun 2, 2022

As part of haraka/Haraka#2737 which was included in Haraka since 2.8.26, there was an unexpected change of the type of Body.body_text_encoded from string to Buffer. Moreover, the new Buffer is of fixed size and requires Buffer.slice() to get actual contents.

Of course, it is a question to Haraka developers about reasons to change types in patch-level release, but it is possible that they're treating Body.body_text_encoded as an internal property.

Anyway, this change caused getBodyOfTypeFromChildren function to return a 64kb string mostly filled with \u0000 chars in a case if body_text_encoded was selected as a source.

@thenitai
Copy link
Member

thenitai commented Jun 2, 2022

Hi,

We already fixed this, but as we are processing over 500,000/emails/day we are always holding back before making releases so we can test everything properly.

That said, please test with the latest develop branch as this contains the one we have been using / fixed since the latest release. Let me know if that still fails. Thank you.

@FlyingDR
Copy link
Author

FlyingDR commented Jun 2, 2022

Hello,

Thank you for fast response. I've tested with current HEAD of the master (b2b8668) and develop (d2057cc) branches and issue is still there.

Here are the results of processing a very simple email, it is the contents of the _email variable at this point of code. Added .txt extension because GitHub does not allow adding attachments in JSON.

The difference is pretty obvious.

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

Successfully merging a pull request may close this issue.

2 participants