ZCS Administrator's Guide Network Edition 6.0, Rev 1
Table of Contents Previous Next Index


Appendix A Command-Line Utilities : Zimbra CLI Commands

Zimbra CLI Commands
The table below lists the CLI commands in /opt/zimbra/bin.
Check consistency of appointments and attendees in the Zimbra calendar
Start, stop, status of the Zimbra servers. Also can use to find the Zimbra version installed.
Start, stop, the conversion server or find the status of the converted attachments conversion/indexing
Start, stop, reload, or find the status of the mailbox components (mailboxd, MySQL, convert)
Performs data restore using backed up snapshots taken periodically. Users who use snapshots to backup and restore their information from a standby site use this command.
Performs all provisioning tasks in Zimbra LDAP, including creating accounts, domains, distribution lists and aliases
Ability to write Python scripts that access Zimbra Java libraries. It sets the ZCS class path and starts the Jython interpreter.
Outputs an XML configuration that describes the current state of the data gathered from zmstat-chart to generate charts on the administration console.
Start, stop, or find the status of the Swatch process, which is used in monitoring
Set the Web server mode to the communication protocol options: HTTP, HTTPS or mixed
Provides mechanism to process timezone changes from the command line
zmprov (Provisioning)
The zmprov tool performs all provisioning tasks in Zimbra LDAP, including creating accounts, aliases, domains, COS, distribution lists, and calendar resources. Each operation is invoked through command-line options, each of which has a long name and a short name.
The syntax for modify can include the prefix “+” or “-” so that you can make changes to the attributes affected and do not need to reenter attributes that are not changing.
The syntax is zmprov [cmd] [argument].
The following objects use this syntax:
The following example would add the attribute zimbraZimletUserProperties with the value “blue” to user 1 and would not change the value of any other instances of that attribute.
zmprov ma user1 +zimbraZimletUserProperties "com_company_testing:favoriteColor:blue"
 
--log property file
use Zimbra admin name/password from localconfig for admin/password
--authtoken (authtoken)
use auth token string (has to be in JSON format) from command line
--authtoken (authtoken file)
use auth token string (has to be in JSON format) from command line
The commands in the following table are divided into the tasks types - Account, Calendar Resources, Config, COS, Distribution List, Documents, Domain, Server, and Miscellaneous.
Short Name
zmprov aaa joe@domain.com joe.smith@engr.domain.com
Note: This command does not check the password age or history.
Syntax:{name@domain} {password} [attribute1 value1 etc]
{name@domain} {ds-type} {ds-name} [attr1 value1 [attr2 value2...]]
{name@domain} {identity-name} [attr1 value1 [attr2 value2...]]
{name@domain} {signature-name} [attr1 value1 [attr2 value2...]]
{name@domain|id|adminName} [attribute1 value1 etc]
zmprov ma joe@domain.com zimbraAccountStatus maintenance
{name@domain | id} {ds-name |ds-id} [attr 1 value 1 [attr2 value 2...]]
{name@domain |id} {identity-name} [attr 1 value 1 [attr 2 value 2...]]
{name@domain |id} {signature-name | signature-id} [attr 1 value 1 [attr 2 value 2...]]
zmprov raa joe@domain.com joe.smith@engr.domain.com
{name@domain|id} {newname@domain}
Note: After you rename an account, you should run a full backup for that account. zmbackup -f - <servername.com> -a <newaccountname@servername.com>
Note: Passwords cannot included accented characters in the string. Example of accented characters that cannot be used: ã, é, í, ú, ü, ñ.
{name@domain|id} {newName@domain}
This lists each COS, the COS ID and the number of accounts assigned to each COS
{alias-domain-name} {local-domain-name|id} [attr1 value1 [attr2 value2...]]
zmprov cd mktng.domain.com zimbraAuthMech zimbra
zmprov md domain.com zimbraGalMaxResults 500
Note: Do not modify zimbraDomainRenameInfo manually. This is automatically updated when a domain is renamed.
Note: renameDomain can only be used with “zmprov -l/--ldap
zmprov cc Executive zimbraAttachmentsBlocked FALSE zimbraAuthTokenLifetime 60m zimbraMailQuota 100M zimbraMailMessageLifetime 0
zmprov mc Executive zimbraAttachmentsBlocked TRUE
zmprov ms domain.com zimbraVirusDefinitionsUpdateFrequency 2h
Used to publish into nginx.conf what servers should be used for reverse proxy lookup.
Used to publish into saslauthd.conf what servers should be used for saslauthd.conf MTA auth
get DistributionListmembership
Before importing files, any file that will become a Documents page (wiki-style page), must be renamed to include the extension “.wiki”. If not it is imported as a file, accessed either as an attachment or an image.
{name@domain|id} {action} [{reindex-by} {value1} [value2...]]
When unread message count and quota usage are out of sync with the data in the mailbox, use this command to immediately recalculate the mailbox quota usage and unread messages count.
Important: Recalculating mailbox quota usage and message count should be schedule to run in off peak hours and used on one mailbox at a time.
[-s/--server hostname] {name@domain|id} {logging-category} {debug|info|warn|error}
[-s/ --server hostname] {name@domain|id} {logging-category}
When name@domain is specified, removes the custom logger created for the account otherwise removes all accounts all account loggers from the system.
See the zmprov Log Categories for a list of logging categories.
[-v] {ldap-query} [limit] [offset] [sortBy {attribute} [sortAscending 0|1] [domain {domain}]
{+|-} {dl-name@domain|id} {owner-name|owner-id} [{folder-path|folder-id}]
Prints all attribute names (account, domain, COS, servers, etc.).
Generates a pre-authentication key to enable a trusted third party to authenticate to allow for single-sign on. Used in conjunction with GenerateDomainPreAuth.
{domain|id} {name} {name|id|foreignPrincipal} {timestamp|0} {expires|0}
Used to publish into nginx.conf the servers that should be used for reverse proxy lookup
Used to publish into saslauthd.conf the servers that should be used for saslauthd.conf MTA auth
Examples
zmprov ca name@domain.com password
Create one account with a password that is assigned to a specified COS. You must know the COS ID number. To find a COS ID, type zmprov gc <COSname>.
zmprov ca name@domain.com password zimbraCOS cosIDnumberstring
zmprov ca name@domain.com ‘’
The empty single quote is required and indicates that there is no local password.
Using a batch process to create accounts, see Managing the zimbra Collaboration Suite chapter for the procedure.
zmprov aaa accountname@domain.com aliasname@domain.com
zmprov cdl listname@domain.com
zmprov adlm listname@domain.com member@domain.com
Change the administrator’s password. Use this command to change any password. Enter the address of the password to be changed.
zmprov sp admin@domain.com password
zmprov cd marketing.domain.com zimbraAuthMech zimbra
zmprov mcf zimbraDefaultDomain domain1.com
zmprov gac -v
zmprov gaa domain.com
zmprov gaa -v domain.com
zmprov +zimbraServiceEnabled logger
Then type zmloggerctl start, to start the logger.
To modify the purge interval, set zimbraMailPurgeSleepInterval to the duration of time that the server should “sleep” between every two mailboxes. Type:
zmprov ModifyServer <server-name> zimbraMailPurgeSleepInterval <Xm>
X is the duration of time between mailbox purges; m represents minutes. You could also set <xh> for hours.
Modify zimbraNewMailNotification to customize the notification email template. A default email is sent from Postmaster notifying users that they have received mail in another mailbox. To change the template, you modify the receiving mailbox account. The variables are
You can specify which of the above variables appear in the Subject, From, or Body of the email. The following example is changing the appearance of the message in the body of the notification email that is received at name@domain.com. You can also change the template in a class of service, use zmprov mc. The command is written on one line.
zmprov ma name@domain.com zimbraNewMailNotificationBody ‘Important message from ${SENDER_ADDRESS}.${NEWLINE}Subject:${SUBJECT}’
zmprov Log Categories
 
        zimbra.account
 
 
zmaccts
This command runs a report that lists all the accounts, their status, when they were created and the last time anyone logged on. The domain summary shows the total number of accounts and their status.
Syntax
zmaccts
zmarchive config
This command is used for configuring the archiving mailbox. It has the option of using short commands or full names for commands that lead to the same function being carried out.
Syntax
zmarchiveconfig [args] [cmd] [cmd-args...]
Description
 
Short Name
(host)[:(port)] Displays the server hostname and optional port
(name) Returns the value of the account name to be authorized
[archive-create <TRUE/FALSE>] [archive-password <pa
zmarchivectl
This command is used to start, stop, reload, or check the status of the Zimbra account archive.
Syntax
/opt/zimbra/bin/zmarchivectl start|stop|reload|status
zmarchivesearch
This command is used to search across account archives. You can search for archives that match specific criteria and save copies to a directory.
Syntax
zmarchivesearch {-m <user@domain.com>} {-q <query_string>} [-o <offset>] [-l <limit>] [-d <output_directory>]
Description
 
Short Name
<arg> Directory to write messages to. If none is specified, then only the headers are fetched. Filenames are generated in the form
RESULTNUM_ACCOUNT-ID_MAILITEMID
<arg> Sets the limit for the number of results returned. The default is 25
<arg> Specifies where the hit list should begin. The default is 0
Allows printing of status messages while the search is being executed
Example
This example is to search archives on a specified server and put a copy of the archive in a specified directory.
zmarchivesearch -m user1@yourdomain.com -q “in:sent” -o 0 -l 30 -d /var/tmp
zmbackup
This tool performs full backups and incremental backups for a designated mail host.
This utility has short option names and full names. The short option is preceded by a single dash, while the full option is preceded by a double dash. For example, -f is the same as --fullBackup.
Syntax
One of -f, -i, or -del must be specified.
zmbackup {-f | -i | del} {-a <arg>} [options]
Description
 
Short Name
<arg> Account email addresses separated by white space or all for all accounts. This option is not specified for auto-grouped backups since the system knows which accounts to backup every night.
<arg> Deletes the backups including and prior to the specified label, date (YYYY/MM/DD[-hh:mm:ss]) or period (nn(d|m|y]).
Starts a full backup. In auto-grouped backup mode, this option also copies the redologs since the last backup (which is the main function of an incremental backup).
Starts an incremental backup. This option is not available in the auto-grouped backup mode
<arg> Mail server host name. For format, use either the plain host name or the server.domain.com name. The default is the localhost name.
<arg> Specifies the target backup location. The default is <zimbra_home>/backup.
Examples
In these examples, the server (-s) is server1.domain.com. The (-t) is not required if the target is the default directory, (zimbra_home/backup).
zmbackup -f -a all -s server1.domain.com
zmbackup -i -a all -s server1.domain.com
Perform full backup of only user1’s mailbox on server1. Note that hostname does not need full domain if account is used.
zmbackup -f -a user1@domain.com -s server1
Perform incremental backup of user1’s mailbox on server1
zmbackup -i -a user1@domain.com -s server1
zmblobchk
Checks the consistency of the Zimbra blob store (/opt/zimbra/store). This command checks and records notes of files without matching database metadata. It also checks to make sure that size information is correct for the files.
Syntax
zmblobchk
Description
 
Short Name
<arg> Saves or loads report to and from the specified file
<arg> Displays report from the specified file
<arg> Returns the Zimbra user MySQL password
zmcalchk
This command checks the consistency of appointments on the Zimbra calendar and sends an email notification regarding inconsistencies. For example, it checks if all attendees and organizers of an event on the calendar agree on start/stop times and occurrences of a meeting.
See the output of zmmailbox help appointment for details on time-specs.
Syntax
zmcalchk [-d] [-n <type>] <user> <start-time-spec> <end-time-spec>
Description
 
Short Name
Allows the user to specify the maximum number of attendees to check. The default value is 50.
Send email notifications to selected users if they are out of sync for an appointment
zmschedulebackup
This command is used to schedule backups and add the command to your cron table.
The default schedule is as follows:
Each crontab entry is a single line composed of five fields separated by a blank space. Specify the fields as follows:
minute — 0 through 59
hour — 0 through 23
day of month — 1 through 31
month — 1 through 12
day of week — 0 through 7 (0 or 7 is Sunday, or use names)
Type an asterisk (*) in the fields you are not using.
This command automatically writes the schedule to the crontab.
Syntax
zmschedulebackup {-q|-s|-A|-R|-F|-D}[f|i|d|] [“schedule”]
Description
 
Save the schedule. Allows you to save the schedule command to a text file so that you can quickly regenerate the backup schedule when the system is restored.
Removes the current schedule and cancels all scheduled backups.
Can be used only to designate a full back target location. The default is /opt/zimbra/backup.
Note: You cannot designate a target for incremental backups. If a target (-t) location is added for incremental scheduled backups, it is ignored.
<time specifier> Incremental backup. Incremental backup is not used with the auto-grouped backup mode.
Examples
zmschedulebackup -D
zmschedulebackup -R f [“schedule”]
zmschedulebackup -A f [“schedule”]
zmschedulebackup -A i [“schedule”]
zmschedulebackup -q
To display the schedules on one line as a command, so that they can be copied to a text file and saved to be used if the application needs to be restored.
zmschedulebackup -s
zmbackupabort
This command can be used to stop a backup process. Before you can abort an account you must know its backup label. This label is displayed after you start the backup procedure. If you do not know the label, use zmbackupquery to find the label name.
To stop the restore process. The zmbackupabort -r interrupts an on going restore. The restore process is stopped after the current account is restored. The command displays message showing which accounts were not restored.
Syntax
zmbackupabort [options]
Description
 
Short Name
<arg> Label of the full backup to be aborted. Use the zmbackupquery, to find the label name.
<arg> Mail server host name. For format, use either the plain host name or the server.domain.com name. The default is the localhost name.
<arg> Specifies the target backup location. The default is <zimbra_home>/backup.
zmbackupquery
The zmbackupquery command is used to find full backup sets. The command can be used to find a specific full backup set or full backup sets since a specific date, or all backup sets in the backup directory.
To find out the best full backup to use as the basis for point-in-time restore of an account, run a command like this:
$ zmbackupquery -a <account email> --type full --to <restore-to time>
Syntax
zmbackupquery [options]
Description
 
Short Name
-a
<arg> Account email addresses separated by white space or all for all accounts
<arg> List backups whose start date/time is at or after the date/time specified here.
<arg> The label of the full backup session to query. An example of a label is backup200507121559510.
<arg> Mail server host name. For format, use either the plain host name or the server.domain.com name. The default is the localhost name.
<arg> Specifies the backup target location (The default is <zimbra_home>/backup.)
<arg> List backups whose start date/time is at or before the date/time specified here.
<arg> Backup set type to query. “full” or “incremental”, both are queried if one is not specified.
Specify date/time in one of these formats:
2008/12/16 12:19:23
2008/12/16 12:19:23 257
2008/12/16 12:19:23.257
2008/12/16-12:19:23-257
2008/12/16-12:19:23
20081216.121923.257
20081216.121923
20081216121923257
20081216121923
Specify year, month, date, hour, minute, second, and optionally millisecond.
Month/date/hour/minute/second are 0-padded to 2 digits, millisecond to 3 digits.
Hour must be specified in 24-hour format, and time is in local time zone.
zmrestore
This tool performs full restores and incremental restores for a designated mail host. You can either specify specific accounts, or, if no accounts are specified, all accounts are in the backup are restored. In addition, you can restore to a specific point in time.
This utility has short option names and full names. The short option is preceded by a single dash, the full option is proceeded by a double dash. For example, -rf is the same as --restorefullBackupOnly.
Syntax
zmrestore [options]
Description
 
Short Name
<arg> Specifies the account email addresses. Separate accounts with a blank space or type all to restore all accounts.
Replays the redo logs in backup only, which excludes archived and current redo logs of the system
Restores accounts to target accounts whose names are prepended with prefix. (Can only be used in commands that use the -pre option.)
<arg> The label of the full backup to restore. Restores to the latest full backup if this is omitted.
<arg> The prefix to pre-pend to the original account names
<arg> Replay redo logs up to and including this incremental backup
<arg> Replay up to and including this redo log sequence
<arg> Replay rodo logs until this time
Restores to the full backup only, not any incremental backups since that backup.
<arg> Mail server host name. For format, use either the plain host name or the server.domain.com name. The default is the localhost name.
If true, do not execute delete operation during redo log replay
Do not restore if named accounts were deleted or did not exist at backup time. (This option is always enabled with -a all)
<arg> Specifies the backup target location. The default is <zimbra_home>/backup.
Examples
Perform complete restore of all accounts on server1, including last full backup and any incremental backups since last full backup.
zmrestore -a all -s server1.domain.com
zmrestore -rf -a all -s server1.domain.com
zmrestore -a user1@domain.com -ca -pre new_
zmrestoreoffline (Offline Restore)
This tool is run when the Zimbra server (i.e., the mailbox process) is down. The MySQL database for the server and the OpenLDAP directory server must be running before you start the zmrestoreoffline command.
Syntax
zmrestoreoffline [options]
Description
 
Short Name
<arg> Specifies the account email addresses. Separate accounts with a blank space or state all for restoring all accounts. Required.
--backedupRedologs Only
Replays the redo logs in backup only, which excludes archived and current redo logs of the system
Restores accounts to new target accounts whose names are pre-pended with prefix
<arg> The label of the full backup to restore. Type this label to specify a backup file other then the latest.
<prefix> The prefix to pre-pend to the original account names.
-restoreToIncrLabel
<arg> Replay redo logs up to and including this incremental backup
<arg> Replay up to and including this redo log sequence
<arg> Replay rodo logs until this time
--restoreFullBackupOnly
Restores to the full backup only, not any incremental backups since that backup.
<arg> Mail server host name. For format, use either the plain host name or the server.domain.com name. The default is the localhost name. If -s is specified, this must be localhost.
--skipDeletedAccounts
-skipDeletedAccounts
Do not restore if named accounts were deleted or did not exist at backup time. (This option is always enabled with -a all)
<arg> Specifies the backup target location. The default is <zimbra_home>/backup.
Examples
Before you begin zmrestoreoffline, the LDAP directory server must be running
Perform a complete restore of all accounts on server1, including last full backup and any incremental backups since last full backup.
zmrestoreoffline -s server1.domain.com
zmrestoreldap
This tool is run to restore accounts from the LDAP backup.
Syntax
zmrestoreldap {-lb <arg>} {-t <arg>} [options]
Description
 
Short Name
<arg> Session label to restore from. For example, full200612291821113.
<arg> Specifies the backup target location. The default is /opt/zimbra/backup.
<arg> Restores named account(s). List account names separated by white space.
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]
Description
 
Short Name
Shutdown all services and manager on this host. When the manager is shutdown, you cannot query that status.
zmmailboxmove (Move Mailbox)
This command is used to move a mailbox from one Zimbra server to another. Mailboxes can be moved between Zimbra servers that share the same LDAP server. All the files are copied to the new server and LDAP is updated. After the mailbox is moved to a new server, a copy still remains on the older server, but the status of old mailbox is closed. Users cannot log on and mail is not delivered. You should check to see that all the mailbox contents were moved successfully before purging the old mailbox.
Syntax
zmmailboxmove {-a <arg>} {-t <arg>|-po} [options]
Description
 
Short Name
<arg> Email address of account to move
Purge old mailbox on previous server. After a mailbox has been successfully moved to a new server, perform purgeOld to remove the mailbox and its contents from the previous server.
<arg> Mail server hostname. The default is the localhost. Server where the --account mailbox is located.
<arg> Server where mailbox is moved to Use -t option to move a mailbox from the current server to the new server specified by the option. .
Use auth token string (has to be in JSON format) from command line
Use auth token string (has to be in JSON format from command line
Example
In these examples, two separate command lines are used to move the mailbox and to purge the old mailbox. This is because -t and -po are mutually exclusive.
To move a mailbox from the default server to the target server:
zmmailboxmove -a user1@domain.com -t server2.domain.com
To move a mailbox from the default server to the target server, while overwriting any existing mailbox for the account on the target server:
zmmailboxmove -a user1@domain.com -t server2.domain.com -ow
To purge an old mailbox from the default server, after checking that the contents of the mailbox were successfully moved to the target server:
zmmailboxmove -a user1@domain.com -po
zmmboxsearch (Cross Mailbox Search)
The CLI command zmmboxsearch is used to search across mailboxes. You can search across mailboxes to find messages and attachments that match specific criteria and save copies of these messages to a directory.
Syntax
zmmboxsearch {-m <arg>} {- q <arg>} [-o <arg>] [-l <arg>] [-d <arg>] [options]
Description
 
Short Name
<arg> Directory to write the messages to. If none is specified, then only the headers are fetched. Files names are generated in the form RESULTNUM_ACCOUNT-ID_ MAILITEMID.
Sets the limit for the number of results returned. The default is 25.
<arg> Comma-separated list of mailboxes to search. UIDs or email-address or /SERVER/MAILBOXID or *.
<arg> Specify where the hit list should start. The default is 0
<arg> The query string for the search
<arg> Mail server hostname. default is the localhost
Request that the status message print while the search is being executed
Example
The following example is to do a cross-mailbox search in the inbox folder of two different mailboxes on the specified server and put a copy of the message in to the specified directory.
zmmboxsearch -m user1@yourdomain.com,user2@yourdomain.com -q “in:inbox” -d /var/tmp
zmcertmgr
The CLI command zmcertmgr is used to manage your certificates from the command line. You can use the administration console to easily view, update and install self-signed and commercial certificates. See the administration console help for more information about using this tool.
Syntax
zmcertmgr {attribute} [arg]
Description
 
<self|comm> [-new] [subject] [-subjectAltNames “host1,host2”]
zmgsautil
The CLI command zmgsautil can be used to create or delete the GAL sync account and to force syncing of the LDAP data to the GAL sync account.
A GAL sync account is created when the GAL is configured on a domain. This account is created and the polling interval for performing a full sync is managed from the administration console.
To see attributes and settings for a GAL sync account, run zmprov gds against the account.
 
Creates the GAL sync account. This should be done from the administration console.
Deletes the GAL sync account and the references to the LDAP server. The account can also be deleted from the administration console.
trickleSync [-a {galsynceaccountname}|-i {account-id}] [-d {datasource-id}] [-n {datsource-name}]
The datasource ID the LDAP datasource ID. The datasource name is the name of the address book (folder) in the GAL account created to sync LDAP to.
This syncs all LDAP contact data. You can also set this from the administration console.
fullSync [-a {galsynceaccountname}|-i {account-id}] [-d {datasource-id}] [-n {datsource-name}]
This should be used to reload the entire GAL if there is change in the filter, attribute mapping or LDAP server parameters.
forceSync [-a {galsynceaccountname}|-i {account-id}] [-d {datasource-id}] [-n {datsource-name}]
zmldappasswd
The CLI command zmldappasswd changes the LDAP password on the local server. In multi node environments, this command must be run on the LDAP master server only.
This CLI command used with options changes other passwords.
For better security and audit trails the following passwords are generated in ZCS:
LDAP Admin password. This is the master LDAP password. This is not new, but has been renamed.
LDAP Root password. This is used for internal LDAP operations.
LDAP Postfix password. This is the password used by the postfix user to identify itself to the LDAP serve and must be configured on the MTA server to be the same as the password on the LDAP master server.
LDAP Amavis password. This is the password used by the amavis user to identify itself to the LDAP server and must be configured on the MTA server to be the same as the password on the LDAP server.
LDAP Replication password. This is the password used by the LDAP replication user to identify itself to the LDAP master and must be the same as the password on the LDAP master server.
Syntax
opt/zimbra/bin/zmldappasswd [-h] [-r] [-p] [-l] new password
Description
 
Changes ldap_amavis-password
Changes ldap_replication_password
Changes ldap_postfix_password
Changes ldap_root_passwd
zmlocalconfig
This command is used to set or get the local configuration for a zimbra server.
Syntax
zmlocalconfig [options]
To see the local config type zmlocalconfig
Description
Short Name
<arg> File in which the configuration is stored
Edit the configuration file, change keys and values specified. The [args] is in the key=value form.
Edit the keys whose change is known to be potentially dangerous
<arg> Shows the values in one of these formats: plain (default), xml, shell, nokey.
Shows the values for only those keys listed in the [args] that have been changed from their defaults
This option is used with the edit option. Specified key is set to a random password string.
Remove a configuration key. If this is a key with compiled-in defaults, set its value to the empty string.
zmmailbox
The zmmailbox tool is used for mailbox management. The command can help administrators provision new mailboxes along with accounts, debug issues with a mailbox, and help with migrations.
You can invoke the zmmailbox command from within the zmprov command. You enter selectMailbox within zmprov to access the zmmailbox command connected to that specified mailbox. You can then enter zmmailbox commands until you type exit. Exit returns you to zmprov. This is useful when you want to create accounts and also pre-create some folders, tags, or saved searches at the same time.
Syntax
zmmailbox [args] [cmd] [cmd-args ...]
Description
 
Short Name
http[s]://{host}[:{port}] server hostname and optional port. Must use admin port with -z/-a
use zimbra admin name/password from localconfig for admin/password
--authtoken (authtoken)
use authtoken string (has to be in JSON format) from command line
--authtoken (authtoken file)
use authtoken string (has be in JSON format) from command line
Specific CLI tools are available for the different components of a mailbox. Usage is described in the CLI help for the following.
 
Examples
When you create an account, you may want to pre-create some tags and folders. You can invoke zmmailbox inside of zmprov by using “selectMailbox(sm)”
 
zmtlsctl
This command is used to set the Web server mode to the communication protocol options: HTTP, HTTPS, Mixed, Both and Redirect.
Mixed mode redirects to HTTPS for login and HTTP for normal session traffic.
Both mode means that an HTTP session stays HTTP, including during the log in phase, and an HTTPS session remains HTTPS throughout, including the log in phase.
Redirect mode redirects any users connecting via HTTP to a HTTPS connection.
Mailboxd has to be stopped and restarted for the change to take effect.
Note: If you switch to HTTPS, you use the self-signed certificate generated during ZCS installation, in /opt/zimbra/ssl/zimbra/server/server.crt.
Syntax
zmtlsctl [mode]
mode = http, https, mixed, both, redirect
Steps to run
 
1.
Type zmtlsctl [mode].
2.
Type zmmailboxdctl stop.
3.
zmhsm
This command is to start, stop (abort), and see the status of a HSM session. The threshold for when messages are moved to a storage volume is configured from the administration console, Servers>Volume tab.
Syntax
zmhsm {abort|start|status} {server} <name>
Description
Short Name
Aborts the current HSM session.If all the messages in a mailbox being processed were not moved before you clicked Abort, no messages from that mailbox are moved from the primary volume. Messages for mailboxes that have completed the move to the secondary volume are not moved back to the primary volume.
<arg> The mail server host name. The default is the localhost [args].
zmlicense
This command is used to view and install your Zimbra license. The license can be viewed and installed from the administration console, Global Settings, License tab.
Syntax
zmlicense [options]
 
Short Name
<arg> Installs the specified license file.[arg] This is the Zimbra license file that you received.
zmmetadump
This command is a support tool that dumps the contents of an item’s metadata in a human readable form.
Syntax
zmmetadump -m <mailbox id/email> -i <item id>
or zmmetadump -f <file containing encoded metadata>
zmmypasswd
This command is used to change zimbra_myql_password. If the --root option is specified, the mysql_root_passwd is changed. In both cases, MySQL is updated with the new passwords. Refer to the MySQL documentation to see how you can start the MySQL server temporarily to skip grant tables, to override the root password. This requires a restart for the change to take effect.
Syntax
zmmypasswd [--root] <new_password>.
zmplayredo
Users who maintain a backup and restore mechanism using the snapshot facility of the storage layer use this command to restore backed up data. This command brings all backed up data to the current state so that there is no loss of information during the restore process.
Syntax
zmplayredo <option>
Time is specified in the local time zone. The year, month, date, hour, minute, second, and optionally millisecond should be specified. Month/date/hour/minute/second are 0-padded to 2 digits, millisecond to 3 digits. The hour must be specified in a 24- hour format.
Description
 
Short Name
<arg> Replays snapshots from the specified redolog sequence
<arg> Used for specifying the queue capacity per player thread. The default value is 100
<arg> Specifies the number of parallel redo threads. The default value is 50
<arg> Replays snapshots to the specified redolog sequence
zmproxyconfgen
This command generates the nginx proxy configuration files. It reads LDAP settings to replace template variables and generates the final nginx configuration.
Syntax
ProxyConfGen [options]
Description
 
Short Name
<arg> Overrides a config variable. The <arg> format should be name=value. To see a list of names, use -d or -D
Prints the Definitions variable map after loading LDAP configuration and processing overrides
<arg> Displays the directory path (relative to $workdir/conf), where included configuration files are written
Specifies not to write configuration and only display the files that would be written
<arg> Displays the config file prefix. The default value is nginx.conf
<arg> Displays the template file prefix. The default value is $prefix
<arg> Specifies a valid server object. Configuration is generated based on the specified server’s attributes. The default is to generate configuration based on global configuration values
<arg>Specifies the proxy template directory. The default value is $workdir/conf/nginx/templates
<arg> Specifies the proxy working directory. The default value is /opt/zimbra
zmproxypurge
This command purges POP/IMAP proxy routing information from one or more memcached servers. Available memcached servers are discovered by the zmprov gamcs function. Others can be specified if necessary using the server port.
Syntax
ProxyPurgeUtil [-v] [-i] -a account [-L accountlist] [cache1 [cache2...]]
Description
 
Short Name
Displays file containing list of accounts, one per line
Specifies the format to be used for printing routing information with information. The fields that display by default are
(optional command) Specifies additional memcache server in the form of server:port
zmredodump
This command is mainly used for debugging purposes and dumps the contents of a redolog file. When users are debugging a problem, Zimbra support might ask them to run zmredodump with specific options.
Multiple log files/directories can be specified with all redolog files under each directory being sorted in ascending order and processed.
Syntax
zmredodump [options] <redolog file/directory> [...]
Description
 
Short Name
Specifies the mailbox ids separated by a comma or a space. The entire list of mailbox ids must be quoted if using space as a separator.
To dump contents of all the redolog files, omit this option.
Specifies if file offsets and size for each redolog dump should not be shown
Activates the quiet mode. Used to only print the log filename and errors, if any. Useful for verifying integrity of redologs with minimal output
Shows blob content. The specified item’s blob is printed with <START OF BLOB> and <END OF BLOB> marking the start and end of the blob
zmskindeploy
This command simplifies the process of deploying skins in ZWC. This tool processes the skin deployment, enables the skin for all users of the ZWC deployment, and restarts the web server so that it recognizes the new skin.
For more information about this tool, see http://wiki.zimbra.com/index.php?title=About_Creating_ZCS_Themes
Syntax
zmskindeploy <path/to/skin/dir/or/zipfile>
zmsoap
Prints mail, account, and admin information in the SOAP format.
Syntax
zmsoap [options] <path1 [<path2>...]
Description
 
Short Name
<name> Displays mailbox account name. Mail and account requests are sent to this account.
This attribute is also used for authentication if -a and -z are not specified
<name>Displays the target account name to which the requests are sent. Used only for non-admin sessions
<name>Displays the admin account name to authenticate as
Displays the Zimbra admin name and password to authenticate as
<path> Displays the root element path. If specified, all path arguments that do not start with a slash (/) are relative to this element
<type> Displays the SOAP request type. Can either be mail, account, or admin
<http[s]://...> Displays the server hostname and optional port value
<[path...]> Displays the element or attribute path and value. Roughly follows the XPath syntax as:
zmstat-chart
This command is used to collect statistical information for the CPU, IO, mailboxd, MTAqueue, MySQL, and other components and to run a script on the csv files to display the usage details in various charts. These csv files are saved to /opt/zimbra/zmstat/.
You must enable zmstat to collect the performance charts data.
To enable zmstat for charting on each server
 
1.
Enter zmprov ms {hostname} zimbraServerEnable : stats.
2.
zmcontrol stop
zmcontrol start
Syntax
zmstat-chart -s <arg> -d <arg> [options]
Description
 
Short Name
<arg> If this is specified, the aggregate computation ends at this timestamp. Usage is MM/dd/yyyy HH:mm:ss.
<arg> If this is specified, the aggregate computation starts at this timestamp. Usage is MM/dd/yyyy HH:mm:ss.
<arg> If this is specified, all samples after the specified timestamp are ignored. Usage is MM/dd/yyyy HH:mm:ss.
<arg> If this is specified, all samples before this timestamp are ignored.
<arg> This gives the chart a title that displays. Defaults to the last directory name of srcdir.
<arg> The directory where the generated chart files are saved.
One or more directories where the csv files are located. The csv files are moved to directories listed by date under zmstat/.
zmstat-chart-config
This command generates an xml file /opt/zimbra/conf/zmstat-chart.xml from a template, taking into account the server setup including the LDAP node and the processes run, among other specifications.
zmstatctl
This is a control script for checking zmstat data collectors. It starts or stops monitoring processes, checks status or rotates logs.
Syntax
zmstatctl start|stop|status|rotate
zmthrdump
This command invokes a thread dump in the ZCS server process and prints the output file. It also gives the option of saving the thread dump to a file and inserts a timestamp on the logfile.
Syntax
zmthrdump [-h] [-i] [-t <timeout seconds>] [-p <pid file>] [-f <file>] [-o <out-file>]
Description
 
Short Name
Appends the timestamp to the LOGFILE before invoking SIGQUIT
Returns the PID to send SIGQUIT. The default value can be found in zmmailboxd_java.pid
Specifies the LOGFILE to save the thread dump output in. The default value is zmmailbox.out
Specifies the output file of the thread dump. The default value is stdout
Specifies the timeout value (in seconds) to exit if the process becomes unresponsive. The default value is 30 seconds.
zmtrainsa
This command is used to train the anti-spam filter. This command is run automatically every night to train the SpamAssasin filter from messages users mark as “junk” “not junk” from their mailbox. See Anti-Spam Training Filters.
The zmtrainsa command can be run manually to forward any folder from any mailbox to the spam training mailboxes. If you do not enter a folder name when you manually run zmtrainsa for an account, for spam, the default folder is Junk. For ham, the default folder is Inbox.
Syntax
zmtrainsa <user> spam|ham [folder]
zmtzupdate
This command is used to update time zone changes in existing appointments for specific users or all users. A .ics rule file should first be created to run with this command. A rule file lists a series of rules to match a time zone and the replacement time zone definitions. More information about this command can be found at http://wiki.zimbra.com index.php?title=Changing_ZCS_Time_Zones
Syntax
zmtzupdate --rulefile <rule file> -a <“all” or list of specific email addresses> [--sync] [--after <date/time stamp>]
Description
Short Name
<arg> account email addresses separated by a white space. Use “all” for all accounts to be updated
<arg> Appointments occurring after the specified date/time in this field are updated. The default cut off time is January 1st, 2008
Specifies the .ics XML file that should be used to update time zone definitions
<arg> Specifies the mail server hostname. The default value is localhost
If specified, this option causes the zmtzupdate command to block till the server processes all requested accounts. The default value is no.
zmvolume
This command can be used to manage storage volumes from the CLI. Volumes can be easily managed from the administration console, Server, Volume tab.
Syntax
zmvolume {-a|-d|-l|-e|-dc|-sc} [options]
Description
 
Short Name
<arg> Compress BLOBs; “true” or “false”
--compressionThreshold
<arg> Volume ID
<arg> Volume name
<arg> Root path
<arg> Mail server hostname. Default is localhost.
<arg> Volume type (primaryMessage, secondaryMessage, or index)
zmzimletctl
This command is used to manage Zimlets and to list all zimlets on the server. See Working with Zimlets. Most Zimlet deployment can be competed from the zimbra administration console.
Syntax
zmzimletctl {-l} {command} <zimlet.zip|config.xml|zimlet>Description
Short Name
<zimlet.zip> Creates the Zimlet entry in the LDAP server, installs the zimlet files on the Server, grants, access to the members of the default COS, and turns on the Zimlet
<zimlet> Uninstall a zimlet from the zimbra server