浏览代码

Fix for IMAP servers that don't always return a UIDNEXT value

Thijs Kinkhorst 23 年之前
父节点
当前提交
91f4b6989d
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      functions/imap_messages.php

+ 5 - 1
functions/imap_messages.php

@@ -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);