Everyone who is migrating to Gmail loves the google search feature for all your new mail, but wouldn’t it be nice if you could get all of your old email messages into Gmail from your Mac OS X Mail.app without forwarding the thousands of messages you’ve accumulated over the years by hand?
Mark Lyon wrote a great little PC program in python that automates importing your old email messages to your gmail account. The site instructions and the program are for Windows and work great, but what about us Mac users?
He was nice enough to include the python source code that also happens to work with Mac OS X, but for those of you that have no idea how to run python scripts, or don’t even know what python is and have no clue about mbox files, I’ve written a simple applescript that uses the terminal to automate the process for all of your mailboxes.
The script requires you to download Mark’s source code, modify a few settings and then click run to automate the process for all of your Mac OS X Mail.app mailboxes, while allowing you to exclude other mailboxes.
1. Download Mark’s script to your Desktop. Instructions Here.
2. Download my gmlAutomator AppleScript.
3. Open the script in Script Editor.
4. Modify the properties at the top of the script
5. Run the AppleScript.
Update:
Another even more simple way to accomplish this was sent to me by Ken. The process is to create a new rule in Mail.app with the action “redirect to
[email protected]”. Have it match whatever messages
you’re interested in bouncing up to gmail, for example all of
’em. Select the messages you’re interested in sending off and
run Message -> Apply Rules. Done!
If you leave the rule in, new (matching) messages will also get
bounced to gmail (and still preserved in Mail.app).
Kelly Friedman points out the following:
I finally got it to work (or at least it seems to be working right now, I’ll find out later).
First of all, you need the older version of the script, which doesn’t require Python Widgets. This can be downloaded here (choose the Linux version at the bottom):
www. marklyon .org /gmail /old /default.htm
Secondly, I use IMAP accounts, and the script doesn’t work with those. So what I did is created a folder “On my Computer” called “Gmail” and option-click-dragged all the e-mails from one folder into that mailbox.
Then, within the script, I set my path to:
property mymailboxpath : “/Users/ kerim /Library /Mail /Mailboxes/”
and I changed the following line:
else if eachMbox does not contain “.mbox” then
to
else if eachMbox does not contain “Gmail.mbox” then
That way it only works with this one folder.
I run the script. Delete all the messages, apply the appropriate Label to all the messages online in Gmail, and then I repeat the process with the next folder.
Hopefully it will work!
Blatant Dog says:
Thanks for the script! it worked like a champ!
June 18, 2004 — 6:56 pm
Blatant Dog says:
Just as a follow-up, I had 40MB of mail, (978 pieces) and it took about six hours to move it all…But is was all done while I did other things thats to this script.
June 19, 2004 — 9:36 am
noel says:
umm…what?
June 19, 2004 — 6:45 pm
Jared Hawkins says:
I get this message in the terminal:
*** Can’t open file or directory. Is the path correct? ***
June 19, 2004 — 10:38 pm
robothouse says:
I gave this script a shot, but it doesn’t do anything… no return codes, etc, nothing…
June 21, 2004 — 11:29 am
Tim says:
The paths are case sensitive. Make sure you entered your username exactly as it’s labled in your home folder. Or, just use the “mail rule” method above instead. It’s much more mac user friendly if you’re sheepish about AppleScripts.
June 21, 2004 — 12:02 pm
robothouse says:
Yeah, I did the case sensitivity stuffs… mail.app rule sounds way beter… running it now ๐ thanks!
June 21, 2004 — 3:16 pm
will says:
MUPPETS!
“I get this message in the terminal: *** Can’t open file or directory. Is the path correct? ***ร@รJune 19, 2004 10:38 PM”
Well duhhh you need to *edit* the first few lines of the script.
RTFM!
“4. Modify the properties at the top of the script”
June 21, 2004 — 4:11 pm
mrdiron says:
Just a note – your script assumes that you only have one account in Mail.app, or rather, assumes that Mail.app handles multiple accounts in a sane way. You pretty much have to do it by hand, if you have multiple accounts. I guess email me if you can’t figure it out.
June 24, 2004 — 10:45 pm
Dan says:
Um. Dude. I have 7 accounts and it worked fine for me.
June 25, 2004 — 1:26 am
jim says:
think the python script has been edited – download link is www.marklyon.org/gmail/gmlw.tar instead and the file is gmlw.py and there are some failures to load some modules in python…
the alternative method of forwarding is that old mails will not have the correct time stamp…
any suggestions? thanks.
July 9, 2004 — 8:34 am
Macuser64 says:
I did both the rule and the apple script. I’m not sure which one is working, but it is! I was just about to give up, because when I ran the script, I got 4 windows, but frankly didn’t know what to do with them and then Gmail refreshed and there was the test message I sent to myself.
Thank you!
July 9, 2004 — 11:52 pm
Tom says:
Getting an error about ‘Tkinter not running’ or something like that…
July 11, 2004 — 2:55 pm
Alan says:
I tried the redirect idea but it looks like not all my email got to google.
Does anyone know if the count google gives is of threads or messages? If threads, how to count messages?
Thanks
July 13, 2004 — 9:41 pm
Metrom says:
Is there a way to export from Mail.app to Gmail WITHOUT losing the timestamps?
August 11, 2004 — 5:01 am
John says:
When I run the apple script, it seems to just send over the first six messages then exit properly. Unfortunatly, I am sure I have over a thousand messages. Anyway I can troubleshoot what the problem is? When running a second time, it sends over the first six messages again from the same mail account.
Help!
๐
August 20, 2004 — 11:48 am
removed says:
removed
June 24, 2004 — 7:21 am
Chris says:
You Guys Rock!!!!!! Works like a champ.
September 23, 2004 — 9:58 pm
r33k5 says:
this works pretty well if you download mark lyon’s 0.4 version. However, the timestamp that you see in your gmail inbox will always be the date gmail received it; if you open the message, you get the correct date. This goes for both the python script as using the filters in apple’s mail.app. So just go with that if you’re not into the techy stuff!
November 14, 2004 — 5:52 pm
Ben says:
Hello all…I am a retarded…this is all way over my head.
I am running Tiger on a Powerbook G4. My old mail client is entourage. How do I set this program up to run with those parameters? If someone would be so kind as to give me a more or less step by step guide as to how to do this…that would be unbelievable.
Much appreciated,
-b
June 22, 2005 — 4:12 pm
Mike says:
I just transferred my emails from Entourage and at many points I didn’t think it was going to be possible. I changed email hosts and had little data to “pop”. It was all on my machine.
I found a way to do it, different from yours, but it worked well and I want to get the word out.
Hoping for link to the how to…so others don’t have to waste 20 hours figuring out how to do this.
Thanks,
–Mike
mikestask.googlepages.com
September 9, 2007 — 10:06 pm
Idetrorce says:
very interesting, but I don’t agree with you
Idetrorce
December 15, 2007 — 7:18 am
nibo says:
I know that this was published a long time ago, but it’s still in use! I’m in the process of migrating 6 months of work email to gmail and am breathing a sigh of relief! Thanks!!
February 29, 2008 — 4:56 pm