/    Sign up×
Community /Pin to ProfileBookmark

IMAP – How can i see folders from squirrel mail with phpscript

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

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@JimoauthorApr 22.2005 — If someone have some idea, please post reply... I'd lost quite a few hours to solve this but... no results
×

Success!

Help @Jimo spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...