Assign Global space per domain using Domain Quota
Assign Global space per domain using Domain Quota
Purpose
Learn how to assign Global space per domain using Domain Quota. This is an interesting feature used to control the Total space per domain instead of per each Mailbox.
Resolution
Since Zimbra Collaboration 8.0.x, you can restrict the Global space per Domain instead of per account. This is a useful feature for some Customer cases and for Service Providers who sell a global Space to share between all accounts; they can instead do it per account.
During this Wiki article we will use the domain zimbralab.local, but you need to follow the steps using your own domain:
Then, go to Home > Configure > Domains > zimbralab.local > Advanced where you add the desired values. Please note that the fields are based in bytes (B).
- Domain Quota (Bytes) - zimbraMailDomainQuota - This specifies a default quota for each account in the domain (for any account that does not have zimbraMailQuota explicitly set). When set to 20100200, for example, each account in the domain will have a quota around 20MB.
- Domain Aggregate Quota (Bytes) - zimbraDomainAggregateQuota - In this field you can specify an aggregate quota for the entire domain. If the value is 100200300400, for example, then the total used by all mailboxes cannot exceed about 100GB. (Note: this guide previously referred to this field as a configuration for extra space as a buffer once the domain quota was reached.)
- Domain Aggregate Quota Warning Percent - zimbraDomainAggregateQuotaWarnPercent - In this field you add the % that the domain should fill to send an email to the Email Account that you configure in the next field. In this example, 75%.
- Domain Aggregate Quota Warning Email Recipient - zimbraDomainAggregateQuotaWarnEmailRecipient - The email contact to send the warning message once the percent is reached.
- Domain Aggregate Quota Policy - zimbraDomainAggregateQuotaPolicy - In this menu, select what to do once the Quota is reached. You have 3 different options:
- allow send/receive
- block send
- block send/receive
When configuring an admin account (Home > Manage > Accounts):
- Maximum Quota (MB) administrator can specify - zimbraDomainAdminMaxMailQuota - This controls the maximum quota that the administrator can set for a user.
Lab example
You can check the Domain Quota as well as the space that each account is using with the next command:
zimbra@zimbra-sn-u14-10:~$ zmprov gqu `zmhostname` |grep zimbralab.local admin@zimbralab.local 20971520 850834 userb@zimbralab.local 20971520 16464 usera@zimbralab.local 20971520 8070 user30@zimbralab.local 20971520 2376 galsync.i4aqxpuk4s@zimbralab.local 20971520 0 ham.tqii1zmg7x@zimbralab.local 20971520 0 spam.9xvljn5ppc@zimbralab.local 20971520 0 userc@zimbralab.local 20971520 0 virus-quarantine.b35czscroj@zimbralab.local 20971520 0
In this case, we can see that the Domain has a Global Domain Quota set at 20MB, from which all users are using 877744 bytes in total, less than 1MB.
Filling the domain up to the 75%
Let's send some 5MB message between the accounts to reach the quota quickly. The Quota cron job is scheduled at 02.15am, but you can force it to see the real Quota right now. The domain right now is using 15164444 bytes, around 15MB:
/opt/zimbra/libexec/zmcomputequotausage <ComputeAggregateQuotaUsageResponse xmlns="urn:zimbraAdmin"> <domain name="zimbralab.local" id="c8c355cd-d76d-449a-bd2e-8e25b6b51e02" used="15164444"/> </ComputeAggregateQuotaUsageResponse>
In this example, we've set to 20MB plus 5MB more, and we don't allow sending or receiving messages, so once the the Quota Warning % is reached you will receive an email like this:
Error message after reaching 100%
If you deny sending messages once the Domain Quota is reached, the users will see the next warning when they attempt to send messages:
Log trace if the domain reaches 100%
2015-07-07 15:20:44,542 INFO [qtp509886383-1225:https://192.168.211.20:8443/service/soap/SendMsgRequest] [name=admin@zimbralab.local;mid=2;ip=192.168.211.20;ua=ZimbraWebClient - GC45 (Mac)/8.6.0_GA_1178;] SoapEngine - handler exception com.zimbra.cs.mailbox.MailServiceException: domain exceeded aggregate quota of 5242880 bytes ExceptionId:qtp509886383-1225:https://192.168.211.20:8443/service/soap/SendMsgRequest:1436278844542:090b76b3080b4319 Code:mail.DOMAIN_QUOTA_EXCEEDED Arg:(limit, NUM, "5242880") at com.zimbra.cs.mailbox.MailServiceException.DOMAIN_QUOTA_EXCEEDED(MailServiceException.java:359) at com.zimbra.cs.util.AccountUtil.checkQuotaWhenSendMail(AccountUtil.java:107) at com.zimbra.cs.service.mail.SendMsg.handle(SendMsg.java:103) at com.zimbra.soap.SoapEngine.dispatchRequest(SoapEngine.java:569) at com.zimbra.soap.SoapEngine.dispatch(SoapEngine.java:432) at com.zimbra.soap.SoapEngine.dispatch(SoapEngine.java:266) at com.zimbra.soap.SoapServlet.doWork(SoapServlet.java:303) at com.zimbra.soap.SoapServlet.doPost(SoapServlet.java:213) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at com.zimbra.cs.servlet.ZimbraServlet.service(ZimbraServlet.java:206) at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:738) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1651) at com.zimbra.cs.servlet.CsrfFilter.doFilter(CsrfFilter.java:176) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1622) at com.zimbra.cs.servlet.RequestStringFilter.doFilter(RequestStringFilter.java:54) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1622) at com.zimbra.cs.servlet.SetHeaderFilter.doFilter(SetHeaderFilter.java:59) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1622) at org.eclipse.jetty.servlets.UserAgentFilter.doFilter(UserAgentFilter.java:83) at org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:351) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1622) at com.zimbra.cs.servlet.ETagHeaderFilter.doFilter(ETagHeaderFilter.java:47) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1622) at com.zimbra.cs.servlet.ContextPathBasedThreadPoolBalancerFilter.doFilter(ContextPathBasedThreadPoolBalancerFilter.java:107) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1622) at com.zimbra.cs.servlet.ZimbraQoSFilter.doFilter(ZimbraQoSFilter.java:116) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1622) at com.zimbra.cs.servlet.ZimbraInvalidLoginFilter.doFilter(ZimbraInvalidLoginFilter.java:117) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1622) at org.eclipse.jetty.servlets.DoSFilter.doFilterChain(DoSFilter.java:457) at org.eclipse.jetty.servlets.DoSFilter.doFilter(DoSFilter.java:326) at org.eclipse.jetty.servlets.DoSFilter.doFilter(DoSFilter.java:299) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1622) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:549) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:544) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:221) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1111) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:478) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1045) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:199) at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:109) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) at org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:309) at org.eclipse.jetty.server.handler.DebugHandler.handle(DebugHandler.java:81) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97) at org.eclipse.jetty.server.Server.handle(Server.java:462) at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:279) at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:232) at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:534) at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:607) at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:536) at java.lang.Thread.run(Thread.java:745)
Additional Content
- No related content