Thursday, November 11, 2004

Uploading to Gmail

I recently signed up for a Gmail account. Normally, I get my mail through my ISP and download it to Outlook, and I want to keep doing this. At the same time, I'd like to have Gmail as a backup and a permanent store that I can access anywhere. There are some tools on the web for uploading your email to Gmail, notably GMLW. However, none of them work with Outlook, and though there are utilities which will extract from Outlook into a format GMLW can use (e.g. outport, readPST), I have not found them to work very well.

So I am writing some Perl scripts to do this. It's not too hard to read the Outlook mailbox, but there are some suprisingly difficult things, such as finding the email address of the sender, the reply-to address, and determining whether the message is plain text, RTF or HTML. In the case of RTF orHTML, there is also a problem of decoding it from the compressed form that Outlook uses. I've found solutions to most of these problems, through a combination of playing around, porting scripts from other languages (e.g. the RTF decompressor and the HTML-from-RTF extractor), and just picking up tricks here and there (e.g. how to get the SMTP transport headers).

The scripts are not yet ready to use, but I am working on them. Leave a comment if you might be interested.