To prepare for a possible clean install of the OS, I’ve been trying to move some local mail archives to the IMAP server, using Mail.app on OS X 10.11.1. Here’s how that’s going:
- I open the local “2004” archives folder in “On My Mac”.
- Select all message (about 8,000 messages in this folder)
- Drag them to the “2004” archives folder on the IMAP server.
- After a few minutes, I’ll see this:
What happened here is that while moving my messages, Mail hit one bad message.
This is so brain-dead. First, you’d think Mail could at least offer some kind of “Skip, and continue with the rest?” dialog (or just continue without one), but no… when it hits a bad message, it just stops the whole move process.
And what’s worse (or at least, as bad), is there’s no way to tell which message is bad, since the order in which Mail copies the selected message seems to be random!
As you can imagine, this makes the process of migrating mail so grueling and inefficient, that probably I’ll just give up.
Updates — I ended up not giving up, and here are some follow-up observations:
- A lot of sent mail messages from the years 2008 and 2009 wouldn’t import because of an “invalid header”. Inspecting these, I found lots of sent mail with the “from” header being “>From” rather than “From:”. I have no idea how that happened, but a global search-and-replace using BBEdit on those .mbox folders in ~/Library/Mail/V3 fixed that.
- When I initiated a transfer of, say, 15,000 messages, they would all immediately disappear from the source folder in Mail, and then one-by-one begin to appear in the destination folder. Every now and then, Mail would crash during the process. On restarting Mail, however, the source folder was still empty, and the destination folder only showed, naturally, those messages that were copied before the crash. I have no idea what happened to the remainder of the messages that didn’t get copied! To recover from this, I had to “import” the source .mbox files from backups, thereby creating some duplicate messages in the destination folder when repeating the mass transfer.
- Regarding the previous note, I’m wondering whether there’s any utility that can scan a folder of messages, removing duplicates?
- In order to prevent a CPU meltdown during the process of moving all these messages, I had to temporarily disable MailTags 4.