- Properly clean up temporary attachment files when saving as Draft
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 21 Nov 2005 17:12:21 +0000 (17:12 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 21 Nov 2005 17:12:21 +0000 (17:12 +0000)
  (#1358407)

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@10385 7612ce4b-ef26-0410-bec9-ea0150e637f0

ChangeLog
src/compose.php

index 27dd2dee16610e0fff144dcccb50ad5de8bc6d0e..5f06406dabdaa25b34f7aa05cb60fa8177eccec3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -486,6 +486,8 @@ Version 1.5.1 -- CVS
     information.
   - Support for LIST-SUBSCRIBED extension. This speeds up the retrieval of
     the subscribed mailbox-list.
+  - Properly clean up temporary attachment files when saving as Draft
+    (#1358407)
 
 Version 1.5.0 - 2 February 2004
 -------------------------------
index 768a8eedd0bf917b958bdaa150cf7f51f88b4ebe..66ddf4c3e319b76328642b92b1726222811805d0 100644 (file)
@@ -1459,6 +1459,10 @@ function saveAttachedFiles($session) {
     sqsession_register($compose_messages , 'compose_messages');
 }
 
+/**
+ * Given a composeMessage, recursively delete all temporary files in the
+ * attachment dir for each body part of that message.
+ */
 function ClearAttachments($composeMessage) {
     if ($composeMessage->att_local_name) {
         $attached_file = $composeMessage->att_local_name;
@@ -1642,6 +1646,7 @@ function deliverMessage($composeMessage, $draft=false) {
             sqimap_append_done ($imap_stream, $draft_folder);
             sqimap_logout($imap_stream);
             unset ($imap_deliver);
+            ClearAttachments($composeMessage);
             return $length;
         } else {
             $msg  = '<br />'.sprintf(_("Error: Draft folder %s does not exist."), $draft_folder);