IMP 3.0 quota not available

John McCoy, Jr. jmccoy@mills.edu
Mon, 11 Mar 2002 13:42:08 -0800


Need a little help here all, duh! Thanks!!!
Horde and Imp latest CVS (8AM PST Mar 11, 2002)

I'm getting this warning message:
Warning: Quota not available on this IMAP server (errflg=2) in Unknown
on line 0

I'm using Courier IMAP (1.4.3) which appears to support Quotas:

* OK Courier-IMAP ready. Copyright 1998-2002 Double Precision, Inc.  See
COPYING for distribution information.
. login teststud <password>
. OK LOGIN Ok.
. getquotaroot INBOX
* QUOTAROOT "INBOX" "ROOT"
* QUOTA "ROOT" (STORAGE 37 97657 MESSAGE 18 10000)
. OK GETQUOTAROOT Ok.

Here is my "imp_show_quota" function:

if (!function_exists('imp_show_quota')) {
    function imp_show_quota ($imp) {
        $quota_html = '';
          $imap_admin = $imp['user'];
          $imap_passwd = Secret::read(Secret::getKey('imp'),
$imp['pass']);

         $stream = @imap_open(IMP::serverString(), $imap_admin,
$imap_passwd, OP_HALFOPEN);
         $quota = @imap_get_quota($stream, 'ROOT');
         imap_close($stream);

         if (!empty($quota)) {
             $taken   = $quota['usage'] / 1024.0;
             $total   = $quota['limit'] / 1024.0;
             $percent = $taken * 100 / $total;
             if ($percent >= 90) {
                 $class = 'quotaalert';
             } elseif ($percent >= 75) {
                 $class = 'quotawarn';
             } else {
                 $class = 'control';
             }

             $quota_html = '<table width="100%" border="0"
cellpadding="0" cellspacing="0"><tr><td class="item">'
                           . '<table border="0" cellspacing="2"
cellpadding="2" width="100%"><tr><td align="center" class="' . $clas
s . '">'
                           . sprintf("%.2fMB / %.2fMB  (%.2f%%)",
$taken, $total, $percent)
                           . '</td></tr></table></td></tr></table>';
         }
         return $quota_html;
     }
}

I've been modifying this line to try to get it to work:

         $quota = @imap_get_quota($stream, 'ROOT');

I changed ROOT to INBOX to more closely match the command I used in
telnet testing, but it made no difference. I'm guessing this may be a
PHP issue. Any help would be greatly appreciated.

Test.php output:
Horde Versions
Horde: 3.0-cvs 
IMP: 4.0-cvs 
Turba: 2.0-cvs 
PHP Version
View phpinfo() screen 
PHP Version: 4.1.2 
PHP Major Version: 4.1 
PHP Minor Version: 2 
PHP Version Classification: release 
You are running a supported version of PHP.
PHP Module Capabilities
FTP Support: No 
Gettext Support: Yes 
IMAP Support: Yes 
LDAP Support: No 
MCAL Support: No 
Mcrypt Support: No 
MySQL Support: Yes 
PostgreSQL Support: No 
XML Support: Yes 
Miscellaneous PHP Settings
magic_quotes_runtime set to Off: Yes 
PHP Sessions
Session counter: 1 
To unregister the session: click here 
PEAR
PEAR - Yes 
Recent PEAR - Yes 
Mail::RFC822 - Yes 
Log - Yes 
DB - Yes

Redhat 7.2 Custom built Apache-1.3.23 and PHP per horde documentation.

********************************
John McCoy, Jr jmccoy@mills.edu
Central Systems Administrator
Mills College Oakland, CA
Voice: 510-430-3321
*********************************