| Subcribe via RSS

Frequently Used Zimbra CLI

June 29th, 2009 Posted in Linux, Mail server

zimbraThe 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.

-

Share this article:
  • Print this article!
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • E-mail this story to a friend!
  • LinkedIn
  • Live
  • MySpace
  • RSS
  • Technorati
  • StumbleUpon
  • Twitter
  • Yahoo! Bookmarks

Related posts:

  1. Redirect HTTP to HTTPS in Zimbra
  2. Error changing default domain COS in Zimbra
  3. Zimbra antivirus not started
  4. Setup a domain catchall account in Zimbra Mail Server
  5. Releasing quarantined emails in Zimbra

6 Responses to “Frequently Used Zimbra CLI”

  1. mark kruger Says:

    Are there Zimprov commands to add contacts to an account? I’m working on an @mail to Zimbra migration.


  2. admin Says:

    @Mark:
    sorry, haven’t find zmprov command to add contacts to an account.


  3. holland america cruises 2011 Says:

    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?


  4. vgteslle Says:


  5. Matildess Says:


  6. Matildes Says:

    Great One…

    What determines how we perceive different types of music? , http://bghgjut.beeplog.com/blog.pl?blogid=225234&o=entry...


Leave a Reply




  • ShoutMix chat widget