#18791 [NEW]: imap_fetch_header fails to fetch all headers

From: Date: Wed, 07 Aug 2002 18:13:15 +0000
Subject: #18791 [NEW]: imap_fetch_header fails to fetch all headers
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-16196@lists.php.net to get a copy of this message
From:             jacooper@isr.umd.edu
Operating system: Solaris 2.6
PHP version:      4.2.2
PHP Bug Type:     IMAP related
Bug description:  imap_fetch_header fails to fetch all headers

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
-- 
Edit bug report at http://bugs.php.net/?id=18791&edit=1
-- 
Fixed in CVS:        http://bugs.php.net/fix.php?id=18791&r=fixedcvs
Fixed in release:    http://bugs.php.net/fix.php?id=18791&r=alreadyfixed
Need backtrace:      http://bugs.php.net/fix.php?id=18791&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=18791&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=18791&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=18791&r=notwrong
Not enough info:     http://bugs.php.net/fix.php?id=18791&r=notenoughinfo
Submitted twice:     http://bugs.php.net/fix.php?id=18791&r=submittedtwice
register_globals:    http://bugs.php.net/fix.php?id=18791&r=globals



Thread (5 messages)

« previous php.bugs (#16196) next »