php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24716 imap_fetchstructure() hangs on certain messages
Submitted: 2003-07-19 10:25 UTC Modified: 2003-09-18 21:10 UTC
From: akropel1 at rochester dot rr dot com Assigned:
Status: Closed Package: IMAP related
PHP Version: 4.3.3RC1 OS: OpenBSD-3.0
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: akropel1 at rochester dot rr dot com
New email:
PHP Version: OS:

 

 [2003-07-19 10:25 UTC] akropel1 at rochester dot rr dot com
Description:
------------
Calling imap_fetchstructure() on certain multi-part messages causes an indefinite hang (function never returns) and the script eventually times out. I've been running a database import of an old mail archive and out of about 172,000 messages, 2 seem to induce this hang. Other imap_* functions seem to work fine, including imap_fetchheader() and imap_headerinfo().

The full messages can be found here:

http://www.kroptech.com/~adk0212/failedmsg.1
http://www.kroptech.com/~adk0212/failedmsg.2

Versions:
c-client from imap-2002d
apache_1.3.27

PHP Config:
./configure  --with-apache=/home/adk0212/downloads/apache_1.3.27 --with-sysvsem --with-sysvshm --with-pgsql --with-mysql --with-imap=/home/adk0212/imap-2002d --with-mcrypt --with-gettext --with-xml --with-curl

Reproduce code:
---------------
<?php
$pop_user = "someuser";
$pop_pass = "somepassword";
$pop_host = "somehost.somewhere.com";
$mbox_path = "/path/to/failedmsg.1";
$pop_conn_string = "\{$pop_host:143/imap}$mbox_path";
$pop_conn = imap_open($pop_conn_string, $pop_user, $pop_pass);
// Assuming message-of-death is first one in the mbox
$mimeobj = imap_fetchstructure($pop_conn, 1);
// Never gets here...
imap_close($pop_conn);
?>


Expected result:
----------------
imap_fetchstructure() should quickly return the structure of the message.

Actual result:
--------------
Indefinitely hang. imap_fetchstructure() never returns.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-19 15:09 UTC] akropel1 at rochester dot rr dot com
Found some additional messages that fail in the same way:

http://www.kroptech.com/~adk0212/failedmsg.3
http://www.kroptech.com/~adk0212/failedmsg.4
http://www.kroptech.com/~adk0212/failedmsg.5
 [2003-08-15 08:41 UTC] sniper@php.net
Does this only happen with POP? (could you try with IMAP instead?)

 [2003-08-15 12:38 UTC] akropel1 at rochester dot rr dot com
I was using IMAP...the example I gave uses an IMAP connection, although I called the connection variables pop_*. Sorry about causing confusion with that.
 [2003-09-18 21:03 UTC] akropel1 at rochester dot rr dot com
The new snapshot appears to solve the problem. imap_fetchstructure() is now able to parse all five messages correctly. Thanks for fixing this!
 [2003-09-18 21:10 UTC] iliaa@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 05:01:31 2024 UTC