How to Adjust the Zimbra Maximum Message and Upload Size via CLI

This article show you how to check and adjust the maximum message size and upload size to an email via the Zimbra MTA (Postfix). The default Postfix message_size_limit was 10MB (10240000 bytes) and the message_size_limit postconf parameter is configured globally for all zimbra MTAs.

Q. How to Adjust the Zimbra Maximum Message and Upload Size via command line interface (CLI) ?

A. This is how to check and adjust the Maximum Message Size and upload size. All the below command shall be runa s zimbra user :

zimbraMtaMaxMessageSize = Refer to message size of the email.
zimbraFileUploadMaxSize = refer to file uploads include attachments to messages, appointments, tasks and etc.
zimbraMailContentMaxSize = Refer to the overall message size
ms = modifyServer
mcf = modifyConfig
gcf = getConfig

1. Run as zimbra user :

# su - zimbra

2. Check the default message_size_limit parameter :

$ postconf | grep message_size_limit

Example and Result:

$ postconf | grep message_size_limit
message_size_limit = 10240000

3. Check the default global size for zimbraMtaMaxMessageSize, zimbraFileUploadMaxSize and zimbraMailContentMaxSize :

$ zmprov gcf zimbraMtaMaxMessageSize
zimbraMtaMaxMessageSize: 10240000
$ zmprov gcf zimbraFileUploadMaxSize
zimbraFileUploadMaxSize: 10240000
$ zmprov gcf zimbraMailContentMaxSize
zimbraMailContentMaxSize: 10240000

4. Change zimbraMtaMaxMessageSize and zimbraFileUploadMaxSizeto 40MB (40960000 bytes) globally.

$ zmprov modifyConfig zimbraMtaMaxMessageSize 40960000
$ zmprov modifyConfig zimbraFileUploadMaxSize 40960000

5. Usually overall message size will be bigger because each message may consist multiple upload files or attachment. In this case we will configure zimbraMailContentMaxSize parameter to 100MB :

$ zmprov modifyConfig zimbraMailContentMaxSize 102400000

6. Check the result of above command :

$ postconf | grep message_size_limit
message_size_limit = 40960000

7. How to set the Maximum Message and Upload Size to 40MB per server and overall message size to 100MB per server :

$ zmprov ms `zmhostname` zimbraFileUploadMaxSize 40960000
$ zmprov ms `zmhostname` zimbraMtaMaxMessageSize 40960000
$ zmprov ms `zmhostname` zimbraMailContentMaxSize 102400000


$ zmprov modifyServer mail1.ehowstuff.local zimbraFileUploadMaxSize 40960000
$ zmprov modifyServer mail1.ehowstuff.local zimbraMtaMaxMessageSize 40960000
$ zmprov modifyServer mail1.ehowstuff.local zimbraMailContentMaxSize 102400000

7. In most of the cases, all of above command will take effect automatically. But if the change does not happen after a short period of time, most likely we will need to do postfix reload or full zmcontrol restart :

$ postfix reload
$ zmcontrol restart

Note : Server settings override global setting

How to Get, Add, Delete, Distribution List using zmprov CLI in Zimbra

zimbraThe zmprov tool can performs all provisioning tasks in Zimbra LDAP including creating accounts, aliases, domains, COS, distribution lists, and calendar resources.This zmprov is very powerful tool for zimbra administrator to perform daily task. Beside using command line interface (CLI), system administrator also can perform the following task from zimbra admin console. For CLI, the syntax is zmprov [cmd] [argument].

1. Login to zimbra :

[root@centos64 ~]# su - zimbra

2. How to get DistributionListmembership :

[zimbra@centos64 ~]$ zmprov gdlm ictgroup@ehowstuff.local
# distributionList ictgroup@ehowstuff.local memberCount=2


3. How to getDistributionList :

[zimbra@centos64 ~]$ zmprov gdl ictgroup@ehowstuff.local
# distributionList ictgroup@ehowstuff.local memberCount=2
mail: ictgroup@ehowstuff.local
objectClass: zimbraDistributionList
objectClass: zimbraMailRecipient
uid: ictgroup
zimbraCreateTimestamp: 20130512043842Z
zimbraId: ee8b2755-d450-42a0-bb8b-b0ab64901ca6
zimbraMailAlias: ictgroup@ehowstuff.local
zimbraMailForwardingAddress: admin@ehowstuff.local
zimbraMailForwardingAddress: user1@ehowstuff.local
zimbraMailHost: centos64.ehowstuff.local
zimbraMailStatus: enabled


4. How to createDistributionList :

[zimbra@centos64 ~]$ zmprov cdl newgroup@ehowstuff.local
[zimbra@centos64 ~]$ zmprov adlm newgroup@ehowstuff.local user1@ehowstuff.local
[zimbra@centos64 ~]$ zmprov adlm newgroup@ehowstuff.local user2@ehowstuff.local
[zimbra@centos64 ~]$ zmprov gdlm newgroup@ehowstuff.local
# distributionList newgroup@ehowstuff.local memberCount=2


5. How to removeDistributionListMember :

[zimbra@centos64 ~]$ zmprov rdlm newgroup@ehowstuff.local user2@ehowstuff.local

6. How to getAlldistributionLists :

[zimbra@centos64 ~]$ zmprov gadl