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

Handle large mime files parsing errors #8532

madhugb opened this issue Jul 11, 2019 · 0 comments

Handle large mime files parsing errors #8532

madhugb opened this issue Jul 11, 2019 · 0 comments


Copy link

@madhugb madhugb commented Jul 11, 2019

ProcessLine method returns error when it identifies a mime that contains more than 300 children. MimePart::parse is not handling this error which causes the ProcessLine to log an error for every line of the mime.

This bug was fixed in PECL mailparse-v3.0.3 which was not ported hhvm library.

Bug -
Fix - php/pecl-mail-mailparse@8aa8c3d

I have tried to simply port these fixes to HHVM.

HHVM Version

$ hhvm --version
HipHop VM 4.0.4 (rel)
Compiler: 1558567803_N
Repo schema: 3db73d7601eff5f54a8e907a42a71f8c7bfae2cb

Operating System and Version

MacOS Mojave 10.14.5

Standalone code, or other way to reproduce the problem

Pass a large email (with more than 300 attachments) to MimePart::parse method.

MimePart::parse(<large file>, <size>)

Actual result

  • Generates lots of MIME message too complex errors.
  • Full parsed MIME resource is not returned.

Expected result

  • Should generate a single MIME message too complex error
  • MimePart::parse should return false
zuercher added a commit to zuercher/hhvm that referenced this issue Oct 21, 2019
Aborts mail message parsing when the maximum number of MIME parts
has been reached, rather than continuing to process message lines.

Fixes facebook#8532
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant