So I think, I have an idea. What if we open a mailbox, get the message count from imap server, if it is above a user defined value (e.g. 20.000), then say sort only a few of them, (a user defined value?) eg 5000, and query only 5000 headers.
If the user wants to view older messages, then we are querying another 5000 part of the mailbox. I'm not an imap expert, but this method saves us to sort all messages in a folder, and we don't waste time, memory, pcu for this. So if there is 4Million messages in the folder, th user gets only the last 5000 headers, not the whole 4M, and the imap server have to sort only a 5000 peace of them, not all. So users are having those bix mailboxes to store mail, not to query all every time they access it. They only wants to have a few messages at once. This method makes the option to easyly query the older messages without long query periods. PS. I think this method is THREAD safe too :) ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642 -- squirrelmail-users mailing list Posting Guidelines: http://www.squirrelmail.org/wiki/MailingListPostingGuidelines List Address: squirrelmail-users@lists.sourceforge.net List Archives: http://news.gmane.org/thread.php?group=gmane.mail.squirrelmail.user List Archives: http://sourceforge.net/mailarchive/forum.php?forum_id)95 List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-users