php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15740 It is better to replace imap_getquota() with imap_getquotaroot() in php_imap.c.
Submitted: 2002-02-26 18:56 UTC Modified: 2002-03-27 00:00 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: pg at finesse-net dot de Assigned:
Status: No Feedback Package: IMAP related
PHP Version: 4.1.1 OS: Solaris 2.8 SPARC
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: pg at finesse-net dot de
New email:
PHP Version: OS:

 

 [2002-02-26 18:56 UTC] pg at finesse-net dot de
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().

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-26 21:20 UTC] yohgaki@php.net
Could you post unified diff against current CVS source to php-dev list?
 [2002-03-27 00:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 19:01:28 2024 UTC