For additional guidance, check out our community articles detailing the process of migrating from your current platform to Carbonio CE.
For enterprise-level requirements and advanced features, consider checking out Zextras Carbonio – the all-in-one private digital workplace designed for digital sovereignty trusted by the public sector, telcos, and regulated industries.
Using CLI, you can manage mailboxes in Zimbra with different command options. In this article we are going to start with an overview of zmprov commands. Then we will take a brief introduction to zmmailbox.
ZMPROV COMMANDS
As mentioned above, we are going to start with some zmprov CLI commands to manage a mailbox. For every command, we will show you the extendend and short form and the syntax to be used. Remember that all commands are intended to be executed logging in as Zimbra user, with the command: su - zimbra
Get Mailbox Info:
To get Mailbox info you need to use getMailboxInfo (gmi) with the following syntax:
zmprov getMailboxInfo {accountName}
Normally the above command is used for advanced task or checks.
Get Quota Usage:
To get quota usage you need to use getQuotaUsage (gqu) with the following syntax:
zmprov getQuotaUsage {serverame}
The command above is used to see quota used by accounts on a server. It can be used also for reports.
Re-Index Mailbox:
To re-index Mailbox you need to use reIndexMailbox (rim) with the following syntax:
zmprov reIndexMailbox {user@yourdomain|id} {start|status|cancel} [{types|ids} {type or id} [,type or id...]]
This command is widely used, specially after account migration from old Zimbra versions, or when there are errors in a log or users reports that search is not working.
Recalculate Mailbox Counts:
To recalculate Mailbox Counts you need to use RecalculateMailboxCounts (rmc) with the following syntax:
zmprov RecalculateMailboxCounts {user@yourdomain|id}
You can use this command to istantly recalculate the mailbox quota usage and unread messages count, in case that both are out of sync with mailbox data.
We suggest to schedule “Recalculating mailbox quota usage and message count” to run in off peak hours and use it on one mailbox at a time.
Select Mailbox:
To select Mailbox you need to use selectMailbox (sm) with the following syntax:
zmprov selectMailbox {accountName} [{zmmailbox commands}]
Below you can find some other commands used mainly in situations where you are experiencing problems on the mailbox:
Compact Index Mailbox:
To compact Mailbox Index you need to use compactIndexMailbox (cim) with the following syntax:
zmprov compactIndexMailbox {name@domain|id} {start|status}
Verify Index:
To verify Index you need to use verifyIndex (vi) with the following syntax:
zmprov verifyIndex {name@domain|id}
Get Index Stats:
To get Index stats you need to use getIndexStats (gis) with the following syntax:
zmprov getIndexStats {name@domain|id}
ZMMAILBOX
To manage mailbox, a tool which can be used to help administrators provision new mailboxes along with accounts, debug issues with a mailbox, and help with migration, is zmmailbox. The basic syntax for this command is:
zmmailbox [args] [cmd] [cmd-args...]
Below we have a table showing you the basic arguments you can use with zmmailbox command with a short description:
Short form name | Long form name | Description |
-h | –help | display usage |
-f | –file | use file as input stream |
-u | –url | http[s]://{host}[:{port}] server hostname and optional port. Must use admin port with -z/-a |
-a | –account {name} | account name to auth as |
-z | –zadmin | use zimbra admin name/password from localconfig for admin/password |
-m | –mailbox | mailbox to open |
-p | –password {pass} | password for admin account and/or mailbox |
-P | –passfile {file} | read password from file |
-v | –verbose | verbose mode (dumps full exception stack trace) |
-d | –debug | debug mode (dumps SOAP messages) |
In addition to that, there are also some specific CLI tools available for different components of a mailbox. Their usage is described in the CLI help as follows:
zmmailbox help admin
– Help on admin related commandszmmailbox help commands
– Help on all commandszmmailbox help contact
– Help on address book. (contact related commands)zmmailbox help conversation
– Help on commands related to conversationzmmailbox help folder
– Help on folder related commandszmmailbox help item
– Help on item related commandszmmailbox help message
– Help on commands related to messageszmmailbox help misc
– Help on miscellaneous commandszmmailbox help search
– Help on commands related to searchzmmailbox help tag
– Help on tag related commands