Now that DBMail and Roundcube are working it’s time to get push notifications working with Z-Push
- First step is to install the required PHP extensions
[root@web1 tmp]# yum install php-mapi php-soap php-imap -y
- Next download and extract z-push
[root@web1 webmail]# cd /tmp/ [root@web1 tmp]# wget http://zarafa-deutschland.de/z-push-download/final/2.0/z-push-2.0.7-1690.tar.gz [root@web1 tmp]# tar -zxvf z-push-2.0.7-1690.tar.gz
- Copy the z-push files into your virtual host directory
[root@web1 tmp]# mkdir /var/www/html/outlook [root@web1 tmp]# cp -rf z-push-2.0.7-1690/* /var/www/html/outlook/
- Z-Push needs a couple of directories created. Create them and set their permissions
[root@web1 outlook]# mkdir /var/log/z-push [root@web1 outlook]# chown apache:apache /var/log/z-push/ [root@web1 outlook]# mkdir /var/lib/z-push [root@web1 outlook]# chown apache:apache /var/lib/z-push/
- Change to the directory you copied z-push to and open the config.php file in your editor
[root@web1 tmp]# cd /var/www/html/outlook/ [root@web1 outlook]# vim config.php
- The following lines need to be updated with your configuration
define('BACKEND_PROVIDER', "BackendIMAP"); define('IMAP_SERVER', '192.168.100.16'); define('IMAP_PORT', 143);
- Next create the virtual host in apache. You do have to create an alias as well as change some php settings for it to work
ServerAdmin firstname.lastname@example.org DocumentRoot /var/www/html/outlook ServerName outlook.mytechtradie.com.au php_flag magic_quotes_gpc off php_flag register_globals off php_flag magic_quotes_runtime off php_flag short_open_tag onAlias /Microsoft-Server-ActiveSync /var/www/html/outlook/index.php SetEnvIf Request_URI "^/Microsoft-Server-ActiveSync(/|$)" zpush_request CustomLog /var/log/httpd/zpush_access_log common env=zpush_request
- To test it browse to http://
/Microsoft-Server-ActiveSync You will be prompted for your username and password. If you enter it correctly you will then see a page with “Z-Push – Open Source ActiveSync GET not supported”
- You should now be able to setup Outlook/Mobile devices to sync.
- You can also use the z-push-admin.php from the CLI to perform actions on synced phones such as remote wipe them
[root@web1 outlook]# php z-push-admin.php -a list All synchronized devices Device id Synchronized users ----------------------------------------------------- HTC27733c90sfd358aabfb1bfsdf5f07 email@example.com
- Note: This was just a test excercise, we haven’t configured SSL certificates so all data between the phone and server is in plan text. If you are going to put this into production please add an SSL cert.
So that is the end result. Overall I am pretty happy if the need arose we could roll back from hosted Email in the cloud to hosting on our own servers without too much hassle.