From a11899fdca21f02f1d4270c70ce74a07a7712237 Mon Sep 17 00:00:00 2001 From: lkehresman Date: Mon, 29 Nov 1999 02:45:31 +0000 Subject: [PATCH] Deleting of folders works git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@36 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/empty_trash.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/empty_trash.php b/src/empty_trash.php index f6baf0db..caed2019 100644 --- a/src/empty_trash.php +++ b/src/empty_trash.php @@ -16,10 +16,40 @@ exit; } + + /** GET FOLDER ARRAY OF TRASH SUBFOLDERS **/ + fputs($imapConnection, "1 list \"\" *\n"); + $str = imapReadData($imapConnection); + + for ($i = 0;$i < count($str); $i++) { + $box = Chop($str[$i]); + $mailbox = findMailboxName($box); + + if (strpos($box, $trash_folder) > 0) { + $folders[$i] = $mailbox; + } else { + $folders[$i] = "NOPE"; + } + } + + $trash = getFolderNameMinusINBOX($trash_folder); + $trash = "user.$username.$trash"; // mark them as deleted setMessageFlag($imapConnection, 1, $numMessages, "Deleted"); expungeBox($imapConnection, $mailbox); + // remove subfolders + for ($i = 0; $i < count($folders); $i++) { + if ($folders[$i] != "NONE") { + $trash = getFolderNameMinusINBOX($folders[$i]); + $trash = "user.$username.$trash"; + echo "$trash
"; + removeFolder($imapConnection, $trash); + } + } + + createFolder($imapConnection, "user.$username.$trash_folder"); + // Log out this session fputs($imapConnection, "1 logout"); -- 2.25.1