ID:               45487
 User updated by:  sblackstone at gmail dot com
 Reported By:      sblackstone at gmail dot com
 Status:           Bogus
 Bug Type:         IMAP related
 Operating System: OSX Leopard
 PHP Version:      5.2.6
 New Comment:

Thanks for looking at this.. I did a little more research and tracked
it all the way through the client libraries.  According to RFC 3501

"
The returned untagged LSUB response MAY contain different mailbox
flags from a LIST untagged response.  If this should happen, the
flags in the untagged LIST are considered more authoritative.
"

And in fact, the case of my server it does not reply with attributes
when using LSUB while it does with LIST.


The documentation for this on php.net currently reads "Identical to
imap_getmailboxes(), except that it only returns mailboxes that the user
is subscribed to." 

This leaves the impressions that this function just returns a subset of
the output of the full list and hides this RFC nuance.


Since the RFC specifically states that the attributes in LIST are
authoritative and thoose in LSUB are not, my suggestion is that we  make
a second call to LIST (which by the RFC MUST be an extremely fast call)
and populate the attributes of the LSUB return with the attributes from
the LIST call.  This would make the function consistent with its
documentation.

Barring that, I would suggest that the documentation be revised so that
it does not use language like "identical" which leads to developer
confusion.


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

[2008-07-15 02:11:57] [EMAIL PROTECTED]

>From sources:

 add_property_long(mboxob, "attributes", cur->attributes);

As you can see, PHP only adds whatever the UW imap c-client has set the
attributes to. Not PHP bug -> bogus.

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

[2008-07-11 15:26:40] sblackstone at gmail dot com

Description:
------------
The documentation for imap_getsubscribed notes the following:

Identical to imap_getmailboxes(), except that it only returns mailboxes
that the user is subscribed to. 


However getsubscribed clobbers the attributes value and returns 0.

Reproduce code:
---------------
<?

$imap   = imap_open("{localhost:143/notls}","username","password");

$results_bad = imap_getSubscribed($imap, "{localhost:143/notls}",
"*");

// Note: I just picked an arbitrary mailbox in the results items below
// You need to pick a value that has children or just print the whole
// array.

print_r($results_bad[1]);

$results_good = imap_getmailboxes($imap, "{localhost:143/notls}",
"*");

print_r($results_good[1]);


?>



Expected result:
----------------
stdClass Object
(
    [name] => {localhost:143/notls}SOMEMAILBOX
    [attributes] => 64
    [delimiter] => .
)


Actual result:
--------------
stdClass Object
(
    [name] => {localhost:143/notls}SOMEMAILBOX
    [attributes] => 0
    [delimiter] => .
)


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


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

Reply via email to