From d3d9ef2d4825fb64a382a7787589c158fe6af4b7 Mon Sep 17 00:00:00 2001 From: stekkel Date: Fri, 14 May 2004 18:37:40 +0000 Subject: [PATCH] Detect untagged BYE responses in case the connection is terminated. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@7458 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_general.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/functions/imap_general.php b/functions/imap_general.php index abb2228b..b67093d5 100755 --- a/functions/imap_general.php +++ b/functions/imap_general.php @@ -469,9 +469,14 @@ function sqimap_retrieve_imap_response($imap_stream, $tag, $handle_errors, } // end while /* error processing in case $read is false */ - if ($read === false) { - unset($data); - if ($handle_errors) { + if ($read === false && $handle_errors) { + // 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 { + unset($data); sqimap_error_box(_("ERROR : Connection dropped by imap-server."), $query); exit; } -- 2.25.1