|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #38712 Add support for CAPABILITY, NAMESPACE etc.
Submitted: 2006-09-04 11:57 UTC Modified: 2011-02-21 21:20 UTC
Avg. Score:4.4 ± 0.9
Reproduced:7 of 7 (100.0%)
Same Version:3 (42.9%)
Same OS:5 (71.4%)
From: benjamin dot podszun at gmail dot com Assigned:
Status: Open Package: IMAP related
PHP Version: 5.3 OS: *
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-09-04 11:57 UTC] benjamin dot podszun at gmail dot com
The current imap modules fails to wrap methods to query for the server capabilities and the server namespace. This is crucial for some servers like courier-imap with virtual shared folders, since those end up in a different namespace and cannot be found without support for both CAPABILITY and NAMESPACE imap support.

Reproduce code:
IMAP source transcript to show the "right way" that php should offer as well:

Transcript on my server:

a001 capability
a001 OK CAPABILITY completed

-> My server supports "namespace", which is exactly what I want/need to use

a002 namespace
* NAMESPACE (("INBOX." ".")) NIL (("#shared." ".")("shared." "."))
a002 OK NAMESPACE completed.

-> As you can see the server supports both "shared." and "#shared" for shared folder namespaces. The latter is the one I need/use.

a003 list "" *
* LIST (\Marked \HasNoChildren) "." "INBOX"
a003 OK LIST completed

-> A wildcard list of everything, without giving any namespace. This results in only one response: My INBOX.

a004 list "" #shared.*
* LIST (\HasNoChildren) "." " de"
* LIST (\HasNoChildren) "." "#shared.sql-bugs@mydomain de"
* LIST (\HasNoChildren) "." "#shared.treffen@mydomain de"
* LIST (\HasNoChildren) "." "#shared.presse@anotherdomain de"
* LIST (\HasNoChildren) "." " de"
a004 OK LIST completed

-> The "right way" (tm) to list the shared namespaces.

Expected result:
Since both the RFC document links to and the underlying c-client library itself support these operations, I'd expect to have any kind of support for that methods in php as well.

Actual result:
No shared folders from php. No useable mail client in php.


imap_capability.patch (last revision 2013-04-02 08:19 UTC by michael dot radzewitz at freenet-ag dot de)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-04 20:30 UTC] benjamin dot podszun at gmail dot com
No offense, but you're probably not reading the report right.
I cannot provide a script that demonstrate that PHP is lacking support for functions. It would be empty.

Trying to be more clear about this: lists lots of methods. It doesn't list (and the source lacks..) methods that wrap the imap command CAPABILITY and the imap command NAMESPACE (caps, because they are used like this in the RFC).
Since the underlying c-client library, that provides the current imap implementation for php, supports these commands (I checked the source for that) I hereby ask php to include these commands into the php imap module. While the NAMESPACE command is optional (and therefor more or less a feature request) the CAPABILITY command is part of the RFC that links to. It's part of common imap support. There should be a wrapper in php.

Since there _is_ no wrapper I cannot provide a script that reproduces the problem. I hope I provided enough feedback to get this back on track.
 [2006-09-04 20:52 UTC] benjamin dot podszun at gmail dot com
Please reconsider your classification again. links (Section "See also") to the imap RFC (

Section 6.1.1 describes the CAPABILITY command, something that the php module just doesn't support/include. Therefor this is a bug in my book, because the (linked/quoted even) RFC is not fully supported.

If there are rules for classifying this as FR I'd kindly like to ask you for any hint where I can find them.

My point: CAPABILITY is missing. The RFC includes it. Bug in the (not complete) imap implementation/wrapper of PHP.
Yes, the second mentioned command is optional..

Last try,
 [2006-09-04 20:52 UTC]
Missing functionality is not a bug.
 [2006-09-15 14:42 UTC] benjamin dot podszun at gmail dot com
Just to make clear that it's not 4.x related or OS dependend..
 [2011-02-21 21:20 UTC]
-Summary: doesn't support CAPABILITY, NAMESPACE etc., the c-client lib does. +Summary: Add support for CAPABILITY, NAMESPACE etc. -Package: Feature/Change Request +Package: IMAP related -Operating System: all +Operating System: * -PHP Version: all +PHP Version: 5.3
 [2013-03-28 15:17 UTC] michael dot radzewitz at freenet-ag dot de
The attached patch works fine for us but you should review the source 
code to ensure that all the necessary data structures, error checking
and return values are setup correctly. 

As mentioned in the above comment: The c-client library supports the 
function call on: imap_cap(MAILSTREAM *stream) directly and we just 
call it *directly*! We don't went through the mail interface in the 
c-client library (mail.h/mail.c) which does not support an capability 
function for different drivers. 

As far as we see - this in some way breaks with the previous php imap 
implementation because all the other functions went through these
mail interface functions. This may also the reason why php does not 
support it by now.

Michael R.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 14 05:01:28 2024 UTC