ff9031bedbed8d6e7218cec8e4200036f021a289
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");
8 $imapConnection = fsockopen($imapServerAddress, 143, &$errorNumber, &$errorString);
9 if (!$imapConnection) {
10 echo "Error connecting to IMAP Server.<br>";
11 echo "$errorNumber : $errorString<br>";
14 $serverInfo = fgets($imapConnection, 256);
17 fputs($imapConnection, "1 login $username $key\n");
18 $read = fgets($imapConnection, 1024);
20 if (strpos($read, "NO")) {
21 error_username_password_incorrect();
25 // switch to the mailbox, and get the number of messages in it.
26 selectMailbox($imapConnection, $mailbox, $numMessages);
28 // Marks the selected messages ad 'Deleted'
32 while ($j < count($msg)) {
34 /** check if they would like to move it to the trash folder or not */
35 if ($move_to_trash == true) {
36 $success = copyMessages($imapConnection, $msg[$i], $msg[$i], $trash_folder);
38 setMessageFlag($imapConnection, $msg[$i], $msg[$i], "Deleted");
40 setMessageFlag($imapConnection, $msg[$i], "Deleted");
47 if ($auto_expunge == true)
48 expungeBox($imapConnection, $mailbox, $numMessages);
50 // Log out this session
51 fputs($imapConnection, "1 logout");
53 echo "<HTML><BODY TEXT=\"#000000\" BGCOLOR=\"#FFFFFF\" LINK=\"#0000EE\" VLINK=\"#0000EE\" ALINK=\"#0000EE\">";
54 displayPageHeader($mailbox);
56 messages_deleted_message($mailbox, $sort, $startMessage);