فهرست منبع

Fix for broken imap-servers with a missing UIDNEXT Value.
Thnx Thijs Kinkhorst for solving this issue.

stekkel 23 سال پیش
والد
کامیت
0e8cd5f791
1فایلهای تغییر یافته به همراه5 افزوده شده و 1 حذف شده
  1. 5 1
      functions/imap_messages.php

+ 5 - 1
functions/imap_messages.php

@@ -184,7 +184,11 @@ function sqimap_get_php_sort_order ($imap_stream, $mbxresponse) {
     $php_sort_array = array();
     $php_sort_array = array();
 
 
     if ($uid_support) {
     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";
         $uid_query = "$sid SEARCH UID 1:$uidnext\r\n";
         fputs($imap_stream, $uid_query);
         fputs($imap_stream, $uid_query);
         $uids = sqimap_read_data($imap_stream, $sid, true ,&$response, $message);
         $uids = sqimap_read_data($imap_stream, $sid, true ,&$response, $message);