screenshot
of Windows Mobile receiving an email

Airhead Direct Push server

[Requirements] [Setting up the server] [Setting up a Windows Mobile 5 client] [Notes] [Status] [Authors]

Airhead is a Python server implementation of Microsoft's Airsync and Direct Push mobile push email protocol. It's designed to have minimal dependencies so you can run it on any machine, regardless of your setup.

Requirements

Airhead should run on any Unix-like OS. Running on Windows might be possible but is entirely untested.

It requires Python 2.5 and the following Python packages to be installed:

Airhead is only tested against Windows Mobile 5. Other devices that support Direct Push and Airsync might or might not work. Feedback is appreciated.

Download

The source code is currently only available from our subversion repository; to check it out to an 'airhead' directory, run the following:

svn co svn://bourdrez.org/airhead/trunk airhead

To update a previously checked-out copy to the latest version, run the following inside the directory:

svn update

Due to an unfortunate hard drive failure, the Subversion repository is temporarily not available. A recent copy of the source is available as a tarball.

Setting up the server

Edit the example configuration file and add your own users, passwords and mailboxes. Move it to airheadconfig.py, then run airheadserver.py. It will bind to port 80 if it can, and to port 8080 otherwise.

Microsoft's Airsync protocol runs over HTTP or HTTPS. You can run it just fine over HTTP but carriers might drop your connection after a few minutes and your password and emails will be going over the internet in plain text. As such it's recommended to run Airhead behind an HTTPS server such as Apache.

Sadly, Windows Mobile will only trust SSL certificates signed by a certificate authority that it has the root key for. Unless you have a server key that's already signed by one of the big certificate authorities (your only option if your device has been locked down by your provider), you need to make one yourself. Transfer the root certificate to the device (loading it in Pocket IE will generally work). As long as it has a .cer extension it should be associated with the certificate manager so that it'll be added to the list of trusted certificates when you open it.

If you're using Apache, you should set up something similar to the following:

Listen 443

<VirtualHost *:443>
       ServerName yourserver.com
       SSLEngine On
       SSLCertificateKeyFile /etc/apache/ssl.key/server.pem
       SSLCertificateFile /etc/apache/ssl.crt/server.pem

       ProxyRequests Off
       ProxyPass /Microsoft-Server-ActiveSync http://localhost:8080/Microsoft-Server-ActiveSync
</VirtualHost>

This redirects the appropriate HTTP traffic to Airhead running at port 8080 on your local machine. You should probably also change the existing Timeout directive to 1800 (which is 30 minutes) to avoid Apache killing your connections.

Setting up a Windows Mobile 5 client

Open ActiveSync, and ensure you don't have an existing airsync setup by going into Options and deleting any Exchange Server entry which appears there. Be warned that doing so will remove any associated email on your device.

Then simply setup a new Exchange Server relationship, entering the hostname of your machine as the server hostname and entering your configured username and password. The domain is not important but Windows Mobile requires it to be filled out; however, airhead will default to username@domain as the From address if you haven't configured one manually.

When you click Finish, it will go ahead and attempt to sync. If something goes wrong, take a look at the server logs to try and work out what, then hit Sync again to retry. Otherwise, you're all setup; ActiveSync will warn you if you don't have an enabled connection suitable for Direct Push.

If you've changed the sync scheduling options, you'll want to go into Schedule inside ActiveSync and change the sync gettings to "As items arrive" to take advantage of Direct Push.

Notes

Direct Push is only going to work over the phone network (GPRS/EDGE/3G) as the other connections available to Windows Mobile devices don't support the necessary wake-on-network-activity functionality.

Enabling Direct Push is going to seriously reduce the amount of battery life you get from your device, especially if your network or server drop connections prematurely.

Status

Airhead currently supports the following parts of the Airsync protocol:

The following is unimplemented:

Authors

You can blame Bertram Bourdrez (bertram at bourdrez etc) and Alyssa Milburn.