-
- $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<BR>";
- removeFolder($imapConnection, $trash);
+ // Now create the nodes for subfolders of the parent folder
+ // You can tell that it is a subfolder by tacking the mailbox delimiter
+ // on the end of the $mailbox string, and compare to that.
+ $j = 0;
+ for ($i = 0;$i < count($boxes);$i++) {
+ if (substr($boxes[$i]["unformatted"], 0, strlen($mailbox . $dm)) == ($mailbox . $dm)) {
+ addChildNodeToTree($boxes[$i]["unformatted"], $boxes[$i]["unformatted-dm"], $foldersTree);