Push e-mail on an iPhone or iPad

When you search google for a similar phrase to the title of this post you usually get a fairly stock response; use exchange, mobile me or gmail and you can have push e-mail by simply activating it in the mail settings. The thing is, most people who search for the above know this already. What they really want to know is how they can push e-mail with a conventional e-mail account that they may have from a hosting provider and access through thunderbird or outlook.

With BlackBerry, push e-mail is really simple. Just provide the setup screen with your IMAP enabled e-mail address and password and BlackBerry will start pushing e-mail to your phone. With iPhone and iPad it can also be that simple without changing your mail provider or e-mail address but to get there we need a step in between. I call this the fake exchange server.

A little known sourceforge project called z-push holds all the answers. Essentially by installing this PHP code on a web server and setting up a config file or two we can fool an iPhone or iPad into thinking it is talking to a Microsoft exchange server and get genuine push e-mail from a standard IMAP e-mail account!

To get started you’ll need the following:

  • A web server
  • Copy of Z-Push code
  • The details of your IMAP e-mail server

Don’t look with concern at the first requirement. You can probably make use of a shared hosting account for this, or if you were prepared to go out and spend on mobile me then you will probably be able to spend less and get your own VPS, which, if you intend to push a lot of mail, might be a better bet in the long run anyway.

Configure your web server to support SSL and install PHP. I won’t go into detail on how to do this as there are plenty of online tutorials for this already that you can google. The SSL bit is important as this will ensure that e-mail traffic from your iPhone or iPad is encrypted which is essential if you have a habit of using open WiFi connections while on the move. If you’re doing things on the cheap and using a home server then make sure you have a static IP at home. You can get a free SSL certificate from the fine folks at StartSSL.

Once your server is up, follow the instructions for installing z-push from their website. In practice I found that the stable version was far from it and didn’t really work so opted for the 2.0 alpha version. Try your luck and see what you get. There is a forum on the z-push site from where you should be able to obtain help if you need it.

With z-push installed and configured as per your IMAP e-mail server settings, you’re ready to try your luck from your Apple device. Head on over to e-mail accounts and delete the current entry you have. Once you have done this, select to configure a new account and choose Microsoft Exchange. Enter your e-mail address, username and password. Leave the domain blank and SSL on. Often your username and e-mail address are one and the same although this can vary. It’s unlikely that just these details will connect as you’re pushing mail from your dummy server, so you’ll be prompted after a few seconds for a server URL. Enter the domain name on which you have installed z-push.

Assuming all of this is accepted by your Apple device, you now just need to go to the fetch new data settings, enable push and and change fetch to manually. Open up mail and if all is working you should see your e-mail in folders. If so your final test will be to return to the home screen, send an e-mail to yourself from your PC and watch the iPhone/iPad. You should see the e-mail arrive within seconds. If so, you’re pushing mail!

At the close of this article I’d like to mention that my ability to investigate this scenario and write up the solution is due in no small part to the generosity of Stinky Ink in them putting up an iPad2 as a prize in their WordCamp UK competition, many thanks once again!

Comments    

Free iPad

Whilst at WordCamp UK 2011, held in Portsmouth, I entered a competition run by one of the key event sponsors, Stinky Ink, to win an iPad2 – and my e-mail got picked out of the hat!

Free iPad

It’s unpacked and I’ve started to have a play around with the interface and features. I’m already liking the ease of use for occasional web browsing, the twitter client is great and I’ve been inspired to do a little hacking in the field of push e-mail. Watch this space!

Comments    

Foursquare Auto-Checkin

Having been a recently new joiner to the foursquare phenomenon I’ve quickly decided that I like it and that it’s leaps and bounds ahead of Facebook places. That being said, it’s not without issue. The main one being that there are places I regularly frequent that I want to check into, but don’t wish to publish on twitter. “You can do that!” I hear you cry, well yes, you can, but you still have to get your phone out of your pocket.

To me, getting one’s phone out of one’s pocket should be to actually say something, such as “I’m at somewhere new” or “I’m at somewhere I normally visit but I’m here for longer this time, come and join me”. If I’m just heading to the office or going home, I want to log that onto the statistics but not shout about it. While there is of course an option on the mobile app to do this, I have to specifically choose that option. In reality, what I really want to do is only to touch my phone if I have something to say, otherwise let foursquare do the work for me.

Enter the API! I have long been a user of google latitude. This little known service allows me, via a private API key, to retrieve the latitude and longitude coordinates of my phone wherever it is. I used this feature to track my road trip progress and it worked very well. To this end, knowing that foursquare is primarily powered by coordinates and I always have access to mine, I decided to stick my coders hat on and program my way to lazy foursuare use.

Registering for a foursquare API key is easy and it arrives straight away. Getting an OAuth token using the key was also just as easy and within a minute or so I was able to call out instructions to foursquare from my server, pretending to be me. It didn’t take me long to close the loop so that to all intents and purposes my server is me as it knows where I am.

Although it’s a little rough around the edges, I now have an application running that has a pre-set list of locations that it is allowed to check me into and when my coordinates say that I am there, it calls out to foursquare and does so.

While this is far from ready for release, I do hope to do so in not too distant future, perhaps in time for WordCamp. In the meantime I’m going to sit back and enjoy ousting my colleagues as mayor of the office, just by pulling into the car park. After all, isn’t that what this whole foursquare thing is all about?

Comments    

SLR Camera Simulator

If you’re looking to hone your photography skills but don’t have much time to get out and about with your camera, spending a few minutes in your working day playing with this camera simulator could be the answer. Look at a subject through the viewfinder, change the settings and take a picture, looking at the results afterwards. Quite a remarkable piece of web development I must say!

Comments (1)    

No to AV

Tomorrow sees the first referendum in the UK for over 35 years and the decision at hand is whether to change the voting system for Westminster elections from the traditional first past the post system to the alternative vote (AV). I’ve written this post as I wanted to share my reasoning for deciding to vote no in the poll.

Firstly let me stress that this referendum is a massively important decision, one of the most important decisions that is to be made about the UK political system for over a generation so please don’t underestimate the significance of casting your vote! Whether you agree with my points or not, you should be sure make your voice heard on May 5th – set aside a time of day to go to the polls and cast your ballot.

I was first introduced to the alternative vote back in 2003 when I started my studies at the University of York and decided to run for election to the Halifax College Students Association (as it is now known). As I became engrossed in campaigning and the fervour of the election trail I came to realise that AV has many flaws, interestingly some of which are not being actively mentioned by the current No to AV campaign.

Initially I noted that the primary flaw seemed to be the time taken to count. In first past the post each ballot paper is required to be reviewed only once, whereas with AV you review some ballot papers a number of times; if the top candidate has less than half of the votes then you review all the papers for the candidate with the lowest number of first place votes to decide if to discard the paper or add the vote to one of the remaining candidates. This could, in theory, continue until almost half of the ballots have been reviewed at least twice. Despite what the yes campaign says there is no way that this can possibly counted as fast as first past the post with standard resource allocation. If they wanted to compete on speed then they’d have to have more counters or resort to electronic voting. For reasons of cost and reliability neither of these two options seem palatable, even to many in the yes campaign. The final nail on this one of course is that if we just accept it will take longer, keeping the count manual and the number of counters the same, our “morning after” results that we currently enjoy (and the excitement of election night) may well be a thing of the past. As someone who has enjoyed election night even since before I was able to vote this is not something I’m willing to let go easily.

It’s probably possible to infer what my next gripe was based on the above, the increased likelihood of counting mistakes. While I’m sure all counts are and would be conducted to a high standard, the vote re-distribution factor in AV along with the increased number of ballot paper options increases the probability that a good counter will make accidental mistakes. Given the counting time factor, if the vote is close, called into question and a recount requested (as is sometimes the case for certain marginal seats) this process could take longer. Don’t get me wrong, I’m a quality over quantity person but I also subscribe to the Keep It Simple Stupid (KISS) principle; if something can be done simply with less chance of error than that is usually the best approach unless there are compelling reasons not to. This of course applies equally to the voter making their choices on the ballot paper although given how long polls are open for during the day any slight time increase in voting time is unlikely to cause any problems.

My final and certainly biggest issue with AV (indeed my decision really rides on this issue) is the political spectrum conundrum. Many of the worked examples you’ll find online for how AV works show a scenario in which there are several similar candidates politically with small but defining differences between them and one politically different candidate. In this situation AV outperforms first past the post in fairness as those placing the several similar candidates in ranked order will ensure one of them gets elected over the politically differing candidate thereby ensuring the political wishes of the majority are catered for. This however assumes a certain polarity of political spectrum in each constituency and in the UK we simply do not have that. Most common is the 3 party ballot in which most votes are shared between them. In AV, the temptation would be to rank amongst these three but politically this makes little sense as if you drew a venn diagram of how policies overlapped you’d find little in common. The result of this is that voters are tempted to mark on the ballot against more than one candidate under the perception of increased choice when in fact doing so is increasing the chances that a party that does not sit well with their true political opinions being elected. This also increases the chances to engage in tactical voting. At present tactical voting goes on but based on past results and opinion polls as you can only vote for one candidate. With AV you can deliberately set out to disadvantage one candidate over others by simply ranking all the others and leaving the last candidate off the ballot. Clearly not everyone will do this but something that even has the potential to encourage people to focus on voting out a candidate rather than voting one in somewhat defeats the objective of polling political opinion which is, after all, what a general election is really about.

Having said all of that, ultimately everyone must make their own decision and I’ve no doubt that many will disagree with my views and my rationale behind them. Whatever you believe though be sure to do one thing; as I said at the start, go out and vote. To stay at home is to let others decide for you and as always when it comes to the decisions others make on your behalf, you might not like what they choose.

Comments (3)    

European Road Trip Photos

They’ve taken a while to sort through and collate but I’ve just finished uploading my photo collection from my European Road Trip that I took in September 2010 with Chris Worfolk, Norman Ralph and George Shore. Click on any of the photos below to be taken to the trip album.

European Road Trip PhotosEuropean Road Trip PhotosEuropean Road Trip PhotosEuropean Road Trip PhotosEuropean Road Trip Photos

To connect the trip properly I’ve tied all comments and track backs from the trip commentary of others into this post and also provide a link to the trip tracker which has now been made static and serves as a log of the highs and lows of the journey and our stopping points.

Comments (10)    

Stiff Gearbox

It appears my car is not all that well. At the start of this week the gearbox was a little stiff, but then we had a cold snap and that sometimes happens. On Thursday I knew I had an issue. I could barely select first gear and the other gears were getting stiffer too.

I contacted my local VW garage in Swindon to book the car in to investigate and they couldn’t fit me in for diagnostics until 21st February which is quite a wait. Given that I had little choice but to accept the date and hope for the best in the meantime, I did so, and I’ve been limping round town since.

Over the weekend I had cause to drive a little further. I collected Shweta from the railway station on Friday evening and had the delights of pulling out of the station in 2nd gear, up a hill. Then we travelled to Avebury for dinner (more on that in a later post) and mercifully, despite the distance the drive was easy as it was country roads 5th gear most of the way.

Sunday was showdown time as I headed up to Milton Keynes to do some skiing practice at the snow dome. The journey there was fine, little traffic made gear usage easy but on the way back I got stuck in traffic on the M40 and almost simultaneously found I was unable to get second gear as I had been unable to get first.

Needless to say it was a painful experience but the old girl got me home. I doubt however that I doubt she’ll be going much further than to the office from now until the garage appointment.

As luck would have it I picked up my skiing technique again very quickly and so don’t feel the need to ensure I go back to the snow dome every weekend before my trip. Good job too, wouldn’t want to have to get back on even fewer gears!

Now for the mechanics amongst you. I’m able to cleanly select all gears when the engine isn’t running. It’s only when I start up the car that the gearbox is stiff and refuses to engage. When it does engage however it does so cleanly without “crunching”. Any ideas most welcome, and of course reassurance that the repair costs won’t be sky high is always appreciated. Paying for a new gear box wouldn’t make my week it must be said!

Comments (4)    

Christmas 2009 Photos

While uploading new photos recently I noticed that I’d neglected to add to my gallery the snaps I took during my Christmas 2009 holiday in North Wales. I’ve now done this and they are available over in the photos section. There are some particularly good shots taken on the beach during a walk on Christmas day, superb clear sky and low winter sunlight.

Comments    

Home VPN

I’ve written an article over on RouterTech about how to setup your own home VPN server. It’s something I’ve mentioned to a few people lately that I use so I figured it was time to share exactly how it’s done. Questions and comments are of course always welcome over on the RouterTech forums.

Comments    

Broadband Upgrade

Today I had my FTTC broadband upgrade installed from XILO and here are the latest statistics from reputable testing sites

Speed Result

Ping Result

I certainly couldn’t be happier with the improvement!

Comments (8)    

Next entries » | « Previous entries