Zarafa Installation Instructions for Synology NAS

From Zarafa wiki

(Difference between revisions)
Jump to: navigation, search
m (Added tweak regarding IMAP access on synology nas)
(Added ifnromation regarding IMAP Port)
(22 intermediate revisions not shown)
Line 1: Line 1:
 +
<BR>
 +
<font color=red>'''This article is a community contribution and includes features that are not supported by Zarafa support subscriptions. Please contact sales@zarafa.com before you deploy this setup in a commercial offering.''' </font>
 +
<BR><BR>
 +
=Overview=
=Overview=
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.
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.
Line 39: Line 43:
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 mydummydomain.local)
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 mydummydomain.local)
-
Note: In DSM 4.1 (beta) or greater you need to install and enable the package "Mail Server". The configuration could be found directly in the start menu (not in the control panel)
+
Note: In DSM 4.1 or greater you need to install and enable the package "Mail Server". The configuration could be found directly in the start menu (not in the control panel)
 +
 
 +
Please disable POP3 and IMAP in the Mailserver configuration in order not to run into conflicts between Zarafa POP3/IMAP capabilities and the integrated dovecot of the Synology Mailserver package
[[Image:dsm_enable_mailserver.png|border|center|451px|dsm_enable_mailserver.png]]
[[Image:dsm_enable_mailserver.png|border|center|451px|dsm_enable_mailserver.png]]
Line 49: Line 55:
The SPK is available in the Package center. You can install Zarafa by clicking the green "Install" button.
The SPK is available in the Package center. You can install Zarafa by clicking the green "Install" button.
You can also download as an alternative the SPK from the Zarafa Community hub and install it through the Package Center like any other SPK.
You can also download as an alternative the SPK from the Zarafa Community hub and install it through the Package Center like any other SPK.
 +
 +
During installation you will be asked for the MySQL root password, the desired user language and if needed a license key.
 +
 +
[[Image:package_install_language.png|border|center|450px|package_install_language.png]] 
 +
[[Image:package_install_license.png|border|center|450px|package_install_license.png]] 
After installation you will find a icon in the DSM startmenu.
After installation you will find a icon in the DSM startmenu.
Line 55: Line 66:
=Configure Zarafa=
=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.
+
Since version 0.3.3 of the SPK an Administration GUI is included. Therefore the main task for administrating Zarafa and Fetchmail could be done with this Tool.
 +
For advanced configurations it might be needed to login by SSH. Therefore connect to your NAS with putty or any other terminal program and login with the root account.
-
==Change mysql password if needed==
+
==Zarafa Admin GUI==
-
The password of the mysql root account will be asked during installation of the SPK. However if you change your root password of the mysql, it is needed to modify the server.cfg as shown below. Please note it is needed to restart zarafa to accept these changes.
+
The admin GUI can be started in the DSM startmenu with the icon "Zarafa Administration". Please make sure that you are logged in as the user "admin" to see the icon
-
If you changed the root password of the mysql server you have to modify a zarafa-configuration file to start the zarafa succesfully.
+
[[Image:admin_gui_overview.png|border|center|500px|admin_gui_overview.png]] 
-
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 Admin GUI allows the following operations:
-
# The user under which we connect with MySQL
+
* Creating / Deleting Zarafa Users
-
mysql_user = root
+
* Configuration of Fetchmail
-
# The password for the user (leave empty for no password)
+
* View Logfiles
-
mysql_password =
+
==Create Zarafa Users==
==Create Zarafa Users==
-
You can create Zarafa Users via the following command:
+
Before you can login to any Zarafa service you have to create Zarafa Users with the Admin GUI.
-
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==
+
Select the tab "Zarafa Users" and click on "Create".
-
The Zarafa Configuration files are located in /etc/zarafa/
+
[[Image:admin_gui_zarafa_users.png|border|center|500px|admin_gui_zarafa_users.png]] 
 +
 
 +
Enter the information for the new Zarafa user and click on "Save"
 +
[[Image:Admin_gui_zarafa_users_create.png|border|center|450px|Admin_gui_zarafa_users_create.png]] 
 +
 
 +
A message box will show the creation of the user:
 +
[[Image:admin_gui_zarafa_users_create_success.png|border|center|450px|admin_gui_zarafa_users_create_success.png]]
==View logfiles==
==View logfiles==
-
The logfiles are located under /var/log/zarafa/
+
All logfiles are located under /var/log/zarafa/ .
-
To view the logfile of the zarafa server type in:
+
The logfiles can be viewed with the Admin GUI in the tab "Logfile viewer".
-
  tail /var/log/zarafa/server.log
+
[[Image:Admin_gui_zarafa_logfiles.png|border|center|450px|Admin_gui_zarafa_logfiles.png]]  
==Starting / Stopping Zarafa==
==Starting / Stopping Zarafa==
-
You can start / stop Zarafa via DSM (via package center) or commandline
+
You can start / stop Zarafa via DSM (via package center) or via commandline
Start:
Start:
  /var/packages/Zarafa/scripts/start-stop-status start
  /var/packages/Zarafa/scripts/start-stop-status start
Line 94: Line 105:
  /var/packages/Zarafa/scripts/start-stop-status stop
  /var/packages/Zarafa/scripts/start-stop-status stop
  /var/packages/Zarafa/scripts/start-stop-status start
  /var/packages/Zarafa/scripts/start-stop-status start
 +
 +
==Zarafa Configuration files==
 +
The Zarafa Configuration files are located in /etc/zarafa/
 +
 +
==Change mysql password if needed==
 +
The password of the mysql root account will be asked during installation of the SPK. However if you change your root password of the mysql, it is needed to modify the server.cfg as shown below. Please note it is needed to restart zarafa to accept these changes.
 +
 +
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 =
 +
 +
==Adding a License key==
 +
If you want to use more than three Outlook Users with Zarafa, you can purchase a license for your Zarafa installation. Please note that a license key will '''only work for x86 based NAS'''. On ARM based devices it is only possible to use the maximum of three outlook Users.
 +
 +
You can add the license in the following way:
 +
echo <license key> > /usr/local/zarafa/zarafa-licensed/etc/zarafa/license/base
 +
Then restart the Zarafa Package. The server.log should state that you will use the commercial license.
 +
=Postfix / Fetchmail Configuration=
=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).
Postfix can be used in various scenarios (Mailserver for a single domain, postfix with smarthost and getting mails from POP3/IMAP with fetchmail).
Line 99: Line 134:
*Postfix with smarthost and fetchmail for receiving mails from POP3/IMAP mailboxes
*Postfix with smarthost and fetchmail for receiving mails from POP3/IMAP mailboxes
*Postfix with your own domain (local user database)
*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.
 
-
Since Synology DSM Version 4.1 the handling of the integrated mailserver postfix has changed. Therefore you will find on every configuration option instructions for > DSM 4.1 and for DSM 4.0 or below.
+
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.
 +
 
 +
Please note also that in the configuration with your own domain which is described here, an empty user database is used for easier administration. The disadvantage is that this can lead to backscatter spam, as postfix simply accepts every email and try to deliver it to zarafa. Zarafa may discard it and will send a NDR back to the sender. Therefore it is recommended to use some type of user database that postfix is able to discard an incoming mail.
 +
 
==Prerequisites==
==Prerequisites==
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.
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.
Line 127: Line 166:
-
===Up to DSM Version 4.0 - Configure Postfix with smarthost ===
+
===Configure Postfix with smarthost ===
-
First edit the main.cf of postfix:
+
-
vi /usr/syno/mailstation/etc/main.cf
+
-
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!)
+
-
#Example: smtp.mail.yahoo.de
+
-
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
+
-
smtpd_sasl_type=cyrus
+
-
 
+
-
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 main.cf and then add the username and password of your provider.
+
-
SMARTHOST      USERNAME:PASSWORD
+
-
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
+
-
 
+
-
===Since DSM Version 4.1 (beta) - Configure Postfix with smarthost ===
+
Since version 4.1 of the DSM you can configure some configuration options of postfix in the DSM UI. Please make the following selections in the DSM for the mail server:
Since version 4.1 of the DSM you can configure some configuration options of postfix in the DSM UI. Please make the following selections in the DSM for the mail server:
[[Image:Synology_DSM_4.1_mailserver_configuration.png|border|center|450px|Synology_DSM_4.1_mailserver_configuration.png]]   
[[Image:Synology_DSM_4.1_mailserver_configuration.png|border|center|450px|Synology_DSM_4.1_mailserver_configuration.png]]   
-
The following settings need to be made in the template of the mail serv
+
Please make sure to add the [ ] brackets to the smarthost you provide
-
vi /var/packages/MailServer/target/etc/template/main.template
+
-
#As it is not allowed to enter a smarthost with [] in the DSM UI, it is necessary to disable MX lookups
+
===Configure fetchmail===
-
#[SMARTHOST] means get the A record
+
Fetchmail retrieves emails from POP3 and IMAP accounts. Fetchmail could be configured using the Admin GUI.
-
#SMARTHOST means get the MX record
+
-
disable_dns_lookups = yes
+
-
#Uncomment the following line to get debug output in case of problems with the smarthost
+
-
#debug_peer_list = SMARTHOST
+
-
After applying these settings you have to restart the mail server. You can do this from the DSM in the package center with stopping and starting the mail server package.
+
Important: Please note that fetchmail will retrieve all your E-Mails from the account you will specify. All E-Mails will be deleted on the provider mailserver and will be only available on your Synology DS!
-
===Configure fetchmail===
+
You can find the fetchmail configuration in the Fetchmail tab. You can create / delete / modify the fetchmail configuration and can restart fetchmail here.
-
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
+
In order to create a new user click on "Create"
-
set daemon 60
+
[[Image:admin_gui_zarafa_fetchmail.png|border|center|450px|admin_gui_zarafa_fetchmail.png]]  
-
# 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
+
-
password PASSWORD_OF_USERNAME ssl
+
-
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.  
+
Enter the information which are needed to fetch emails from you provider POP3/IMAP inbox. Click on "Save" to add the user to your configuration.
-
/var/packages/Zarafa/scripts/start-stop-status stop
+
-
/var/packages/Zarafa/scripts/start-stop-status start
+
-
Logfiles can be viewed with:
+
Default Port list:
-
tail -f /var/log/fetchmail
+
* POP3 Port: 110
-
==Configure Postfix with your own domain ==
+
* POP3 (SSL) Port: 995
-
Create a user “vmail” in DSM (i made this user admin – not sure if this is necessary)
+
* IMAP Port: 143
 +
* IMAP (SSL) Port: 993
-
===Up to DSM Version 4.0 - Configure Postfix===
+
[[Image:admin_gui_zarafa_fetchmail_create.png|border|center|450px|admin_gui_zarafa_fetchmail_create.png]]  
-
Edit the file /usr/syno/mailstation/etc/master.cf and add the zarafa part seen below:
+
-
vi /usr/syno/mailstation/etc/master.cf
+
-
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/main.cf
+
-
vi /usr/syno/mailstation/etc/main.cf
+
-
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
+
With Click on "Save & Restart fetchmail" the whole configuration will be saved and fetchmail will be restarted. You can confirm if your new configuration works in the fetchmail section of the logviewer.
-
/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.
+
[[Image:Admin_gui_zarafa_fetchmail_save.png|border|center|450px|Admin_gui_zarafa_fetchmail_save.png]]  
-
  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:
+
Please note that the Admin GUI uses an own configuration file for generating the /etc/fetchmailrc file. Therefore manual changes will be overwritten when using the Admin GUI.
-
/var/packages/Zarafa/scripts/start-stop-status stop
+
 
-
/var/packages/Zarafa/scripts/start-stop-status start
+
==Configure Postfix with your own domain ==
 +
Create a user “vmail” in DSM (i made this user admin – not sure if this is necessary)
-
===Since DSM Version 4.1 (beta) - Configure Postfix===
+
===Since DSM Version 4.1 - Configure Postfix===
Configure the mail server package in the DSM to serve your domain:
Configure the mail server package in the DSM to serve your domain:
[[Image:Synology_DSM_4.1_mailserver_configuration_own_domain.png|border|center|450px|Synology_DSM_4.1_mailserver_configuration_own_domain.png]]   
[[Image:Synology_DSM_4.1_mailserver_configuration_own_domain.png|border|center|450px|Synology_DSM_4.1_mailserver_configuration_own_domain.png]]   
Line 277: Line 244:
  /var/packages/Zarafa/scripts/start-stop-status stop
  /var/packages/Zarafa/scripts/start-stop-status stop
  /var/packages/Zarafa/scripts/start-stop-status start
  /var/packages/Zarafa/scripts/start-stop-status start
-
 
=Client Access=
=Client Access=
You can access Zarafa in many different ways.
You can access Zarafa in many different ways.
-
*via Zarafa Webaccess
+
*via Zarafa Webaccess / Webapp
*with Microsoft Outlook
*with Microsoft Outlook
*via Active Sync with your Smartphone
*via Active Sync with your Smartphone
Line 288: Line 254:
==Zarafa Webaccess==
==Zarafa Webaccess==
-
Simply go the webaccess URL of your NAS: http://YOURNASIP/webaccess
+
Simply go the webaccess URL of your NAS: http://YOURNASIP/webaccess for webaccess or http://YOURNASIP/webapp for the new webapp.
-
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.
+
 
 +
If you want to access the webaccess/webapp 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:
It is also possible to access the webaccess SSL encrypted. Simply activate SSL in the DSM:
[[Image:dsm_ssl.png|border|center|550px|dsm_ssl.png]]   
[[Image:dsm_ssl.png|border|center|550px|dsm_ssl.png]]   
-
Please look [http://forum.synology.com/wiki/index.php/Remote_Access_on_the_Synology_DiskStation here] for more information regarding port forwarding and DynDNS.
+
Please look [http://forum.synology.com/wiki/index.php/Remote_Access_on_the_Synology_DiskStation here] for more information regarding port forwarding and DynDNS
 +
.
The Port 443 has to be forwarded to access the webaccess via DynDNS.
The Port 443 has to be forwarded to access the webaccess via DynDNS.
==Microsoft Outlook==
==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).
+
Up to three users can use the Zarafa Outlook plugin (if you want more you have to buy a license => See above).
-
The plugin can be downloaded here[http://doc.zarafa.com/7.0/User_Manual/en-US/html/_configure_outlook.html here].
+
 
 +
The plugin can be downloaded [http://download.zarafa.com/community/final/7.1/7.1.1-37812/windows here]. Please note that you can also use the latest plugin, simply goto the link and navigate to the newest version.
 +
 
Then follow the [http://doc.zarafa.com/7.0/User_Manual/en-US/html/_configure_outlook.html official documentation].
Then follow the [http://doc.zarafa.com/7.0/User_Manual/en-US/html/_configure_outlook.html official documentation].
Line 305: Line 275:
  export LC_ALL=C
  export LC_ALL=C
  zarafa-admin -u USERNAME --enable-feature imap  
  zarafa-admin -u USERNAME --enable-feature imap  
 +
 +
Please note that the zarafa-gateway will use Port 144 for IMAP on Synology devices because 143 is blocked by the IMAP Part of the mailserver package, even if disabled.
A sample configuration of thunderbird is shown below:
A sample configuration of thunderbird is shown below:
Line 311: Line 283:
==Active Sync==
==Active Sync==
Active Sync is realized with z-push.
Active Sync is realized with z-push.
-
Since Package Version 0.2.9 Z-Push is no longer included. You can download the package from here [http://zarafa-deutschland.de/z-push-download/final/1.5/Synology/]
+
Since Package Version 0.2.9 Z-Push is no longer included. You can download the package from here [http://zarafa-deutschland.de/z-push-download/final/2.0/Synology/]
Simply download the SPK and install it over the DSM Package center.
Simply download the SPK and install it over the DSM Package center.
If you want to use Z-Push from mobile devices over the internet you have to forward some Ports (http/https) like shown under Zarafa Webaccess.
If you want to use Z-Push from mobile devices over the internet you have to forward some Ports (http/https) like shown under Zarafa Webaccess.

Revision as of 08:19, 10 September 2013


This article is a community contribution and includes features that are not supported by Zarafa support subscriptions. Please contact sales@zarafa.com before you deploy this setup in a commercial offering.

Contents

Overview

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.

Please make sure not to enable IMAP/POP3 features of the Synology Mail Station when using Zarafa, to make sure that no conflicts occur in mail delivery.

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 myemailadress@mydomain.com). Postfix has to be configured to send and receive emails. Zarafa sends emails to postfix, and receives emails from postfix.

Zarafa_own_domain.png

Zarafa with postfix and fetchmail for POP3 / IMAP mailboxes

In this setup you have a email address from a provider (like myemailaddress@yahoo.com 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.

Zarafa_own_pop3.png

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.

Upgrade instructions

  • Make a Backup of your important configuration files and MySQL Database (only in case something goes wrong)
  • Simply install the new SPK
  • Install the Z-Push SPK if you want to use syncronization to mobile devices, if not yet installed (see Active Sync below)

Prerequisites

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”

dsm_enable_ssh.png

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 mydummydomain.local)

Note: In DSM 4.1 or greater you need to install and enable the package "Mail Server". The configuration could be found directly in the start menu (not in the control panel)

Please disable POP3 and IMAP in the Mailserver configuration in order not to run into conflicts between Zarafa POP3/IMAP capabilities and the integrated dovecot of the Synology Mailserver package

dsm_enable_mailserver.png

Enable Web Services

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

dsm_enable_webservices.png

Installation

The SPK is available in the Package center. You can install Zarafa by clicking the green "Install" button. You can also download as an alternative the SPK from the Zarafa Community hub and install it through the Package Center like any other SPK.

During installation you will be asked for the MySQL root password, the desired user language and if needed a license key.

package_install_language.png
package_install_license.png

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

dsm_zarafa_icon.png

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

Configure Zarafa

Since version 0.3.3 of the SPK an Administration GUI is included. Therefore the main task for administrating Zarafa and Fetchmail could be done with this Tool. For advanced configurations it might be needed to login by SSH. Therefore connect to your NAS with putty or any other terminal program and login with the root account.

Zarafa Admin GUI

The admin GUI can be started in the DSM startmenu with the icon "Zarafa Administration". Please make sure that you are logged in as the user "admin" to see the icon

admin_gui_overview.png

The Admin GUI allows the following operations:

  • Creating / Deleting Zarafa Users
  • Configuration of Fetchmail
  • View Logfiles

Create Zarafa Users

Before you can login to any Zarafa service you have to create Zarafa Users with the Admin GUI.

Select the tab "Zarafa Users" and click on "Create".

admin_gui_zarafa_users.png

Enter the information for the new Zarafa user and click on "Save"

Admin_gui_zarafa_users_create.png

A message box will show the creation of the user:

admin_gui_zarafa_users_create_success.png

View logfiles

All logfiles are located under /var/log/zarafa/ . The logfiles can be viewed with the Admin GUI in the tab "Logfile viewer".

Admin_gui_zarafa_logfiles.png

Starting / Stopping Zarafa

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

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

Stop:

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

Restart:

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

Zarafa Configuration files

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

Change mysql password if needed

The password of the mysql root account will be asked during installation of the SPK. However if you change your root password of the mysql, it is needed to modify the server.cfg as shown below. Please note it is needed to restart zarafa to accept these changes.

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 =

Adding a License key

If you want to use more than three Outlook Users with Zarafa, you can purchase a license for your Zarafa installation. Please note that a license key will only work for x86 based NAS. On ARM based devices it is only possible to use the maximum of three outlook Users.

You can add the license in the following way:

echo <license key> > /usr/local/zarafa/zarafa-licensed/etc/zarafa/license/base

Then restart the Zarafa Package. The server.log should state that you will use the commercial license.

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.

Please note also that in the configuration with your own domain which is described here, an empty user database is used for easier administration. The disadvantage is that this can lead to backscatter spam, as postfix simply accepts every email and try to deliver it to zarafa. Zarafa may discard it and will send a NDR back to the sender. Therefore it is recommended to use some type of user database that postfix is able to discard an incoming mail.

Prerequisites

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
#alert
#crit
#debug
#emerg
#err
#info
#notice

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


Configure Postfix with smarthost

Since version 4.1 of the DSM you can configure some configuration options of postfix in the DSM UI. Please make the following selections in the DSM for the mail server:

Synology_DSM_4.1_mailserver_configuration.png

Please make sure to add the [ ] brackets to the smarthost you provide

Configure fetchmail

Fetchmail retrieves emails from POP3 and IMAP accounts. Fetchmail could be configured using the Admin GUI.

Important: Please note that fetchmail will retrieve all your E-Mails from the account you will specify. All E-Mails will be deleted on the provider mailserver and will be only available on your Synology DS!

You can find the fetchmail configuration in the Fetchmail tab. You can create / delete / modify the fetchmail configuration and can restart fetchmail here.

In order to create a new user click on "Create"

admin_gui_zarafa_fetchmail.png

Enter the information which are needed to fetch emails from you provider POP3/IMAP inbox. Click on "Save" to add the user to your configuration.

Default Port list:

  • POP3 Port: 110
  • POP3 (SSL) Port: 995
  • IMAP Port: 143
  • IMAP (SSL) Port: 993
admin_gui_zarafa_fetchmail_create.png

With Click on "Save & Restart fetchmail" the whole configuration will be saved and fetchmail will be restarted. You can confirm if your new configuration works in the fetchmail section of the logviewer.

Admin_gui_zarafa_fetchmail_save.png


Please note that the Admin GUI uses an own configuration file for generating the /etc/fetchmailrc file. Therefore manual changes will be overwritten when using the Admin GUI.

Configure Postfix with your own domain

Create a user “vmail” in DSM (i made this user admin – not sure if this is necessary)

Since DSM Version 4.1 - Configure Postfix

Configure the mail server package in the DSM to serve your domain:

Synology_DSM_4.1_mailserver_configuration_own_domain.png

Edit the file /var/packages/MailServer/target/etc/template/master.template and add the zarafa part seen below:

vi /var/packages/MailServer/target/etc/template/master.template

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 /var/packages/MailServer/target/etc/template/main.template

vi /var/packages/MailServer/target/etc/template/main.template

Remove/comment this line:

#home_mailbox = .Maildir/

Then add these lines:

mailbox_transport = zarafa:
local_recipient_maps =
zarafa_destination_recipient_limit = 1

In order to get the changes in the mail server package template files affected, please stop and start the mailserver package in the DSM package center.

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 / Webapp
  • 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 for webaccess or http://YOURNASIP/webapp for the new webapp.

If you want to access the webaccess/webapp 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:

dsm_ssl.png

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

Up to three users can use the Zarafa Outlook plugin (if you want more you have to buy a license => See above).

The plugin can be downloaded here. Please note that you can also use the latest plugin, simply goto the link and navigate to the newest version.

Then follow the official documentation.

IMAP Access

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

export LC_ALL=C
zarafa-admin -u USERNAME --enable-feature imap 

Please note that the zarafa-gateway will use Port 144 for IMAP on Synology devices because 143 is blocked by the IMAP Part of the mailserver package, even if disabled.

A sample configuration of thunderbird is shown below:

thunderbird_imap.png

Active Sync

Active Sync is realized with z-push. Since Package Version 0.2.9 Z-Push is no longer included. You can download the package from here [1] Simply download the SPK and install it over the DSM Package center.

If you want to use Z-Push from mobile devices over the internet you have to forward some Ports (http/https) like shown under Zarafa Webaccess.

Personal tools