• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Horde 5.0.4 Quota Status - Missing with Plesk 11.5

A

aashua

Guest
Hi All,

Is there any one which is facing issue as below:
Horde - Quota Status Options missing as per attached Old Horde Interface.
 
This is very unfortunate change that this mailbox quota is no longer provided. I have requested this from Parallels support, but they just say that this should be requested from Horde community.

So far I have not found much help for this issue - the file /usr/share/psa-horde/imp/config/backends.php has some information about this feature in Horde5 / IMP6:

==================

* quota: (array) Use this if you want to display a user's quota status. Set
* to an empty value to disable quota status (DEFAULT).
*
* To enable, set the 'driver' key to the name of the driver. The 'params'
* key can contain optional configuration parameters.
*
* These 'params' keys are available for ALL drivers:
* - hide_when_unlimited: (boolean) True if you want to hide quota
* output when the server reports an unlimited
* quota.
* - format: (array) Specifies the formats of the quota messages displayed
* to the user. The array must contain the following four keys:
* - long
* - short
* - nolimit_long
* - nolimit_short
* The values for each of these keys are strings that will be
* passed through PHP's sprintf() command.
*
* The default values for each key is as follows (these might
* appear slightly different based on the current language;
* [UNIT] will be replaced with the value of the 'unit'
* parameter):
* - long: Quota status: %.2f [UNIT] / %.2f [UNIT] (%.2f%%)
* - nolimit_long: Quota status: %.2f [UNIT] / NO LIMIT
* - short: %.0f%% of %.0f [UNIT]
* - nolimit_short: %.0f [UNIT]
* - unit: (string) What storage unit the quota messages should be
* displayed in. One of:
* - GB
* - MB [DEFAULT]
* - KB
*
* These are the available drivers, along with their optional parameters:
* - hook: Use the quota hook to handle quotas (see imp/config/hooks.php).
* All parameters defined for this driver will be passed to the
* quota hook function.
* - imap: Use the IMAP QUOTA extension to handle quotas. The IMAP server
* server must support the QUOTAROOT command to use this driver.
* This is the RECOMMENDED way of handling quotas.

==================

The settings are found later on this file:

'quota' => array(
'driver' => 'imap',
'params' => array(
'hide_when_unlimited' => true,
'unit' => 'MB'
)
),

Still I have not found sollution how to enable quota. Whatever I changed seems not to work.

There is also this documentation http://wiki.horde.org/AltQuota?referrer=HowTo but it seems to document how to use seperate quotas for IMAP folders and inbox. Not much help.

Currently it seems that with Plesk 11.5.30 mailbox quota can be checked by e-mail users only by logging into the Plesk with e-mail account. There you can see the quota bar on the same page where e-mail settings are modified. However, this is not very convenient for most users that they need to seperately login into Plesk just to see their mailbox quota.

Another option we're using is an old notification script provided from here:
http://forum.parallels.com/showthre...il-quota-notification-script-for-Plesk-9-3-10

If anyone can find any sollution for this issue, it would be highly appreciated. (The new Horde5 & IMP 6 seems modernly designed webmail inteface but this quota problem is a serious flaw in design. Also another issue is that user cannot no longer set the location of signature - to put it before quotations - which is a big problem for most of the users).
 
Seems extremely straightforward to me. Create /usr/share/psa-horde/imp/config/backends.local.php with following content:

Code:
<?php

$servers['imap']['quota'] = array(
        'driver' => 'imap',
        'params' => array(
            'hide_when_unlimited' => true,
            'unit' => 'MB'
        )
    );
 
Woot! So simple. It works. Thanks a lot!

However, I am trying to change also the quota format from short to long but seems not to understand how this works.

As documented, I tried to add:

Code:
<?php

$servers['imap']['quota'] = array(
        'driver' => 'imap',
        'params' => array(
            'hide_when_unlimited' => true,
            'unit' => 'MB',
            'format' => array(
                'long' => 'Quota status: %.2f [UNIT] / %.2f [UNIT] (%.2f%%)',
                'nolimit_long' => 'Quota status: %.2f [UNIT] / NO LIMIT',
                'short' => '%.0f%% of %.0f [UNIT]',
                'nolimit_short' => '%.0f [UNIT]'
	    )
        )
    );
?>

However, this doesn't change anything on the quota page. What I'd like is the old good long format like:

Mail Quota: 0,09 MB / 0,19 MB (46,43%)

This would be more informative than the format Horde5 outputs that is simply something like:

99% / 1 MB

Any ideas?
 
After some searching I found that this format array in my previous configuration simply allows changing the default outputs for four different quota formats (like long, nolimit_long, short and nolimit_short). However changing them by the documentation seems not to work properly as even if I define quota type 'short' having content as 'long', this doesn't work:

Code:
'format' => array('short' => 'Quota status: %.2f [UNIT] / %.2f [UNIT] (%.2f%%)')

This outputs the quota in the long format in Horde IMP inbox, but [UNIT] is not replaced nor "Quota status" from the translations. Also the way of tempering short format to long is not very good implementation either.

I guess the proper way to find sollution this would be to know where in Horde IMP this quota format is set to "short" and change it there to be "long". Does anyone has any idea for that?

Meanwhile it seems that only sollution is to have short format quota (which is absolutely much better than nothing) by simply - as Nikolay said - to edit file /usr/share/psa-horde/imp/config/backends.local.php and put there:

Code:
<?php
$servers['imap']['quota'] = array(
        'driver' => 'imap',
        'params' => array(
            'hide_when_unlimited' => true,
            'unit' => 'MB'
        )
    );
</?>

This outputs the quota in very short, but informative enough format showing first the usage persentage for mailbox and then mailbox size, as for e.g.

10% / 100 MB

PS. The sollution above worked on our test server, but on actual production servers did not (even though the only difference was that test server is running 32-bit OS compared to others 64-bit OS).

But the result on our production servers was that after editing the backends.local.php logging into webmail was no longer possible, but outputted an error message about expired session. When I emptied this file the login was working properly. So this needs some more investigation...
 
Last edited:

A rule of thumb: never ever put any kind of closing tags in PHP file unless it's really an HTML template. Otherwise you risk ending up with random spaces in random places, where they might bring a headache.


[UNIT] doesn't seem to be substituted and messages are not localized, obviously. Format type (with limit / without limit) is selected based on information available from backend. Only "short" formats seem to be used. They are used in either of these ways (see /usr/share/psa-horde/imp/lib/Quota/Ui.php):

$ret['message'] = sprintf($strings['short'], $ret['percent'], $quota['limit'], $unit);
$ret['message'] = sprintf($strings['nolimit_short'], $quota['usage'], $unit);


So basically you cannot achieve something like "Mail Quota: 0,09 MB / 0,19 MB (46,43%)" without some kind of black magic (since you don't have $quota['usage'] parameter for 'short' case). I guess you may file a bug to Horde folk :)
 
Thanks. I guess the closing tag was the reason for this modification not to work in our production servers (dunno why. I was pretty sure that i typoed it only in this forum). But now it works just fine.

I guess for now we can live just fine with the shorter format - the only thing I thought was just would it be possible at any bearable way to add some explaining text into this quota information, to make:

10% / 200 MB

to

Mailbox usage: 10% / 200 MB

Any ideas?
 
I believe setting 'short' => "Mailbox usage: %.0f%% / %.0f %s" should help. Of course, there would be no localization for the text.
 
That worked perfectly. To sum up for other users, the code should be then like:

Code:
<?php

$servers['imap']['quota'] = array(
        'driver' => 'imap',
        'params' => array(
            'hide_when_unlimited' => true,
            'unit' => 'MB'
            'format' => array('short' => 'Mailbox usage: %.0f%% / %.0f %s')
        )
    );

However, as you seem to know a lot of modifying Plesk integrated Horde5, I really would like to ask if you know how to modify the localizations as well. It seems that Horde5 is still so unmatured that there are some parts of the localizations that shows in English for us (even though we're using Finnish localization).

There are only a few parst we would like to correct, for example:

1) When you send e-mail the link "Add Attachment" is not translated to our locale
2) When you open inbox without selecting any messages, the bottom area shows "No messages selected." (not translated)
3) Some other small parts in settings...

These are minor cosmetics, but still usablity issues for our customers. I am not planning to go trough all the translations, but just to fix some missing details if possible. So where can the files be found for fixing these, if you know?
 
One small correction

Posting this because I just wasted some time due to a small typo in the above code snippet. It is missing a comma after the 'unit' = 'MB' line, which manifests itself as a never-ending login prompt !

The bit below going into /usr/share/psa-horde/imp/config/backends.local.php worked great.

Code:
<?php
$servers['imap']['quota'] = array(
        'driver' => 'imap',
        'params' => array(
            'hide_when_unlimited' => true,
            'unit' => 'MB',
            'format' => array('short' => 'Mailbox usage: %.0f%% / %.0f %s')
        )
    );
 
Back
Top