Back out support for using SM without Frames
[squirrelmail.git] / src / move_messages.php
index 51af2ce4d2efe10d4d8ac8d5d632a4cf79e2f472..7a2ba7e12ef8c54321528418be29384b98b9753c 100644 (file)
@@ -9,9 +9,10 @@
  * Enables message moving between folders on the IMAP server.
  *
  * $Id$
+ * @package squirrelmail
  */
 
-/* Path for SquirrelMail required files. */
+/** Path for SquirrelMail required files. */
 define('SM_PATH','../');
 
 /* SquirrelMail required files. */
@@ -77,7 +78,7 @@ function attachSelectedMessages($msg, $imapConnection) {
             $fp = fopen( $full_localfilename, 'wb');
             fwrite ($fp, $body);
             fclose($fp);
-            $composeMessage->initAttachment('message/rfc822',$subject.'.eml',
+            $composeMessage->initAttachment('message/rfc822',$subject.'.msg',
                  $full_localfilename);
         }
     }
@@ -114,6 +115,7 @@ sqgetGlobalVar('markRead',        $markRead,        SQ_POST);
 sqgetGlobalVar('markUnread',      $markUnread,      SQ_POST);
 sqgetGlobalVar('attache',         $attache,         SQ_POST);
 sqgetGlobalVar('location',        $location,        SQ_POST);
+sqgetGlobalVar('bypass_trash',    $bypass_trash,    SQ_POST);
 
 /* end of get globals */
 
@@ -178,7 +180,7 @@ if(isset($expungeButton)) {
                 sqimap_toggle_flag($imapConnection, $id, '\\Seen',false,true);
             } else  {
                 if (!$button_action) {
-                    sqimap_msgs_list_delete($imapConnection, $mailbox, $id);
+                    sqimap_msgs_list_delete($imapConnection, $mailbox, $id,$bypass_trash);
                     if ($auto_expunge) {
                         $cnt = sqimap_mailbox_expunge($imapConnection, $mailbox, true);
                     }
@@ -209,7 +211,7 @@ if(isset($expungeButton)) {
 } else {    // Move messages
 
     if (count($id)) {
-        sqimap_msgs_list_copy($imapConnection,$id,$targetMailbox);
+        sqimap_msgs_list_move($imapConnection,$id,$targetMailbox);
         if ($auto_expunge) {
             $cnt = sqimap_mailbox_expunge($imapConnection, $mailbox, true);
         } else {