Table of Contents

About

Z-Push is a groupware component that can be added to any IMAP server such as dovecot in order to promptly deliver E-mail to clients. This tutorial shows how to set-up z-push given a pre-configured web-server and an IMAP server running on the same host.

Requirements

Additionally, the following packages must be installed (on Debian):

aptitude install php-soap php5-imap 

Setup

Extract the z-push package from the requirements and move it to /opt/ and change the ownership to the web-server's executing username (www-data on Debian). After that create the folders /var/lib/z-push and /var/log/z-push and set the appropriate permissions:

mkdir -p /var/{lib,log}/z-push
chown www-data:www-data /var/{lib,log}/z-push
chown 750 /var/{lib,log}/z-push

Configuring

The file /opt/z-push/config.php has to be edited in order to make the following changes:

define('TIMEZONE', 'Europe/Paris');
define('BACKEND_PROVIDER', "BackendIMAP");

You will need to change Europe/Paris to your local time-zone.

Next, create an apache configuration file (at /etc/apache2/conf-available/z-push.conf in Debian) with the following contents:

Alias /Microsoft-Server-ActiveSync /opt/z-push/index.php
<Directory "/opt/z-push/">
      Options -Indexes
      AllowOverride All
      Require all granted
</Directory>

# Recommended: use HTTPs if available
<IfModule mod_rewrite.c> 
  <IfModule mod_ssl.c> 
    <Location /Microsoft-Server-ActiveSync>
      RewriteEngine on 
      RewriteCond %{HTTPS} !^on$ [NC] 
      RewriteRule . https://%{HTTP_HOST}%{REQUEST_URI}  [L] 
    </Location>    
  </IfModule> 
</IfModule> 

Finally, create a .htaccess file at /opt/z-push/.htaccess with the following contents:

php_flag magic_quotes_gpc off
php_flag register_globals off
php_flag magic_quotes_runtime off
php_flag short_open_tag on

And restart the web-server.

Client Setup

With z-push in place, clients will have to setup the account as a Microsoft Exchange account instead of a regular IMAP account.