Difference between revisions of "Ajcody-Notes"

Line 13: Line 13:
[[Category: Community Sandbox]]
[[Category: Community Sandbox]]

Revision as of 03:45, 17 November 2008


This page holds a Table of Contents of all my pages but each main Subject is an actual link to another page. I'm hoping this gives the best of both worlds. Where there is one long page with all topics as well as pages that contain the details to a specific subject. I did this by the following wiki code.

Enjoy, Adam


Information For New Support Customers

   KB 2439        Last updated on 2008-11-17  

(0 votes)

Details On Response Times and What's Supported

Please review the Support Overview and Support Program, specifically the "Exclusions" and "Reasonable Use Policy" sections. You can also find a link to the Support Plan document when you log in to your Zimbra Support Portal account (Network Edition Customers). As of 12 August 2008, it includes the following statement:

Requests that are excluded from support include but are not limited to: performing initial installs of customer systems, performing migrations, performing upgrades of customer systems, performing configuration changes to add or remove servers or services, and testing a customer’s system. Zimbra Professional Services may be available to assist with these projects.

New Network Edition Customers

Your sales contact should already have made a support record for your company and added one or more user accounts for our primary support tool, the Support Portal. Please Contact Sales if you are unsure whether you and/or your company have been set up for access to the Support Portal. Additional user accounts can be associated with your support record if necessary by submitting a case to support with the following information:

  • Full name of new contact
  • Title of new contact
  • Email address of new contact
  • Best phone number to reach new contact (this will potentially be used in the event of an email outage)

Understanding The Support Process For Urgent Issues

In order to receive the most efficient and timely response, please follow this procedure.

  1. Create a new case via the Support Portal
    • In the lower section of the navigation menu on the left, choose Case Menu > Submit A New Case
    • When you need urgent help, please open a case through the Support Portal instead of sending email to support@zimbra.com. Cases submitted through email will not be assigned the appropriate urgency for an outage or otherwise urgent situation, and they will appear lower in priority in our incoming case queue. When submitting a case through the Support Portal you may assign the appropriate urgency level according to scope, impact, and urgency of issue.
    • Please include as much detail as possible to allow us to effectively prepare prior to calling you. Having details of the situation allows us to reach out to any resources (people) we may feel are needed prior to calling you back.
    • Include contact information in the new case record. Desk phone, cell phone, alternate email address, and YahooIM handle are all useful. This allows us to contact you for clarification as needed.
  2. Call the Support Phone Line
    • If you get the voice mail - don't panic or hang up without leaving a voice mail.
      • Give your name and company first
      • Provide the number of the case that you created in the Support Portal
      • Summarize the outage situation
      • Mention your contact information
  3. Continue to work on the issue yourself.
    • Promptly update the case with all relevant information you discover
      • Left-hand lower section, Case Menu > Case Management
      • If you can't "email", use the Comments section with your case record to input the information.
  4. If you have not received a response from us, please try updating the case and calling into the Support Phone Line again
    • Note that depending on the day and hour of your outage, time might be needed for the information to route to the on-call staff and for them to get into a position to respond.

How To Communicate Support Need Clearly

Over the years, open source luminary Eric Raymond has assembled a guide to getting help with technical issues online. Bear in mind that the guide has been written for those seeking free help, so the overall guide taken at face value is most applicable for posting to the Zimbra Forums. There is, however, plenty of useful guidance for those submitting support cases. The complete guide is available online as How To Ask Questions The Smart Way. Here are a few examples:

  • Use meaningful, specific subject headers
  • Write in clear, grammatical, correctly-spelled language
  • Be precise and informative about your problem
  • Describe your problem's symptoms in chronological order

Simon Tatham, author of the PuTTY software, wrote a similar guide for How to Report Bugs Effectively.

Support Tools

Case Management

Subscribe To RSS Feeds

Our sites have unrestricted (anonymous) access for RSS feeds. The new RSS feeds are:

Clicking on an article from the RSS feed will direct the user to the login page with an "Authorization Required" message.

Email Communication

When you send emails to support@zimbra.com, it will create a case for us and show in our new case tool. What is important to note though, is our tools first check to see if the subject line of the email has SF: Case ########: in it. If so, it redirects that email to update an existing case. If those values aren't in the subject line, it creates a new case. So, if you wanted to update an existing case - let's say case number 00000001 - you would have your subject line as "SF: Case 00000001: some text of the topic" .

New Cases Created By Email Are Always Sev-4

If you send your initial support request via email to support@zimbra.com it will automatically be set at a "Severity Level 4", which is the lowest priority. If you need your case set to a higher severity level, please create your case via the support portal page where you can set the severity level. At this time, you can not change a case severity level once it's made via the support portal case management tools.

Always Include support@zimbra.com In Case Email Threads

If emails for your case do not include the support@zimbra.com address, there's a good chance the support member your working with will not be updated about your response correctly.

Sales Force Case Comments

Sales Force [zimbra support portal case management tool] has the option to do "Case Comments". Please use this only when necessary - for example, your email isn't working. Currently, case comments from sales force don't work appropriately with our other tools because it doesn't create a email subject to match the "SF: Case ########:" pattern and it also doesn't change the status of the case to reflect "customer replied". The email subject line is important because most of us here at support use the Zimbra's email conversation view and also "tagging" of our case threads. The case comments from Sales Force doesn't work against this. And of course, the case not being updated as "customer replied" causes issues as it most likely leaves it in the state of "Awaiting Customer Response".

Zimbra Forums

The forums provide a place where the greater Zimbra community (server administrators, users, developers, commentators, etc) can work together on solving problems. There is a wide range of experience among the community, and a long history of issues available for searching.

Create A Forums Account

This is open to anyone. It is not tied to your Network Edition support id.

Zimbra Wiki

The wiki also centers around the community, providing a site where anyone with an account can contribute documentation, especially how-to guides, non-standard configurations, and topics related to but external to ZCS.

Create A Wiki Account

This is open to anyone. It is not tied to your Network Edition support id.

Why is this important?

  • It allows you to participate in improving the wiki articles and content. Note that you need to be logged in to make edits.
    • Create your own articles if you find something missing that might prove useful to others.
    • Improve existing articles.
    • Add to the "discussion" page for an article. This is a good place to add comments for those less inclined to be bold and modify the main article.
      • You can propose questions and other things here as well.
  • You can add articles to your "watchlist" in order to monitor your favorite articles for changes.
    • In your wiki preferences you can specify whether to be notified by email when different events occur.
  • You can create your own personal section on the wiki.
    • Use the category of "community sandbox" at the bottom of them.
      • [[Category: Community Sandbox]]
    • If you decide to create sandbox articles, the wiki convention is to prefix the topic with your wiki username: Username-Topic
      • For example, the original staging page for this article was written by Ajcody, so the sandbox article was named Ajcody-New-Customers-Users
    • Use {{:Special:PrefixIndex/YourUsername}} to automatically generate a list of these articles in a wiki document, on your user profile page for example
      • This wiki tag on Ajcody's profile page causes a list of all of his notes articles to be displayed: {{:Special:PrefixIndex/Ajcody}}

Remote Server Access

Conditions For Remote Access

In some cases, a Zimbra TSE may request access to the system in question. Direct access is not generally the preferred method of investigation on cases, and we typically request that the customer please perform the hands-on administration of your system, with which you would be far more familiar than Zimbra; in some cases however, direct access may be considered an option for investigating the situation.

Zimbra TSE's will need some way to communicate with someone on your IT staff when they are going to log in to your servers. Zimbra Support helps and facilitates customers with their problems but we are not the "administrators" of customers servers and can't make independent decisions on what to do or not on their servers. We need to have access to immediate forms of communication [phone, IM, etc.] with someone at the company with the authority to make those decisions.

Remote Access Starts With Webex

Support agents can setup Webex sessions with customers when the situation calls for it. The standard policy is to use Webex for various legal & other policy justifications. Support staff will give guidance to the customer over the Webex session for the particular tasks in question. Customer participation is required throughout the Webex session. Other forms of access, ssh for example, should occur along side the Webex session. Ssh would use the screen utility mentioned below to accomplish this.

Your Webex meeting request will most likely also include a telephone conference number and instructions on how to file transfer log files as necessary.

Secondary Remote Access Options

Support SSH Keys
Note that it is not required that customers allow remote server access.
Updated: Switched to rsa rather than dsa. [2010/02/23]

In the Zimbra Support Portal, a public key for ssh is available for situations when Zimbra support will log in to a customer server using ssh. You can allow remote connections for a user (typically zimbra or root) by logging in to the server as that user and following these steps.

Running the script command within the ssh/shell session is a good idea for both the support staff and customer. See the following script man page

1. Save the key file on the server as /opt/zimbra/.ssh/zsupport_rsa.key.pub

2. Add the key to the user's authorized_keys file; command #1 outputs the current list of keys; command #2 appends the support key

1% cat ~/.ssh/authorized_keys
2% cat /opt/zimbra/.ssh/zsupport_rsa.key.pub >> ~/.ssh/authorized_keys
Note, the ~/ above will be setting up the ssh access for the same username that is running the commands. This is the "user" that you'll tell Zimbra is the login account for ssh to the server.

3. Verify that public key access is allowed by sshd

In the sshd config file (typically /etc/ssh/sshd_config), the value of the PubkeyAuthentication keyword should not be no. It's OK if it is not listed or if it is commented out; the default is yes.

4. Confirm, if appropriate, that the user you setup for ssh access will be able to su and/or sudo to gain zimbra and/or root access.

5. You'll then need to communicate to support that the key is setup and provide the necessary information:

  • username to login with
  • password if required for ssh access
  • the initial server [hostname/ipaddr] to ssh to and then how to access other servers inside if needed
  • way to gain zimbra or root access [su - [username] or via sudo]
It is up to you, how you would like to communicate the login information to support - email, IM, phone, etc..
Shared Sessions With the screen Utility

The screen command line utility allows multiple users to attach to the same terminal session. To start a new screen session, run screen -m or screen -R. To attach to an existing screen session, run screen -x. Additional documentation for screen is available online.

Sun Shared Shell Application

Sun Microsystems offers a java application to allow shared access to a terminal session. More information is available at their site.


This might interest some customers as well DimDim Web Conferencing . They have an OSS edition - DimDim OSS Edition

Installation and Migration Planning


Support doesn't do migration for customers, nor do we do migration planning. We can help if you run into issues during migration. Are there gray areas involved in this? Yes, of course. Some guidelines to follow:

  • Engage your sales contact about your needs.
    • Sales has access to pre-sales engineers and tools that can help plan your Zimbra deployment and migrations.
    • If your needs exceed the above, they can determine if our Professional Services group would be a good option for you.
  • When you start to engage the Support Team
    • Try to have specific questions or issues rather than large open-ended ones - those that imply support is doing the planning or migration for you.
    • It would be helpful if you documented your "plan" to the best of your ability and to share that with support as issues or questions come up.
      • This gives us more "concrete" information to work against.
    • Be prepared to know and investigate the technical requirements for the "other" mail server. Support will offer what we can but there is no obligation for us to know all the in's and out's of another mail server product. The exception to this would be when we are working with our tools that we developed for migration. And even then, there is a certain expectation of knowledge we require of the administrator in regards to the other mail system.
  • Remember, anyone can use the Zimbra Forums! Advise and help is free and open to everyone on the forums.

ZCS Upgrade And Install Specific Expectations

Zimbra support works on a break-fix model, we do not provide administrative services.

For upgrades and installs, we generally offer :

  1. Provide input on upgrade and install plans or the remaining questions that aren't addressed documentation resources listed below:
    • Latest Releases are at:
    • Documentation Resources are at:
    • Please see "System Requirements" under the "Documentation Resources" section for system requirements - server and client.
    • The "Installation Resources" section addresses:
      • Steps to install ZCS - see either the Single-Server Installation Guide or Multi-Server Installation Guide.
      • Checks, prerequisites, and other items you might need to address prior to installing.
    • The Release Notes & Upgrade Instructions addresses:
      • Steps to upgrade your server/s.
      • Checks, prerequisites, and other items you might need to address prior to upgrading.
      • List of notable bugs and RFE's addressed with this release. It will have a history going back through other older versions also.
    • After reviewing the above resources for your specific version, you should also login to the support portal for any other critical information that might not be listed in the Release Notes & Upgrade Instructions.
  2. We can add a customer's intentions about upgrading or installing ZCS on our team calendar. This allows our staff during our 'after hours' to be aware of customers that are intending to upgrade/install ZCS and that they might be submitting sev1 support cases if they run into issues.
  3. If the customer runs into a problem during an upgrade/install, they should submit a support case [setting the right severity level] for the specific issue at hand. The resolution of the support case is specific to the issue that was encountered. The support case is closed and the customer continues to do upgrade/install or other remaining steps they have independently.


Please take time to review the Administrators Guide. Noting what features you might want or need for the installation. It would be wise to make notes while your skimming the guide of features your wanting. Depending on the choices you have, it might drastically effect your installation steps. Do you want HSM, Archive & Discovery, Proxies - what type, and so forth.

The Basics

Starting Official Source Guides

Other Resources To Review

General Ways To Find More Specific Information:

Please Consider Your Backup Issues Before Deploying

Assuming you've consulted the other above resources as well.

More items to consider:

Be Aware Of DR Processes

Multi-Server Installations

Assuming you read or skimmed the above.

Starting Official Source Guides

Other Resources To Review

Migration Issues

This will pull all of them regardless of their "status".

Quick Tips

License issues (Dos/Unix New Lines)

Sometimes when customers get their license file on a Windows machine and then go about transferring it to the zimbra server they accidentally convert the license file to have windows new line characters that will not work when Zimbra goes to read the file. To see if this happen, to the following on the zimbra server:

vi file and then

:set list

Confirm you're not getting the ^M characters at the end. The ^M is the windows new line character, they'll need to be removed. There is a script or even rpm package you can get, usually called dos2unix, that will do this for you.

Verified Against: Zimbra Collaboration Suite 8.0, 7.0 Date Created: 08/4/2014
Article ID: https://wiki.zimbra.com/index.php?title=Ajcody-Notes Date Modified: 2008-11-17

Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »

General Notes

   KB 2439        Last updated on 2008-11-17  

(0 votes)
24px ‎  - This is Zeta Alliance Certified Documentation. The content has been tested by the Community.

Actual General Notes Homepage

Please see Ajcody-General-Notes

Zimbra Variables

Ways to check on different zimbra variables.

su - zimbra
zmlocalconfig -i
zmlocalconfig -d
cd /opt/zimbra/conf/attrs
more zimbra-attrs.xml
cd /opt/zimbra/openldap/etc/openldap/schema/
more zimbra.schema

Made the following concerning zmlocalconfig's behavior:

Also, with newer versions of ZCS, you can get it via zmprov - for example:

#zmprov desc -a zimbraFreeBusyExchangeAuthScheme
        auth scheme to use

                   type : enum
                  value : basic,form
               callback :
              immutable : false
            cardinality : single
             requiredIn :
             optionalIn : cos,domain,globalConfig,account
                  flags : accountInherited,domainInherited
               defaults :
                    min :
                    max :
                     id : 611
        requiresRestart :
                  since : 5.0.3
        deprecatedSince : 

Addition note, example, for those checking source : src/6.0.7/com/zimbra/cs/account/ProvUtil.java.html

Zimbra Contact Fields For CSV Import Mapping

Please see /opt/zimbra/conf/zimbra-contact-fields.xml

This will show you what "fields" Zimbra is looking for and mapping to in regards to importing from another applications contact csv files.

One easy way to do this is the following:

  • From zimbra ajax client as a test user (or any old user) do an export Addressbook.
    • This is under the preference tab > Address Book > Import / Export > Export - select Addressbook and click Export button
  • Then open file file something like Excel or a Text Editor
    • Your only interested in the Top line - that gives the default fields for a Zimbra Addressbook.
    • You'll get something like this:
    • Note, ordering [left to right] isn't important. What is important, is the data lines up under the right column header.
  • With your other Mail system, export the addressbook to a csv file.
    • Open this file in another Excel window.
  • Copy the column data from the one Excel sheet and paste it into the appropriate column within the Zimbra Excel sheet.
  • Move as much as you can and then save.
    • For example:
"Apple Computer Inc.","1-800-MY-APPLE","","3","","http://www.apple.com","","","","Cupertino","United States","","","","","95014","CA","1 Infinite Loop"
  • Now you can try importing this csv file back into Zimbra.
  • Either with the webclient or you can use some on the CLI commands
    • See User_Migration for variations of CLI commands that could be used.
    • Here's the documented example:
    • curl -u schemers:password --data-binary @/tmp/new.csv http://server/service/home/schemers/contacts?fmt=csv

Example Header For Horde Contacts

I have not used this myself, I found it on the forums.


I'm hoping the forum user simply renamed the top header column to match description fields that Zimbra knows and that it's in order of the data (left to right) that Horde normally exports in. You'll need to review it and make sure it fits with your exported data columns from Horde.

Admin With Curl And Wget

You will most likely need to include :7071 in the url string to get around the pop-up issue that you would get if you used the same string in a web browser, without :7071 you'll see a permission error when trying to see/get data from a users account via the admin account.

curl -u admin:pass https://hostname:7071/home/user/Contacts
wget https://admin:pass@hostname:7071/home/user/Contacts

What's My Server Like

To dump out your server details, these commands are useful. Login to your zimbra server and as the zimbra user do:

zmprov gs `zmhostname`
zmprov gacf

Another good document to review for "odd performance" issues is the large server wiki.


Restarting Jetty - ZCS 5+

As zimbra

zmmailboxdctl restart

How Do I Find Out What Version Of Zimbra I'm Using


Get Version From Ajax Client

In newer versions of ZWC, the Help > About will also state the ZCS server version being used.

For older version, put the below in the search field of the Ajax client and hit enter:

$set:get version



Search for the CLIENT_VERSION line.

Other Ways To Get Version Of Server

See this forum post:

What's Compiled With Postfix

Moved to What's_Complies_With_Zimbra's_Postfix

REST Information

Resources to review

Format to get around permission denied on multi-domain hosting servers

If you getting permission denied rather than resource not found...try this format example:




I but both in case one issue is where the username has special characters, like the period.

Server Source Doc's

Please see:



   KB 2439        Last updated on 2008-11-17  

(0 votes)
24px ‎  - This is Zeta Alliance Certified Documentation. The content has been tested by the Community.

Actual Logging Homepage

Please see Ajcody-Logging


RFE's Related To Better Logging And Historical Data Of Systems

See : Ajcody-Testing-Debugging#RFE.27s_Related_To_Better_Logging_And_Historical_Data_Of_Systems


See : Ajcody-Testing-Debugging for more complete debugging information.

When Was A ZCS Service Enabled Or Disabled

See : Ajcody-Notes-Archive-Discovery#When_Was_A_ZCS_Service_Enabled_Or_Disabled

Syslog Items

Single Server Setup

/etc/syslog.conf should have lines similiar to:

[towards bottom of conf file]
local0.*                -/var/log/zimbra.log
auth.*                  -/var/log/zimbra.log
mail.*                  -/var/log/zimbra.log

Make sure syslog allows messages from log4j to be written, log4j doesn't do unix pipes. Specifically, it uses internet domain sockets (514/upd) instead of unix domain sockets (/dev/log). On a single server setup, this means log4j talking to localhost via 514/udp. Again, /dev/log is never used by log4j (AFAIK, this could change in the future). Adding the "-r" applies for the centralized syslog server as usual, but it also applies for the case where you want log4j data to be logged via syslog locally [single server setup]:

[root@zimbra sysconfig]# diff -u /etc/sysconfig/syslog.ORIG /etc/sysconfig/syslog
--- /etc/sysconfig/syslog.ORIG  2008-03-25 09:14:28.000000000 -0400
+++ /etc/sysconfig/syslog       2009-06-09 16:01:13.000000000 -0400
@@ -3,7 +3,7 @@
 # -r enables logging from remote machines
 # -x disables DNS lookups on messages recieved with -r
 # See syslogd(8) for more details
 # Options to klogd
 # -2 prints all kernel oops messages twice; once for klogd to decode, and
 #    once for processing with 'ksymoops'

Restart syslog:

/etc/init.d/syslog restart

Setup ZCS to be aware of syslog [we'll restart Zimbra later once all the changes are done]:

zmprov mcf zimbraLogToSyslog TRUE

This will set the appropriate ldap values (after a zimbra restart) to make log4j.properties be written correctly:

/opt/zimbra/conf/log4j.properties will now show some modifications, for example:

[snips - DON'T cut cut/paste this info below for your server]
# Syslog appender
log4j.appender.SYSLOG.layout.ConversionPattern=mailboxd: %-5p [%t] [%z] %c{1} - %m

This will actually cause very little to goto syslog though, it's a very minimalist setup. Now adjust /opt/zimbra/conf/log4j.properties.in to log more items to syslog.

Note: You may or may not want all these things going to syslog and you may be able to send more/other things to syslog as well. I've not spend lots of time with log4j and I'm not familiar enough with all the code to know which pieces are using which logger/settings.

WARNING: the AUDIT logs may have sensitive data so be careful to protect the logs so that sensitive data is not leaked accidentally.

[zimbra@zimbra conf]$ diff -u log4j.properties.in.ORIG log4j.properties.in
--- log4j.properties.in.ORIG    2009-06-05 15:31:20.000000000 -0400
+++ log4j.properties.in 2009-06-09 15:54:07.000000000 -0400
@@ -35,7 +35,7 @@

 # Save zimbra.security to AUDIT appender

 # Syslog appender
@@ -88,7 +88,7 @@


At this point, you can restart zimbra for all the changes to be in effect:

zmcontrol stop ; zmcontrol start

Centralized Syslog Server

Please see:

This will show you how to setup a syslog server and then to configure the "clients" to log to the local filesystem as well as the syslog server.

You'll need to then take into account the information in Ajcody-Logging#Single_Server_Setup to handle the "Zimbra" part as well as dealing with log4j.

Centralized Log Server Project Ideas


  • Logs are to large to manage on each server.
  • Want to build a central logging server for all logging events.
  • The syslog events are very minimal with Zimbra (/var/log/zimbra.log). Most of the logging is control by Log4j (tomcat/jetty). Output from log4j generally goes into the /opt/zimbra/log/ directory. There's some conf files in /opt/zimbra/conf/log4j.properties* for log4j. You can adjust this file to also output into the syslog environment but syslog has very limited choices for "facility". See Ajcody-Logging#Single_Server_Setup and Log4j & Syslog facility for details. You'll end up getting huge files and god knows how many log events per second if you adjusted log4j to dump all zimbra logging into syslog control.

General Thought On This:

Use syslog-ng with mysql for the central log server. Add on php-syslog-ng for comfort.

Leave the log4j stuff alone and configure syslog-ng to monitor the actual log files as they are generated by log4j in /opt/zimbra/log/* .

Then decrease the log sizes and archiving done on the local servers, i.e. zimbraLogRawLifetime & zimbraLogSummaryLifetime .


Log Rotation and Removal

Logs In /opt/zimbra/log Directory

Please look at the output of your crontab - AS ZIMBRA, look for the "Log pruning" line.

crontab -l

And also the config files for logrotate:



Example From 5.0.11 - Complete ZCS Install Single Server

crontab for zimbra:

# Log pruning
30 2 * * * find /opt/zimbra/log/ -type f -name \*.log\* -mtime +8 -exec rm {} \; > /dev/null 2>&1
35 2 * * * find /opt/zimbra/log/ -type f -name \*.out.???????????? -mtime +8 -exec rm {} \; > /dev/null 2>&1

# Log pruning
30 2 * * * find /opt/zimbra/mailboxd/logs/ -type f -name \*log\* -mtime +8 -exec rm {} \; > /dev/null 2>&1

And the logrotate files:

$ cat /etc/logrotate.conf 
# see "man logrotate" for details
# rotate log files weekly

# keep 4 weeks worth of backlogs
rotate 4

# create new (empty) log files after rotating old ones

# uncomment this if you want your log files compressed

# RPM packages drop log rotation information into this directory
include /etc/logrotate.d

# no packages own wtmp -- we'll rotate them here
/var/log/wtmp {
    minsize 1M
    create 0664 root utmp
    rotate 1

# system-specific logs may be also be configured here.

And also:

$ cat /etc/logrotate.d/zimbra 
/var/log/zimbra.log {
    create 0644 zimbra zimbra
      killall -HUP syslogd 2> /dev/null || true
      kill -HUP `cat /opt/zimbra/log/swatch.pid 2> /dev/null` 2> /dev/null || true
      kill -HUP `cat /opt/zimbra/log/logswatch.pid 2> /dev/null` 2> /dev/null || true

/opt/zimbra/log/myslow.log {
    rotate 30
    create 0644 zimbra zimbra

/opt/zimbra/log/logger_myslow.log {
    create 0660 zimbra zimbra
    size 5000k
    rotate 7

/opt/zimbra/log/clamd.log {
    create 0660 zimbra zimbra
     kill -HUP `cat /opt/zimbra/log/clamd.pid 2> /dev/null` 2> /dev/null || true
    size 5000k
    rotate 7

/opt/zimbra/log/zmlogswatch.out {
    create 0740 zimbra zimbra
      su - zimbra -c "/opt/zimbra/bin/zmlogswatchctl stop"
      su - zimbra -c "/opt/zimbra/bin/zmlogswatchctl start"
    rotate 5

/opt/zimbra/log/zmswatch.out {
    create 0740 zimbra zimbra
      su - zimbra -c "/opt/zimbra/bin/zmswatchctl stop"
      su - zimbra -c "/opt/zimbra/bin/zmswatchctl start"
    rotate 5

/opt/zimbra/log/zmmtaconfig.log {
    create 0740 zimbra zimbra
      su - zimbra -c "/opt/zimbra/bin/zmmtaconfigctl restart"
    rotate 5

/opt/zimbra/log/nginx.log {
    create 0644 zimbra zimbra
      kill -USR1 `cat /opt/zimbra/log/nginx.pid 2> /dev/null` 2> /dev/null || true
    rotate 7

/opt/zimbra/log/zmconvertd.log {
    create 0644 zimbra zimbra
    rotate 7

/opt/zimbra/zmstat/zmstat.out {
    rotate 7

Openldap Logs - In /opt/zimbra/openldap-data/

Ldap logs files in /opt/zimbra/openldap-data/ and in /opt/zimbra/data/ldap/* subdirectories [ZCS 6+] that are like log.0000000001 , log.0000000002 , etc.

This logpurge is controlled by:

$ cd /opt/zimbra/openldap/etc/openldap/
[zimbra@mail3 openldap]$ grep logpurge *
master-accesslog-overlay.conf:logpurge	07+00:00	01+00:00
Logpurge Directive Description

From Accesslog Chapter

logpurge Directive

logpurge age interval

Defines both the maximum age for log entries to be retained in the database and how often to scan the database for old entries. Bothage and interval are specified as a time span in days, hours, minutes, and seconds. The time format is [ddd+]hh:mm[:ss], for example, the days and seconds components are optional but hours and minutes are required. Except for days, which can be up to 5 digits, each numeric field must be exactly two digits. Example:

  1. the log database will be scanned every day
  2. entries older than two days will be deleted.

logpurge 2+00:00 1+00:00

When using a log database that supports ordered indexing on generalizedTime attributes, specifying an eq index on the reqStart attribute will increase the performance of purge operations.

What's up with all the logs?

Other Logging Page Resources





The Bread And Butter Logs

/opt/zimbra/log/mailbox.log - where most of your mailbox store activity is logged
  • This log is the mailboxd log4j server log containing the logs from the mailbox server. This includes activity from the mailbox store, LMTP server, IMAP and POP servers, and Index server.
    • Location: /opt/zimbra/log/mailbox.log
/opt/zimbra/log/zmmailboxd.out - mailboxd/jvm output log
  • Mailstore not coming up and nothing is being logged in mailbox.log, check here for errors.
    • Location: /opt/zimbra/log/zmmailboxd.out
/opt/zimbra/log/stacktrace.<pid> - stacktrace logs
  • stacktraces related to mailboxd
    • Location: /opt/zimbra/log/stacktrace.<pid>
/opt/zimbra/db/data/YOURHOSTNAME.err - errors for MySQL - ZCS 4.x & ZCS 5.x
  • This is the message store database error log.
    • Location: /opt/zimbra/db/data/YOURHOSTNAME.err
/var/log/zimbra.log - mta and system status log, postfix, amavisd
  • The Zimbra syslog details the activities of the Zimbra MTA (Postfix, amavisd, antispam, antivirus), Logger, Authentication (cyrus-sasl), and Directory (OpenLDAP). By default LDAP activity is logged to Zimbra.log.
    • Location: /var/log/zimbra.log
/var/log/messages - mta and OS related log events
  • Probably has mta logging events [which also show in /var/log/zimbra.log] and also log events related to your OS
    • Location: /var/log/messages
/opt/zimbra/log/mysql_error.log - problems with MySQL
  • If there is data corruption or another problem causing direct mysql errors, events will be logged here.
    • /opt/zimbra/log/mysql_error.log
/opt/zimbra/log/myslow.log - slow db/MySQL queries
  • If certain search requests are taking longer to complete than others, they will be logged here.
    • /opt/zimbra/log/myslow.log

Other Logs

/opt/zimbra/log/audit.log - authentication events
  • A log of all admin actions taken as well as logins to the server.
    • /opt/zimbra/log/audit.log
Want to see all uses of the "View Mail" button from the admin console? Will have the IP address, User Agent of the browser, user that the admin is logged in as, and the account that they are viewing.
 grep DelegateAuth /opt/zimbra/log/audit.log 
/opt/zimbra/log/clamd.log - antivrius db
  • Status and checks for clamav
    • /opt/zimbra/log/clamd.log
If your clamav db is out of date, you'll see a log event here like this:
LibClamAV Warning: **************************************************
LibClamAV Warning: *** The virus database is older than 7 days! ***
LibClamAV Warning: *** Please update it as soon as possible. ***
LibClamAV Warning: **************************************************
/opt/zimbra/log/convertd.log - attachment conversion
  • If your having problems with your attachments and the ability to view them in ZWC, check here for errors.
    • /opt/zimbra/log/convertd.log
/opt/zimbra/log/freshclam.log - clam antivirus updates
  • Shows the actual attempt to update the clamav updates.
    • /opt/zimbra/log/freshclam.log
/opt/zimbra/log/spamtrain.log - spam/ham training details
  • Spam/Ham training details are logged here. Errors are also logged here related to this service.
  • From a default single ZCS configurations crontab [zimbra]:
# Spam training
0 :23 * * * /opt/zimbra/bin/zmtrainsa >> /opt/zimbra/log/spamtrain.log 2>&1
# Spam training cleanup
45 23 * * * /opt/zimbra/bin/zmtrainsa --cleanup >> /opt/zimbra/log/spamtrain.log 2>&1
/opt/zimbra/log/sync.log - zimbra mobile and activesync
  • Your mobile devices will basically log here.
    • /opt/zimbra/log/sync.log
/opt/zimbra/log/synctrace.log - zimbra mobile and activesync
  • Still looking for description that describes difference with sync.log
    • /opt/zimbra/log/synctrace.log
/opt/zimbra/log/syncstate.log - no description found
  • No description found.
    • /opt/zimbra/log/syncstate.log
/opt/zimbra/log/wbxml.log - no description found
  • No description found.
    • /opt/zimbra/log/wbxml.log
/opt/zimbra/log/zmlogswatch.out -
/opt/zimbra/log/zmmtaconfig.log -
/opt/zimbra/log/zmmyinit.log -
/opt/zimbra/log/zmsetup.`date`-'pid'.log -
/tmp/install.log -

After install, gets moved to : /opt/zimbra/.install/

/tmp/zmsetup.log -

After install, gets moved to : /opt/zimbra/log/zmsetup.log.[some numbers]

/opt/zimbra/httpd_access.log -
/opt/zimbra/httpd_error.log -

New Data Directory In ZCS6+

In ZCS 6+ , there's a directory to organize 'data' from our various components.

[root@mail3 data]# pwd

[root@mail3 data]# ls -F
altermime/  amavisd/  clamav/  dspam/  ldap/  postfix/  tmp/

This information could prove useful as well with trouble-shooting and debugging problems.

Increase Logging

Increase Logging Per User

Depending on the ZCS version the below will clear all the per account loggers on zimbra reboot. IMAP is used for these examples.

  • addAccoutLogger
zmprov aal user@domain.com zimbra.imap debug
  • removeAccountLogger
zmprov ral user@domain.com zimbra.imap

Example usuage:

zmprov aal user@domain.com zimbra.soap debug 

And tail the log file, while attempting to login to the AJAX client.:

tail -f /opt/zimbra/log/mailbox.log

See Ajcody-Logging#Log4J_Variables for variables that can be used.

To See What Accounts Have Extended Logging Enabled

There's the gaal option for zmprov . It list the accounts on a per mailstore basis :

  getAllAccountLoggers(gaal) [-s/--server hostname]
[zimbra@zcs806 ~]$ zmprov gaal `zmhostname`
# name test01@zcs806.domain.com
Bugs And RFE's

I filed the following RFE:

Increase Logging Per Server

If you want to do it globally edit this file:

vi /opt/zimbra/conf/log4j.properties

Add a line at the end that's similar to something like this: log4j.logger.zimbra.imap=DEBUG.

No restart of any service is needed, BUT if something happens that causes a regeneration of the log4j.properties file then your changes will be overwritten. A regeneration of this file takes the contents of /opt/zimbra/conf/log4.properties.in .

To permanently make a change, modify the /opt/zimbra/conf/log4.properties.in file, then a restart would be necessary.

$ zmcontrol stop
$ zmcontrol start

or you could run this on the server:

$ zmmtaconfig mailboxd

Wait for a minute for the server to pick up your change.

See Ajcody-Logging#Log4J_Variables for variables that can be used.

Log4J Variables

An Official page has been made for this topic now per my RFE request, bug 41894

Please see:

OpenLDAP Logging Levels

Please see King0770-Notes-Change-LDAP-Log-Levels

Want To See What's In Redolog Files

If you suspect there's too much redolog activity during a time window or have another need to inspect the contents of the redolog, dump it and examine it:

$ zmjava com.zimbra.cs.redolog.util.RedoLogVerify /opt/zimbra/redolog/redo.log > out.file

Pick the right redolog file, either redo.log or one of the files under archive/, based on timestamp.

See Ajcody-Backup-Restore-Issues#Redolog_Files for more details.

Internal Zimbra Charting - zmstat-chart

RFE/Bugs You Might Be Interested In

zmstat IS NOT Logger (graphs in admin console)

Please note, zmstat is different than the processes and graphs involved with Logger. Logger is behind the graphs that show up in the admin web console.

Please see Logger for details and trouble-shooting steps with Logger.

Rick has some other steps for King0770-Notes#Reinitialize_the_Logger_DB

Main References For zmstat-chart Command

Please see the following:

zmstat-chart CLI Administration Guide

zmstat-chart-config CLI Administration Guide

zmstatctl CLI Administration Guide

Zmstats Wiki

Server Monitoring Wiki

Monitoring Administration Guide

JFreeChart is the project/binary behind the charting tool. You'll find the jar files here [ZCS 5.0.9 example]:

  • /opt/zimbra/lib/jars/jfreechart-1.0.1.jar
  • /opt/zimbra/jetty-6.1.5/common/lib/jfreechart-1.0.1.jar

Issues Being Investigated With zmstat And Other "Charting" Items

I currently have an internal thread going with the dev's about some issues with zmstat and also with attempts of getting the active sessions data from the admin web console to be seen in trends.

I'll just be dumping my notes here and then cleaning them up once I'm done with the internal conversation.

  • Question: (mailboxd: active connections by client protocol) What exactly is this tracking? I'm on a test box with no connections and it has the different threads in the 100's/1000's. Customer was hoping (as was I) that this would be giving data much like is shown in the admin console about user connections. Also, there doesn't seem to be a comparable "active connections" for the web client (soap)?
    • Answer: For the connections issue, it's the number of clients that are currently connected. There's no analog for SOAP because SOAP doesn't have persistent connections. We may be able to log stats for number of SOAP sessions, but that would include noise for cases where the user closes the browser window and the session hasn't timed out yet. If you think this is useful, please file an RFE.
  • Question: (graph time plot) If I run zmstat-chart with the --aggregate-start-at option with something like "08/07/2008 01:00:00" I notice that the graphs don't actually reference "days" at the bottom but still use what looks to be "hours". Is this a bug where the bottom reference of the graph doesn't get adjusted or is the syntax to run zmstat-chart to do this more tricky that I think.
    • Answer: zmstat-chart doesn't support multi-day ranges, it really only supports a single directory with a single day of charts, the aggregate options are for specifying ranges at which to calculate the max(col)/min(col)/avg(col) values. Our usual practice is to generate one set of charts for each day we want to look at; I think it gives us a better look at when peaks occur and how they compare day-to-day (it's much easier to look at them in an overlay fashion).
    • Answer: Seems like a reasonable request to be able to generate charts for multiple days. Please file an RFE if you think this would be useful.
  • Question: How reliable are these numbers are in admin console....
    • Answer: I imagine they should be quite reliable; but HTTP (Web) is stateless, so you can't really determine whether a session is really active or not. I believe multiple sessions appearing for a single user would be the result of reloading or closing and then reopening the browser to log in again.
      • Perhaps it is best to ask the users in question what their usage is like? Is there any concern over the high number of sessions? I don't think it should affect server performance.
  • Question: Could you please explain the following:
    • Mailboxd Mailbox Add Rate (Delivery Rate)
      • Answer: The rate at which messages are being added to the mailbox server, e.g. 1 message being delivered per second is... 1 m/s
    • Mailboxd Mailbox Add Latency (Delivery Speed)
      • Answer: How long it takes on average to add a message to a mailbox (averaged over the period of a minute)
    • Mailboxd Active Connections by Client Protocol- This one does NOT give us counts for web client. Host zcs2.mail.XXXX.xxx: Mailboxd: Active Connections by Client Protocol avg(IMAP) = 169.86 avg(IMAP SSL) = 0.00 avg(POP) = 0.21 avg(POP SSL) = 0.00
      • Answer: It doesn't give counts for web client because the web client does not have persistent connections (being HTTP-based). SOAP requests (used by the Web client) use transient connections that often close after they are used; i.e. if you took the number of "SOAP" connections and compared it to the number of "active" sessions, it'd likely be something like 0-1% of the latter figure.
    • Mailboxd Mailbox Get Count
      • Answer: The number of mailboxes that got opened in the last minute (I don't recall if this counting cache hits or not?)
    • Mailboxd Mailbox Get Latency
      • Answer: How long it takes to open a mailbox, on average (over a minute)
    • Also, we don't get stats for any of the soap parameters:
      • SOAP Invocation Count Summary (Top 10 max)
      • SOAP Average Call Duration AuthRequest
        • Answer: I don't know why this could be; perhaps zmstat-chart-config.xml needs to be regenerated, is /opt/zimbra/zmstat/soap.csv available and does it contain data?

Running zmstat-chart

Confirm it's running:

zmprov gs [mailserver hostname] | grep -i stats
  zimbraServiceEnabled:  stats
  zimbraServiceinstalled: stats

Default location of stat files is:


Example command to run:

mkdir /tmp/stats
zmstat-chart -s /opt/zimbra/zmstat -d /tmp/stats/

Like To Have zmstat-chart Data Integrated With Zimbra

I've made an RFE for this integration:

With Zimbra Jetty
The default Jetty behavior will NOT display directory listing. You'll need a valid html type file in the directory target.
I would recommend the apache solution over this one as you can avoid hitting performance issues this might cause.

Dump some graphing directories in there:

zmstat-chart -s /opt/zimbra/zmstat -d /opt/zimbra/jetty/webapps/zimbra/downloads/zmstat-chart/`date +%F-%H-%M`

You'll see there's the directory and when you go into it - there's your charts.

You can now place this command in your crontab to run on a schedule basis.

Things you'll want to check before deploying:

  1. Place charting directory in a location where space is available and will not create a risk to the mail services if it's full.
  2. Look at the zmstat-chart options to see what other parameters you want to use - especially if it's going in your crontab.
  3. Make sure your following and security guidelines for your environment.

You'll be able to view the data with the following url:

With Zimbra Apache Or Non-Zimbra Server With Apache
Before You Proceed

Things to check or confirm first before deploying:

  • Place your directory root [/opt/zimbra/support in this example] in a location where space is available and will not create a risk to the mail services if it's full.
  • If you'll be using NFS to have a centralized storage point:
    • Your NFS mount point on the Zimbra servers would be /opt/zimbra/support in this example.
    • You'll be exporting /opt/zimbra/support in this example from the NFS server.
    • If this is a non-zimbra server, copy the zimbra entry from a zimbra server's /etc/passwd and /etc/group into the non-zimbra servers passwd and group file. This way, if NFS is also used the UID/GID matches.
  • Apache Directory variable will be /opt/zimbra/support/data in this example.
  • Apache .htpasswd location will be /opt/zimbra/support/.htpasswd in this example, putting it above of the apache Directory variable.
    • Make sure your following the security guidelines for your environment.
  • Look at the zmstat-chart options to see what other parameters you want to use - especially if it's going in your crontab.
Directory Layout

As root:

mdir -p /opt/zimbra/support/data
cd /opt/zimbra/support/data
for i in `/opt/zimbra/bin/zmprov gas`
 mkdir $i

If your not on a ZCS server, you'll be manually creating directories named after the output of zmhostname from each of your ZCS servers.

Now, create subdirectory paths under each zmhsotname directory.

cd /opt/zimbra/support/data/
for i in `ls`
  mkdir $i/debug $i/logs $i/zmstat $i/tops

Set permissions on the directories we made:

chown -R zimbra:zimbra /opt/zimbra/support
chmod -R 755 /opt/zimbra/support

With this structure and with NFS setup, you'll have a common repository that will have a standard path to use on a per server basis. Example :

script-command -PathOption /opt/zimbra/support/data/`zmhostname`/TYPE_OF_DATA/`date +%F-%H-%M`
Apache Configuration

Let's configure apache to show this directory.

  • For ZCS Apache Setup:
vi /opt/zimbra/conf/httpd.conf
** Towards the end, add the following**
# Include zmstat-chart directory
Include /opt/zimbra/httpd/conf/extra/zimbra-support.conf
  • Non-ZCS Server With Apache. Check that there's an existing Include directive that will see our zimbra-support.conf:
vi /etc/httpd/conf/httpd.conf
** Look for something that will allow the following**
** /etc/httpd/conf.d/zimbra-support.conf to be used**
** Your distro might differ on apache paths as well**
** as Include statement for other conf files**
Include conf.d/*.conf

Let's now make the apache conf file for zimbra-support.conf

  • For ZCS Apache Setup:
vi /opt/zimbra/httpd/conf/extra/zimbra-support.conf
Alias /support "/opt/zimbra/support/data"
<Directory "/opt/zimbra/support/data">
  AuthName "Secure Area For Zimbra Support"
  AuthType Basic
  AuthUserFile /opt/zimbra/support/.htpasswd
  require valid-user
  Options Indexes
  IndexOptions FancyIndexing VersionSort
  AllowOverride None
  Order allow,deny
  Allow from all
  • Non-ZCS Server With Apache:
vi /etc/httpd/conf.d/zimbra-support.conf
Alias /support "/opt/zimbra/support/data"
<Directory "/opt/zimbra/support/data">
  AuthName "Secure Area For Zimbra Support"
  AuthType Basic
  AuthUserFile /opt/zimbra/support/.htpasswd
  require valid-user
  Options Indexes
  IndexOptions FancyIndexing VersionSort
  AllowOverride None
  Order allow,deny
  Allow from all

Make sure permissions are set correctly on zimbra-support.conf so apache will use it.

Now let's setup a username and password to use with the .htpasswd file.

cd /opt/zimbra/support/
htpasswd -c .htpasswd zimbrasupport
chmod 644 .htpasswd

Restart apache so the changes take effect:

  • For ZCS Apache Setup:
zmapachectl stop
zmapachectl start
  • Non-ZCS Server With Apache:
httpd restart

Now, let's dump some graphing directories in there:

zmstat-chart -s /opt/zimbra/zmstat -d /opt/zimbra/support/data/`zmhostname`/zmstat/`date +%F-%H-%M`

To now view the charts. Adjust, SERVERHOSTNAME, for your servername.

  • For ZCS Apache Setup:


  • Non-ZCS Server With Apache:


You'll see there's the directory and when you go into it - there's your charts.

You can now place this command in your crontab to run on a schedule basis.

Tweaking zmstat-chart

zmstat-chart also has the option to use a configuration file. The default configuration file is:


Copy this to another location and edit away. Then add the -c /location/to/config/file to use your new configuration.

Default Items Charted

Here's a list of the default items that will be charted with zmstat-chart:

  • Postfix Queue Size
  • convertd CPU time used
  • convertd Resident Memory
  • convertd Processes and Threads
  • Total CPU
  • Process CPU
  • Process Total Memory
  • Process Resident Memory
  • Virtual Memory
  • Context Switches
  • Run/Blocked Process Queue Size
  • Disk Partition Throughput
  • Disk Utilization
  • Disk Throughput
  • Disk IOPs
  • Swap Activity
  • Total file descriptors open
  • SOAP Invocation Count Summary (Top 10 max)
  • SOAP Average Call Duration Summary (Top 10 avg)
  • SOAP Invocation Count GetServerRequest
  • SOAP Invocation Count BackupRequest
  • SOAP Invocation Count GetAllConfigRequest
  • SOAP Invocation Count GetDomainRequest
  • SOAP Invocation Count GetAllDomainsRequest
  • SOAP Invocation Count AuthRequest
  • SOAP Average Call Duration GetServerRequest
  • SOAP Average Call Duration BackupRequest
  • SOAP Average Call Duration GetAllConfigRequest
  • SOAP Average Call Duration GetDomainRequest
  • SOAP Average Call Duration GetAllDomainsRequest
  • SOAP Average Call Duration AuthRequest
  • MySQL Database Connections
  • MySQL InnoDB Buffer Pool Pages
  • MySQL InnoDB Buffer Pool Hit Rate
  • MySQL Tables Open/Opened
  • MySQL Total Slow Queries Count
  • Mailboxd Connection Pool Get Latency
  • Mailboxd Dirty Lucene Index Writers
  • Mailboxd Lucene IndexWriterCache Hitrate
  • Mailboxd Lucene IO
  • Mailboxd LMTP Delivery Throughput
  • Mailboxd LMTP Delivery Rate
  • Mailboxd Mailbox Add Rate (Delivery Rate)
  • Mailboxd Mailbox Add Latency (Delivery Speed)
  • Mailboxd Request Rate by Client Protocol
  • Mailboxd Response Time by Client Protocol
  • Mailboxd Active Connections by Client Protocol
  • Mailboxd Mailbox Get Count
  • Mailboxd Mailbox Get Latency
  • Mailboxd Mailbox Cache Hit Rate
  • Mailboxd Mailbox Item/Blob Cache Hit Rate
  • Mailboxd Garbage Collection Time
  • Mailboxd Garbage Collection Count
  • Mailboxd JVM Heap Used
  • Mailboxd JVM Heap Free
  • Mailboxd JVM Permanent Generation and Code Cache

Getting All User Quota Data With Zmsoap (not zmstat related really)

Moved to Getting_All_Users_Quota_Data

Getting All User Quota Data With Zmprov (not zmstat related really)

Moved to Getting_All_Users_Quota_Data

Third Party Tools (Monitoring & Logging)

FYI - Support For Real Time Counters (snmp,etc.)

This is for those that need to go beyond what zmstat-chart is doing or need to intergrate within a third party monitoring systems.

Please see RFE:

Currently, this RFE has only resolved support for JMX, not SNMP. Customers who need SNMP can use a product like jManage to do the translation from JMX to SNMP.

SNMP And Zimbra

SNMP Related Bugs And RFEs

Please read the following below as they'll have little bits of information that you might need for your customizations / external setup for snmp use against Zimbra. :

SNMP Setup On Zimbra To Notify A Remote Host

Our SNMP support is pretty basic; currently, we only send traps when a service (mta, mailbox, ldap) changes state (stop/start).

First, you'll need net-snmp package install on the zimbra host for the notifications to be sent to a remote host.

  • When you install the net-snmp package, it creates /etc/snmp/snmpd.conf. This file needs to be edited with the correct community string to allow for snmp mibs to be read from remote machines The default value is "public" with the net-snmp package.
    • /opt/zimbra/conf/swatchrc.in is set to use [ perlcode 0 my $snmpargs="-v 2c -c zimbra localhost "; ] for the community string. Adjust this if needed for your corporate snmp environment.
    • Your security policy for your company might require you to review the other options there as well - i.e. limit to read-only.
    • Also, if there is a firewall between the zimbra server and the snmp server host you'll need to open up port 161/UDP.

Then your zimbra host with the zimbra snmp service installed, do the following for a basic default setup:

zmlocalconfig -e snmp_notify=1
zmlocalconfig -e snmp_trap_host=your.host.name
zmswatchctl stop
zmswatchctl start

We watch for something matching /err: Service status change/ and send the trap with:


See other topics below for customizations that might be needed for your snmp environment.

Other reference for Zimbra and SNMP:

Files To Review For SNMP

Look at the contents of the following files:

  • /opt/zimbra/libexec/zmsnmpinit
    • /opt/zimbra/conf/swatchrc.in
      • zmsnmpinit reads swatchrc.in and writes out the file swatchrc for the running configuration
      • /opt/zimbra/conf/swatchrc
    • /opt/zimbra/snmp/share/snmp/snmpd.conf.in which is the SOURCE file to
      • /opt/zimbra/conf/snmpd.conf [see /opt/zimbra/libexec/zmsnmpinit ]
        • The two above are used by zmsnmpinit to generate the /opt/zimbra/conf/swatchrc
  • /opt/zimbra/net-snmp/share/snmp/mibs/zimbra.mib
  • /opt/zimbra/net-snmp/share/snmp/mibs/zimbra_traps.mib
  • /opt/zimbra/log/zmswatch.out
    • Monitor this to see the services when they go up and down successfully send out the email notification for your snmp configuration
Zimbra MIBS

You'll find zimbra.mib and zimbra_traps.mib in the following directory. This listing is mine under 5.0.19 :

[root@mail3 ~]# cd /opt/zimbra/net-snmp/share/snmp/mibs/

[root@mail3 mibs]# ls
AGENTX-MIB.txt                       IPV6-TC.txt                SNMP-USER-BASED-SM-MIB.txt
DISMAN-EVENT-MIB.txt                 IPV6-UDP-MIB.txt           SNMP-USM-AES-MIB.txt
EtherLike-MIB.txt                    NET-SNMP-EXTEND-MIB.txt    SNMPv2-MIB.txt
HCNUM-TC.txt                         NET-SNMP-MIB.txt           SNMPv2-SMI.txt
HOST-RESOURCES-MIB.txt               NET-SNMP-TC.txt            SNMPv2-TC.txt
HOST-RESOURCES-TYPES.txt             NET-SNMP-VACM-MIB.txt      SNMPv2-TM.txt
IANAifType-MIB.txt                   RFC1155-SMI.txt            TCP-MIB.txt
IANA-LANGUAGE-MIB.txt                RFC1213-MIB.txt            TRANSPORT-ADDRESS-MIB.txt
IANA-RTPROTO-MIB.txt                 RFC-1215.txt               UCD-DEMO-MIB.txt
IF-INVERTED-STACK-MIB.txt            RMON-MIB.txt               UCD-DISKIO-MIB.txt
IF-MIB.txt                           SMUX-MIB.txt               UCD-DLMOD-MIB.txt
IP-FORWARD-MIB.txt                   SNMP-FRAMEWORK-MIB.txt     UCD-SNMP-MIB.txt
IP-MIB.txt                           SNMP-MPD-MIB.txt           UDP-MIB.txt
IPV6-ICMP-MIB.txt                    SNMP-NOTIFICATION-MIB.txt  zimbra.mib
IPV6-MIB.txt                         SNMP-PROXY-MIB.txt         zimbra_traps.mib
IPV6-TCP-MIB.txt                     SNMP-TARGET-MIB.txt
What Is Looked For

Take a look at your /opt/zimbra/conf/swatchrc - this is mine under 5.0.19

perlcode 0 my %notifications=();
perlcode 0 $notifications{smtp}="yes";
perlcode 0 $notifications{snmp}="yes";

perlcode 0 my $fr='admin@mail3.zimbra.REMOVED.com';
perlcode 0 my $pwc='admin@mail3.zimbra.REMOVED.com';

perlcode 0 my $snmpargs="-v 2c -c zimbra localhost ''";
perlcode 0 my $snmptrap="/opt/zimbra/snmp/bin/snmptrap $snmpargs";
perlcode 0 my $snmpsvctrap="ZIMBRA-TRAP-MIB::zmServiceStatusTrap";
perlcode 0 my $snmpsvcname="ZIMBRA-MIB::zmServiceName";
perlcode 0 my $snmpsvcstatus="ZIMBRA-MIB::zmServiceStatus";

perlcode 0 my %statuses=('started'=>1,'stopped'=>0);

perlcode 0 my $hostname="mail3.zimbra.homeunix.com";

perlcode 0 sub donotify {   my %args = (@_); if ($args{HOST} eq "localhost") {$args{HOST}=$hostname;}; 
 if ($notifications{smtp}) { dosmtp(%args) if $args{SERVICE}; dodisksmtp(%args) if $args{DISK};}; 
 if ($notifications{snmp}) {dosnmp(%args);};  }

perlcode 0 sub dosmtp {   my %args = (@_);  print "SMTP notification: $args{MESSAGE}\n"; 
 open (FOO, "|/opt/zimbra/postfix/sbin/sendmail -Am -t"); 
 print FOO "To: $pwc\nFrom: $fr\nSubject: Service $args{SERVICE} $args{STATUS} on $args{HOST}\n\n$args{MESSAGE}\n";
 close FOO; }

perlcode 0 sub dodisksmtp {   my %args = (@_);  print "SMTP notification: $args{MESSAGE}\n"; 
 open (FOO, "|/opt/zimbra/postfix/sbin/sendmail -Am -t"); 
 print FOO "To: $pwc\nFrom: $fr\nSubject: Disk $args{DISK} at $args{UTIL}\% on $args{HOST}\n\n$args{MESSAGE}\n"; 
 close FOO; } 

perlcode 0 sub dosnmp {   my %args = (@_); print "SNMP notification: $args{MESSAGE}\n"; 
 `$snmptrap $snmpsvctrap $snmpsvcname s $args{SERVICE} $snmpsvcstatus i $statuses{$args{STATUS}}`; }

ignore /DEBUG/

watchfor /err: Service status change: (\S+) (.*) changed from stopped to running/ 
	donotify SERVICE=$2,STATUS=started,HOST=$1
watchfor /err: Service status change: (\S+) (.*) changed from running to stopped/ 
	donotify SERVICE=$2,STATUS=stopped,HOST=$1

watchfor /err: Disk warning: (\S+) (\S+) at (\d+)/ 
        donotify DISK=$2,UTIL=$3,HOST=$1
watchfor /crit: Disk warning: (\S+) (\S+) at (\d+)/ 
        donotify DISK=$2,UTIL=$3,HOST=$1
Enhanced MIB Files For HP OpenView

I've created an RFE for this:

Zimbra does not provide "enhanced" mib files" at this time. Thresholds can be set by the customer within their individual monitoring system. Zimbra is alerting on is service up or service down, see the other information above in Ajcody-Logging#SNMP_And_Zimbra .

Some Choices

Charting & Graphing The Data
Montoring Software

Nagios On Zimbra

This is a really rough draft for ideas I have in background. Shouldn't be used by anyone.

Configure Nagios to run on single server Zimbra box - Centos 5.x

Configure yum with repo and install nagios

vi /etc/yum.repos.d/Dag.repo
yum update
yum install nagios nagios-plugins nagios-devel nagios-plugins-nrpe

Move nagios.conf http file into main zimbra directory.

cp /etc/httpd/conf.d/nagios.conf /opt/zimbra/httpd/conf/extra/

Setup nagios to run as zimbra

vi /etc/nagios/nagios.cfg
**Change nagios user to zimbra**

Change ownership of directories from nagios to zimbra.

chown -R 500:500 /var/log/nagios/
chown -R 500:500 /etc/nagios/
chown -R 500:500 /usr/share/nagios/

Configure authentication within Nagios

vi /etc/nagios/nagios.cfg

Set up httpasswd's for the accounts for Nagios

htpasswd -c /etc/nagios/htpasswd.users nagiosadmin
htpasswd /etc/nagios/htpasswd.users guest

Configure Zimbra's http/apache to use nagios http config file

vi /opt/zimbra/conf/httpd.conf
**Add the following towards bottom**
# Include Nagios
Include /opt/zimbra/httpd/conf/extra/nagios.conf

Starting nagios is done as root

/etc/init.d/nagios start

Restarting apache for nagios issues would be done with (as zimbra)

zmapachectl stop
zmapachectl start

The webpage address to view Nagios will be like this:


Use the rest of this how-to to configure it now: http://wiki.centos.org/HowTos/Nagios

MRTG - SNMP On Zimbra

This is a really rough draft for ideas I have in background. Shouldn't be used by anyone.

Configure yum with repo and install mrtg, net-snmp, net-snmp-utils

vi /etc/yum.repos.d/Dag.repo
yum update
yum instal mrtg net-snmp net-snmp-utils

Follow some how-to on setting up the basics.

Create a http config:

vi /opt/zimbra/httpd/conf/extra/mrtg.conf
Alias /mrtg "/opt/zimbra/mrtg"
<Directory "/opt/zimbra/mrtg">
#  SSLRequireSSL
  Options None
  AllowOverride None
  Order allow,deny
  Allow from all
#  Order deny,allow
#  Deny from all
#  Allow from

Add mrtg to http configuration within zimbra:

vi /opt/zimbra/conf/httpd.conf
# Include Mrtg
Include /opt/zimbra/httpd/conf/extra/mrtg.conf

Restart apache:

zmapachectl stop
zmapachectl start

Create directory to hold mrtg data:

mkdir /opt/zimbra/mrtg

Address will be something like:


Mailq Pointing To Right Binary

# ls -la /usr/bin/mailq
 lrwxrwxrwx 1 root root 27 Sep  3 17:00 /usr/bin/mailq -> /etc/alternatives/mta-mailq
# ls -la /etc/alternatives/mta-mailq
 lrwxrwxrwx 1 root root 23 Apr  1 10:17 /etc/alternatives/mta-mailq -> /usr/bin/mailq.sendmail
# rm /usr/bin/mailq
# ln -s /opt/zimbra/postfix/sbin/mailq /usr/bin/mailq
# mailq
 Mail queue is empty

Web Client Logging

Active Sessions

Please see Zmsoap#Active_Server_Sessions_With_DumpSessionsRequest

Debug (SOAP) via Browser

See http://wiki.zimbra.com/index.php?title=Web_Client_URL_Tricks&redirect=no

Admins To View Client Issues

Within the admin console, you can view users mail.

  • Goto accounts and highlight the user having the problem.
  • Click on the View Mail button above that frame.
  • Then goto the url field of that new window and modify it to look like this [replace mailserver with yours]:
  • Hit your return key to cause the browser to reload.
    • If you get warning about pop-up, accept it.
    • If the debug window doesn't show, just mouse in the url field and hit the return key again. It should now pop up.

User Management Topics

   KB 2439        Last updated on 2008-11-17  

(0 votes)
24px ‎  - This is Zeta Alliance Certified Documentation. The content has been tested by the Community.

Actual User Management Topics Homepage

Please see Ajcody-User-Management-Topics

Resetting A User's Account From CLI

Resetting A Password

Standard Method

SetPassword [sp] from zmprov:

zmprov sp joe@domain.com test321

Resetting Users Auth Session - Force Disconnect

Please See First - In Case Of Compromised Accounts / Spammers

Note - Restarting the mta services will be important once you reset the password/s or lock the account. It's required to ensure the active connections will be closed and any existing auth tokens no longer are valid. See:

Changing the Users Password To Expire Session

See Resetting A Password Via CLI or change it via the admin console.

Prior To 605 - Use CLI To Change zimbraAuthTokenValidityValue To Expire The Session

Change the zimbraAuthTokenValidityValue to a small time value:

su - zimbra
zmprov ma <accountname> zimbraAuthTokenValidityValue 1
zmprov fc account <accountname>

This value gets stored in the auth token and compared on every request. Changing it will invalidate all outstanding auth tokens.

8.7.6+ invalidate sessions by removing zimbraAuthTokens

This may be helpful in case you do no want to change zimbraAuthTokenValidityValue or changing zimbraAuthTokenValidityValue does not log you out.

To clear or reset all auth token values we need to enter token data in a particular format like "1689192272|1548369012160|8.8.15_GA_3890".

These are the steps to clear the auth tokens from an account. 1). First check few stored token for the account.

     zmprov ga USERNAME@DOMAIN.COM zimbraAuthTokens | head

2). Now pick anyone token value and set it with below command, with this step only one token will be set and others will be removed.

     zmprov -l ma USERNAME@DOMAIN.COM zimbraAuthTokens '1689192272|1548369012160|8.8.15_GA_3890'

3). Flush the account cache at the end.

     zmprov fc account USERNAME@DOMAIN.COM

All sessions of USERNAME@DOMAIN.COM are now ended.

6.0.5+ You Have Admin Console Option

In the admin console, under the Manage Accounts window you can right click on the user name and choose "Expire Sessions".

User , Mailbox ID's, And Who Is What

ZimbraID [UserID] is system wide.

MailboxID is per server store.

To get the ZimbraID:

$ zmprov ga user@domain.com | grep -i zimbraid
zimbraId: aeca260b-6faf-4cfe-b407-7673748aabf4
zimbraIdentityMaxNumEntries: 20

To get the MailboxID, get on the appropriate mailserver and:

zmprov gmi user@domain.com
mailboxId: 3
quotaUsed: 251512

or globally:

/opt/zimbra/bin/mysql -e "use zimbra; select id from mailbox where account_id = 'UserID HERE including the leading 0'"

Other details can be found here:


Account & Domain Summary

Run zmaccts

Here's what it would return:

su - zimbra
[zimbra@mail3 ~]$ zmaccts
           account                          status             created       last logon
------------------------------------   -----------     ---------------  ---------------
admin@mail3.internal.domain.com           active      05/06/08 18:46   07/08/08 09:56
ajcody@mail3.internal.domain.com          active      05/06/08 20:43   06/23/08 15:48
ajcody2@mail3.internal.domain.com         active      05/28/08 11:48   06/30/08 17:44
forward@mail3.internal.domain.com         active      05/06/08 21:06   05/29/08 17:24
ham.bidiob2mm@mail3.internal.domain.com   active      05/06/08 18:47            never
spam.rormmtcyy@mail3.internal.domain.com  active      05/06/08 18:47            never
wiki@mail3.internal.domain.com            active      05/06/08 18:46            never
           account                        status             created       last logon
------------------------------------   -----------     ---------------  ---------------
secondary@secondary.internal.domain.com   active      06/23/08 15:26   06/23/08 15:27
wiki@secondary.internal.domain.com        active      06/23/08 15:25            never
                                domain summary
    domain                  active    closed    locked    maintenance     total
-----------------------   --------  --------  --------  -------------  --------
mail3.internal.domain          7         0         0              0         7
secondary.internal.domain          2         0         0              0         2

Last Logon comes from the variable zimbraLastLogonTimestamp . This is used to update the "Last Login Time" column in the admin web console as well. It also shows up with [ zmprov ga user@domain ]. Login's based upon session type would only be found in either audit.log or the mailbox.log files. It should have a reference to the user id and the session type for the login [ pop, imap, etc. ].

RFE To Expand zmaccts Output And Options

Please see the following RFE I made:

Zmmailbox Stuff

Shares And Permissions

RFE's And Bugs To Review

Please see these RFE's first:

Some other's to look at:

To See All Folders For A User

Do the following for the user:

[zimbra@mail3 ~]$ zmmailbox -z -m ajcody@DOMAIN gaf
        Id  View      Unread   Msg Count  Path
----------  ----  ----------  ----------  ----------
         1  conv           0           0  /
        16  docu           0           2  /Briefcase
        10  appo           0           1  /Calendar
        14  mess           0           0  /Chats
         7  cont           0           0  /Contacts
         6  mess           0           0  /Drafts
        13  cont           0           9  /Emailed Contacts
         2  mess           0          11  /Inbox
         4  mess           0           0  /Junk
       344  mess           0           0  /Junk E-mail
        12  wiki           0           0  /Notebook
       302  appo           0           0  /Restored
         5  mess           0          15  /Sent
       420  mess           0           0  /Share
       421  mess           0           0  /Share/Share1
       422  mess           0           0  /Share/Share1/Share1-1
       423  mess           0           0  /Share/Share2
       424  mess           0           0  /Share/Share2/Share2-1
        15  task           0           2  /Tasks
         3  conv           0           0  /Trash

To See All Shares And Perms On A Users Folders

Do the following for the user [ I'm cutting some of the output to keep it short ]:

[zimbra@mail3 ~]$ zmmailbox -z -m ajcody@DOMAIN gaf -v
 "id": "1",
 "name": "USER_ROOT",
 "path": "/",
 "parentId": "11",
 "flags": null,
 "color": "defaultColor",
 "unreadCount": 0,
 "messageCount": 0,
 "view": "conversation",
 "url": null,
 "effectivePermissions": null,
 "children": [
 "id": "5",
 "name": "Sent",
 "path": "/Sent",
 "parentId": "1",
 "flags": null,
 "color": "defaultColor",
 "unreadCount": 0,
 "messageCount": 15,
 "view": "message",
 "url": null,
 "effectivePermissions": null
 "id": "420",
 "name": "Share",
 "path": "/Share",
 "parentId": "1",
 "flags": "i",
 "color": "defaultColor",
 "unreadCount": 0,
 "messageCount": 0,
 "view": "message",
 "url": null,
 "effectivePermissions": null,
 "grants": [
 "type": "usr",
 "name": "ajcody2@mail3.internal.domain.com",
 "id": "88fd808e-a526-419d-9eda-ad50100d23b6",
 "permissions": "rwidx",
 "args": null
 "type": "all",
 "name": null,
 "id": null,
 "permissions": "rwx",
 "args": null
 "children": [
 "id": "421",
 "name": "Share1",
 "path": "/Share/Share1",
 "parentId": "420",
 "flags": "i",
 "color": "defaultColor",
 "unreadCount": 0,
 "messageCount": 0,
 "view": "message",
 "url": null,
 "effectivePermissions": null,
 "grants": [
 "type": "usr",
 "name": "ajcody2@mail3.internal.domain.com",
 "id": "88fd808e-a526-419d-9eda-ad50100d23b6",
 "permissions": "rwidx",
 "args": null
 "type": "usr",
 "name": "admin@mail3.internal.domain.com",
 "id": "5ab13330-2e9b-4a45-9b30-de2c70858265",
 "permissions": "rwidx",
 "args": null
 "children": [
 "id": "422",
 "name": "Share1-1",
 "path": "/Share/Share1/Share1-1",
 "parentId": "421",
 "flags": null,
 "color": "defaultColor",
 "unreadCount": 0,
 "messageCount": 0,
 "view": "message",
 "url": null,
 "effectivePermissions": null
 "id": "423",
 "name": "Share2",
 "path": "/Share/Share2",
 "parentId": "420",
 "flags": null,
 "color": "defaultColor",
 "unreadCount": 0,
 "messageCount": 0,
 "view": "message",
 "url": null,
 "effectivePermissions": null,
 "children": [
 "id": "424",
 "name": "Share2-1",
 "path": "/Share/Share2/Share2-1",
 "parentId": "423",
 "flags": null,
 "color": "defaultColor",
 "unreadCount": 0,
 "messageCount": 0,
 "view": "message",
 "url": null,
 "effectivePermissions": null

Remove All Shares

RFE I filed for zmmailbox to have options for this and "recursive".

Script To Remove All Shares

Here's a script I wrote. Remove the echo statements to actually run the commands.

GETPERM="zmmailbox -z -m $USER gfg $SHARE"
MODPERM="zmmailbox -z -m $USER mfg $SHARE"

$GETPERM | egrep -i 'all|guest|public|accoun|domain|group' | gawk '{print $2 " " $3}' | while read SHAREPERM
TYPE=`echo $SHAREPERM|awk '{print $1}'`
DISPLAY=`echo $SHAREPERM|awk '{print $2}'`

case $TYPE in
        accoun) echo $MODPERM account $DISPLAY $NEWPERM
        all) echo $MODPERM $TYPE $NEWPERM

Ouput of an example:

[zimbra@mail3 ~]$  zmmailbox -z -m ajcody@mail3.internal.domain.com gfg /Shared
Permissions    Type  Display
-----------  ------  -------
          r     all
          r   guest  ajcody@domain.com
          r  accoun  admin@mail3.internal.domain.com
          r   group  mydl@mail3.internal.domain.com
          r  domain  mail3.internal.domain.com
[zimbra@mail3 ~]$ /tmp/remove-share.sh
zmmailbox -z -m ajcody@mail3.internal.domain.com mfg /Shared all none
zmmailbox -z -m ajcody@mail3.internal.domain.com mfg /Shared guest ajcody@domain.com none
zmmailbox -z -m ajcody@mail3.internal.domain.com mfg /Shared account admin@mail3.internal.domain.com none
zmmailbox -z -m ajcody@mail3.internal.domain.com mfg /Shared group mydl@mail3.internal.domain.com none
zmmailbox -z -m ajcody@mail3.internal.domain.com mfg /Shared domain mail3.internal.domain.com none

I then removed the echo statements:

[zimbra@mail3 ~]$ vi /tmp/remove-share.sh
[zimbra@mail3 ~]$ /tmp/remove-share.sh
[zimbra@mail3 ~]$  zmmailbox -z -m ajcody@mail3.internal.domain.com gfg /Shared
Permissions    Type  Display
-----------  ------  -------
[zimbra@mail3 ~]$
User Contributed Perl Script To Remove All Shares

Please TEST this on a test box or a test account before running against a production situation. ZCS version change and commands might act different. Also note, this is a user contributed script and not one from Zimbra developers or the support staff. Also - the wiki formatting might throw of the script and could require you to fix before it runs correctly.

Script is called - zmshares - and should be named such.

#!/usr/bin/env perl
# This program was written by Pablo Garaitonandia on Nov. 26 2012.
# This program is for viewing and deleting all the shares that a user 
# may have in the event that removing the many shares a user has is 
# time consuming.
# This was written on a system running Zimbra 7.2.0, RHEL 5.8, with perl v5.8.8

use strict;
use warnings;
use Getopt::Long;

my $id=getpwuid($<);
my $help=0;
my $user_id=0;
my $option=0;
my @shares;
sub view_share;
sub del_share;

chomp $id;
if ($id ne "zimbra") {
	print STDERR "Error: must be run as zimbra user\n";
	exit (1);

        'h|help' => \$help,
        'u|uid=s' => \$user_id,
	'o|option=s'=> \$option, ) or die "Incorrect usage!\n";

# Check for usage, definition, and correct argument types
if ((defined ($user_id) && ($user_id =~ /([a-z0-9]+@[a-z.]+\.[a-z.]+)/gi)) 
	&& (defined ($option) && (($option eq "delete") || ($option eq "view")))) {
		print "\n$option: shares for $user_id \n\n";
		} elsif ($help) {
		} else {

if ($option eq "view"){ view_share();}
if ($option eq "delete"){ del_share();}

sub view_share {
	open(VIEW, "/opt/zimbra/bin/zmprov getShareInfo $user_id |");	
	print <VIEW>;

sub del_share {
	open(SHARES, "zmprov getShareInfo $user_id |awk '{print substr(\$0,70,6) ,substr(\$0,131,36), substr(\$0,168,15)}' | awk 'NR>2' |");
	@shares = <SHARES>;
	if (!(@shares)){
		print "EXITING: User has no shares to delete.  \n\n";
		 exit (1);
	foreach my $share (@shares){
		my @line = split(/\s+/, $share);
		if (defined ($line[2])){
			print "zmmailbox -z -m $user_id  mfg $line[0] account $line[1] none\n";
			system("/opt/zimbra/bin/zmmailbox -z -m $user_id  mfg $line[0] account $line[1] none") == 0
				or die "Command Failed";
			} else {
			print "zmmailbox -z -m $user_id  mfg $line[0] account \"\" none\n";
			system("zmmailbox -z -m $user_id  mfg $line[0] account \"\" none") == 0
				or die "Command Failed";

sub usage {

        my ($msg) = (@_);

        $msg && print STDERR "\nINCORRECT USAGE: $msg\n";
        print STDERR <<USAGE;

  zmshares -u username\@domain -o (delete|view)

  -u: (user\@domain)  The full user id with domain for user. 
  -o: (delete|view) Delete or view ALL shares for the user

        exit (1);


Setting Up A Share - CLI

I've yet to test these against all items (resources) listed in bug 25740 and work as expected.

To see current perms

zmmailbox -z -m faxfinder@example.com gfg /Inbox

To modify perms:

  • r = read
  • w = write
  • i = insert
  • d = delete
  • x = accept/decline invites
  • a = administer
zmmailbox -z -m faxfinder@example.com mfg /Inbox account user@example.com rwidx

To confirm perms are set:

zmmailbox -z -m faxfinder@example.com gfg /Inbox

To mount "folder" into a user account that was given permission:

zmmailbox -z -m user@example.com cm --view message "/Incoming_Faxes" faxfinder@example.com /Inbox

To confirm folder is mounted:

zmmailbox -z -m user@example.com gaf

Additions notes/options see:

zmmailbox help folder 

For mfg it shows it can take the below as a target:

  • account {name}
  • group {name} *This could be a DL?*
  • domain {name}
  • all
  • public
  • guest

Scripting note to do this with multiple users:

  • zmmailbox cm could use the zmprov gaa to provide a list of all accounts, this would include system & archive (if exist) accounts though.

How To Turn Off Sharing

You can enable / disable sharing from admin console:

- Admin console --> class of service --> select the CoS (eg default) --> features --> general features --> check/uncheck 'Sharing' option

Alternatively, this can be achieved by having the following CoS attribute either 'TRUE' or 'FALSE', from command line: zimbraFeatureSharingEnabled

Searches With zmmailbox

Special Note If Your Search String Needs Spaces

Here is an example using the correct format to include required spaces to have your search do what you want. For instance, many shared folders will end up using, by default, spaces in the folder name.

$ zmmailbox -z -m ajcody@`zmhostname` gaf | grep appo
        10  appo           0           0  /Calendar
       263  appo           0           2  /Large Share's Calendar (large-share@mail71.DOMAIN.com:10)

$ zmmailbox -z -m ajcody@`zmhostname` s -t appo in:"\"Large Share's Calendar"\"
num: 2, more: false

                                         Id  Type   From        Subject               Date
   ----------------------------------------  ----   ----------  --------------------- ------
1. 799efb72-2e6b-400a-8881-c5f9d7c282b1:265  appo   <na>        Test On Thu           10/28/10 00:02
2. 799efb72-2e6b-400a-8881-c5f9d7c282b1:263  appo   <na>        test for friday       10/28/10 00:02

Note, the "\"Text1 Text2"\" is for a [s option] search string query, when querying for the folder name with other zmmailbox options - normal quoting works. For example:

$ zmmailbox -z -m ajcody@`zmhostname` gfg "Large Share's Calendar"  
Permissions      Type  Display
-----------  --------  -------
     rwidxa   account  ajcody@mail71.DOMAIN.com

Search For Messages And Then Delete Them

Here's some examples to grab the message id's from a search and then put them in a variable to use for the delete command.

Other reference: King0770-Notes#Removing_Messages_with_Zmmailbox_based_on_the_Subject

Note - Crossmailbox Search And Delete Is Currently An RFE

See the following :

First - Default Search Returns Only 25 Results

From zmmailbox [help search] & zmmailboxsearch

--limit (optional)
Sets the limit for the number of results returned. The default is 25.
Example Search With A From And To Date - Multiple Variable Search

This allows you to restrict your search in-between a date range.

zmmailbox -z -m user@domain.com s -t message -l 999 "before:6/15/2011 and after:6/9/2011"

Note - If your trying to do this for a tgz export, please see the following :

Example Search With To Field
[zimbra@mail3 ~]$ zmmailbox -z -m ajcody@mail3.internal.DOMAIN.com s -t message "To: Adam"
num: 4, more: false

     Id  Type   From                  Subject                                             Date
   ----  ----   --------------------  --------------------------------------------------  --------------
1.  269  mess   Adam                  Re: 8-7-08 11:37 AM to both outside accounts        08/07/08 11:57
2.  268  mess   Adam                  Re: 8-7-08 11:37 AM to both outside accounts        08/07/08 11:39
3.  266  mess   Adam                  Re: 8-7-08 11:37 AM to both outside accounts        08/07/08 11:38
4.  263  mess   Adam                  Re: test on 8-7-08 to zimbra account                08/07/08 11:37

[zimbra@mail3 ~]$ zmmailbox -z -m ajcody@mail3.internal.DOMAIN.com s -t message "To: Adam" |awk '{ if (NR!=1) {print}}'| grep mess | awk '{ print $2 "," }' | tr -d '\n'


[zimbra@mail3 ~]$ message=`zmmailbox -z -m ajcody@mail3.internal.DOMAIN.com s -t message "To: Adam" |awk '{ if (NR!=1) {print}}'| grep mess | awk '{ print $2 "," }' | tr -d '\n'`

[zimbra@mail3 ~]$ zmmailbox -z -m ajcody@mail3.internal.DOMAIN.com dm `echo $message`

[zimbra@mail3 ~]$ zmmailbox -z -m ajcody@mail3.internal.DOMAIN.com s -t message "To: Adam"
num: 0, more: false
Example Search With From Field
[zimbra@mail3 ~]$ zmmailbox -z -m ajcody@mail3.internal.DOMAIN.com s -t message "From: Adam"
num: 8, more: false

     Id  Type   From                  Subject                                             Date
   ----  ----   --------------------  --------------------------------------------------  --------------
1.  464  mess   Adam                  test 3                                              10/02/08 11:43
2.  463  mess   Adam                  test  2                                             10/02/08 11:43
3.  462  mess   Adam                  test  1                                             10/02/08 11:43
4.  461  mess   Adam                  test                                                09/29/08 16:18
5.  460  mess   Adam                  test for mailbox log                                09/29/08 16:17
6.  265  mess   Adam                  8-7-08 11:37 AM to both outside accounts            08/07/08 11:38
7.  261  mess   Adam                  test on 8-7-08 to zimbra account                    08/07/08 11:36
8.  257  mess   Adam                  test from zimbra on 8-7-08                          08/07/08 11:27

[zimbra@mail3 ~]$ zmmailbox -z -m ajcody@mail3.internal.DOMAIN.com s -t message "From: Adam" |awk '{ if (NR!=1) {print}}'| grep mess | awk '{ print $2 "," }' | tr -d '\n'


[zimbra@mail3 ~]$ message=`zmmailbox -z -m ajcody@mail3.internal.DOMAIN.com s -t message "From: Adam" |awk '{ if (NR!=1) {print}}'| grep mess | awk '{ print $2 "," }' | tr -d '\n'`

[zimbra@mail3 ~]$ echo $message


[zimbra@mail3 ~]$ zmmailbox -z -m ajcody@mail3.internal.DOMAIN.com dm `echo $message`

[zimbra@mail3 ~]$ zmmailbox -z -m ajcody@mail3.internal.DOMAIN.com s -t message "From: Adam"
num: 0, more: false

[zimbra@mail3 ~]$

More Search Possibilities

Please see [Search Tips]

Export & Import Of Users Data In TGZ Format

Please see Ajcody-Migration-Notes#ZCS_User_to_Another_ZCS_Server_-_With_Rest_.26_TGZ

Seeing What & Where Of A Message ID

If your need to figure out what the actual email/message is from a logging event.

For example, log shows:

 2009-03-03 22:04:58,969 INFO [btpool0-5532] [name=USER@DOMAIN.com;mid=8;ip=;ua=ZimbraWebClient - IE6
(Win)/5.0.11_GA_2695.UBUNTU8_64;] mailop - moving Message (id=10955) to Folder Trash (id=3) 

To see the details of the message, do the following:

zmmailbox -z -m USER@DOMAIN gm 10955
Id: 10955
Conversation-Id: 11155
Folder: /Trash
Subject: FW: How are you doing?
From: User External <USER@DOMAIN.com>

Message Count Mismatches

Message Count Via zmprov

To see a listing of message count in folders, replace USER@DOMAIN w/ user:

zmmailbox -z -m USER@DOMAIN gaf

You can also do something like this:

zmmailbox -z -m USER@DOMAIN s -t mess in:"FOLDER_IN_QUESTION"

If the folder has spaces, use the following format : "\"Large Share's Calendar"\"

zmprov rmc RecalculateMailboxCounts

From the zmprov help for rmc:

RecalculateMailboxCounts  rmc  {name@domain|id}
  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. 

  $zmprov rmc user@domain

Users should log into a new ZWC session after this was done.

If User Is Using IMAP Client

We have some bugs/rfe's in regards to how various IMAP clients operate with their delete/purge and it's impact on the our message counting.

Here's a recent one:

One work around was by configuring the IMAP client to move messages to a Trash/Deleted Items folder [if available] and to delete/purge messages immediately or upon sign off.

Check The Message Blobs On The File System

This is more of a sanity check, confirming the user does have what you would estimate for message blobs on the file system under their message store path.

See: Ajcody-Mysql-Topics#How_To_Locate_Users_Mailstore_and_Message_Store_Directory

You might also see "No Such Blob" messages in the ZWC client and the mailbox.log file.

See: Ajcody-Notes-No-Such-Blob

Make Sure Your Not Auto-purging Messages

These are set at the global or server level.

zmprov gacf | egrep "zimbraMailPurgeSleepInterval|zimbraMailTrashLifetime|\

zmprov gs server.domain.com | egrep "zimbraMailPurgeSleepInterval|\

These at the user level:

zmprov ga user@domain | egrep "zimbraPrefInboxReadLifetime|zimbraPrefInboxUnreadLifetime|\


Managing Legal Requests for Information


The ZCS legal intercept feature is used to obtain copies of email messages that are sent, received, or saved as drafts from targeted accounts and send these message to a designated “shadow” email address. Legal Intercept can be configured to send the complete content of the message or to send only the header information. When a targeted account sends, receives, or saves a draft message, an intercept message is automatically created to forward copies of the messages as attachments to the specified email address.

Please see:

Persona, Identities, Send As, Send On Behalf Of Issues

For ZCS 8 And Above You Must Grant ACL Rights For sendAs and sendAsDistList for internal users

This section below only applies to versions ZCS 6 and ZCS 7. For ZCS 8 and above, the zimbraAllowFromAddress variable only is valid for external accounts and can NOT be used for internal users or ZCS distribution lists [DL's]. Please see the following for ZCS 8+

CLI Commands To Manage Persona, Identities, External Account

The following should provide you with the necessary commands to manage these user configurations:

 zmprov help command| grep -i data
 createDataSource(cds) {name@domain} {ds-type} {ds-name} zimbraDataSourceEnabled {TRUE|FALSE} zimbraDataSourceFolderId {folder-id} [attr1 value1 [attr2 value2...]]
 deleteDataSource(dds) {name@domain|id} {ds-name|ds-id}
 getDataSources(gds) {name@domain|id} [arg1 [arg2...]]
 modifyDataSource(mds) {name@domain|id} {ds-name|ds-id} [attr1 value1 [attr2 value2...]]
 zmprov help command| grep -i identit
 createIdentity(cid) {name@domain} {identity-name} [attr1 value1 [attr2 value2...]]
 deleteIdentity(did) {name@domain|id} {identity-name}
 getIdentities(gid) {name@domain|id} [arg1 [arg...]]
 modifyIdentity(mid) {name@domain|id} {identity-name} [attr1 value1 [attr2 value2...]]

Bugs And RFE's To Look At

Send As Issues

On Behalf Of Issues

Persona Setup With Send As [zimbraAllowFromAddress] Rights Rather Than On Behalf Of

This section below only applies to versions ZCS 6 and ZCS 7. For ZCS 8 and above, the zimbraAllowFromAddress variable only is valid for external accounts and can NOT be used for internal users or ZCS distribution lists [DL's]. Please see the following for ZCS 8+

Using A DL - Mailing List - As Your Shared Email Address

This was tested against ZCS 6.0.8p1 .

Attribute descriptions - 608 :

zimbra-attrs.xml:<attr id="427" name="zimbraAllowAnyFromAddress" type="boolean" 
   cardinality="single" optionalIn="account,cos" flags="accountInfo,accountInherited">

zimbra-attrs.xml:<attr id="428" name="zimbraAllowFromAddress" type="email" max="256" 
   cardinality="multi" optionalIn="account" flags="accountInfo,domainAdminModifiable">
  • First, created a test user account:
    • ajcody@rr608.zimbra.DOMAIN.com
      • In the admin web console, under the users preferences tab :
        • Sending Mail > checked  : "Allow sending email from any address"
          • zmprov ma ajcody@rr608.zimbra.DOMAIN.com zimbraAllowAnyFromAddress TRUE
          • Note, this could be setup in a COS as well and then assign the users you want to that COS
          • If this is to permissive, because it does allow the user to send as anybody, then you'll want to do this instead:
            • zmprov ma ajcody@rr608.zimbra.DOMAIN.com zimbraAllowAnyFromAddress FALSE
            • zmprov ma ajcody@rr608.zimbra.DOMAIN.com zimbraAllowFromAddress personal-dl@rr608.zimbra.DOMAIN.com
              • Note - bug alert.
                • Testing shown that you could still have a persona setup for a particular address that wasn't set for the zimbraAllowFromAddress variable and zimbraAllowAnyFromAddress is set as FALSE. You'll be able to select it when composing a message and the message is sent with no error. But, what happens is the email is delivered to the recipient with your primary account details rather than the persona's.
  • If your only using a DL for the mail traffic, you would:
    • Create a new DL :
      • persona-dl@rr608.zimbra.DOMAIN.com
        • checked "Can receive email"
        • Added a user/s to the DL:
          • ajcody@rr608.zimbra.DOMAIN.com
  • Now, once that is done we can setup the persona for our "test user" - ajcody. Login as testuser
    • Create a Folder called "Persona DL" and then a filter rule to move all emails with persona-dl@rr608.zimbra.DOMAIN.com to the "Persona DL" folder.
      • Under the users perferences, Mail > Accounts > Add Persona button:
        • Persona Name : Persona DL
          • From : Persona DL # personal-dl@rr608.zimbra.DOMAIN.com
          • Reply-To : Persona DL # personal-dl@rr608.zimbra.DOMAIN.com
          • Use this persona:
          • check "when replying or forwarding messages sent to: Persona DL # personal-dl@rr608.zimbra.DOMAIN.com
          • check "when replying or forwarding messages in folder(s) : Personal DL
  • Things to note when using persona
    • A new message in the "From" section will give a drop down for your persona choice.
    • It's best to create a mail filter rule to put related messages for the persona account into a folder and then in the persona choose the option about using the persona as the default when replying to messages in that folder.

Using A Shared Mailbox As Your Shared Email Address

This section below only applies to versions ZCS 6 and ZCS 7. For ZCS 8 and above, the zimbraAllowFromAddress variable only is valid for external accounts and can NOT be used for internal users or ZCS distribution lists [DL's]. Please see the following for ZCS 8+

The below how-to was tested against ZCS 6.0.8p1 .
  • First, created a test user account:
    • ajcody@rr608.zimbra.DOMAIN.com
      • In the admin web console, under the users preferences tab :
        • Sending Mail > checked  : "Allow sending email from any address"
          • zmprov ma ajcody@rr608.zimbra.DOMAIN.com zimbraAllowAnyFromAddress TRUE
          • Note, this could be setup in a COS as well and then assign the users you want to that COS
          • If this is to permissive, because it does allow the user to send as anybody, then you'll want to do this instead:
            • zmprov ma ajcody@rr608.zimbra.DOMAIN.com zimbraAllowAnyFromAddress FALSE
            • zmprov ma ajcody@rr608.zimbra.DOMAIN.com zimbraAllowFromAddress personal-source@rr608.zimbra.DOMAIN.com
              • Note - bug alert.
                • Testing shown that you could still have a persona setup for a particular address that wasn't set for the zimbraAllowFromAddress variable and zimbraAllowAnyFromAddress is set as FALSE. You'll be able to select it when composing a message and the message is sent with no error. But, what happens is the email is delivered to the recipient with your primary account details rather than the persona's.
  • If I was only using a "shared mailbox" for the mail traffic, I would:
    • First create a DL that will have the user accounts you want to share this 'new' mailbox [Inbox]:
      • Create a new DL:
        • persona-share@rr608.zimbra.DOMAIN.com
          • checked "Can receive email"
          • Added a user to the DL:
            • ajcody@rr608.zimbra.DOMAIN.com
  • The create a new account/mailbox that others will share:
    • persona-source@rr608.zimbra.DOMAIN.com
      • From the 'admin console', do "View Mail" on the new account
        • Share the Inbox to the DL : persona-share@rr608.zimbra.DOMAIN.com w/ Manager or Admin Rights
  • Log back into the 'test user' acocunt - ajcody@rr608.zimbra.DOMAIN.com
    • Accept the share and confirm you see the "Inbox" from the "persona-source" account.
      • Then, under the users perferences, Mail > Accounts > Add Persona button::
        • Persona Name : Persona Source
          • From : Persona Source # persona-source@rr608.zimbra.DOMAIN.com
          • Reply-To : Persona Source # persona-source@rr608.zimbra.DOMAIN.com
          • Use this persona:
          • check "when replying or forwarding messages sent to: persona-source@rr608.zimbra.DOMAIN.com
          • check "when replying or forwarding messages in folder(s) : Persona Source's Inbox
  • Things to note when using persona
    • A new message in the "From" section will give a drop down for your persona choice.
    • It's best to create a mail filter rule to put related messages for the persona account into a folder and then in the persona choose the option about using the persona as the default when replying to messages in that folder.
    • Need An RFE/BUG Report? - When you have a shared mailbox folder, the 'normal' operation when replying to messages from that folder is to send them "on behalf of". You don't want this option, since your wanting to use the persona rules. You might need to "uncheck" the box under the new message that says:
      • uncheck box for "Send this message on behalf of: persona-source@rr608.zimbra.DOMAIN.com"
      • I couldn't find a way to have this "unchecked" as the default.

Sieve Rules

Administrating Rules For Users - CLI

Please see King0770-Notes-Sieve_Rules_By_Proxy

Jump to: navigation, search