I was also interested in playing with my new phone's push email feature. Although I dont really have the kind of job where it is essential, I thought that it would be nice to see if I could get it working without paying my service provider for the privilege. I was also intrigued as to how it actually worked. Unfortunately, I was not entirely successful in getting it to work, but I will walk you through the theory as you may have more success.
If you have ever used pull email on your phone, you will probably be aware of the IMAP (Internet Message Access Protocol) protocol, which basically synchronizes the headers of emails so it generally doesnt store much locally. Using the IMAP protocol means that the client must poll the server every few minutes and "pull" the email down.
If you think about what is happening behind the scenes, you can see that there is a reasonable amount of traffic involved: open a connection, find the server, attempt to log in, send the username, send the password, ask if there are any new messages, and finally, close the connection. If you were to set up your phone to perform these tasks every few minutes, over the course of the month, you will have a pretty hefty data bill!
The IDLE command in IMAP essentially reduces drastically the amount of data that is required to check email. Some people say that this isnt strictly push email, but I will leave this up to you.
This is how it works: the client opens up a connection to the server in the usual way, but then instead of closing the connection, it leaves it open and tries to keep the connection open. Now the server essentially has an "always on" connection to the client, so when an email arrives, it can push it down to the client immediately.
But because connections generally have a time-out associated with them, the client must keep the connection alive using a "heartbeat" or keep-alive method. All it has to do is send a couple of bytes a little more often than the connection time-out, and presto, push email! Neat huh?
If you would like to find out whether your email server supports IDLE, telnet to it. Here's a sample telnet session:
telnet mail.myisp.com 143
Connected to example.com.
Escape character is '^]'.
* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT
THREAD=REFERENCES SORT QUOTA IDLE ACL ACL2=UNION STARTTLS] Courier-IMAP ready.
Copyright 1998-2005 Double Precision, Inc. See COPYING for distribution information.
From the example, you can see that this server supports IDLE (sixth line in the example).
In my client software on my phone, I had an option for IDLE (Figure 13), so I checked it. I set up my server information and my phone connected to the Internet, and then downloaded my email and remained connected to the Internet. If I sent an email then to my phone, it would appeare instantly! Brilliant!
Figure 13: SyncML Option's Basic Tab
So why didnt it work properly? Well, the main problem was that my service provider doesnt much like permanent Internet connections to their network, so they have a time-out as you would expect. This shouldnt be a problem as the heartbeat from the IDLE protocol should keep the connection open; however, as I found out, there was no way of setting how often the heartbeat should be sent on my phone.
Unfortunately it would appear that the default is longer than the time-out on my network! So essentially once the time-out "kicked in," my email stopped appearing. Despite lengthy phone calls to Vodafone and Sony Ericsson, nobody seemed to know what they were talking about, and their conclusion was that if I wanted push email, I was going to have to pay for it.
So a slightly disappointing end to the exercise, but one that proved very insightful. Perhaps you, the reader, can give this a "go," and discuss your successes (or otherwise) in the Comments. Unfortunately, I could find very little information about it on the Internet that would help, but by all means give it a try!
So there we have it, two free solutions to a potentially expensive problem; one definitely successful, the other slightly less so. But who knows? Perhaps it will work for you!