XMailforum is a readonly knowledge archive now.

Registering as a new user or answering posts is not possible anymore.

Might the force be with you, to find here what you are looking for.

2019-09-20 - hschneider, Admin

Cookie Disclaimer: This forum uses only essential, anonymous session cookies (xmailforum*), nothing to be scared of.

XMail Forum -> Quota Monitor In Imp And Xmail

Reply to this topicStart new topic

> Quota Monitor In Imp And Xmail
thefusa
  Posted: Nov 10 2004, 10:44 AM
Quote Post


Member
***

Group: Members
Posts: 80
Member No.: 1017
Joined: 4-April 04



Hi,
I'm using XMAIL with Courier-Imap (smartpost) and IMP/HORDE as webmail
I conntect IMP using Courier IMAP.
I wish to use the IMP features of
conf['hooks']['quota'] = 'imp_show_quota';

I configure the conf file of quota as follows:
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 (is_array($quota) && $quota['limit'] != 0) {
$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="' . $class . '">'
. sprintf("%.2fMB / %.2fMB (%.2f%%)", $taken, $total, $percent)
. '</td></tr></table></td></tr></table>';
}
return $quota_html;
}
}
**************************************
It doesn't give me any errors but IMP doesn't show me the quota.

So my question is:
I've made an error in the config file?
It's impossible to use the imp quota monitor with XMAIL/COURIER IMAP?


Thanks for your help!! biggrin.gif


--------------------
www.pcmweb.it - Il portale che mancava!!!
PMEmail Poster
Top
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
« Next Oldest | Webmail Add-ons | Next Newest »

Reply to this topicStart new topic