Zarafa 7 Install on OpenVZ Ubuntu 10.04 with All the Trimmings

There are a lot of wiki's and blogs on how to install zarafa mailserver, yet when it comes to a simple A to Z guide on how to be up an running with all the trimmings, it is something of a shortage...

So, lets install a new OpenVZ VPS with:

  • Zarafa 7RC1 - latest and greatest open source alternative to Microsoft Exchange.
  • OpenLDAP - open source Active Directory alternative.
  • Spamassassin - self explanatory.
  • LDAP admin - self explanatory. We prefer this tool to the phpldapadmin.
  • Z-push - open source Active Sync alternative.

Following the creation of a new container on the ubuntu-10.04-x86 template, we update it and prepare it for our needs:

vzctl enter 120
apt-get update
apt-get install aptitude
sudo locale-gen en_GB.UTF-8
$ sudo update-locale LANG=en_GB.UTF-8
export LANG=en_GB.UTF-8
cd /etc
ln -sf /usr/share/zoneinfo/Europe/London localtime
sudo aptitude safe-upgrade
sudo aptitude install apache2 postfix libapache2-mod-php5 mysql-client slapd mysql-server tinyca ca-certificates libcurl3 libssh2-1 build-essential php5-dev libtool pkg-config uuid-dev libmysqlclient-dev gettext libz-dev libldap2-dev automake debhelper flex bison libcurl4-gnutls-dev libssl-dev libxml2-dev libncurses5-dev libclucene-dev

You will have probably been prompted for the mysql password - please make a note of it as you will need it a bit later. Next we install zarafa:

cd /root
tar -zxf zcp-7.0.0rc1-26667-ubuntu-10.04-i386-free.tar.gz
cd zcp-7.0.0rc1-26667-ubuntu-10.04-i386

During the install process, you would have been given some prompts. keep the defaults for all and type the MySQL password from the step earlier. You should have the Zarafa server up and running - you can check by going to your http://your ip/webaccess. Yet this is not all - you cant send yet emails, you cant receive emails and you dont have any mail users.

So we set it up to send and receive emails.

Locate the /etc/postfix/ and add 2 lines to the bottom of the file:

mailbox_command = /usr/bin/zarafa-dagent "$USER"
mailbox_transport = zarafa: zarafa_destination_recipient_limit = 1

In the same file we need locate the line with 'mydestination' and adjust to include the domains you wish to receive emails from.

Next we locate /etc/postfix/ file and add a few more lines to it (keep spaces intact):

zarafa    unix  -       n       n       -       10       pipe
  flags=DRhu user=vmail argv=/usr/bin/zarafa-dagent -R ${recipient}
spamassassin unix -     n       n       -       -       pipe
        user=spamd argv=/usr/bin/spamc -f -e    
        /usr/sbin/sendmail -oi -f ${sender} ${recipient}

Adjust spamassasin settings to suit in /etc/spamassassin/ and then create a user for it to run on:

groupadd -g 5001 spamd
useradd -u 5001 -g spamd -s /sbin/nologin -d /var/lib/spamassassin spamd
mkdir /var/lib/spamassassin
chown spamd:spamd /var/lib/spamassassin

Create a new user for zarafa:

adduser --system --no-create-home vmail

Locate /etc/zarafa/server.cfg and add the user vmail to the local_admin_users line next to root.

Install Z-Push:

tar zxvf z-push-z-push-1.5.2.tgz -C /var/www
chmod 755 /var/www/z-push/state
chown www-data.www-data /var/www/z-push/state 

Locate /etc/apache2/sites-available/default and add:

Alias /Microsoft-Server-ActiveSync /var/www/z-push/index.php 

Configure OpenLDAP and create the database as per the official guide

Download LDAP admin from here

Create your users in LDAP directory:

  1. Create a Posix group - 'zarafa-users'
  2. Create a new user with all the basic details
  3. Right-click on the new user and select 'Edit entry'
  4. Add a new objectclass - zarafa-user and that will bring the rest of options where you can configure the rest of settings for zarafa - admin etc.

If LDAP admin fails to create the user store you can create that manually:

zarafa-admin --lang an_GB --create-store "youruser"

Restart the container and check that you can send and receive emails.

To check that you can receive emails you can connect via telnet and do this:

telnet 25
RCPT TO:yourmail@
somedata to test

So if all worked, say hi to your new Microsoft Exchange alternative on Linux that also is very easy to integrate with various other business applications, especially with the new Python API for  Zarafa 7.

Add new comment

This question is for testing whether you are a human visitor and to prevent automated spam submissions.
4 + 4 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.