Saturday, December 20, 2008

Script to import mail from existing email account into google

I am writing a script to help our customers migrate from their current mail to google apps' gmail. Found a host of scripts on the net but finding one that works correctly not to mention even work proved a challenge. Too many of the script just fell short of what I needed. There were perl scripts, ruby scripts and also python scripts.

All of them just did not have the one thing I needed that is to convert the imap folders into gmail's labels. What about folders that have more than one level? Well I came up with the idea to convert them this way:

Original structure:
Level 1
=> Level2
Into a label : Level1_Level2

The normal mail migrate script that comes with gmail does not seem to convert imap folders into labels. Currently I am looking into using the libgmail library to do what I want. Ran into some trouble installing the source copy because it was looking for python-mechanize and one of the dependancy of python-mechanize is python < 2.5! Sheesh! Well poking around using google I found an older package of libgmail that did not need python-mechanize. Hopefully to be able to come up with early prototype by tomorrow. Has anyone built something similar?
Post a Comment