/**
* imap_messages.php
*
- * Copyright (c) 1999-2003 The SquirrelMail Project Team
+ * Copyright (c) 1999-2004 The SquirrelMail Project Team
* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* This implements functions that manipulate messages
* @param string $mailbox Mailbox messages are being deleted from
* @return void
*/
-function sqimap_messages_delete ($imap_stream, $start, $end, $mailbox) {
+function sqimap_messages_delete ($imap_stream, $start, $end, $mailbox, $bypass_trash=false) {
global $move_to_trash, $trash_folder, $auto_expunge, $uid_support;
- if (($move_to_trash == true) && (sqimap_mailbox_exists($imap_stream, $trash_folder) && ($mailbox != $trash_folder))) {
+ if (($move_to_trash == true) && ($bypass_trash != true) &&
+ (sqimap_mailbox_exists($imap_stream, $trash_folder) && ($mailbox != $trash_folder))) {
sqimap_messages_copy ($imap_stream, $start, $end, $trash_folder);
}
sqimap_messages_flag ($imap_stream, $start, $end, "Deleted", true);
function sqimap_msgs_list_delete ($imap_stream, $mailbox, $id, $bypass_trash=false) {
global $move_to_trash, $trash_folder, $uid_support;
$msgs_id = sqimap_message_list_squisher($id);
- if (($move_to_trash == true) && (sqimap_mailbox_exists($imap_stream, $trash_folder) && ($mailbox != $trash_folder)) && ($bypass_trash != true)) {
+ if (($move_to_trash == true) && ($bypass_trash != true) &&
+ (sqimap_mailbox_exists($imap_stream, $trash_folder) && ($mailbox != $trash_folder)) ) {
$read = sqimap_run_command ($imap_stream, "COPY $msgs_id " . sqimap_encode_mailbox_name($trash_folder), true, $response, $message, $uid_support);
}
$read = sqimap_run_command ($imap_stream, "STORE $msgs_id +FLAGS (\\Deleted)", true, $response, $message, $uid_support);