Gracefully recover from over quota error while sending a mail (#1145144):
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 21 May 2005 19:04:59 +0000 (19:04 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 21 May 2005 19:04:59 +0000 (19:04 +0000)
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
src/compose.php

index d056282..31e11c5 100644 (file)
--- 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
 -------------------------------
index 53581cb..20f1079 100644 (file)
@@ -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 '   <br><br><center><a href="' . $location
+                    . '/compose.php?saved_sent=yes&amp;session=' . $composesession . '">'
+                    . _("Return") . '</a></center>';
+            }            
             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&note=".urlencode($draft_message));
+            } else {
+                echo '   <br><br><center><a href="' . $location
+                    . '/right_main.php?mailbox=' . urlencode($draft_folder)
+                    . '&amp;startMessage=1&amp;note=' . urlencode($draft_message) .'">'
+                    . _("Return") . '</a></center>';
+            }            
             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 '   <br><br><center><a href="' . $location
+                    . '/compose.php?mail_sent=yes">'
+                    . _("Return") . '</a></center>';
+            }
+            exit();
+        } else {
+            if ( !isset($pageheader_sent) || !$pageheader_sent ) {
+                Header("Location: $location/right_main.php?mailbox=$urlMailbox".
+                    "&startMessage=$startMessage&mail_sent=yes");
+            } else {
+                echo '   <br><br><center><a href="' . $location
+                    . "/right_main.php?mailbox=$urlMailbox"
+                    . "&amp;startMessage=$startMessage&amp;mail_sent=yes\">"
+                    . _("Return") . '</a></center>';
+            }
+            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
+?>