Skip to content

Bug in multipart parsing #411

@g-regor

Description

@g-regor

Multipart mime types are improperly parsed. By standard, the last boundary has "--" appended, which the parser doesn't account to. This produces an erroneous mime part with only "--".

MIME-Version: 1.0
Content-Type: multipart/alternative;
 boundary="===============0438762424560383716=="
Subject: Subject
From: sender@localhost
To: receiver@localhost
Date: Sat, 23 Jul 2022 18:08:29 -0000
Message-Id: <165859970975.49072.13986632326735601263@localhost>

--===============0438762424560383716==
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit

Text message

--===============0438762424560383716==
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: 7bit
MIME-Version: 1.0

<!doctype html><html><body><b>HTML</b> message</body></html>

--===============0438762424560383716==--

The above email produces 3 mime parts.

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions