logo
Header graphic 5 of 8

Categories

Archives

Other stuff

Other sites

I wish this site were powered by Django

August 03rd, 2011

First look: Funambol connector for Mozilla Thunderbird 5.0

Filed under: Mobile,Technology — jm @ 20:21

Over the last few weeks I spent a couple of nights on porting the Funambol connector for Mozilla Thunderbird to Gecko 2.0, the engine underlying Thunderbird 5.0. Funambol for years now has been an important part of my infrastructure as I use it to sync my address book between my iPhone, my Laptop and my PC at home, so the lack of official support is unsettling to me.

Details on the changes that were necessary can be found in the Release Notes for version 1.0b4-tb5-jm-dev1 and the Mercurial repository. An experimental version for Windows can be found here.

October 26th, 2010

Running Z-Push 1.4.2 with Apache and FastCGI/fcgid

Filed under: Mobile,PHP,Technology — jm @ 20:49

I spent half a night yesterday installing Z-Push, an open-source Microsoft Exchange ActiveSync push protocol implementation, which is written in PHP. Z-Push supports multiple back-ends from which it can push data to your mobile device, including maildirs, IMAP and vCard folders. Multiple other open-source groupware projects (like Horde.org) have produced their own back-ends.

I'm using my iPhone with my own mail system with a secure IMAP server and CalDav, based on Sun's Oracle Communications Calendar Server. I want the ability to remotely wipe my phone, though.

Z-Push itself only supports the "remote wipe"-command through Zarafa's administration console. However, there is a project called iRemoteWipe that provides a Z-Push back-end that checks with a LDAP database which remote devices are to be wiped. There's a good how-to on AFP548.com that shows how to make this back-end work with a SQLite database.

I will not cover the whole process of unpacking and configuring Z-Push, as it's easily done and well documented, but I want to describe the few bumps that I've hit along the way.

The thing that left me stumped is that I'm running PHP through mod_fcgid on a Apache 2.2 server with the worker MPM. The Z-Push installation instructions however, only cover the installation with mod_php. When I tried to access the "Microsoft-Server-ActiveSync"-URL on my server, I always got the error message "No input file specified". This first error was easily fixed. Z-Push uses a Alias directive to map its index.php-file to the ActiveSync-URL. I had issues with this before, so I knew that somehow Apache will not use pass the right URL to the fcgid-script handler. I just rewrote it using mod_rewrite to:

RewriteEngine On
RewriteRule ^/Microsoft-Server-ActiveSync \
        /z-push/index.php [PT,L,QSA]

Now however, Z-Push complained that it didn't get any authentication headers. While the documentation was right in that, when I accessed the URL using a browser, I got an authentication dialog... I still couldn't authenticate. It took hours before I remembered that using Apache with mod_php passes some HTTP headers using non-standard names. "Authorization" becomes "HTTP_AUTHORIZATION" for example. Armed with that knowledge and extensive googling, I finally found this forum post, which solved the remaining problem, as Z-Push assumes running under mod_php at the moment.

So the final configuration reads:

# Enable ActiveSync (Z-Push)
RewriteEngine On
RewriteRule .* - [E=HTTP_MS_ASPROTOCOLVERSION: \
        %{HTTP:Ms-Asprotocolversion}]
RewriteRule .* - [E=HTTP_X_MS_POLICYKEY: \
        %{HTTP:X-Ms-Policykey}]
RewriteRule .* - [E=HTTP_AUTHORIZATION:\
        %{HTTP:Authorization}]
RewriteRule /Microsoft-Server-ActiveSync \
        /z-push/index.php [PT,L,QSA]

I hope this helps someone else out there :-).