Explorar el Código

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

Thijs Kinkhorst hace 23 años
padre
commit
91f4b6989d
Se han modificado 1 ficheros con 5 adiciones y 1 borrados
  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 ($sort == 6) {
         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);