Bug #14101 Updated: imap_sort returns irregular sort sequence
| From: | sniper@php.net | Date: | Mon, 19 Nov 2001 23:01:59 +0000 |
| Subject: | Bug #14101 Updated: imap_sort returns irregular sort sequence | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-70981@lists.php.net to get a copy of this message | ||
ID: 14101
Updated by: sniper
Reported By: richard@bridgetechmedia.com
Old Status: Open
Status: Feedback
Bug Type: IMAP related
Operating System: Linux 2.4.10 (rH7.1)
PHP Version: 4.0.5
New Comment:
First of all update your c-client to imap-2001a:
ftp://ftp.cac.washington.edu/mail/imap.tar.Z
also get the latest RC of PHP from:
http://download.php.net/~zeev/php-4.1.0RC3.tar.gz
--Jani
Previous Comments:
------------------------------------------------------------------------
[2001-11-18 22:30:29] richard@bridgetechmedia.com
Hello folks...
Imap sort works only with small mailbox...
<--- snip --->
$newstrm = imap_open ($ms.$selectedmb, $usr, $usrpwd) or die ("cant connect:
".imap_last_error());
switch ($sortby) {
case "date":
$sorted_headers = imap_sort($newstrm,SORTDATE, $rev_flag,'');
break;
case "subject":
$sorted_headers = imap_sort($newstrm,SORTSUBJECT, $rev_flag,'');
break;
case "tag":
if ($tag == "From") {
$sorted_headers = imap_sort($newstrm,SORTFROM, $rev_flag,'');
} else {
$sorted_headers = imap_sort($newstrm,SORTTO, $rev_flag,'');
}
break;
case "size":
$sorted_headers = imap_sort($newstrm,SORTSIZE, $rev_flag,'');
break;
}
while (list(,$qq) = each($sorted_headers)) {
$header = imap_headerinfo($newstrm, $qq);
....>>> etc
<--- snip --->
the sort sequence returned by imap_sort is incorrect for any mailbox where there is more than 10
emails in the mailbox, and especially if there is a mix of "R" and "U" type of
unread.
The function appears to sort partly by new, and then old, and then both...
<========== php compiled with ========
'./configure' '--with-mysql=/usr/local/mysql' '--with-xml'
'--with-apache=../apache_1.3.19/' '--with-imap=/usr/local/imap'
'--enable-track-vars'
<======== imap specs ===========
compiled from :
imap-2001.BETA.SNAP-0106191041.tar
<========= hardware ============>
intel Pentium 4 1.3 Ghz
640 meG ram
400MHZ BUS MOTHERBOARD
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=14101&edit=1