php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18791 imap_fetch_overview fails to fetch all headers
Submitted: 2002-08-07 14:13 UTC Modified: 2002-09-11 11:50 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: jacooper at isr dot umd dot edu Assigned:
Status: No Feedback Package: IMAP related
PHP Version: 4.2.2 OS: Solaris 2.6
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2002-08-07 14:13 UTC] jacooper at isr dot umd dot edu
PHP built with: 

'./configure' '--with-apxs=/export/software/httpd/bin/apxs' '--with-ldap=/dept/isr/local' '--with-snmp=/dept/isr/local' '--with-imap=/dept/isr/local' '--with-mysql' '--with-gd=/usr/local' '--disable-safe-mode' '--prefix=/dept/isr/local' '--with-config-file-path=/export/software/httpd/conf' '--enable-cli' '--with-openssl=/dept/isr/local' '--with-imap-ssl=/dept/isr/local'

according to phpinfo. c-client version is 2002-RC2, according to my SA. The following code snippet does not result in the expected result:


$sorted_array = imap_sort($mbox, SORTDATE, 0, SE_UID);
$sequence = implode(",",$sorted_array);
$overview = imap_fetch_overview($mbox,$sequence,FT_UID);
if(is_array($overview)) {
        reset($overview);
        while( list($key,$val) = each($overview)) {
                print     $val->msgno
                . " - " . $val->date
                . " - " . $val->subject
                . "<br>\n";
        }
} else {
        print "Bollocks, overview fails again<br>\n";
}

I would expect that this code snippet would return a header for each message in the mailbox I have opened in my imap_open call. 

The behavior I experience is that I will get a small number of headers (call it $x) the first time I run imap_fetch_overview. If I put imap_fetch_overview in a for/while loop, it will return $x+1 headers ($x seems to increment each iteration) on each iteration. I do not change the sequence I give to imap_fetch_overview while doing this. 

I have also tried setting sequence to the first and last message UID, seperated by a :. This results in the same behavior.

For example, if I have a mailbox with 70 messages, the first iteration will return 9 headers. The next 10, after that 11, and so on until eventually it appears to not get a full header for a message. I'm guessing it hits the script time execution limit when this happens but I have not tested increasing that limit to see what happens. 

If I have missed any relevant information, please let me know and I'll provide it as soon as possible.

Thanks
Jason

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-07 15:56 UTC] jacooper at isr dot umd dot edu
ack, botched the summary when I submitted. My apologies.

-Jason
 [2002-08-07 17:00 UTC] kalowsky@php.net
tried to debug this today.  your script seems to work fine, but I can only get one message on my IMAP server (silly quotas).  can you try a development snapshot and see if this still works for you?
 [2002-08-09 17:06 UTC] jacooper at isr dot umd dot edu
We're working on installing a developer snapshot and testing the code against the new installation. I'll hopefully have an update sometime next week.
 [2002-09-11 11:50 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 03:01:29 2024 UTC