|
@@ -4,23 +4,9 @@
|
|
include("../functions/strings.php");
|
|
include("../functions/strings.php");
|
|
include("../functions/page_header.php");
|
|
include("../functions/page_header.php");
|
|
include("../functions/display_messages.php");
|
|
include("../functions/display_messages.php");
|
|
|
|
+ include("../functions/imap.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, $imapServerAddress);
|
|
|
|
|
|
// switch to the mailbox, and get the number of messages in it.
|
|
// switch to the mailbox, and get the number of messages in it.
|
|
selectMailbox($imapConnection, $mailbox, $numMessages);
|
|
selectMailbox($imapConnection, $mailbox, $numMessages);
|
|
@@ -41,4 +27,4 @@
|
|
displayPageHeader($mailbox);
|
|
displayPageHeader($mailbox);
|
|
|
|
|
|
messages_deleted_message($mailbox, $sort, $startMessage);
|
|
messages_deleted_message($mailbox, $sort, $startMessage);
|
|
-?>
|
|
|
|
|
|
+?>
|