February 10, 2006, 12:41 AM ET
Python interface to Microsoft Outlook Web Access
Because I telecommute, I'm limited to using my company's webmail interface, Microsoft Outlook Web Access, rather than having direct POP or IMAP access to e-mail. This isn't ideal, for several reasons:
- Outlook Web Access has a horrendous user interface in any browser other than Internet Explorer. (And I'm on Linux, so I can't use Internet Explorer.) It's hard to search, the icons are unintuitive, it encourages top-posting and doesn't have the basic benefits of a desktop e-mail app, such as spell-checking and address auto-completion.
- Using webmail forces me to keep a browser window/tab open to check messages. And Outlook Web Access doesn't auto-refresh, so I have to remember to click "Inbox" every so often to get the latest messages. This is a huge disruption.
- It's just simpler and more efficient to have all my e-mail in one place.
So I figured I'd do a bit of programming to make my life easier. The result: weboutlook, a Python library that screen-scrapes Outlook Web Access. It can:
- Log into a Microsoft Outlook Web Access account on a given server with a given username and password.
- Retrieve all e-mail IDs from the first page of your Inbox.
- Retrieve all e-mail IDs from the first page of any folder in your webmail (such as "Sent Items").
- Retrieve the full, raw source of the e-mail with a given ID.
- Delete an e-mail with a given ID (technically, move it to the "Deleted Items" folder).
Also, I've included a Python implementation of a POP server that provides a POP interface to the scraper. This means I can point my desktop e-mail client at the script, my e-mail client will think it's a normal POP server, and my e-mails will download nicely into my desktop app, with the screen-scraper running silently behind the scenes.
I put this together in my free time, and it's been working nicely for a week, so I'm open-sourcing it for other poor souls who've been sentenced to use Outlook Web Access. I presented this at tonight's Chicago Python Users Group meeting and was surprised to see that, even in a group of only 30 people, 5 or 6 people used Outlook Web Access through their company. I hope somebody finds this useful.
Please send comments and improvements.
(Footnote: In doing research for this, I found MrPostman, which claims to convert various webmails into POP. It didn't fit my needs -- it's a bulky Java app and doesn't actually retrieve the raw source of Outlook Web Access e-mails -- but I mention it here in case it's helpful to somebody.)

Post a comment:
Comments on this entry are closed.
Don't see any comments? That's because my Web hosting provider has made a server upgrade that broke the commenting feature on this site. I'm working to restore that; please check back later.