| 1 | <? |
| 2 | include("../config/config.php"); |
| 3 | include("../functions/mailbox.php"); |
| 4 | include("../functions/strings.php"); |
| 5 | include("../functions/page_header.php"); |
| 6 | include("../functions/display_messages.php"); |
| 7 | include("../functions/imap.php"); |
| 8 | include("../functions/array.php"); |
| 9 | |
| 10 | include("../src/load_prefs.php"); |
| 11 | |
| 12 | $imapConnection = loginToImapServer($username, $key, $imapServerAddress, 0); |
| 13 | |
| 14 | getFolderList($imapConnection, $boxes); |
| 15 | |
| 16 | $mailbox = $trash_folder; |
| 17 | fputs($imapConnection, "1 LIST \"$mailbox\" *\n"); |
| 18 | $data = imapReadData($imapConnection , "1", false, $response, $message); |
| 19 | while (substr($data[0], strpos($data[0], " ")+1, 4) == "LIST") { |
| 20 | for ($i = 0; $i < count($boxes); $i++) { |
| 21 | if (($boxes[$i]["UNFORMATTED"] == $mailbox) || |
| 22 | (substr($boxes[$i]["UNFORMATTED"], 0, strlen($mailbox . $dm)) == $mailbox . $dm)) { |
| 23 | echo "\nDEBUG - Removing folder " . $boxes[$i]["UNFORMATTED"] . "<BR>\n"; |
| 24 | echo "DEBUG - mailbox is : $mailbox<br>\n"; |
| 25 | removeFolder($imapConnection, $boxes[$i]["UNFORMATTED"]); |
| 26 | } |
| 27 | } |
| 28 | fputs($imapConnection, "1 LIST \"$mailbox\" *\n"); |
| 29 | $data = imapReadData($imapConnection , "1", false, $response, $message); |
| 30 | } |
| 31 | |
| 32 | createFolder($imapConnection, "$trash_folder", ""); |
| 33 | |
| 34 | selectMailbox($imapConnection, $trash_folder, $numMessages); |
| 35 | echo "<HTML><BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n"; |
| 36 | displayPageHeader($color, $mailbox); |
| 37 | messages_deleted_message($trash_folder, $sort, $startMessage, $color); |
| 38 | fputs($imapConnection, "1 logout"); |
| 39 | ?> |