From 43a27409ccbdd1ec4a50d14a42064892f3863671 Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Thu, 14 Aug 2008 07:09:38 -0400
Subject: [PATCH] Better fix for skipping untagged responses; should also work with long body structres (#1485261)

---
 program/lib/imap.inc |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/program/lib/imap.inc b/program/lib/imap.inc
index da709fa..42aa0fa 100644
--- a/program/lib/imap.inc
+++ b/program/lib/imap.inc
@@ -2575,8 +2575,8 @@
 			do {
 				$line = iil_ReadLine($fp, 5000);
 				$line = iil_MultLine($fp, $line);
-				list(, $index, $rest) = explode(' ', $line);
-				if ($index == $id || preg_match("/^$key/", $line))
+				list(, $index, $cmd, $rest) = explode(' ', $line);
+				if ($cmd != 'FETCH' || $index == $id)
 					$result .= $line;
 			} while (!preg_match("/^$key/", $line));
 

--
Gitblit v1.9.1