Gmail Import, the Geeky way.
So I’ve had this blog/journal for a long time now, since 2002 I think. And I realized that it’s not very often that I do post an entry that resembles that of most other bloggers out there. I’m usually posting about some horrible thing in my life, or something wonderful, but this time, i’m giving back.
So I wanted to finally figure out how to import my mail to gmail. I searched the net and couldnt find much of anything I havent tried already. gExodus, gMail Loader, and some other random ones, just never seem to work for me. I converted my dbx(outlook express) mail files to mbox using different programs and even “cleaned” the mbox once it finished converting, but nothing worked flawless for me. The programs would usually stop after like 10, 20, and sometimes 100 messages and just lock up. Well, I remembered that a friend of mine told me he was very successful with his gmail import when he used a program called Fetchmail. I wish i could claim the smarts behind this one, but I cant. Creadit goes to this guy. I figure if its posted in more than one place people will be able to find it easier. I couldn’t find that guys post anywhere in the first couple pages of a google search for gmail import. I’m not a linux guru yet, so i really wasnt sure what distro to install and start my venture into fetchmail. I ended up picking ubuntu because it seemed to be called out as the easiest linux install or something. Dunno. Anyway, i downloaded the ISO and loaded up vmware. 5 minutes later I was able to use the synaptic package manager to install a packaged version of fetchmail and I plugged in the following:
fetchmail -k -a -p IMAP \
-S smtp.server.of.gmail \
–smtpname youremailaddress@gmail.com \
-u username.of.old.mail.server \
–auth password \ <— leave as password, it will ask for the password
-r “inbox”,”inbox/subfolder” \
-v oldmailserver.domain.com
Thats all you have to do. It works amazingly easy and I was able to move over all my mail. On top of moving the mail, I wanted to sort it. I decided that the easiest way of doing this would be to do the move in stages. So, I moved all the inbox mail messages, then archived them and set a label of “oldinbox”. After that I sent over each subfolder, one by one. After each subfolder was done, I set a label to the messages and set them to “read” and archived them. It didnt take long at all and now i have all my messages archived in a safe place.
One of the main reasons for posting this was that I couldnt figure out what to use as the mailbox directories under the -r command. The original poster used inbox, inbox.blah, inbox.bleh, etc. But none of those worked for me. I tried a bunch more before I came to what now seems like a completely logical syntax. Should have started there in the first place. :p