Configuring Z-Push ActiveSync for Ubuntu Email Server

watch 6m, 3s
views 2

11:59, 14.08.2026

Article Content
arrow

  • What You’ll Need to Get Started
  • Step 1: Set Up Z-Push on Your Ubuntu Mail Server
  • Step 2: Add Essential PHP Extensions
  • Step 3: Configure Your Web Server for Z-Push
  • Nginx Configuration for Z-Push
  • Apache Configuration for Z-Push
  • Step 4: Secure Your Email with HTTPS
  • Step 5: Activate Push Email on Mobile Devices
  • Failed to Connect to the Server? Here’s Why
  • Can’t Verify Account Information? Fix it Here
  • How to Diagnose Issues Using Server Logs
  • To Sum Up

Z-Push ActiveSync is important in case you want to synchronize tasks, contacts, and emails between the desktop device and mobile gadgets.

By default, the users of email clients have a specific time frame during which the server is checked and push email appears. To speed up this process, Z-Push can also be used. So, in This guide we will discuss some configuration insights about Z-Push for Ubuntu users.

What You’ll Need to Get Started

To start the process, you should already have a Ubuntu mail server that is properly functioning. In case, you don’t have it, there are lots of guides with detailed explanations of how to set up everything properly.

Step 1: Set Up Z-Push on Your Ubuntu Mail Server

Enter the mail server and use the following line:

sudo apt install z-push z-push-backend-imap z-push-common

Once in the installation process, you will be offered Lighttpd or Apache as a web server for automatic configuration. In case, you use the Nginx server, you should press Tab and Enter to skip this process of selection.

Those who will select the Apache server will create 2 configuration files. However, in this guide we will only share the set-up process with IMAP backend for email synchronization.

 sudo apt install z-push-backend-combined z-push-backend-caldav z-push-backend-carddav z-push-backend-kopano

For the configuration of auto-discovery use:

 sudo nano /etc/z-push/utodiscover.conf.php

After that find and set up your time zone, and find the next line where you should change false to true:

define('USE_FULLEMAIL_FOR_LOGIN', false);

Then find the backend setting and switch on the IMAP backend, and close the file with all the saved changes.

Now let’s edit imap.conf.php:

sudo nano /etc/z-push/imap.conf.php

Search for the part with IMAP settings where you should enable TLS encryption. Specify the server address in the defining part, add port, and add /ssl in IMAP_OPTIONS.

Next, mention smtp in IMAP_SMTP_METHOD. In this parameter $imap_smtp_params add SMTP settings of the server that include address, port, username, and password. The last thing to change before the saving is IMAP_FOLDER_CONFIGURED, it should be true. Once that is done, you can close the file with all the saved changes.

Step 2: Add Essential PHP Extensions

Z-Push isn’t compatible with PHP 8, so you can use version 7.4 and the installation looks like this:

sudo apt install software-properties-common

sudo add-apt-repository ppa:ondrej/php

sudo apt update

sudo apt install php-soap php7.4-common php7.4-soap php7.4-fpm php7.4-imap php7.4-mbstring

In case, you use an Apache server, the process starts with disabling of PHP7 and MPM:

sudo a2dismod php7.4 

sudo a2dismod mpm_prefork

Then use the following commands:

sudo a2enmod mpm_event proxy_fcgi setenvif

sudo a2enconf php7.4-fpm

The final point will be the restart of the Apache server with:

sudo systemctl restart apache2

Step 3: Configure Your Web Server for Z-Push

Nginx Configuration for Z-Push

Start the process with the creation of the file:

sudo nano /etc/nginx/conf.d/z-push.conf

Add the following lines to the file:
server {

     listen 80;

     listen [::]:80;

     server_name insert your real name;

 

     access_log /var/log/nginx/z-push.access;

     error_log /var/log/nginx/z-push.error;

 

     location ~* /AutoDiscover/AutoDiscover.xml {

             alias /usr/share/z-push/autodiscover/autodiscover.php;

             include /etc/nginx/fastcgi.conf;

             fastcgi_read_timeout 3660;

             fastcgi_pass unix:/run/php/php7.4-fpm.sock;

     }

 

     location ~* /Microsoft-Server-ActiveSync {

             alias /usr/share/z-push/index.php;

             include /etc/nginx/fastcgi.conf;

             fastcgi_read_timeout 3660;

             fastcgi_pass unix:/run/php/php7.4-fpm.sock;

     }

 

}

Then test if everything functions properly and reload the Nginx server.

Apache Configuration for Z-Push

Start with the file creation:

sudo nano /etc/apache2/sites-availabe/z-push.conf

Add the following info to the created file:

<VirtualHost *:80>

  ServerName insert real name in here

 

  <IfModule mod_alias.c>

Alias /Microsoft-Server-ActiveSync /usr/share/z-push/index.php

  </IfModule>

 

  <Directory /usr/share/z-push>

DirectoryIndex index.php

Options -Indexes +FollowSymLinks

 

AllowOverride none

<IfModule mod_authz_core.c>

     Require all granted

</IfModule>

 

<Files "config.php">

   <IfModule mod_authz_core.c>

     Require all denied

   </IfModule>

</Files>

  </Directory>

 

  <IfModule mod_alias.c>

Alias /AutoDiscover/AutoDiscover.xml "/usr/share/z-push/autodiscover/autodiscover.php"

Alias /Autodiscover/Autodiscover.xml "/usr/share/z-push/autodiscover/autodiscover.php"

Alias /autodiscover/autodiscover.xml "/usr/share/z-push/autodiscover/autodiscover.php"

  </IfModule>

 

  Include /etc/apache2/conf-available/php7.4-fpm.conf

 

</VirtualHost>

After that, you should restart the server.

Step 4: Secure Your Email with HTTPS

To secure your email, install Let’s Encrypt with the following command:

sudo apt install certbot

For the users of Nginx, it is also a necessity to add this step:

sudo apt install python3-certbot-nginx

To install the certificate, use the next line:

sudo certbot --nginx --agree-tos --redirect --hsts --staple-ocsp --email you@name.com -d autodiscover.name.com

For the Apache users, start with:

sudo apt install python3-certbot-apache

To install the certificate, use the following line:

sudo certbot --apache --agree-tos --redirect --hsts --staple-ocsp --email you@name.com -d autodiscover.name.com

After you’ve restarted the server, everything should function properly. If not, we will share a couple of errors that you can easily fix later in the guide.

Step 5: Activate Push Email on Mobile Devices

iPhone users can activate push emails by going to the settings, selecting mail, then accounts, and adding accounts. While in the process of enabling activation choose Microsoft Exchange. After that fill in the email, choose manual configuration, and enter the PW. Enter credentials once again and add server info.  

Failed to Connect to the Server? Here’s Why

Usually, failure with connection to the server occurs because of the wrong PHP version so you should just update it for Z-Push to work properly.

Can’t Verify Account Information? Fix it Here

To verify account info, you will need to edit Dovecot configuration file. Enter the file with:

sudo nano /etc/dovecot/conf.d/10-auth.conf

Find the line with the default realm and after uncommenting add the domain there and restart.

How to Diagnose Issues Using Server Logs

For Nginx use:

/var/log/nginx/z-push.error.

To diagnose server logs in Apache:

/var/log/apache2/z-push_error.log.

Z-push logs:

/var/log/z-push/

To Sum Up

Hope now you have full information about the configuring of Z-Push ActiveSync for the Ubuntu email server.

Share

Was this article helpful to you?

VPS popular offers

-10%

CPU
CPU
10 Xeon Cores
RAM
RAM
64 GB
Space
Space
300 GB SSD
Bandwidth
Bandwidth
Unlimited
KVM-SSD 65536 Linux

134.99 /mo

/mo

Billed annually

-9.7%

CPU
CPU
10 Epyc Cores
RAM
RAM
64 GB
Space
Space
300 GB NVMe
Bandwidth
Bandwidth
Unlimited
wKVM-NVMe 65536 Windows

139.49 /mo

/mo

Billed annually

-10%

CPU
CPU
8 Epyc Cores
RAM
RAM
32 GB
Space
Space
200 GB NVMe
Bandwidth
Bandwidth
Unlimited
KVM-NVMe 32768 Linux

70.49 /mo

/mo

Billed annually

-10%

CPU
CPU
4 Xeon Cores
RAM
RAM
2 GB
Space
Space
60 GB HDD
Bandwidth
Bandwidth
Unlimited
KVM-HDD 2048 Linux

7.7 /mo

/mo

Billed annually

-10%

CPU
CPU
6 Xeon Cores
RAM
RAM
16 GB
Space
Space
150 GB SSD
Bandwidth
Bandwidth
Unlimited
KVM-SSD 16384 Linux

49.99 /mo

/mo

Billed annually

-5.4%

CPU
CPU
4 Xeon Cores
RAM
RAM
2 GB
Space
Space
60 GB HDD
Bandwidth
Bandwidth
300 Gb
wKVM-HDD HK 2048 Windows

11.73 /mo

/mo

Billed annually

-10%

CPU
CPU
4 Epyc Cores
RAM
RAM
4 GB
Space
Space
50 GB NVMe
Bandwidth
Bandwidth
Unlimited
KVM-NVMe 4096 Linux

16.45 /mo

/mo

Billed annually

-7.5%

CPU
CPU
3 Xeon Cores
RAM
RAM
1 GB
Space
Space
40 GB HDD
Bandwidth
Bandwidth
300 Gb
KVM-HDD HK 1024 Linux

4.88 /mo

/mo

Billed annually

-9.5%

CPU
CPU
8 Epyc Cores
RAM
RAM
32 GB
Space
Space
200 GB NVMe
Bandwidth
Bandwidth
Unlimited
wKVM-NVMe 32768 Windows

74.49 /mo

/mo

Billed annually

-7.1%

CPU
CPU
4 Xeon Cores
RAM
RAM
4 GB
Space
Space
100 GB HDD
Bandwidth
Bandwidth
Unlimited
wKVM-HDD 4096 Windows

21 /mo

/mo

Billed annually

Other articles on this topic

cookie

Accept cookies & privacy policy?

We use cookies to ensure that we give you the best experience on our website. If you continue without changing your settings, we'll assume that you are happy to receive all cookies on the HostZealot website.