|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73110 Mails with header mime-version which end with a semicolon gets treated as plain
Submitted: 2016-09-19 06:20 UTC Modified: -
From: jochem dot blok at fasterforward dot nl Assigned:
Status: Open Package: mailparse (PECL)
PHP Version: 5.6.26 OS: Ubuntu 14.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: jochem dot blok at fasterforward dot nl
New email:
PHP Version: OS:


 [2016-09-19 06:20 UTC] jochem dot blok at fasterforward dot nl
We are trying to parse an e-mail with mailparse extension. The header Mime-Version is as follows: "Mime-Version: 1.0;", note the semicolon at the end. Due to this semicolon mailparse treats the mail as text/plain.

Test script:
$tekst = 'Mime-Version: 1.0;
Content-Type: multipart/Alternative; boundary="=====1473780076CSSSMTP_CLIENT=="

Content-Type: text/plain

Hello please pay attached invoice
Content-Type: text/html; charset=utf-8

Hello please pay attached invoice

$stream = fopen('php://memory', 'r+');
fwrite($stream, $tekst);
fseek($stream, 0);
$resource = mailparse_msg_create();
mailparse_msg_parse($resource, fread($stream, 10000));
$data = mailparse_msg_get_part_data(mailparse_msg_get_part($resource, 1));

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-02-06 11:32 UTC] jochem dot blok at fasterforward dot nl
Any update regarding the open bugs in Mailparse? I found another but this very old bug is still not solved?
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Jan 22 01:01:23 2021 UTC