From 09047d19fab2afd788d7ea6e493811393bf4c1a3 Mon Sep 17 00:00:00 2001 From: kink Date: Sat, 21 May 2005 19:04:59 +0000 Subject: [PATCH] Gracefully recover from over quota error while sending a mail (#1145144): when an quota error occurs we can't redirect properly ("Warning: headers already sent"), so provide a link to the redirected page instead. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@9433 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- ChangeLog | 1 + src/compose.php | 42 +++++++++++++++++++++++++++++++++++------- 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index d056282a..31e11c55 100644 --- a/ChangeLog +++ b/ChangeLog @@ -352,6 +352,7 @@ Version 1.5.1 -- CVS - Modified mercury32 preset in order to remove INBOX prefix in mercury32 4.01. - Added peardb backend to change_password plugin. - Tweak IMAP connection error display (#1203154). + - Gracefully recover from over quota error while sending a mail (#1145144). Version 1.5.0 - 2 February 2004 ------------------------------- diff --git a/src/compose.php b/src/compose.php index 53581cb8..20f10791 100644 --- a/src/compose.php +++ b/src/compose.php @@ -382,11 +382,24 @@ if ($draft) { sqimap_logout($imap_stream); } if ($compose_new_win == '1') { - Header("Location: $location/compose.php?saved_draft=yes&session=$composesession"); + if ( !isset($pageheader_sent) || !$pageheader_sent ) { + Header("Location: $location/compose.php?saved_draft=yes&session=$composesession"); + } else { + echo '

' + . _("Return") . '
'; + } exit(); } else { - Header("Location: $location/right_main.php?mailbox=" . urlencode($draft_folder) . + if ( !isset($pageheader_sent) || !$pageheader_sent ) { + Header("Location: $location/right_main.php?mailbox=" . urlencode($draft_folder) . "&startMessage=1¬e=".urlencode($draft_message)); + } else { + echo '

' + . _("Return") . '
'; + } exit(); } } @@ -461,10 +474,25 @@ if ($send) { sqimap_logout($imap_stream); } if ($compose_new_win == '1') { - Header("Location: $location/compose.php?mail_sent=yes"); - }else { - Header("Location: $location/right_main.php?mailbox=$urlMailbox". - "&startMessage=$startMessage&mail_sent=yes"); + if ( !isset($pageheader_sent) || !$pageheader_sent ) { + Header("Location: $location/compose.php?mail_sent=yes"); + } else { + echo '

' + . _("Return") . '
'; + } + exit(); + } else { + if ( !isset($pageheader_sent) || !$pageheader_sent ) { + Header("Location: $location/right_main.php?mailbox=$urlMailbox". + "&startMessage=$startMessage&mail_sent=yes"); + } else { + echo '

" + . _("Return") . '
'; + } + exit(); } } else { if ($compose_new_win == '1') { @@ -1631,4 +1659,4 @@ function deliverMessage($composeMessage, $draft=false) { } // vim: et ts=4 -?> \ No newline at end of file +?> -- 2.25.1