Zarafa Installation Instructions for Synology NAS

From Zarafa wiki

(Difference between revisions)
Jump to: navigation, search
(Added Client Access information)
m (release note regarding z-push deleted)
Line 227: Line 227:
==Active Sync==
==Active Sync==
Active Sync is realized with z-push and should work out of the box. However if you want to use it from remote you have to forward some Ports like shown under Zarafa Webaccess.
Active Sync is realized with z-push and should work out of the box. However if you want to use it from remote you have to forward some Ports like shown under Zarafa Webaccess.
Note that the current SPK release contains a Issue: Z-Push might not work correctly. Simply go to the share \\YOURNAS\web\z-push and delete the directory state and recreate it with the same name

Revision as of 22:06, 26 March 2012



This page describes how to install the Zarafa on your Synology NAS. Additional information may be found in the support forum and in the official documentation.

What is Zarafa?

Zarafa - is a Open Source Email & Collaboration Software. Store all your contacts / emails / notes / task on your Synology NAS. Zarafa has a powerful webfrontend (Outlook Webaccess alike) and provides Active Sync Support to easily connect mobile devices. It acts like a exchange server to Microsoft Outlook (sync all contacts / task etc.). POP3 and IMAP connections are also possible. To send and receive emails, it is necessary to setup postfix / fetchmail.

Setup Types

Depending on your current situation you can setup zarafa in many different ways. You can access Zarafa via many different ways:

  • with Microsoft Outlook
  • via Active Sync with your Smartphone
  • via Zarafa Webaccess
  • via POP3/IMAP Gateway of Zarafa
  • via ICal

Zarafa with postfix and own domain

In this setup you have your own domain (like [email protected]). Postfix has to be configured to send and receive emails. Zarafa sends emails to postfix, and receives emails from postfix.


Zarafa with postfix and fetchmail for POP3 / IMAP mailboxes

In this setup you have a email address from a provider (like [email protected] etc.). In this configuration fetchmail receives you email from the providers pop3/imap mailbox and delivers it to Zarafa. Zarafa sends emails to postfix which delivers it to your providers SMTP Server.


Installation of the SPK

Before you can install the SPK on your device, please make sure that you activated/installed the following prerequisites. The installation / screenshots are based on DSM 4.0, however it should be possible to get Zarafa running on DSM 3.2 too.


All prerequisites have to be enabled in the DSM interface in the control panel.

Enable Telnet / SSH access

Some parts of Zarafa has to be configured via commandline, therefore click on “Terminal” and Enable “SSH Service”


Enable Mailserver

Zarafa needs a mailserver to send/receive mails. Therefore enable the Mailserver. If you don’t have a own domain (only a POP3 mailbox) please enter some type of dummy domain here (like mydummdomain.local)


Enable Web Services

Zarafa has a powerful webinterface and Active Sync Interface. Please enable Webstation and mysql



You can download the SPK from the Zarafa Community hub and install it through the Package Center like any other SPK.

After installation you will find a icon in the DSM startmenu.


You can access the Zarafa Webaccess via http://YOURNASIP/webaccess

Configure Zarafa

The configuration of Zarafa is mainly done via SSH. Therefore connect to your NAS with putty or any other terminal program and login with the root account.

Change mysql password if needed

If you changed the root password of the mysql server you have to modify a zarafa-configuration file to start the zarafa succesfully. This could be done in the file

vi /etc/zarafa/server.cfg

Change the following lines to your mysql root password (Only needed if you changed your default mysql password!!

# The user under which we connect with MySQL
mysql_user = root
# The password for the user (leave empty for no password)
mysql_password = 

Create Zarafa Users

You can create Zarafa Users via the following command:

zarafa-admin -c USERNAME -P -e EMAILADRESS -f "FULL NAME"

You can check the successful user creation with this commands:

zarafa-admin -l
zarafa-admin --details USERNAME

Zarafa Configuration files

The Zarafa Configuration files are located in /etc/zarafa/

View logfiles

The logfiles are located under /var/log/zarafa/ To view the logfile of the zarafa server type in:

tail /var/log/zarafa/server.log

Starting / Stopping Zarafa

You can start / stop Zarafa via DSM (via package center) or commandline Start:

/var/packages/Zarafa/scripts/start-stop-status start


/var/packages/Zarafa/scripts/start-stop-status stop


/var/packages/Zarafa/scripts/start-stop-status stop
/var/packages/Zarafa/scripts/start-stop-status start

Postfix / Fetchmail Configuration

Postfix can be used in various scenarios (Mailserver for a single domain, postfix with smarthost and getting mails from POP3/IMAP with fetchmail). This document currently describes the following configurations:

  • Postfix with smarthost and fetchmail for receiving mails from POP3/IMAP mailboxes
  • Postfix with your own domain (local user database)

Please look in the configuration description for the advantages. Please note also that you have to configure the MX records of your domain to point to your Synology device. The port 25 is also needed to be forwarded when you want to use postfix with your own domain. More information about postfix information can be found here or in the official Zarafa and postfix documentation.


Postfix logs to the standard syslog. Synology reduces this logs by default. For starting it is very useful to get full log details from postfix. Edit the file /etc/syslog.deny

vi /etc/syslog.deny

and comment out debug, info, notice. Then reboot your NAS. You should revert this changes after your configuration works as expected.

# These priorities in this config file are not logged
# refer to syslog.h

You can then view the logfiles with

tail -f /var/log/messages

Configure Postfix with smarthost and fetchmail for receiving mails from POP3/IMAP mailboxes

This section describes how to configure postfix/fetchmail for the following configuration

  • Emails will be received with fetchmail by using POP3/IMAP
  • Fetchmail stores this emails into Zarafa
  • Zarafa sends emails to postfix, which uses a smarthost/relay to deliver emails

First edit the of postfix:

vi /usr/syno/mailstation/etc/

Then add the following lines (replace SMARTHOST with the SMTP server of your provider):

smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination
default_privs = guest
#Change SMARTHOST to the mailserver of your provider (the [] are important, do not remove them!)
relayhost = [SMARTHOST]
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
#This file contains the username and password of your provider
smtp_sasl_password_maps = hash:/usr/syno/mailstation/etc/saslpasswd
#Uncomment the following line to get debug output in case of problems with the smarthost
#debug_peer_list = SMARTHOST

Next edit the password file which contains the username and password of the smtp server of your provider

vi /usr/syno/mailstation/etc/saslpasswd

Create one line with the smarthost that you selected in the and then add the username and password of your provider.


You have to create .db files of the saslpasswd file and the aliases files, so that postfix can read it (you have to repeat this everytime you change the saslpasswd file).

/usr/syno/mailstation/sbin/postmap /usr/syno/mailstation/etc/saslpasswd

Now it is time to test the configuration. With “postfix reload” the changed configuration files can be read in.

/usr/syno/mailstation/sbin/postfix reload

Configure fetchmail

Fetchmail retrieves emails from POP3 and IMAP accounts. This example shows how to query a POP3 account.

vi /etc/fetchmailrc
# every 60 seconds fetchmail tries to download new mail
set daemon 60
# Replace POP3SERVER and USERNAME with the correct values from your provider
poll POP3SERVER protocol pop3 port 995 user USERNAME
# Replace PASSWORD_OF_USERNAME with the password of the username 
smtpaddress localhost
# Replace ZARAFAUSER with the username of your local zarafauser where the mail shoud be delivered to.
flush forcecr mda "/usr/local/zarafa/bin/zarafa-dagent ZARAFAUSER"

Then restart the zarafa package to get fetchmail running.

/var/packages/Zarafa/scripts/start-stop-status stop
/var/packages/Zarafa/scripts/start-stop-status start

Logfiles can be viewed with:

tail -f /var/log/fetchmail

Configure Postfix with your own domain

Create a user “vmail” in DSM (i made this user admin – not sure if this is necessary) Edit the file /usr/syno/mailstation/etc/ and add the zarafa part seen below:

vi /usr/syno/mailstation/etc/

Add the zarafa part seen below:

# ==========================================================================
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
# ==========================================================================
zarafa    unix  -       n       n       -       10      pipe
 flags= user=vmail argv=/usr/local/zarafa/bin/zarafa-dagent $(user)
#submission inet n       -       n       -       -       smtpd

(Note: before flags is a space!!) Next edit /usr/syno/mailstation/etc/

vi /usr/syno/mailstation/etc/

Remove/comment this line:

#home_mailbox = .Maildir/

Then add these lines:

mailbox_transport = zarafa:
local_recipient_maps =
zarafa_destination_recipient_limit = 1
#information which domains are served by this postfix installation
mydestination = $myhostname, $myhostname.local, localhost, $mydomain
smtpd_recipient_restrictions = permit_mynetworks, reject_unknown_recipient_domain, permit_sasl_authenticated, reject_unauth_destination
smtpd_sender_restrictions = reject_unknown_address

Then reload postfix config

/usr/syno/mailstation/sbin/postfix reload

The user vmail needs to have the rights to deliver emails to zarafa. Therefore the server.cfg has to be modified. Find the line containing local_admin_users and add vmail.

vi /etc/zarafa/server.cfg
# local admin users who can connect to any store (use this for the zarafa-dagent)
# field is SPACE separated
# eg: local_admin_users = root vmail
local_admin_users       = root vmail

Then restart the zarafa package:

/var/packages/Zarafa/scripts/start-stop-status stop
/var/packages/Zarafa/scripts/start-stop-status start

Client Access

You can access Zarafa in many different ways.

  • via Zarafa Webaccess
  • with Microsoft Outlook
  • via Active Sync with your Smartphone
  • via POP3/IMAP Gateway of Zarafa
  • via ICal

Zarafa Webaccess

Simply go the webaccess URL of your NAS: http://YOURNASIP/webaccess If you want to access the webaccess from remote you have to forward ports and enable a DynDNS service if you have a dynamic IP. It is also possible to access the webaccess SSL encrypted. Simply activate SSL in the DSM:


Please look here for more information regarding port forwarding and DynDNS. The Port 443 has to be forwarded to access the webaccess via DynDNS.

Microsoft Outlook

If you have a x86 based NAS, three users can use the Zarafa Outlook plugin (if you want more you have to buy a license). The plugin can be downloaded herehere. Then follow the official documentation.

IMAP Access

If you want to use IMAP, you have to enable it for each user with this command

zarafa-admin -u USERNAME --enable-feature imap 

A sample configuration of thunderbird is shown below:


Active Sync

Active Sync is realized with z-push and should work out of the box. However if you want to use it from remote you have to forward some Ports like shown under Zarafa Webaccess.

Personal tools