[imp] wu-imap quotas on Redhat 8 or 9 with imp 3.2.2
AJ
aj at mindcrash.com
Mon Sep 22 08:31:11 PDT 2003
Hello, I know this is not really a supported request, but I was wondering if
anyone could point me in the right direction..
The below code works for me to get quotas working they way I want them to,
however, when I move this to a box that has long device names such as..
/dev/cciss/c0d1p3
4 7000 8000 1 0 0
The output of the quota/grep command has a newline.. How can I get rid of this?
It is causing the below code to be broken.. I know this is a big request, but
any help would be appreciated. I am not a programmer, and I am trying to get
this to work. Thanks again.
AJ
imp/lib/Quota/command.php
function quotaHTML()
{
global $imp;
$imap_user = strtolower($imp['user']);
$passwd_array = posix_getpwnam($imap_user);
$homedir = "/dev/hda2";
$cmdline = $this->_params['quota_path'] . " -u $imap_user | " .
$this->_params['grep_path'] . " $homedir";
$junk = exec($cmdline, $quota_data, $return_code);
if (($return_code == 0) && (count($quota_data) == 1)) {
$quota = split("[[:blank:]]+", trim($quota_data[0]));
return $this->_quotaHTML($quota[1] * 1024, $quota[2] * 1024);
}
$cmdline2 = $this->_params['quota_path'] . " -u $imap_user | " .
$this->_params['grep_path'] . " none";
$junk2 = exec($cmdline2, $quota_data, $return_code);
if (($return_code == 0)) {
$quota = 0;
return $this->_quotaHTML($quota);
}
return $this->_quotaError(_("Unable to retrieve quota"));
}
}
More information about the imp
mailing list