Fix for broken imap-servers with a missing UIDNEXT Value.
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 14 Aug 2002 12:10:17 +0000 (12:10 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 14 Aug 2002 12:10:17 +0000 (12:10 +0000)
Thnx Thijs Kinkhorst for solving this issue.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3300 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_messages.php

index 838245f3d7879d991026b1cedb78d0af313e2eb2..fd592a2bfde6cbabd0a1bd325d8a76ae44716f3a 100755 (executable)
@@ -184,7 +184,11 @@ function sqimap_get_php_sort_order ($imap_stream, $mbxresponse) {
     $php_sort_array = array();
 
     if ($uid_support) {
-        $uidnext = $mbxresponse['UIDNEXT']-1;
+        if (isset($mbxresponse['UIDNEXT']) && $mbxresponse['UIDNEXT']) {
+           $uidnext = $mbxresponse['UIDNEXT']-1;
+       } else {
+           $uidnext = '*';
+       }
         $uid_query = "$sid SEARCH UID 1:$uidnext\r\n";
         fputs($imap_stream, $uid_query);
         $uids = sqimap_read_data($imap_stream, $sid, true ,&$response, $message);