possible fix for unsolicited fetch responses during select call (IA Mail
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 9 Mar 2006 18:22:47 +0000 (18:22 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 9 Mar 2006 18:22:47 +0000 (18:22 +0000)
Server v.5.3 Corporate Edition

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@10908 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/imap_general.php

index 958e835d17f214daece6f07ae2285889911c72f0..908598a97405da2510363f24c0699baf7ad1ecc6 100755 (executable)
@@ -392,6 +392,12 @@ function sqimap_retrieve_imap_response($imap_stream, $tag, $handle_errors,
     $aResponse = '';
     $resultlist = array();
     $data = array();
+    $sCommand = '';
+    if (preg_match("/^(\w+)\s*/",$query,$aMatch)) {
+        $sCommand = strtoupper($aMatch[1]);
+    } else {
+        // error reporting (shouldn't happen)
+    }
     $read = sqimap_fgets($imap_stream);
     $i = 0;
     while ($read) {
@@ -455,7 +461,7 @@ function sqimap_retrieve_imap_response($imap_stream, $tag, $handle_errors,
 
           case '*':
           {
-            if (preg_match('/^\*\s\d+\sFETCH/',$read)) {
+            if ($sCommand == "FETCH" && preg_match('/^\*\s\d+\sFETCH/',$read)) {
                 /* check for literal */
                 $s = substr($read,-3);
                 $fetch_data = array();