From ee231c8bd39395071cc369d1670e4558d8cd7d63 Mon Sep 17 00:00:00 2001 From: stekkel Date: Thu, 9 Mar 2006 18:22:47 +0000 Subject: [PATCH] possible fix for unsolicited fetch responses during select call (IA Mail 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 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/functions/imap_general.php b/functions/imap_general.php index 958e835d..908598a9 100755 --- a/functions/imap_general.php +++ b/functions/imap_general.php @@ -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(); -- 2.25.1