A quota report question
Gregorio Faraldo
ls_imp@itacom.com.py
Wed, 13 Feb 2002 18:11:16 -0300
Hi List
I also have the same problem I cannot make work the function imp_show_quota
from the conf.php file
I have installed the version 3 of IMP and 2 of the HORDE
I have also the last version of courier-imap and i am sure i have the
vpopmail wirh quota support
I have the maildirsize file in the Maildir
but i cannot see the status report in the mailbox page
That is my configuration file
// See the 'imp_show_quota' function below for an example.
$conf['hooks']['quota'] = 'imp_show_quota';
/* Gets the quota usage from the imap server. $imap_admin &
* $imap_passwd must be set to fit your own settings. This works
* with the Cyrus imap server and the Courier imap server > 1.3.12.
* Note the necessary changes for the Courier server in the comments.
*/
if (!function_exists('imp_show_quota')) {
function imp_show_quota ($imp) {
$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;
echo '<table width="100%" border="0" cellpadding="0"
cellspacing="0"><tr><td class="item"><table
echo sprintf("%.2fMB / %.2fMB (%.2f%%)", $taken, $total
$percent);
echo '</td></tr></table></td></tr></table>';
}
}
}
?>
That is my session
platon# telnet localhost 143
Trying 127.0.0.1...
Connected to localhost.itacom.com.py.
Escape character is '^]'.
* OK Courier-IMAP ready. Copyright 1998-2001 Double Precision, Inc. See
COPYING for distribution information.
a login user@domain.net 123456
a OK LOGIN Ok.
b getquota
* QUOTA "GETQUOTA" (STORAGE 3 586 MESSAGE 4 100)
b OK GETQUOTA Ok.
c logout
* BYE Courier-IMAP server shutting down
c OK LOGOUT completed
Connection closed by foreign host.
platon#
What i can do
Thanks In advance