I have problem with POP3 mail.
I’m trying to view all messages in my mailboxes. I’m log in to my mail through the script, but i can see only the messages from the INBOX folder. The other folders, that i make in Squirrelmail… I can’t see them.
Can someone has idea…
This is the code:
##################
$mailbox = “{my_host_ip:110/pop3/novalidate-cert}”;
$mail = “my_mail”;
$pass = “my_pass”;
$mbox = imap_open ($mailbox, $mail, $pass);
echo “<h1>Mailboxes</h1>n”;
$list = imap_getmailboxes($mbox, $mailbox, “*”);
$subs = imap_listsubscribed($mbox, $mailbox, “*”);
print_r($subs);
if (is_array($list)) {
reset($list);
while (list($key, $val) = each($list)) {
echo “($key) “;
echo imap_utf7_decode($val->name) . “,”;
echo “‘” . $val->delimiter . “‘,”;
echo $val->attributes . “<br />n”;
}
} else {
echo “imap_getmailboxes failed: ” . imap_last_error() . “n”;
}
echo “<h1>Headers in INBOX</h1>n”;
$headers = imap_headers($mbox);
if ($headers == false) {
echo “Call failed<br />n”;
} else {
while (list ($key, $val) = each ($headers)) {
echo $val . “<br>n”;
}
}
echo “<hr>”;
$check = imap_mailboxmsginfo($mbox);
if ($check) {
echo “Date: ” . $check->Date . “<br />n” ;
echo “Driver: ” . $check->Driver . “<br />n” ;
echo “Mailbox: ” . $check->Mailbox . “<br />n” ;
echo “Messages: ” . $check->Nmsgs . “<br />n” ;
echo “Recent: ” . $check->Recent . “<br />n” ;
echo “Unread: ” . $check->Unread . “<br />n” ;
echo “Deleted: ” . $check->Deleted . “<br />n” ;
echo “Size: ” . $check->Size . “<br />n” ;
} else {
echo “imap_check() failed: ” . imap_last_error() . “<br />n”;
}
imap_close($mbox);
print_r(imap_errors());
##################
and its only show me the INBOX mailbox & messages in it.
But if i login through Squirrelmail Client i can see the folders like Trash, Sent, Draft and folders that i made manualy.
Finally… i want see this mailboxes through PHP-script
P.S. Sorry for my bad English