if(!isset($username)) { echo "You need a valid user and password to access this page!"; exit; } ?>
include("config/config.php3"); include("functions/strings.php3"); include("functions/imap.php3"); // ***************************************** // Parse the incoming mailbox name and return a string that is the FOLDER.MAILBOX // ***************************************** function findMailboxName($mailbox) { // start at -2 so that we skip the initial quote at the end of the mailbox name $i = -2; $char = substr($mailbox, $i, 1); while ($char != "\"") { $i--; $temp .= $char; $char = substr($mailbox, $i, 1); } return strrev($temp); } // open a connection on the imap port (143) $imapConnection = fsockopen($imapServerAddress, 143, &$errorNumber, &$errorString); if (!$imapConnection) { echo "Error connecting to IMAP Server.\n";
for ($i = 0;$i < count($str); $i++) {
$mailbox = Chop($str[$i]);
// find the quote at the begining of the mailbox name.
// i subtract 1 from the strlen so it doesn't find the quote at the end of the mailbox name.
$mailbox = findMailboxName($mailbox);
$periodCount = countCharInString($mailbox, ".");
// indent the correct number of spaces.
for ($j = 0;$j < $periodCount;$j++)
echo " ";
$mailboxURL = urlencode($mailbox);
echo "";
echo readShortMailboxName($mailbox, ".");
echo "
\n";
}
echo "
";
fclose($imapConnection);
?>