1 (edited by frank.daeuble 2014-03-17 21:31:03)

Topic: Shared Domain Quota

======== 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.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Shared Domain Quota

frank.daeuble wrote:

To achieve this we set the quota for each account always to unlimited.

It's not just how it's displayed in iRedAdmin-Pro, you must check whether Dovecot supports it.
if you set user mailbox quota to unlimited, Dovecot will consider this user has unlimited mailbox quota, then you don't have domain quota at all.

3

Re: Shared Domain Quota

Yes, I know - we only have a visual quota. If the domain quota esceeds, the graphical bar gets red and we can see it very simple in the list.

this is much better for us - so the client does not get any warning and we know what to do.

4

Re: Shared Domain Quota

Just curious, what will you do when domain quota exceeded?

If user sent/received lots of large emails (e.g. 1GB more than domain quota) before you found the domain quota exceeded, what can/will you do?

5

Re: Shared Domain Quota

As a full service provider we are working everyday in iRedmail. As soon we see a red bar (quota limit exceeded) we contact the customer, so he can reduce the size - otherwise we will charge more for the additional disc-space used.

This is a win-win solution for us, as our customers nerver get a email blocked (because of quota limit) and we could easily sell more disc-space.

6

Re: Shared Domain Quota

Good idea to do business.

Personally, i have no idea to implement this feature in a ideal way, so i don't want to implement it right now. I think it's easy for you to maintain this small modification on your server.