As Jabber does not seem appropriate for a SMS-replacement (the clients just don’t to survive connection changes from wifi->3g, 3g->E, etc.) i’ve been looking for something different. E-Mail is nice, just the shortest polling-interval of 15minutes is not suited for realtime communication. So – theres Push Email (meaning the iPhone will hold a HTTP connection to some server open all the time and the server writes something to that stream as soon as a new mail arrives) for various services including Microsoft Exchange and GMail. How about you hosting a own server since you don’t want to give away all your data? No problem – either use one of the tons of commercial servers supporting Push or use Z-Push with your favorite IMAP and SMTP server.
Z-Push is a collection of PHP Scripts that emulate a Microsoft Exchange AS Server to provide push. It supports multiple backends – IMAP among them.
One drawback of Z-Push is that it does so strange PHP magic it doesn’t support PHP-CGI on apache, it wants mod_php really really bad. But mod_php is bad for security. So for testing purposes i’ve set up Z-Push on my homeserver instead of my dedicated server which runs php-cgi. Problem: Z-Push will run on a different domain and machine than the mailserver runs on. This produces quite some headache – here’s how you solve it:
- normally install Z-Push (simply unpack the tarball and install according to INSTALL) on your “small server”. Edit config.php to reflect your timezone settings, change the BACKEND_PROVIDER to “BackendIMAP”, enter your server data (you may want /ssl/[no]validate-cert in IMAP_OPTIONS). Also set IMAP_DEFAULTFROM to “@yourdomain.com” – important :).
- Configure your “small servers” MTA to relay via your “big server”. As i don’t want a pseudo-open relay on my “big server” i chose to use exims SMARTHOST with SMTP Login method:
- (I’m assuming Debian here) install exim4 or start dpkg-reconfigure exim4-config. Configure your box to be a smarthost with remote smtp. Then open up “/etc/exim4/passwd.client" and add a line with the syntax "host:user:password" to reflect your "big servers" smtp account.
- As this is a normal smtp connection and no relay, no changes must be made to your big server.
- Thats it, enter the data as Microsoft Exchange Account on your iPhone, valdidation will fail. Press Next and Save anyways, navigate to Account Details, turn of SSL.
- Now your Push-Email account works!
Tipp: if you need debug output from Z-Push create a file called debug.txt in its Install-Dir and chmod it a+rw.
Well, this is IMO a quite nice way to get PushMail as a SMS-Substitute for the iPhone (given all your friends have Smartphones with Internet and use your Push solution too :P). Have fun!
that`s a relay helpful information. thank you 🙂