Exchange ActiveSync for Zimbra Open Source Edition

Posted by

If you want to obtain Exchange ActiveSync ability on your Zimbra Open Source Edition, you can integrate Zimbra and Z-push + Zimbra Backend. With it, you can synchronize email, contacts, and calendars between Zimbra and your mobile device.

This article only for Zimbra that installing Single Server. If you have Zimbra with multi-server installation, I recommend you to install Z-push + Zimbra Backend on a separate server.

This guidance has been tested on Zimbra 8.8.12 – 8.8.15

# Install dependencies

For CentOS 7

yum install epel-release -y
yum install git php-cli php-soap php-process php-mbstring -y

For Ubuntu 16.04 and 18.04

apt update -y
apt install git php-cli php-soap php-cgi php-mbstring php-curl -y

Clone repo

git clone https://github.com/imanudin11/zcs-zpush.git
cd zcs-zpush/

Create folder for log

mkdir /var/lib/z-push /var/log/z-push
chmod 755 /var/lib/z-push /var/log/z-push
chown zimbra:zimbra /var/lib/z-push /var/log/z-push

Save z-push folder on /opt/

cp -rvf z-push /opt/

Note : I use Asia/Jakarta as my Timezone. Please open /opt/z-push/config.php and adjust/change Asia/Jakarta to your Timezone

Create symlink

ln -sf /opt/z-push /opt/zimbra/jetty/webapps/

Save php script on /usr/bin

cp php-cgi-fix.sh /usr/bin/php-cgi-fix.sh
chmod +x /usr/bin/php-cgi-fix.sh

Change publicHostname domain on your Zimbra into localhost

su - zimbra -c 'zmprov md yourzimbradomain.tld zimbraPublicServiceHostname localhost zimbraPublicServiceProtocol https'

Note : If you have more than 1 domain, and that domain want to use Exchange ActiveSync, you should run above command for each domains

# Backup and replace jetty.xml.in

For Zimbra 8.8.6

cp /opt/zimbra/jetty/etc/jetty.xml.in /opt/zimbra/jetty/etc/jetty.xml.in.backup
cp jetty.xml.in-for-zcs-886 /opt/zimbra/jetty/etc/jetty.xml.in
chown zimbra.zimbra /opt/zimbra/jetty/etc/jetty.xml.in

For Zimbra 8.8.7

cp /opt/zimbra/jetty/etc/jetty.xml.in /opt/zimbra/jetty/etc/jetty.xml.in.backup
cp jetty.xml.in-for-zcs-887 /opt/zimbra/jetty/etc/jetty.xml.in
chown zimbra.zimbra /opt/zimbra/jetty/etc/jetty.xml.in

For Zimbra 8.8.8 – Zimbra 8.8.12

cp /opt/zimbra/jetty/etc/jetty.xml.in /opt/zimbra/jetty/etc/jetty.xml.in.backup
cp jetty.xml.in-for-zcs-888-8812 /opt/zimbra/jetty/etc/jetty.xml.in
chown zimbra.zimbra /opt/zimbra/jetty/etc/jetty.xml.in

For Zimbra 8.8.15

cp /opt/zimbra/jetty/etc/jetty.xml.in /opt/zimbra/jetty/etc/jetty.xml.in.backup
cp jetty.xml.in-for-zcs-8815 /opt/zimbra/jetty/etc/jetty.xml.in
chown zimbra.zimbra /opt/zimbra/jetty/etc/jetty.xml.in

# Add zpush.ini into php

For CentOS 7

cp zpush.ini /etc/php.d/zpush.ini

For Ubuntu 16.04

cp zpush.ini /etc/php/7.0/cgi/conf.d/10-zpush.ini

For Ubuntu 18.04

cp zpush.ini /etc/php/7.2/cgi/conf.d/10-zpush.ini

Restart Zimbra Mailbox

su - zimbra -c 'zmmailboxdctl restart'

For testing, please access https://ip-of-zimbra/Microsoft-Server-ActiveSync from your browser. Log in with your Zimbra account. If it works, you can see the output as below. Or you can configure your mail apps on mobile devices and ensure choose exchange/activesync

30 comments

  1. Hi Ahmad, your tutorials are great! Thank you. I’ve tried to get this work, but something is not right, the schedules and the e-mails not pushing to the phones. I’m using Ubuntu 18.04.03 with the latest Zimbra build.

    1. Hi Tamas,
      Please make sure your mobile phone :
      – Enable sync
      – Please choose Automatic (Push) on Sync frequency. This configuration is there on your Mail client apps

  2. I tried, but it does not work in Centos 7 and the latest version of zimbra

    HTTP ERROR 404

    Problem accessing /service/extension/zimbrasync. Reason:

    Not Found

  3. Dear,
    We are using single server, 8.8.15P3 on Centos 7.7 with 4 vCPU and 8GB RAM. Server will serve about 200-300 accounts. Do you think we can have z-push on this spec?
    Many thanks and best regards,
    Minh.

  4. Hello,

    Seems something wrong.

    I get :

    . * * Consult LICENSE file for details ************************************************/ ob_start(null, 1048576); // ignore user abortions because this can lead to weird errors – see ZP-239 ignore_user_abort(true); require_once ‘vendor/autoload.php’; if (!defined(‘ZPUSH_CONFIG’)) define(‘ZPUSH_CONFIG’, ‘config.php’); include_once(ZPUSH_CONFIG); // Attempt to set maximum execution time ini_set(‘max_execution_time’, SCRIPT_TIMEOUT); set_time_limit(SCRIPT_TIMEOUT); try { // check config & initialize the basics ZPush::CheckConfig(); Request::Initialize(); ZLog::Initialize(); ZLog::Write(LOGLEVEL_DEBUG,”——– Start”); ZLog::Write(LOGLEVEL_DEBUG, sprintf(“cmd=’%s’ devType=’%s’ devId=’%s’ getUser=’%s’ from=’%s’ version=’%s’ method=’%s'”, Request::GetCommand(), Request::GetDeviceType(), Request::GetDeviceID(), Request::GetGETUser(), Request::GetRemoteAddr(), @constant(‘ZPUSH_VERSION’), Request::GetMethod() )); // always request the authorization header if (! R………………..

      1. Hello Iman,
        I noticed that your z-push source version is 2.3.4, while there’s now v2.5.1 final available.
        I’m going to experiment the “source” way (i.e. procedure outlined on your article) replacing your z-push subdir with the updated source from here https://stash.z-hub.io/projects/ZP/repos/z-push/browse/src?at=refs%2Ftags%2F2.5.1 (plus, of course, the Zimbra backend v68).
        May I fork your GitHub repo for this activity?
        Additionally, I believe that it isn’t strictly necessary to set zimbraPublicServiceHostname to “localhost”, you should instead whitelist the server’s public IP address within the Zimbra’s DoSFilter configuration section, as explained here https://wiki.zimbra.com/wiki/DoSFilter
        Does this sound correct to you?

        1. Hello Ferdinando,
          Sure. You can fork my GitHub repo and it’s open. zimbraPublicServiceHostname refers to the localhost because I define localhost on ZIMBRA_URL config. So, the log is clean and not appear warning about ZIMBRA_URL

          1. Yes, I noticed that, reviewing the various configurations files.
            I was only concerned (as a Zimbra newbie) about possible negative interactions with other Zimbra services of setting “public hostname” to localhost.

  5. Hello Iman,

    This solution for Exchange Active-Sync for Zimra open source is great help. However, one problem with setting the Hostname as “localhost” (zimbraPublicServiceHostname localhost) is that one of the Admin Zimlet (com_zimbra_viewmail) stopped working. It uses the Hostname to open the mailbox for a user and now it is unable to do so.
    Can you help solve this problem?

  6. Hi there thank you for the guide, as for the zpush version it seems that it’s on 2.3.4 the current version is 2.5 is there a possibility to upgrade it?

  7. Thank you for the reply, as for the localhost i ran the command but how to revert it back? and whitelist ?

    su – zimbra -c ‘zmprov md mail.domain.com zimbraPublicServiceHostname localhost zimbraPublicServiceProtocol https’

    Thank you

  8. Hi Iman,

    Your guide works fine and ActiveSync was set up correctly.

    I’m on version 8.8.15, but ActiveSync breaks when proxy port is changed from 443.

    I want to change proxy port to 9444 then use a reverse proxy to serve clients on port 443.

    Can you please help out.

    Thanks,
    Darren

    1. Hi Darren Ramen,
      In this article, ActiveSync listen on Jetty. It’s mean ActiveSync active on mailbox services. If you have reverse proxy, you can try pointing to port 8080 or 8443 where service mailbox listen

  9. Hi Iman,

    Thanks for the instructions for setting up Activesync for Zimbra! Iphone mail/calender apps work line a charm.

    Do you know if Outlook App for iPhone is supported? The only error I get is “Can not sign in”. I’m using Patch 8.8.15_P8 on Ubuntu 18.04.4 64b.

  10. Hi Iman,

    Thank you for this nice post.
    I configured and it worked well in my environment. However, it seems the internal GAL is not syncing with PC Outlook. At the same time, email contact is syncing properly in mobile default app and webmail.
    Could you please help me on this?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.