Skip to content

Empty HTML body, content is considered as attachment #578

Open
@digiwirtual

Description

@digiwirtual

Wrong parsing parts of email, result is empty body and one attachment with wrong parsed html content.

Used config
Image

Problematic email
0-email.zip

  1. Initially, in Structure::parsePart, everything is processed correctly. One part is detected from the email, which is valid – see the output of $parts. Image
  2. However, at line 118, the condition is skipped, and the valid variable $parts is discarded. The code continues at line 123, where the body is re-parsed using the class Part. The result is an invalid $part. Image
  3. The final result is that the Message object does not contain $bodies, but it does contain an attachment where $part is invalid. Image
  4. The solution lies at line 118 – if the valid result ($parts) were not discarded, the issue would be resolved. Image

The actual bug seems to be here, but you'll need to determine that yourself, as I don't have perfect knowledge of the email structure. Maybe other parts of the email should not be considered as empty so condition will work...

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions