[imp] Troubles with IMP quota driver !!!
Eric Jon Rostetter
eric.rostetter at physics.utexas.edu
Tue Aug 29 09:15:18 PDT 2006
Quoting Néstor Rodríguez-Triana Domínguez <triana at maceo.ijv.sld.cu>:
> I have troubles with IMP command quota driver running in a WhiteBox
> Linux Enterprise Server 4 with dovecot 0.99.11 installed. The problem
> it's related to the partition configuration.
Yes, this is a rather known issue that has never been fixed correctly.
See http://lists.horde.org/archives/dev/Week-of-Mon-20040126/012982.html
for a not so clean attempt at fixing it and other problems with the
command line quota driver.
> /dev/mapper/VolGroup00-LogVol03
> 24 2144 3144 1 0 0
>
> As you can see the filesystem name is too long so when the command
> driver issued the grep command only extract the filesystem name not the
> quota status and the quota report show the menssage Unable to retrieve
> quota.
>
> How can I get the next line of the quota info?
Well, first, you can modify the grep command to include "-A1" which will
always return the line following the match. That gives you two return
lines instead of one, which is what you want from grep. You can add that
to the configuration file where you define the "grep_path" command or
edit the imp/lib/Quota/command.php file (I would think the configuration
file would be best).
Now, you need to parse it. For this you would need to edit the file
imp/lib/Quota/command.php. Where it reads:
if (($return_code == 0) && (count($quota_data) == 1)) {
$quota = split("[[:blank:]]+", trim($quota_data[0]));
return $this->_quotaHTML($quota[1] * 1024, $quota[2] * 1024);
}
You would need to add something like:
else if (($return_code == 0) && count($quota_data) == 2)) {
$quota = split("[[:blank:]]+", trim($quota_data[1]));
return $this->_quotaHTML($quota[0] * 1024, $quota[1] * 1024);
}
Now, that is just code off the top of my head, not tested, and may not
work (or even be correct syntax). But it should give you an idea
of how to proceed.
In reality, the check should also check that $quota_data[0] is a
string of 15 or more non-blank characters and nothing else, before
it assumes $quota_data[1] is the valid data... But I'm to lazy/busy to
figure out that check right now.
> Thanks all
--
Eric Rostetter
The Department of Physics
The University of Texas at Austin
Go Longhorns!
More information about the imp
mailing list