浏览代码

second try ..

stekkel 21 年之前
父节点
当前提交
f630a0daf1
共有 1 个文件被更改,包括 9 次插入5 次删除
  1. 9 5
      functions/imap_general.php

+ 9 - 5
functions/imap_general.php

@@ -469,13 +469,17 @@ function sqimap_retrieve_imap_response($imap_stream, $tag, $handle_errors,
     } // end while
     
     /* error processing in case $read is false */
-    if ($read === false && $handle_errors) {
+    if ($read === false) {
         // try to retrieve an untagged bye respons from the results
         $sResponse = array_pop($data);
-        if ($sResponse != NULL && strpos($sResponse,'* BYE')) {
-            $message[$tag] = substr($sResponse,5);
-            $response[$tag] = 'BYE';
-        } else {
+        if ($sResponse !== NULL && strpos($sResponse,'* BYE') !== false) {
+            if (!$handle_errors) {
+                $query = '';
+            }
+            sqimap_error_box(_("ERROR : Imap server closed the connection."), $query, _("Server responded:"),$sResponse);
+            echo '</body></html>';
+            exit;
+        } else if ($handle_errors) {
             unset($data); 
             sqimap_error_box(_("ERROR : Connection dropped by imap-server."), $query);
             exit;