Difference between revisions of "Z-Push v2 with Zimbra"

Jump to navigation Jump to search
7,292 bytes added ,  21:47, 4 October 2016
Add Google Ads
m (Minor corrections)
(Add Google Ads)
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
The procedure below should get you up and running so you can sync your mobile device to your Zimbra server using Active-Sync provided by Z-Push.
The procedure below should get you up and running so that you can sync your mobile device to your Zimbra server, using the Active-Sync protocol, provided by Z-Push.


It doesn't include setting up provisioning, which is the Active-Sync feature that enhances security by providing a mechanism to remote wipe your devices, enforce storage encryption etc.  See the forum thread above if you want to know how to set it up.
It doesn't include setting up provisioning, which is the Active-Sync feature that enhances security by providing a mechanism to remote wipe your devices, enforce storage encryption etc.  Buried in the Zimbra forum thread are instructions on how to set it up - [http://www.zimbra.com/forums/mobility/26536-z-push-zimbra-backend-push-email-contacts-appointments-tasks.html Z-Push Zimbra Backend (Push Email, Contacts, Appointments & Tasks) - Zimbra :: Forums].


{| class="vwiki-note"
{| class="vwiki-note"
Line 10: Line 10:
If you must do it, then your best bet is to install on separate server first. Then, once you know you've got a working installation, try to get Z-Push running on your Zimbra server.
If you must do it, then your best bet is to install on separate server first. Then, once you know you've got a working installation, try to get Z-Push running on your Zimbra server.
|}
|}
{{#widget:Widget:GoogleAdSenseSkyscraper}}
Z-Push is essentially a website.  Mobile devices access the site in order to be able to sync with your Zimbra server.  Therefore, you need a publicly accessible server that can host the site, and a DNS record that points to it (that client mobile devices will need to be able to resolve)


The following procedure assumes that you have a web-server that's accessible from the internet.  Mine is an [http://httpd.apache.org/ Apache2] webserver, running on [http://releases.ubuntu.com/lucid/ Ubuntu 10.04 LTS], therefore any references to commands, paths, etc, will have come from that set-up.
The following procedure assumes that you have a web-server that's accessible from the internet.  Mine is an [http://httpd.apache.org/ Apache2] webserver, running on [http://releases.ubuntu.com/lucid/ Ubuntu 10.04 LTS], therefore any references to commands, paths, etc, will have come from that set-up.
Line 19: Line 21:
* [[Z-Push_with_Zimbra_and_HTML_Support#Apache_Config_.28Normal.29|Apache Config]]
* [[Z-Push_with_Zimbra_and_HTML_Support#Apache_Config_.28Normal.29|Apache Config]]
* [[Z-Push_with_Zimbra_and_HTML_Support#Apache_Config_.28SSL.29|Apache SSL Config]]
* [[Z-Push_with_Zimbra_and_HTML_Support#Apache_Config_.28SSL.29|Apache SSL Config]]
You are advised to read the <code>INSTALL</code> file that comes with the Zimbra backend before you attempt the install.  Don't just blindly follow the steps below, they should work but are intended to provide additional support and not to replace any of the documentation supplied by Z-Push or the Zimbra Backend's authors.  You may miss a critical dependency or alteration required for your environment.


# If you don't have them, install subversion and php-curl
# If you don't have them, install subversion and php-curl
Line 24: Line 28:
# Create a folder for Z-Push on your webserver
# Create a folder for Z-Push on your webserver
#* EG <code> mkdir /var/www/z-push </code>
#* EG <code> mkdir /var/www/z-push </code>
# Download the latest Z-Push version (see http://z-push.sourceforge.net/soswp/index.php?pages_id=39&t=Download) to a temp folder and unpack
# Download the latest Z-Push version (see http://zarafa-deutschland.de/z-push-download/final/) to a temp folder and unpack
#* EG <code> wget http://zarafa-deutschland.de/z-push-download/final/2.0/z-push-2.0.3-1467.tar.gz </code>
#* EG <code> wget http://zarafa-deutschland.de/z-push-download/final/2.0/z-push-2.0.6-1616.tar.gz </code>
#* EG <code> tar -zxvf z-push-2.0.3-1467.tar.gz </code>
#* EG <code> tar -zxvf z-push-2.0.6-1616.tar.gz </code>
# Move the contents to your webserver folder
# Move the contents to your webserver folder
#* EG <code> mv z-push-2.0.3-1467/* /var/www/z-push/</code>
#* EG <code> mv z-push-2.0.6-1616/* /var/www/z-push/</code>
# Create folders for state (<code>/var/lib/z-push</code>) and log data (<code>/var/log/z-push</code>) and make writeable by the webserver (can be altered in <code>config.php</code> file)
# Create folders for state (<code>/var/lib/z-push</code>) and log data (<code>/var/log/z-push</code>) and make writeable by the webserver (can be altered in <code>config.php</code> file)
#* <code> mkdir /var/lib/z-push </code>
#* <code> mkdir /var/lib/z-push </code>
Line 37: Line 41:
#* EG <code> chmod g+w /var/log/z-push</code>
#* EG <code> chmod g+w /var/log/z-push</code>
# Download the Zimbra Z-Push backend into a <code>/zimbra</code> folder under the <code>backend</code> folder
# Download the Zimbra Z-Push backend into a <code>/zimbra</code> folder under the <code>backend</code> folder
#* EG <code> svn checkout https://zimbrabackend.svn.sourceforge.net/svnroot/zimbrabackend/zimbra-backend/branches/z-push-2 /var/www/z-push/backend/zimbra</code>
#* EG <code> svn checkout svn://svn.code.sf.net/p/zimbrabackend/code/zimbra-backend/branches/z-push-2 /var/www/z-push/backend/zimbra</code>
# Update the Z-Push <code>config.php</code> file as required (see example below - [[#Z-Push_Config|Z-Push Config]])
# Update the Z-Push <code>config.php</code> file as required (see example below - [[#Z-Push_Config|Z-Push Config]])


=== Additional steps ===
Some additional steps are sometimes required due to bugs etc, see the INSTALL file included with the backend for more info.
* If running Zimbra backend 59 onwards fix Z-Push's <code>RowCmp()</code> function
** Within <code>z-push/lib/default/diffbackend/diffstate.php</code>, replace existing contents of <code>RowCmp()</code> with
** <code>return strcmp( $b["id"], $a["id"] ) ;</code>
* If running Zimbra 7.2 onwards and have clients with multiple devices you need to allow them to connect simultaneously, on your Zimbra server allow an appropriate number of sessions (default is 5)
** <code>zmlocalconfig -e zimbra_session_limit_soap=7</code>
** <code>zmconfigdctl reload</code>
* If running Zimbra 8 onwards you need to whitelist your Z-Push server otherwise its likely to get blocked by Zimbra, on your Zimbra server allow your Z-Push server's IP address
** EG <code> zmprov mcf zimbraHttpThrottleSafeIPs 158.10.20.123 </code>
=== Testing ===
In theory, it should be working now, in order to test...
In theory, it should be working now, in order to test...
# Browse to your server, eg http://as.domain.com/Microsoft-Server-ActiveSync
# Browse to your server, eg http://as.domain.com/Microsoft-Server-ActiveSync
Line 47: Line 63:
#* You should get a page showing "Z-Push - Open Source ActiveSync" which doesn't contain errors - this confirms that connectivity exists between all the required components (Apache, Z-Push, Zimbra), and that they are basically OK.
#* You should get a page showing "Z-Push - Open Source ActiveSync" which doesn't contain errors - this confirms that connectivity exists between all the required components (Apache, Z-Push, Zimbra), and that they are basically OK.


=== Z-Push Config ===
=== Logrotate ===
You should also set-up logrotate on the Z-Push logs, example below will rotate daily, keeping two weeks of logs.  Create in <code>/etc/logrotate.d</code>, eg <code>vi /etc/logrotate.d/z-push</code>
<pre>
/var/log/z-push/*.log {
        daily
        missingok
        rotate 14
        compress
        delaycompress
        notifempty
}
</pre>
{{#widget:Widget:GoogleAdSenseSkyscraper}}
== Z-Push Config ==
Note that starting from Z-Push version v2.0.6, there are now seperate config files for both Z-Push and the Zimbra Backend.  If you're installing an old version for some reason, see the [[#Pre Z-Push v2.0.6|Pre Z-Push v2.0.6]] section below.
 
The following are excerpts from the config files that need to be edited or should be considered by you.  Update the existing files provided with the software as per your requirements.
 
=== Z-Push Config Example ===
EG <code> /var/www/z-push/config.php</code>
<source lang="php">
// Update existing fields in config
define('TIMEZONE', 'Europe/London"');
define('PROVISIONING', false);
$BACKEND_PROVIDER = "BackendZimbra";
</source>
 
=== Zimbra Backend Config ===
EG <code> /var/www/z-push//backend/zimbra/config.php</code>
The below is just an example, see the <code>INSTALL</code> file that comes with the Zimbra backend to work out the correct settings for your environment.
<source lang="php">
define('ZIMBRA_URL', 'https://mail.domain.com');
define('ZIMBRA_USER_DIR', 'zimbra');
define('ZIMBRA_SYNC_CONTACT_PICTURES', true);
define('ZIMBRA_VIRTUAL_CONTACTS',true);
define('ZIMBRA_VIRTUAL_APPOINTMENTS',true);
define('ZIMBRA_VIRTUAL_TASKS',true);
define('ZIMBRA_IGNORE_EMAILED_CONTACTS',true);
define('ZIMBRA_HTML',true);
 
define('ZIMBRA_ENFORCE_VALID_EMAIL', true);
 
define('ZIMBRA_SMART_FOLDERS',false);
define('ZIMBRA_RETRIES_ON_HOST_CONNECT_ERROR',5);
 
define('ZIMBRA_LOCAL_CACHE', true);
 
define('ZIMBRA_DEBUG',false);
</source>
 
=== Pre Z-Push v2.0.6 Example ===
The below is just an example, see the <code>INSTALL</code> file that comes with the Zimbra backend to work out the correct settings for your environment.
The below is just an example, see the <code>INSTALL</code> file that comes with the Zimbra backend to work out the correct settings for your environment.


Line 70: Line 136:


See http://php.net/manual/en/timezones.php for the correct name for your local timezone
See http://php.net/manual/en/timezones.php for the correct name for your local timezone
=== Config Items ===
This section does not contain an exhaustive list of all configuration options, just the more common ones.
==== Z-Push ====
{| class="vwikitable"
|-
! Item !! Example Value !! Purpose / Comments
|-
| <code>TIMEZONE</code> || <code>Europe/London</code> || Default timezome of server - see http://php.net/manual/en/timezones.php
|-
| <code>STATE_DIR</code> || <code>/var/lib/z-push/</code> || Where sync state data gets stored
|-
| <code>LOGFILEDIR</code> || <code>/var/log/z-push/</code> || Where logs get written to
|-
| <code>LOGLEVEL</code> || <code>LOGLEVEL_INFO</code> || Logging level - see config file for available options
|-
| <code>LOGAUTHFAIL</code> || <code>false</code> || Whether to log user authentication failures or not
|-
| <code>LOGUSERLEVEL</code> || <code>LOGLEVEL_DEVICEID</code> || Logging level for per user logging (off by default, add users to log for to array, eg <code>$specialLogUsers = array("user@domain.com");</code>)
|-
| <code>PROVISIONING</code> || <code>false</code> || Whether to enforce provisioning (ActiveSync security policies) over devices
|-
| <code>LOOSE_PROVISIONING</code> || <code>false</code> || Allows legacy devices that don't support provisioning to still be able to sync
|-
| <code>SYNC_FILTERTIME_MAX</code> || <code>SYNC_FILTERTYPE_ALL</code> || Allows you to limit the time period obver which devices can sync (see config file for available time periods).  Useful for when time-outs are causing device syncs to fail. See also <code>SYNC_MAX_ITEMS</code>
|-
| <code>FILEAS_ORDER</code> || <code>SYNC_FILEAS_LASTFIRST</code> || Sets FileAs/SaveAs for contacts
|-
| <code>SYNC_MAX_ITEMS</code> || <code>100</code> || Limits the number of items sync'ed in one device request. Useful for when time-outs are causing device syncs to fail. See also <code>SYNC_FILTERTIME_MAX</code>
|-
| <code>BACKEND_PROVIDER</code> || <code>BackendZimbra</code> || Backend interconnect provider which alows Z-Push to interact Zimbra (or other) email/collaboration server
|}
==== Zimbra Backend ====
{| class="vwikitable"
|-
! Item !! Examplqe Value !! Purpose / Comments
|-
| <code>ZIMBRA_URL</code> || <code>https://mail.domain.com</code> || URL to Zimbra server (can be http or https)
|-
| <code>ZIMBRA_USER_DIR</code> || <code>zimbra</code> ||
|-
| <code>ZIMBRA_SYNC_CONTACT_PICTURES</code> || <code>true</code> || Sync contact pictures to devices.
|-
| <code>ZIMBRA_VIRTUAL_CONTACTS</code> || <code>true</code> ||
|-
| <code>ZIMBRA_VIRTUAL_APPOINTMENTS</code> || <code>true</code> ||
|-
| <code>ZIMBRA_VIRTUAL_TASKS</code> || <code>true</code> ||
|-
| <code>ZIMBRA_IGNORE_EMAILED_CONTACTS</code> || <code>true</code> ||
|-
| <code>ZIMBRA_HTML</code> || <code>true</code> || Whether to sync email etc content as HTML, or raw/basic text
|-
| <code>ZIMBRA_ENFORCE_VALID_EMAIL</code> || <code>true</code> ||
|-
| <code>ZIMBRA_SMART_FOLDERS</code> || <code>true</code> || Whether to enable Smart Folders or not (a Backend feature that allows end user control of what gets synced to their devices). Cannot be changed on the fly, all sync state data needs to be manually cleared.
|-
| <code>ZIMBRA_RETRIES_ON_HOST_CONNECT_ERROR</code> || <code>5</code> || How many times the backend should attempt to reconnect to Zimbra should connect fail (because services are down for backup, for example)
|-
| <code>ZIMBRA_LOCAL_CACHE</code> || <code>true</code> ||
|-
| <code>ZIMBRA_DEBUG</code> || <code>false</code> ||
|}


== Mobile Device Setup ==
== Mobile Device Setup ==

Navigation menu