|
@@ -5,25 +5,10 @@
|
|
|
include("../functions/page_header.php");
|
|
|
include("../functions/display_messages.php");
|
|
|
|
|
|
- $imapConnection = fsockopen($imapServerAddress, 143, &$errorNumber, &$errorString);
|
|
|
- if (!$imapConnection) {
|
|
|
- echo "Error connecting to IMAP Server.<br>";
|
|
|
- echo "$errorNumber : $errorString<br>";
|
|
|
- exit;
|
|
|
- }
|
|
|
- $serverInfo = fgets($imapConnection, 256);
|
|
|
-
|
|
|
- // login
|
|
|
- fputs($imapConnection, "1 login $username $key\n");
|
|
|
- $read = fgets($imapConnection, 1024);
|
|
|
-
|
|
|
- if (strpos($read, "NO")) {
|
|
|
- error_username_password_incorrect();
|
|
|
- exit;
|
|
|
- }
|
|
|
+ $imapConnection = loginToImapServer($username, $key);
|
|
|
|
|
|
// switch to the mailbox, and get the number of messages in it.
|
|
|
- selectMailbox($imapConnection, $mailbox, $numMessages);
|
|
|
+ selectMailbox($imapConnection, $mailbox, $numMessages, $imapServerAddress);
|
|
|
|
|
|
// Marks the selected messages ad 'Deleted'
|
|
|
$j = 0;
|
|
@@ -54,4 +39,4 @@
|
|
|
displayPageHeader($mailbox);
|
|
|
|
|
|
messages_deleted_message($mailbox, $sort, $startMessage);
|
|
|
-?>
|
|
|
+?>
|