Zarafa -- exchange replacement -- in Ubuntu
For a long time I’m searching for a free exchange that runs on Ubuntu. Zimbra is very nice but you can’t connect with outlook for free. OpenExchange has the same issue and OpenChange is far from finished. I came across this news message.
Zarafa is licenced under the AGPL
Zarafa is a Mail Delivery Agent that supports:
- AJAX webaccess with mail, contacts, todo, calendar
- POP,IMAP support
- Z-Push (ActiveSync replacement, I use this with my iphone)
- 3 outlook users (via a closed source component)
- iCal support
- LDAP support (Active Directory)
You can use Postfix and other MTA’s to send and receive mails.
This tutorial describes how you can configure Zarafa. I use this for all my mail and it works perfect (also on my iPhone).
The webmail demo: http://demo.zarafa.com/
Step 1: install Zarafa
install depedencies:
| apt-get install mysql-server-5.0 libmysqlclient15off apache2-mpm-prefork libapache2-mod-php5 |
Zarafa use Mysql as a storage backend. You need apache if you want to use the WebAccess and Z-Push, both are written in PHP.
Download zarafa community edition, the download page is a little bit annoying because there is no direct download link. With lynx you can download it very easy. If you don’t have lynx: apt-get install lynx
| lynx http://zarafa.com/?q=en/download-community |
Next we need to untar it:
| tar zxvf zarafa-6.20-ubuntu8.04-i386.tar.gz cd zarafa-6.20-ubuntu8.04-i386 |
Start the installer:
| ./install.sh |
Follow the steps on the screen. Don’t enter a serial number. You can enter all questions except of the MySQL password.
Next we need to change a configuration in php.ini:
| nano /etc/php5/apache2/php.ini |
Find with ctrl-w the line “magic_quotes_gpc = On” and turn On in Off.
Restart apache:
| apache2ctl restart |
Zarafa needs some older versions of some packages. Therefore you need to hold back some new packages otherwise zarafa will be removed when you run "apt-get dist-upgrade"
| echo libvmime0 hold | dpkg --set-selections echo libical0 hold | dpkg --set-selections |
Done, zarafa is installed! Time to add a user.
| zarafa-admin -c jan -p secret -e jan@debaas.nl -f “Jan Peter Balkenende” -a 0 |
-c = create user
-p = password
-e = email
-f = full name
-a = administrator 1 or 0 (true of false)
To test Zarafa Webaccess, check with ifconfig the ip address and go this url:
Works great isn’t it? Pop, imap, mapi etc everything is working..
Step 3: install postfix and get mail working)
Install postfix:
| apt-get install postfix |
Click oke and choose “No Configuration”
Next we have to change the config files. The fastest way is to copy these config files:
master.cf
| # # Postfix master process configuration file. For details on the format # of the file, see the master(5) manual page (command: "man 5 master"). # # Do not forget to execute "postfix reload" after editing this file. # # ================================================== ======================== # service type private unpriv chroot wakeup maxproc command + args # (yes) (yes) (yes) (never) (100) # ================================================== ======================== smtp inet n - - - - smtpd zarafa unix - n n - 10 pipe flags= user=vmail argv=/usr/bin/zarafa-dagent ${user} #submission inet n - - - - smtpd |
main.cf
| See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) mailbox_transport = zarafa: zarafa_destination_recipient_limit = 1 # appending .domain is the MUA's job. # Uncomment the next line to generate "delayed mail" warnings readme_directory = no # TLS parameters # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for myhostname = |
Finally you have to add your hostname at this line: "myhostname = "
add the user vmail:
| useradd vmail |
Now you can send mail. To receive mail you have to configure the MX records for your domain and point them to your IP.
Everything is working right now.
Step 4: run as non-root user (optional)
This step is very recommended, but not necessary to get zarafa working.
Add a user:
| addgroup --system zarafa adduser --system –-home /dev/null –-no-create-home –-ingroup zarafa –-disabled-password --gecos 'Zarafa services' --shell /bin/false zarafa mkdir /var/log/zarafa chown zarafa.zarafa /var/log/zarafa |
You can change the config files of every zarafa service in /etc/zarafa. Open them all and edit the run_as_user and run_as_group options in zarafa.
When you change the user of zarafa-licenced you can't use Outlook anymore. This is some annoying bug. A work around is to change some permissions:
| chown zarafa.zarafa /var/run/zarafa-licensed chown -R zarafa.zarafa /var/lib/zarafa/ |
But when you restart zarafa licenced with /etc/init.d/zarafa-licenced restart you have to change the permissions of /var/run/zarafa-licenced again. You can solve this by adding the chown command to the init script.
Step 5: get Z-push working (optional)
download Z-Push
untar to the apache directory
| tar zxvf z-push-<version>.tgz -C /var/www |
Change some permissions:
| chmod 755 /var/www/z-push/state chown www-data.www-data /var/www/z-push/state |
Add an alias to the apache config.
/etc/apache2/sites-availiable/default
| Alias /Microsoft-Server-ActiveSync /var/www/z-push/index.php |
*WARNING* You CANNOT simply rename the Z-Push directory to Microsoft-Server-ActiveSync.
This will cause Apache to send redirects to the PDA, which will definitely break your PDA
synchronisation.
Done
More information
http://www.zarafa.nl/?q=en/content/documentation


Recent comments
9 weeks 6 days ago
9 weeks 6 days ago
10 weeks 6 days ago
11 weeks 2 days ago
12 weeks 16 hours ago
12 weeks 19 hours ago
12 weeks 2 days ago
13 weeks 6 days ago
26 weeks 14 hours ago
30 weeks 1 day ago