|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #59152 mailparse part numbers and IMAP
Submitted: 2010-04-09 11:50 UTC Modified: -
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: Assigned:
Status: Open Package: mailparse (PECL)
PHP Version: 5.3.2 OS: Linux Gentoo 2.6.33
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:
New email:
PHP Version: OS:


 [2010-04-09 11:50 UTC]
While writing an IMAP server I needed to parse mime mails 
serverside (it's a feature of imap servers).
Mailparse saved me, however part ids in mailparse do not 
match imap part ids.

Ref: RFC 3501 page 55

In IMAP, when a multipart is found at the root of the mail, 
or if its parent is a message/rfc822 part, it is "merged" 
with its parent.
For example my test email has the following ids:


1: multipart/mixed us-ascii
1.1: text/plain us-ascii 8bit
1.2: message/rfc822 us-ascii 8bit
1.2.1: multipart/mixed us-ascii 8bit multipart/alternative us-ascii 8bit text/plain iso-8859-1 8bit text/html iso-8859-1 8bit application/msword us-ascii


TEXT: multipart/mixed us-ascii
1: text/plain us-ascii 8bit
2: message/rfc822 us-ascii 8bit
2.TEXT: multipart/mixed us-ascii 8bit
2.1: multipart/alternative us-ascii 8bit
2.1.1: text/plain iso-8859-1 8bit
2.1.2: text/html iso-8859-1 8bit
2.2: application/msword us-ascii

A way to fetch imap part id (or to "switch" to imap part 
format) would be great (for now I have implemented a routine 
in php to generate imap part ids based on mail structure)


Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon Jul 04 12:03:36 2022 UTC