|  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
Have you experienced this issue?
Rate the importance of this bug to you:

 [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-2018 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC