I work for a company that uses Exchange for its internal email. This means I have to use Outlook Web Access to access my account there, since I am 100% remote, and Entourage doesn’t work over our VPN.
WebOutlook 0.3 released, with DELE support, and a bugfix. Download here.
Wouldn’t it be nice if we could scrape this in some way, and perhaps publish it with a regular POP server? Then Gmail could access it and merge it with our other accounts.
Thankfully, Adrian Holovaty1 has written WebOutlook, a Python script to do just that. Except, it doesn’t support Gmail because the
UIDL command isn’t implemented. Also it doesn’t support the HTTP Basic Authentication Scheme, which is how my particular OWA server authenticates me. Also, it deletes your mail without asking. Ok…
After a few hours of reading RFC 1939 and struggling with Python’s combinatorics of tuples, dicts, and primitives, I am pleased to release WebOutlook 0.2, which you can download here. (GPL’ed because the original version is GPL’ed.)
- Python 2.4
- A web server (I’m actually using my local machine with a static IP)
- A Gmail account
- Set your Exchange server in
- Log in to Gmail, and go to “Settings”, “Accounts”, “Get mail from other accounts”
- Add a new account
- Check “Leave mail on server”
- Add a tag so you know where the messages came from
Now, watch as Google logs into your crappy local Python script and steals your mail out of your own house.
I welcome patches, and can give you subversion access if necessary. The following things need to be done:
- Make the authentication mode configurable
- Add support for sending mail
- Add support for folders other than the inbox
I had to write this thing in Python:
import re re.search(r"Message-ID: <(.*?)>", msg, re.S).group(1)
In Ruby I would have written:
msg[/Message-ID: <(.*?)>/, 1]
Or in POP:
REGX Message-ID: <(.*?)> STRG msg GETG 0 . +OK .
Just kidding about the POP. But I’m not really seeing the benefit of Python here, even with the shortcuts (
r instead of
re.S instead of
 Best known for playing the MacGyver theme song on acoustic guitar.