Tine2.0

Admins/Synchronisation

Tine 2.0 enables you have your data synchronized on your mobile phone. The synchronisation is based on ActiveSync, which allows you to choose from a broad range of devices. For example your can use any Nokia business phone(Exx), the IPhone, different Android based phones and all windows mobile based phones. We also implemented ActiveSync push. ActiceSync push gives you access to your data nearly in realtime. No need to buy a Blackberry any more.

Contents

Patent warning for US-based users

Don't use our implementation of ActiveSync if you live in the USA. As Microsoft has a software patent on ActiveSync you can not use our code free of charge. We are currently in contact with Microsoft to negotiate a deal for our US-based users. Any other users are free to use our ActiveSync implementation.

Requirements

The requirements on serverside are very low. You just need to make a special URL available, which is needed by the ActiveSync enabled phones. This URL is hardcoded into any ActiveSync enabled phone and can not be changed.

The ActiveSync device tries to connect to the following URL on your Tine 2.0 installation.

Following URL must be made available:

http(s)://your.domain.name/Microsoft-Server-ActiveSync

Below you find configuration examples for different webservers.

Apache Webserver

You need to define one rewrite rule. Unfortunately defining rewrite rules can be a little bit tricky as you can define rewrite rules on different places.


Apache Webserver: Directly in the Apache vhost configuration file

If you have access to the vhost configuration file, just add the parameters RewriteEngine and RewriteRule.

In the vhost configuration, add the following:

<VirtualHost *:80>
  DocumentRoot "/var/www/tine20"
  ...
  
  <Directory "/var/www/tine20">
      ...
  </Directory>
  
  # enable the rewrite engine
  RewriteEngine on
  # rewrite /Microsoft-Server-ActiveSync internal to /var/www/tine20/index.php
  RewriteRule /Microsoft-Server-ActiveSync(.*) /var/www/tine20/index.php$1 [E=REDIRECT_ACTIVESYNC:true,E=REMOTE_USER:%{HTTP:Authorization}]
</VirtualHost>


Apache Webserver: Using the .htaccess file

If you don't access to the vhost configuration file, you can place the needed parameters also in a .htaccess file. This file must be located in the document root of your webserver and Tine 2.0 must also be installed in the document root.

RewriteEngine on
RewriteRule Microsoft-Server-ActiveSync(.*) index.php$1 [E=ACTIVESYNC:true,E=REMOTE_USER:%{HTTP:Authorization}]

If Tine 2.0 is not installed in the document root, you need to add the local path to Tine 2.0 index.php. But the .htaccess must always be placed into the document root.

RewriteEngine on
RewriteRule Microsoft-Server-ActiveSync(.*) path/to/tine20/index.php$1 [E=ACTIVESYNC:true,E=REMOTE_USER:%{HTTP:Authorization}]


Apache Webserver with CGI : Using the Rewrite Directive

As i had trouble moving Tine to a new server utilizing CGI/FCGI (i spent hours reading different forum threads and about the same amount of time changing my webserver config), i want to share, how i succeded using ActiveSync.

The big difference when using CGI/FastCGI instead of mod_php is, that the variables $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW] are not existent. The authentication method is therefore slightly different.

Environment: openSUSE 11.0 with Plesk 9.2.3, Apache 2.2.14 (mpm-worker), PHP 5.2.9, tine20-allinone-2010-03-ms1-1

As i use suexec, i have installed a wrapper script /srv/www/cgi/php-cgi-wrapper:

 #!/bin/sh
PHPRC="/etc/php5/fastcgi"
export PHPRC
exec /usr/bin/php-cgi5


The owner of the wrapper script php-cgi-wrapper and the directory /srv/www/cgi has to be identical to the

SuexecUserGroup <user> <group>


statement.

The domain is configured in Plesk with setting

FastCGI for PHP


and the corresponding httpd.include should contain:

<IfModule mod_fcgid.c>
	<Files ~ (\.php)>
		SetHandler fcgid-script
		FCGIWrapper /srv/www/cgi/php-cgi-wrapper .php
		Options +ExecCGI
		allow from all
	</Files>
</IfModule>


The following vhost configuration assumes, that your url to login to your tine installation is

http://<yourdomain>/tine20/


i.e. you get to your setup.php via

http://<yourdomain>/tine20/setup.php


In your vhost configuration you should then add:

RewriteEngine on
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1]
RewriteRule /Microsoft-Server-ActiveSync(.*) /tine20/index.php$1 [E=ACTIVESYNC:true,E=REMOTE_USER:%{HTTP:Authorization}]


In case your tine installation is in the document root and not in a subfolder, the fourth line from above with the RewriteRule should then read instead:

RewriteRule /Microsoft-Server-ActiveSync(.*) /index.php$1 [E=ACTIVESYNC:true,E=REMOTE_USER:%{HTTP:Authorization}]


If you don't have access to your Apache configuration (e.g. in a shared hosting environment) you can alternatively add the code above to the '.htaccess' file in your webservers root directory.


Troubleshooting

You can test your setup up by pointing your browser to

http://<yourdomain>/Microsoft-Server-ActiveSync


You should get a pop-up window asking for your username/password and after entering your credentials you should then see the famous

It works!
Your username is: <username> and your IP address is: xxx.xxx.xxx.xxx.


Congratulations. You are done.


Alternatively you can use this Web-Service to test your installations connectivity:

https://www.testexchangeconnectivity.com/Default.aspx

Supported devices

In general any ActiveSync enabled device should be working out of the box. So far we have success reports for following devices:

  • Windows mobile pda (Pocket Loox T810)
  • Nokia E61 with Mail for Exchange (download here / any other Exx phone should be working too)
  • Nokia N95 8GB with RoadSync v4
  • Nokia N95 with Mail for Exchange
  • IPhone 3G setup howto
  • HTC Kaiser aliasTytn 2 alias MDA Vario 3 - WM6.1
  • HTC Kaiser aliasTytn 2 alias MDA Vario 3 - WM6.5
  • Synchronisation with webOS like Palm Pre and Palm Pixi
  • HTC MDA Compact III WM6.1

Supported datatypes

Currently we support the synchronisation of contact, events and tasks.

Support for synchronizing emails is partly implemented since release Mialena (2010/03). Not working:

  • email subfolders