- 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 27dd2de..5f06406 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 768a8ee..66ddf4c 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);