php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #65760 Add content-type to imap_fetch_overview()
Submitted: 2013-09-25 15:38 UTC Modified: 2013-09-25 18:31 UTC
Votes:2
Avg. Score:4.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: mail at nikha dot org Assigned:
Status: Wont fix Package: IMAP related
PHP Version: Irrelevant OS: Linux
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mail at nikha dot org
New email:
PHP Version: OS:

 

 [2013-09-25 15:38 UTC] mail at nikha dot org
Description:
------------
---
From manual page: http://www.php.net/function.imap-fetch-overview
---
this function should also return an object reflecting the values in the header 
line "Content-Type:". This is as necessary for mailbox overviews as the other 
lines, the function reflects: Overviews should show, whether mails have 
attachments or not!

Test script:
---------------
no special code for this! 

My script first calls this function. But the missing content-type object forces me later to re-fetch the header of every mail to parse the "Content-Type:". This works, but is a considerable overhead, that could be avoided, if it's provided by the single call of this function.

(And is really stupid, because the function must parse the mail headers anyway, why not this line too?)

Expected result:
----------------
An additional object returned by this function, named "type" or whatever you 
like, with at minmum two values: "text" or "multipart". (May also provide 
subtypes like "plain", "mixed" etc, but this is less important)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-09-25 15:55 UTC] mail at nikha dot org
-Summary: Add a content-type obejct to imap_fetch_overview() +Summary: Add content-type to imap_fetch_overview()
 [2013-09-25 15:55 UTC] mail at nikha dot org
Sorry, I mean an additional _property_ of the object, not a new object!
 [2013-09-25 16:20 UTC] aharvey@php.net
-Status: Open +Status: Wont fix
 [2013-09-25 16:20 UTC] aharvey@php.net
This would need to be added to c-client before we could implement it — right now, 
ENVELOPE structs returned from mail_fetch_structure() (which is the underlying 
function) only include the properties that imap_fetch_overview() returns.

Closing for now, since this would require upstream changes. Please reopen this 
request if and when those occur.
 [2013-09-25 18:10 UTC] mail at nikha dot org
to aharvey@php.net:

Sorry, that is absurd and cannot be true! If the underlying function IS 
"imap_fetchstructure()", then you HAVE the type information! It's the first 
property of the object, returned by imap_fetchstructure()!

simply add it to the return of the calling "imap_fetch_overview()"! Do this, and 
do not close this request!!!
Thanks
 [2013-09-25 18:27 UTC] mail at nikha dot org
Sorry again, aharvey@php.net:

You mention "mail_fetch_structure()" in the c-lient, I was confusing it with 
"imap_fetchstructure()" from the PHP extension.

Probably you are right, but try to add this damned content-type as soon as 
possible, it whould so extremely usefull!

Thanks.
 [2013-09-25 18:31 UTC] aharvey@php.net
The problem is that the type returned by imap_fetchstructure() is contained in 
the body struct c-client returns, not the envelope — in order for 
imap_fetch_overview() to return the type, it would have to download the entire 
message rather than just the headers, which defeats the purpose of the function.

As I said, we can't do anything about this in PHP — this has to be changed in c-
client.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 17:01:30 2024 UTC