From:             [EMAIL PROTECTED]
Operating system: Solaris 2.8 SPARC
PHP version:      4.1.1
PHP Bug Type:     IMAP related
Bug description:  It is better to replace imap_getquota() with imap_getquotaroot() in 
php_imap.c.

It is better to replace "imap_getquota()" with
"imap_getquotaroot()" in php_imap.c, because the latter is
usable by the user so no need to create a mailbox admin user.

The IMAP4-Request "GETQUOTA" only works with a special privileged imap
user. For the "normal" user "GETQUOTAROOT" is usable. GETQUOTAROOT(*)
gives 2 output lines, the Quota root
directory and the Storage Quota. IMAP 2001 perfectly handles
this with the function imap_getquotaroot.

It is in line 1031 of ext/imap/php_imap.c:

-        if(!imap_getquota(imap_le_struct->imap_stream,
Z_STRVAL_PP(qroot)))
+        if(!imap_getquotaroot(imap_le_struct->imap_stream,
Z_STRVAL_PP(qroot)))

Tested with Cyrus IMAPD 2.0.16 and Sun iPlanet Messaging
Server 5.1.

With this you can get the quota of every mailbox opened
by typing:

$quota_array = imap_get_quota($mb,"INBOX");

Pascal



(*) in raw session it will look like this:

A001 GETQUOTAROOT INBOX
* QUOTAROOT INBOX user.pascal
* QUOTA user.pascal (STORAGE 80280 10000000)
A001 OK Completed

IMAP2001 C-Client handles this with imap_getquotaroot().
-- 
Edit bug report at http://bugs.php.net/?id=15740&edit=1
-- 
Fixed in CVS:        http://bugs.php.net/fix.php?id=15740&r=fixedcvs
Fixed in release:    http://bugs.php.net/fix.php?id=15740&r=alreadyfixed
Need backtrace:      http://bugs.php.net/fix.php?id=15740&r=needtrace
Try newer version:   http://bugs.php.net/fix.php?id=15740&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=15740&r=support
Expected behavior:   http://bugs.php.net/fix.php?id=15740&r=notwrong
Not enough info:     http://bugs.php.net/fix.php?id=15740&r=notenoughinfo
Submitted twice:     http://bugs.php.net/fix.php?id=15740&r=submittedtwice

Reply via email to