Zimbra FAQ's, tips and tricks

Version 0.3 (2006/02/07)

Introduction
This page ...

... gathers some FAQ's and tips&tricks to ease installation and tweaking of Zimbra.
You are welcome to send me (sietse@sietse.net) corrections and new stuff; I will add it to this page.

Disclaimer

I am not connected to the company Zimbra, other than that I am using Zimbra.
I am not responsible for anything that happens to your Zimbra installation if you do anything written on this page.

Frequently asked questions with answers

What is Zimbra?
What is the difference between the Open Source Edition, and Network Edition?
Does Zimbra run on [your favourite Linux distribution]?
Does Zimbra run on Windows?
Does Zimbra run on Mac OSX?
Can I use Outlook to connect to Zimba?
I already have a webserver/mysql running. Why does Zimbra have its own?
How can I backup Zimbra Open Source?
What is the relation between spamassassin score and the spam percentages in the admin console?
How can I see the scores of spamassassin? And what mail is junked/blocked?
Where is the source?
Can I have multiple email accounts in Zimbra?
Can I use LDAP to access my contacts?
What is the max. message size and how can I change it?
Can I copy my current mail/contacts/appointments into Zimbra?

What is Zimbra?

From their website: Zimbra is an open source server and client technology for next-generation enterprise messaging and collaboration.
That means that it contains both a server part (like Exchange) and a client part (like web-based Outlook).
The server part is built on a MySQL database, Tomcat web/application server, postfix mailserver, amavis spam and virus scanner, and an Apache+aspell based spell checker.
The client part is built using AjaxTK, a rich webclient. The webclient is very slick; seeing is believing: have a look at the demo.

What is the difference between the Open Source Edition, and Network Edition?

The short answer is: the Open Source Edition is free, the Network Edition is not. The Network Edition has more features, an Outlook connector and has support.
The long answer is here and in this thread in the forum.

Does Zimbra run on [your favourite Linux distribution]?

Zimbra Open Source Edition runs on at least Fedora Core 3/4, Suse 9/10, Debian (although it is still alpha) and RHEL 4, see the download page.
Zimbra Network Edition is only supported on RHEL 4.

Does Zimbra run on Windows?

Not natively. However, work seems to be in progress according to this forum thread. It does not seem ready for prime time yet.

Does Zimbra run on Mac OSX?

Yes, it does, have a look at the download page. See also this forum thread.

Can I use Outlook to connect to Zimba?

If you are using the Open Source Edition, you can use Outlook to send and receive email via POP and IMAP. If you wish to to make use of additional functionality that Zimbra offers, such as calendaring, you would need to purchase the Network Edition of Zimbra.

I already have a webserver/mysql/whatever running. Why does Zimbra have its own?

The idea behind Zimbra is provide a do-all 'black box' that Just Works. All needed software is included, making the package independent of already existing (or missing) software. Also, the packaged software is optimized for Zimbra.
Here is a forum thread about the subject.

How can I backup Zimbra Open Source?

Online backup/restore is part of Zimbra Network Edition.
For the Open Source Edition, for now it is recommended to shut down Zimbra, and make your backup. There is work in progress for another backup mechanism, see this thread.

What is the relation between spamassassin score and the spam percentages in the admin console?

A spam score of 20 is considered 100%. So, if spam tagging is at 33%, it means that email with score of 6.6 and up is marked as spam, and will end up in your spam folder. If spam killing is at 75%, it means that email with score 15 and up is blocked.

How can I see the scores of spamassassin? And what mail is junked/blocked?

This data is logged in the logger database of zimbra. The following will show you information on received mail:

su - zimbra
logmysql zimbra_logger -e "select * from amavis order by arrive_time"
Where is the source?

Some can be downloaded from the download page.
Bleeding edge sources are available from CVS, see this thread.

Can I have multiple email accounts in Zimbra?

Zimbra allows you to setup aliases, so you can receive mail from multiple acounts.
However, it is not (yet) possible to easily choose a sender address yet in the web gui; see this post.
Another option is to use an email client that is able to choose from multiple sender addresses, and can connect via IMAP or POP. Examples are outlook, evolution and Thunderbird.

Can I use LDAP to access my contacts?

In the Zimbra LDAP, only the Global Address List is stored. The personal contacts are in the MySQL database for search reasons.
So, no, you cannot access your personal contacts via LDAP.

What is the max. message size and how can I change it?

There are in fact two settings that determine the maximum message or attachment size. For incoming mail, it can be set in the admin GUI (Global Settings -> MTA -> Maximum Message Size (in kb).
For mail, dropped into Zimbra via IMAP (e.g. when copying mail from your old server to Zimbra), it is determined by the configuration variable zimbraFileUploadMaxSize. That can only be set using zmprov. So, to set both limits to 50Mb, use the following commands:

su - zimbra
zmprov mcf zimbraMtaMaxMessageSize 51200000
zmprov mcf zimbraFileUploadMaxSize 51200000
exit
Can I copy my current mail/contacts/appointments into Zimbra?

It depends.

If you migrate from: the answer is:
Outlook .pst file There is as migration wizard available on the download page.
Exchange 2003, 2005 or 5.5 There is as migration wizard available on the download page.
An IMAP server There is a nice tool out there called imapsync; see the Tips&Tricks section on imapsync.
IMAP has no notion of contacts and appointments, so nothing to migrate.
Another email/groupware client For email, try the imapsync trick; see the Tips&Tricks section on imapsync.
Contacts can be migrated via .CSV files.
Calendar entries cannot be migrated.

Tips and tricks

One might run into problems when installing or using Zimbra; you could find some useful tips here.

Zimbra can be tweaked to fit your needs. The following tweaks are most likely not supported by Zimbra, and might break when upgrading to a newer version.
That said, they might be useful as well.

Tip: Installing on Fedora Core 4
Tweak: Zimbra behind an existing webserver
Tweak: Boosting spamassassin
Tip: Migrating mail with imapsync
Tip: Installing on Fedora Core 4

When starting to install Zimbra on FC4, a few required RPM's are checked by the installer. However, when doing a minimal FC4 install, a few others must be installed as well.
So, before installing on FC4, make sure to run the following yum install commands:

yum install fetchmail compat-libstdc++-33 compat-db openssl097a
yum install curl libidn gmp
Tweak: Zimbra behind an existing webserver

Here is my problem. I run Zimbra somewhere in my home network on a machine called zimbra.vogons.av.
The machine behind my adsl router is called home.sietse.net, and it is running a webserver.
Mail is (for now) handled on the machine home.sietse.net by sendmail, and using .procmailrc, mail is forwarded to zimbra.vogons.av.
I want to access the Zimbra web interface from the internet.

My solution was to make a new virtual host on the existing webserver called zimbra.sietse.net, and proxy the requests to zimbra.vogons.av.
That works for the initial pages, but at some moment during the login process, the client is redirected to zimbra.vogons.av - and that is The End for accessing zimbra from outside.

There is a solution: tell the Zimbra Tomcat that the requests are proxied.

Addition to the httpd.conf file:

<VirtualHost *:80>
    ServerAlias       zimbra.sietse.net
    ProxyRequests     Off
    ProxyPass         / http://zimbra.vogons.av:80/
    ProxyPassReverse  / http://zimbra.vogons.av:80/
    ErrorLog          logs/sietse.net/error_log
    CustomLog         logs/sietse.net/access_log combined
</VirtualHost>

Edit the file /opt/zimbra/tomcat/conf/server.xml.in, and add the line with the proxyName and proxyPort (use your own Zimbra virtual host and port):

        <!-- HTTPBEGIN -->
    <Connector port="%%zimbraMailPort%%"
        enableLookups="false" redirectPort="%%zimbraMailSSLPort%%"
                proxyName="zimbra.sietse.net" proxyPort="80"
        maxThreads="100" minSpareThreads="100" maxSpareThreads="100"/>
        <!-- HTTPEND -->
Tweak: Boosting spamassassin

Spamassassin in my experience is not configured optimally. I have been using spamassassin for a long time now, but performed poorly until I found RulesDuJour - a set of spamassassin rules that are updated regularly, and can be updated daily.
So here is what I did to implement these extra rules.

First, read the wiki page of RulesDuJour, then download the update script and put it in /usr/local/sbin.
Create a configuration file for rules_du_jour:

mkdir /etc/rulesdujour
echo 'TRUSTED_RULESETS="TRIPWIRE SARE_EVILNUMBERS0 SARE_EVILNUMBERS1 BOGUSVIRUS SARE_ADULT SARE_FRAUD"
TRUSTED_RULESETS="$TRUSTED_RULESETS SARE_BML SARE_SPOOF SARE_BAYES_POISON_NXM SARE_OEM"
TRUSTED_RULESETS="$TRUSTED_RULESETS SARE_RANDOM SARE_HEADER SARE_HTML SARE_SPECIFIC SARE_OBFU"
TRUSTED_RULESETS="$TRUSTED_RULESETS SARE_REDIRECT SARE_GENLSUBJ SARE_UNSUB SARE_WHITELIST"
SA_DIR="/opt/zimbra/conf/spamassassin"
RULES_DU_JOUR_SCRIPT="/usr/local/sbin/rules_du_jour"
SA_RESTART="/opt/zimbra/bin/zmclamdctl restart"
SA_LINT=""' > /etc/rulesdujour/config

Add a cron entry to the root crontab (pick your own time):

17 3 * * * su - zimbra -c /usr/local/sbin/rules_du_jour

You can run the command by hand the first time to get started.

Tip: Migrating mail with imapsync
If you have all your mail stored in an IMAP server, and you want to migrate mail in there to Zimbra, the tool imapsync is what you need.
Here is what you have to do:
- get imapsync
- install appropriate Perl module(s)
- set imap login in Zimbra to allow cleartext login
- make sure the max file upload size is high enough for your attachments
- start syncing

# The following assumes RedHat or Fedora, and user root.

# Get imapsync
cd /some/where
wget http://www.linux-france.org/prj/imapsync/imapsync
chmod +x imapsync

# Try to run; it will most likely fail.
./imapsync

# It most likely gave you a message stating that a Perl module was missing.
# If so, yank in the missing Perl modules using CPAN.
# If you run CPAN for the first time, it will ask you a **LOT** of questions. Be patient, and answer them.
# Ignore error messages during the installation, as long as the end result is that the module is installed.
cpan install Mail::IMAPClient
cpan install Term::ReadKey

# Try imapsync again, it should give a usage message.
./imapsync

# Now make sure the message size is big enough for you. Default is 10Mb. If you want more, e.g. 50Mb:
su - zimbra -c "zmprov mcf zimbraMtaMaxMessageSize 51200000"
su - zimbra -c "zmprov mcf zimbraFileUploadMaxSize 51200000"

# Make sure IMAP cleartext login is enabled:
su - zimbra -c "zmprov mcf zimbraImapCleartextLoginEnabled TRUE"

# Restart zimbra if you made one of the above changes
service zimbra restart

# Now, syncing should work.
# Mail is transferred from host1 (the IMAP server) to host2 (Zimbra).
# There are a lot more options, but this should get you started.
# It is ok to stop mid-way, and restart. It will continue from where it was.
./imapsync --host1 imaphost   --user1 imapuser   --password1 imappwd \
           --host2 zimbrahost --user2 zimbrauser --password2 zimbrapwd \
           --syncinternaldates --subscribed
Revisions