From 7ec3a6b9d91effbc7853d810bbc59462bdacd459 Mon Sep 17 00:00:00 2001 From: kink Date: Wed, 30 Mar 2005 18:35:50 +0000 Subject: [PATCH] Fixed bad/malformed request error when Sent was over quota. This was checked at the second stage when appending to Sent but not the first stage (the response was simply thrown away). I've abstracted the checking to a separate function that is called at the two relevant points. Closes: #1172694 git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@9166 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- ChangeLog | 1 + functions/imap_general.php | 15 +++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index af4c086f..eabfe0ef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -289,6 +289,7 @@ Version 1.5.1 -- CVS (#1043576). - mbstring internal encoding is switched to ASCII, if mbstring.func_overload is enabled (#929644). + - Fixed checking for quota when appending to Sent folder (#1172694). Version 1.5.0 -------------------- diff --git a/functions/imap_general.php b/functions/imap_general.php index 56e551fe..9d1fa6dc 100755 --- a/functions/imap_general.php +++ b/functions/imap_general.php @@ -966,15 +966,22 @@ function sqimap_status_messages ($imap_stream, $mailbox, function sqimap_append ($imap_stream, $sent_folder, $length) { fputs ($imap_stream, sqimap_session_id() . ' APPEND ' . sqimap_encode_mailbox_name($sent_folder) . " (\\Seen) \{$length}\r\n"); $tmp = fgets ($imap_stream, 1024); + sqimap_append_checkresponse($tmp, $sent_folder); } function sqimap_append_done ($imap_stream, $folder='') { - global $squirrelmail_language, $color; fputs ($imap_stream, "\r\n"); $tmp = fgets ($imap_stream, 1024); - if (preg_match("/(.*)(BAD|NO)(.*)$/", $tmp, $regs)) { + sqimap_append_checkresponse($tmp, $folder); +} + +function sqimap_append_checkresponse($response, $folder) { + + if (preg_match("/(.*)(BAD|NO)(.*)$/", $response, $regs)) { + global $squirrelmail_language, $color; set_up_language($squirrelmail_language); require_once(SM_PATH . 'functions/display_messages.php'); + $reason = $regs[3]; if ($regs[2] == 'NO') { $string = "\n" . @@ -994,7 +1001,7 @@ function sqimap_append_done ($imap_stream, $folder='') { _("ERROR : Bad or malformed request.") . "
\n" . _("Server responded: ") . - $tmp . "

\n"; + $reason . "
\n"; error_box($string,$color); exit; } @@ -1020,4 +1027,4 @@ function map_yp_alias($username) { return chop(substr($yp, strlen($username)+1)); } -?> \ No newline at end of file +?> -- 2.25.1