ID:               11561
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Bogus
 Bug Type:         IMAP related
 Operating System: Redhat 7.0, Linux 2.2.16-22
 PHP Version:      4.0.5
 New Comment:

Thank you for taking the time to report a problem with PHP.
Unfortunately your version of PHP is too old -- the problem
might already be fixed. Please download a new PHP
version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.




Previous Comments:
------------------------------------------------------------------------

[2001-06-19 11:13:23] [EMAIL PROTECTED]

Hello,

According to the PHP4 documentation,  the functions imap_getsubscribed
and imap_getmailboxes are supposedly identical except
imap_getsubscribed returns just the subscribed mailboxes and
imap_getmailboxes returns all mailboxes.

This seems to be true everywhere except the for the attributes
bitmask.

Running the following program on one of my imap mailboxes returns the
following output.

PROGRAM:
<?
$mbox = imap_open ("{localhost:143}", "username", "password"
,OP_HALFOPEN);

echo "<p><h1>Mailboxes</h1>\n";
$folders = imap_getmailboxes ($mbox, "{localhost:143}", "*");

if ($folders == false) {
    echo "Call failed<br>\n";
} else {
    while (list ($key, $val) = each ($folders)) {
        
    print "($key) ";
    print imap_utf7_decode($val->name).",";
    print "'".$val->delimiter."',";
    print $val->attributes."<br>\n";
    }
}
?>

OUTPUT:
(0) {localhost:143}Sent Items,'/',1
(1) {localhost:143}Drafts,'/',1
(2) {localhost:143}PHP,'/',2
(3) {localhost:143}PHP/Inbox,'/',1
(4) {localhost:143}PHP/Saved,'/',1
(5  {localhost:143}Sendmail,'/',2
(6) {localhost:143}Sendmail/Inbox,'/',1
(7) {localhost:143}Sendmail/Saved,'/',1
(8)  localhost:143}INBOX,'',1

The attributes for printed out are correct.  ( However I am 100% clear
on  what the attributes LATT_MARKED and LATT_UNMARKED mean. )

After replacing the following line from the program above:
$folders = imap_getmailboxes $mbox, "{localhost:143}", "*");

With this one:
$folders=imap_getsubscribed ($mbox, "{localhost:143}", "*");

I now get the following output...

(0) {localhost:143}Sent Items,'/',0
(1) {localhost:143}Drafts,'/',0
(3) {localhost:143}Sendmail,'/',0
(4) {localhost:143}Sendmail/Inbox,'/',0
(5) {localhost:143}Sendmail/Saved,'/',0
(6) {localhost:143}PHP,'/',0
(7) {localhost:143}PHP/Inbox,'/',0
(8) {localhost:143}PHP/Saved,'/',0
(9) {localhost:143}INBOX,'',1

As you can see, I have lost the attribute information for each mailbox
when using imap_getsubscribed.  Particuarly I have lost the
LATT_SUBSCRIBED, and LATT_NOSELECT information.  

According the documentation, I assumed the behavior of these two
functions should be similiar.

Excerpt of documentation from imap_getmailboxes().
____________________________________________________

Returns an array of objects containing mailbox information. Each object
has the attributes name, specifying the full name of the mailbox;
delimiter, which is the hierarchy delimiter for the part of the
hierarchy this mailbox is in; and attributes. Attributes is a bitmask
that can be tested against: 


LATT_NOINFERIORS - This mailbox has no "children" (there are no
mailboxes below this one). 

LATT_NOSELECT - This is only a container, not a mailbox - you cannot
open it. 

LATT_MARKED - This mailbox is marked. Only used by UW-IMAPD. 

LATT_UNMARKED - This mailbox is not marked. Only used by UW-IMAPD. 

_________________________________________________________


I am running a Redhat 7.0 system with apache 1.3.20, with
mod_ssl-2.8.4-1.3.20, mysql-max-3.23.38, php-4.0.5 

Is this a bug or am I doing something wrong???

Ed Brady 
ed@.ebrady.net


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=11561&edit=1

Reply via email to