Quantcast
Channel: iRedMail
Viewing all articles
Browse latest Browse all 14150

Shared Domain Quota

$
0
0

======== Required information ====
- iRedMail version: 1.8.1
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Linux/BSD distribution name and version: Debian
- Related log if you're reporting an issue:
====

Just want to share a workaround:

The Domain Quota is working, but not the way we need it. Currently you can limit the Sum of all account quotas. If you set a domain limit of 1GB then 5 accounts could have each 200MB as quota. I you add another account, you have to change all others ...

But we want to set a limit for the used space of a domain - so all accounts are sharing the quota of the domain. To achieve this we set the quota for each account always to unlimited. After changing some lines in sourcecode I got a nice display:

domain1.tld   Name1    67% (692 MB) / 1 GB
domain2.tld   Name2    16% (171 MB) / 1 GB

The only downside of this approach is: no one will get a warning, if the domain quota exceeds. But that is no Problem for us, because with the graphical bar you see very fast, if a quota is exceeded.

The required changes are in file \templates\default\mysl\domain\list.html
Just replace line 92

{% set percentOfDomainQuota = r.quota_count |convert_to_percentage(r.maxquota) %}

with that

{% set DomainMBquota = domain_used_quota.get(domain, {}).get('size', 0) / 1024 / 1024 %}
{% set percentOfDomainQuota = DomainMBquota |convert_to_percentage(r.maxquota) %}

I also removed the amount of Allocated space in line 96, because we don't need it. But that is not required.


Viewing all articles
Browse latest Browse all 14150

Trending Articles