Fix for IMAP servers that don't always return a UIDNEXT value
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 23 Sep 2002 08:32:29 +0000 (08:32 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 23 Sep 2002 08:32:29 +0000 (08:32 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@3712 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_messages.php

index 4c113dc9757095bfae7fcc45fcc25b97190749c1..3b52743e32a7c07ad1e7214e831452c1e9a27654 100755 (executable)
@@ -118,7 +118,11 @@ function sqimap_get_sort_order ($imap_stream, $sort, $mbxresponse) {
 
     if ($sort == 6) {
         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);