update
[squirrelmail.git] / src / empty_trash.php
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
9 $imapConnection = loginToImapServer($username, $key, $imapServerAddress);
10
11 // switch to the mailbox, and get the number of messages in it.
12 selectMailbox($imapConnection, $mailbox, $numMessages);
13
14 if ($mailbox != $trash_folder) {
15 echo "ERROR -- I'm not in the trash folder!<BR>";
16 exit;
17 }
18
19 // mark them as deleted
20 setMessageFlag($imapConnection, 1, $numMessages, "Deleted");
21 expungeBox($imapConnection, $mailbox);
22
23 // Log out this session
24 fputs($imapConnection, "1 logout");
25
26 echo "<HTML><BODY TEXT=\"#000000\" BGCOLOR=\"#FFFFFF\" LINK=\"#0000EE\" VLINK=\"#0000EE\" ALINK=\"#0000EE\">";
27 displayPageHeader($mailbox);
28
29 messages_deleted_message($mailbox, $sort, $startMessage);
30 ?>