From 617a4d89ef9d9761d4472e27871438ff132e2f05 Mon Sep 17 00:00:00 2001 From: pdontthink Date: Fri, 1 Aug 2014 02:26:11 +0000 Subject: [PATCH] Add session variables that store information about most recent fatal IMAP error git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@14472 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/imap_general.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/functions/imap_general.php b/functions/imap_general.php index f7f371a9..718c16b6 100755 --- a/functions/imap_general.php +++ b/functions/imap_general.php @@ -616,22 +616,34 @@ function sqimap_retrieve_imap_response($imap_stream, $tag, $handle_errors, case 'NO': /* ignore this error from M$ exchange, it is not fatal (aka bug) */ if (strstr($message[$tag], 'command resulted in') === false) { + sqsession_register('NO', 'IMAP_FATAL_ERROR_TYPE'); + sqsession_register($query, 'IMAP_FATAL_ERROR_QUERY'); + sqsession_register($message[$tag], 'IMAP_FATAL_ERROR_MESSAGE'); sqimap_error_box(_("ERROR: Could not complete request."), $query, _("Reason Given:") . ' ', $message[$tag]); echo ''; exit; } break; case 'BAD': + sqsession_register('BAD', 'IMAP_FATAL_ERROR_TYPE'); + sqsession_register($query, 'IMAP_FATAL_ERROR_QUERY'); + sqsession_register($message[$tag], 'IMAP_FATAL_ERROR_MESSAGE'); sqimap_error_box(_("ERROR: Bad or malformed request."), $query, _("Server responded:") . ' ', $message[$tag]); //FIXME: NO HTML IN CORE! echo ''; exit; case 'BYE': + sqsession_register('BYE', 'IMAP_FATAL_ERROR_TYPE'); + sqsession_register($query, 'IMAP_FATAL_ERROR_QUERY'); + sqsession_register($message[$tag], 'IMAP_FATAL_ERROR_MESSAGE'); sqimap_error_box(_("ERROR: IMAP server closed the connection."), $query, _("Server responded:") . ' ', $message[$tag]); //FIXME: NO HTML IN CORE! echo ''; exit; default: + sqsession_register('UNKNOWN', 'IMAP_FATAL_ERROR_TYPE'); + sqsession_register($query, 'IMAP_FATAL_ERROR_QUERY'); + sqsession_register($message[$tag], 'IMAP_FATAL_ERROR_MESSAGE'); sqimap_error_box(_("ERROR: Unknown IMAP response."), $query, _("Server responded:") . ' ', $message[$tag]); /* the error is displayed but because we don't know the reponse we return the result anyway */ -- 2.25.1