Microsoft Exchange email access without IMAP through Python...help needed!
I'm looking for some Python or iPhone POP3 help. Read below for the full explanation...
Since I got my iPhone, I've been searching for a way to get my work email to work on it. Of course, my company can't (won't) enable IMAP. We have Outlook Web Access, but sadly, that won't load in iPhone's Safari either due to some kind of compatibility problem. Sure, there's Synchronica, but it's a pain and only free for 60 days.
So I started thinking about creating an app or script that could screen-scrape Outlook Web Access behind the scenes and present my email in a nice, iPhone-like interface. Surprisingly, I found just the thing already made for me. Adrian Holovaty wrote a simple python script that collects email from OWA and serves it up locally as a 'fake' POP3 server. It's called weboutlook. Now having Python already installed on my iPhone doesn't seem quite as useless.
His script is made to work on an OWA site that uses forms-based authentication, so I had to make a number of modifications to use it with my HTTP-authenticated site (you'd know if it uses HTTP by the login box popping up rather than appearing as part of a web page). I can't get the code to attach to this post for some reason, but if anyone wants my version, let me know.
So the scraper/POP server runs great on my laptop. The only thing you need to do to the script is to put your OWA server address after 'WEBMAIL_SERVER =' in popdaemon.py. Then just install python (if you don't already have it), chmod +x both .py files, and run 'python popdaemon.py' from your Terminal or command prompt to start the POP server. Then set up a POP account in your favorite email program and point it to the fake POP server, 127.0.0.1 at port 8110. Use your OWA login for username and password and the emails from the first page of your Inbox should show up in the new account.
Unfortunately, it does not work when installed/run on the iPhone. Using all the same settings, I just get 'cannot connect to POP server' errors. Using SSH, I have confirmed that the scraper is functioning (and successfully downloading emails) from the Python command line. It appears that the POP server is also running, but I'm having a hard time debugging due to the lack of an iPhone telnet client (anyone know of one?).
I am by no means a Python expert so I don't know what could be preventing the iPhone from seeing the POP server. It does use the same libraries that WebShell uses to serve webpages, which is reported to be working on the iPhone, although I haven't tried it yet. If anyone else gives it a try, please let me know if you get anywhere.
Finally, a question about security. The password is sent from Python to OWA over HTTPs, so security should not be an issue there. However, you are logging into the local fake POP server without any encryption. This does not concern me on a firewalled computer, but could there be a possibility for abuse of the script on the iPhone?