AW: [imp] quota usage doesn't show...

Tilo Lutz TiloLutz@gmx.de
Sat, 20 Jul 2002 12:17:48 +0200


Hi

> I have some problems in configuring IMP to show quota usage...
> My configuration: Horde 2.1, Imp 3.1, apache 1.3.26, PHP 4.2.1, default
IMAP
> server Slack 8.0 comes with.
> I can't figure out what to change in imp_quota_show function in
> imp/config/conf.php.
First of all, your webserver must be able to run "quota" as root.
i've inserted the line
wwwrun ALL = NOPASSWD: /usr/bin/quota
in the file /etc/sudoers if apache runs as "wwwrun"
You can check it be running the following command as "wwwrun":
wwwrun@wormhole:/home/sonder/ist/public_html/horde/imp/config> sudo
/usr/bin/quota -u tilo
Disk quotas for user tilo (uid 1546):
     Filesystem  blocks   quota   limit   grace   files   quota   limit
grace
192.168.0.7:/home
                  18036  400000  400000             697   10000   10000
192.168.0.7:/etc/samba
                  18036  400000  400000             697   10000   10000

The next step may differ.
Search in config.php for the line $junk = exec("sudo /usr/bin/quota ...
and modify it.
I use:
$junk = exec("sudo /usr/bin/quota -u $imap_admin | grep 00 | tail  -n 1",
                     $quota_data,$return_code);
You can check the output in your console. In my case it's
18036  400000  400000             697   10000   10000

You have to play a little bit with grep, awk, tail, ... to get
the output.

Tilo