php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35011 imap calls hang
Submitted: 2005-10-29 02:18 UTC Modified: 2005-11-10 01:00 UTC
Votes:3
Avg. Score:5.0 ± 0.0
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:1 (33.3%)
From: ckryzan at prosidio dot com Assigned:
Status: No Feedback Package: IMAP related
PHP Version: 4.4.0 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ckryzan at prosidio dot com
New email:
PHP Version: OS:

 

 [2005-10-29 02:18 UTC] ckryzan at prosidio dot com
Description:
------------
I am having a very similar issue, and it is very 
reproduceable. The imap_fetchstructure(), imap_headers() and 
imap_headerinfo() calls all fail -- without returning any 
value whatsoever -- for what I have narrowed down to the 
following condition: When the attachment file size is big 
(>1MB it seems), these calls hang without returning. It is 
very reproduceable, and I did a rather comprehensive set of 
tests to determine what was triggering these calls to hang, 
and this seems to be the culprit.

Reproduce code:
---------------
	// Open an IMAP stream using the email configuration data
	$mailbox = imap_open("{".$this->data['server']."}INBOX",$this->data['user'],$this->data['password']);
	if (!$mailbox) return false;	// If the stream is unable to be opened, return false
	
	// Extract content from messages
	for ($i=1; $i<=imap_num_msg($mailbox); $i++) {	// Iterate through all of the headers

		// Retrieve the message overview
		$header = imap_headerinfo($mailbox,$i);	// Retrieve an overview of the information contained in the message
		
print_r($header);
		// Retrieve the message structure
		$structure = imap_fetchstructure($mailbox,$i);	// Retrieve the structure of the message
print_r($structure);
		}
		


Expected result:
----------------
I would expect the header and structure to be printed for each 
message in the mailbox. This does, in fact, happen, until it 
encounters a message with an attachment that is relatively big 
(>1MB more or less). At that point, I would expect it to 
continue. Instead, the functions (pick any one of the three I 
mention) simply hang, without returning any value. This is 
connecting to a POP3 server. I can easily download the 
messages to my desktop email client, repeatedly, by the way.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-02 14:20 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip


 [2005-11-10 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 11:01:34 2025 UTC