Gmail Import
Before I was using Gmail only for private emails – now I am using it for all my daily messages. Again I had to import some of my existing mails. Bertrand has already blogged some excellent instructions on how to do that. Some things I did differently though.
For one I wanted the subject line change to be as little disturbing as possible. (Gmail so needs an overhaul of its filter facilities!!) So I just added an “_” to then end of the subject and filtered on that.
sed s"/^Subject: \(.*\)$/Subject: \1 _/" < inbox.mbox > inbox.mbox.marked
I also modified the GML script to save the state of the import. So you can hit Ctrl-C at any stage of the import and continue later on. It now also writes out an error mbox file with message that could not be imported. (I had a few that the python library failed to parse). For the mail server to use check the Gmail MX record.
dig mx gmail.com
So I used…
python ngml.py mbox inbox.mbox.marked [email protected] gsmtp183.google.com.
You can get hold of the modified GML script here.