php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37159 imap_fetchstructure returns wrong encoding
Submitted: 2006-04-21 22:35 UTC Modified: 2006-04-28 00:40 UTC
From: oliver dot block at lycos dot de Assigned:
Status: Not a bug Package: IMAP related
PHP Version: 5.1.2 OS: Unix
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: oliver dot block at lycos dot de
New email:
PHP Version: OS:

 

 [2006-04-21 22:35 UTC] oliver dot block at lycos dot de
Description:
------------
applying imap_fetchstructure to a message return wrong encoding value, if the message has NO Content-Encoding field.

Reproduce code:
---------------
$stream = imap_open($server, $username, $password);

$msg_struct = imap_fetchstructure($stream, $uid, FT_UID);

$encoding = $msg_struct->encoding;



Expected result:
----------------
If I apply this on a message with NO Content-Encoding field,
$encoding should be equal to 0 -- according to RFC2045, Sect. 6.1.


Actual result:
--------------
If I apply this code on a message with NO Content-Encoding field, $encoding is equal to 5.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-04-22 08:11 UTC] tony2001@php.net
This is what IMAP c-client returns to PHP and we can't fix or change it in any way.
If you consider it a bug - please report to c-client developers. Thanks.
 [2006-04-22 13:19 UTC] oliver dot block at lycos dot de
Thanks for your response. I'll do that. 
Yes, it is a bug. I am sure.
 [2006-04-22 15:12 UTC] oliver dot block at lycos dot de
workaround: 
 
check the header for existing 
 
Content-Transfer-Encoding: 
 
field if you receive an object returning encoding equal to 
5. 
 
If there is none, a 7bit encoding should be assumed 
(according to RFC2045). 
 
Best Regards, 
 
Oliver
 [2006-04-27 22:50 UTC] oliver dot block at lycos dot de
With strong support of Mark Crispin, author of the 
c-client library, it turned out, that the bug is neither 
in php nor in the c-client library.  
The cause of the behavior of the imap_fetchstructure 
function is a bug in the imap server of my ISP.  
It does not return imapr4 complaint data. 
 
Best Regards, 
 
Oliver Block
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 08:01:28 2024 UTC