Frequently Used Zimbra CLI
The Zimbra administration console is usually used as the mail tool for configuring and maintaining Zimbra. But actually, some Zimbra function can only be changed using the Command Line Interface (CLI) utility.
The CLI utility can be used for the following:
• Provisioning accounts
• Starting and stopping a service
• Installing self-signed certificates
• Local configuration
In this article I will list some CLI that frequently used. Before we start with the list, let’s see some notes about Zimbra CLI. I take these notes from Zimbra documentation.
General Tool Information
The Zimbra command-line utilities follow standard UNIX command-line conventions. Follow these guidelines when using the commands
• CLI commands are run as the zimbra user, that is su - zimbra.
• The actual CLI commands are case-sensitive. You must type them in lower case.
• Press ENTER after you type a command.
• Typing the CLI command and then - h displays the usage options for the command. Example: zmprov - h lists all the options available for the zmprov utility.
• Each operation is invoked through command-line options. Many have a long name and a short name. For example, these two commands are equivalent:
zmprov createAccount joe@domain.com test123
zmprov ca joe@domain.com test123
Syntax Conventions
When demonstrating the syntax of each tool, the following conventions indicate required, optional, and alternate values:
• {attribute} in curly brackets is required information.
• [attribute] in square brackets are optional arguments or information.
• {a|b|c} or [a|b|c] options separated by the pipe character | means “a” OR “b” OR “c”
• For attribute names that may contain spaces, surround the name with double quotes.
Location of Command-Line Utilities
The command-line tools available for administrators are all located in the /opt/zimbra/bin directory on the Zimbra server.
Zimbra CLI Commands
Here are some frequently used Zimbra CLI.
Account Provisioning Commands
| Long Name | Short Name | Syntax Example |
| createAccount | ca | Syntax:{name@domain} {password} [attribute1 value1 etc]
zmprov ca joe@domain.com test123 displayName JSmith |
| deleteAccount | da | Syntax:{name@domain|id|adminName}
zmprov da joe@domain.com |
| getAccountMembership | gam | {name@domain|id}
zmprov gam joe@domain.com |
| getAccount | ga | Syntax:{name@domain|id|adminName}
zmprov ga joe@domain.com |
| getAllAccounts | gaa | Syntax: [-v] [{domain}]
zmprov gaa zmprov gaa -v domain.com |
| getAllAdminAccounts | gaaa | Syntax: gaaa
zmprov gaaa |
| modifyAccount | ma | {name@domain|id|adminName} [attribute1 value1 etc]
zmprov ma joe@domain.com zimbraAccountStatus maintenance |
| setPassword | sp | {name@domain|id|adminName} {password}
zmprov sp joe@domain.com test321 |
| addAccountAlias | aaa | {name@domain|id|adminName} {alias@domain}
zmprov aaa joe@domain.com joe.smith@domain.com |
| removeAccountAlias | raa | {name@domain|id|adminName} {alias@domain}
zmprov raa joe@domain.com joe.smith@domain.com |
| setAccountCOS | sac | {name@domain|id|adminName} {cos-name|cos-id}
zmprov sac joe@domain.com RegularUsers |
| renameAccount | ra | {name@domain|id} {newname@domain}
zmprov ra joe@domain.com joe23@domain |
Distribution List Provisioning Commands
| Long Name | Short Name | Syntax Example |
| createDistributionList | cdl | {list@domain}
zmprov cdl distlist@domain.com |
| addDistributionListMember | adlm | {list@domain|id} {member@domain}
zmprov adlm distlist@domain.com joe@domain.com |
| removeDistributionListMember | rdlm | {list@domain|id}
zmprov rdlm distlist@domain.com joe@domain.com |
| deleteDistributionList | ddl | (list@domain|id}
zmprov ddl distlist@domain.com |
COS Provisioning Commands
| Long Name | Short Name | Syntax Example |
| createCos | cc | {name} [attribute1 value1 etc]
zmprov cc Executive zimbraAttachmentsBlocked FALSE zimbraAuthTokenLifetime 60m zimbraMailQuota 100M zimbraMailMessageLifetime 0 |
| deleteCos | dc | {name|id}
zmprov dc Executive |
| getCos | gc | {name|id}
zmprov gc Executive |
| getAllCos | gac | [-v]
zmprov gac -v |
| modifyCos | mc | {name|id} [attribute1 value1 etc]
zmprov mc Executive zimbraAttachmentsBlocked TRUE |
| renameCos | rc | {name|id} {newName}
zmprov rc Executive Business |
zmmsgtrace
This command is used to trace an email message that was sent or received
with the last 30 days.
Syntax
zmmsgtrace {-i|-s|-r|-F} <message_id>
| Long Name | Short Name | Description |
| –help | -h | Shows the help for the usage options for this tool. |
| -i | Message ID. | |
| -s | Sender address. | |
| -r | Recipient address. | |
| -F | From_ip/host | |
| -D | Dest_ip/host | |
| -t | start, end times in YYYYMMDD (hhmmss) format |
Example
zmmsgtrace -s joe@domain.com
zmmsgtrace -r jane@domain.com
zmmsgtrace -s joe@domain.com -t 20090701
zmmsgtrace -s joe@domain.com -r jane@domain.com -t 20090701
zmcontrol (Start/Stop Service)
This command is run to start or to stop services. You can also find which version of the zimbra Collaboration Suite is installed.
Syntax
zmcontrol [ -v -h ] command [args]
| Long Name | Short Name | Description |
| -v | Displays ZCS software version. | |
| -h | Displays the usage options for this command | |
| -H | Host name (localhost). | |
| Command in… | ||
| maintenance | Toggle maintenance mode. | |
| shutdown | Shutdown all services and manager on this host. When the manager is shutdown, you cannot query that status | |
| start | Startup manager and all services on this host | |
| startup | Startup manager and all services on this host | |
| status | Returns services information for the named host | |
| stop | Stop all services but leave the manager running. | |
-
Related posts:
- Redirect HTTP to HTTPS in Zimbra
- Error changing default domain COS in Zimbra
- Zimbra antivirus not started
- Setup a domain catchall account in Zimbra Mail Server
- Releasing quarantined emails in Zimbra


















July 16th, 2010 at 11:19 pm
Are there Zimprov commands to add contacts to an account? I’m working on an @mail to Zimbra migration.
August 5th, 2010 at 1:33 am
@Mark:
sorry, haven’t find zmprov command to add contacts to an account.
June 18th, 2011 at 8:35 pm
I saw the name of your blog post - Frequently Used Zimbra CLI | Papandut.Com: like IT, blog IT, share IT, help with IT - while I was searching on the web a few minutes ago. Would you mind if I put a link back to http://papandut.com/2009/06/29/frequently-used-zimbra-cli/ on my website?
September 9th, 2011 at 2:49 am
Hello…
My life,vist it http://juhuacha.sexusblog.com/2011/09/02/little-rock-wedding-cakes/ ,Thanks….
September 11th, 2011 at 3:57 am
Hello…
My life,vist it http://xiangdress.weblogplaza.com/2011/09/02/military-weddings-are-more-spectacular-than-civilian-weddings/ ,Thanks….
October 21st, 2011 at 6:26 pm
Great One…
What determines how we perceive different types of music? , http://bghgjut.beeplog.com/blog.pl?blogid=225234&o=entry...