Recover 'stuck' messages in Mail.app folders

Jan 28, '05 08:16:00AM

Contributed by: Zonker1967

Mail.app allows you to organize your messages into folders and sub-folders. This is frequently combined with Rules for automatic sorting of incoming messages. Visually in Apple Mail, there are two kinds of folders: a blue icon folder (mailbox) can contain messages and sub-folders, while a white icon folder (folder) can only contain sub-folders (more info on mailbox colors). Or, so I thought.

Today, I received an email which was automatically sorted into one of my folders, called "Website." The problem was that when I created the rule, Website was a mailbox (blue icon), but had since become a folder (white icon). Yet, there was the Website folder staring me in the face, in bold and with "(1)" appended telling me that there was a new message in there for me to read. But, I could't read it. After some playing around, I found a solution using both Mail and Terminal.

  1. Using Mail, create a new sub-folder of Website. I called it "A."

  2. Open Terminal and go to the directory where "Website" is located. In my case it was, ~/Library/Mail/Mailboxes/Website. In this directory, I found two interesting files, Incoming_Mail and Incoming_Table_of_Contents, which had been modified today. A quick look at the first confirmed that this was where my new message was. I also saw my newly created, and therefore empty, mailbox "A.mbox"

  3. Copy the Incoming_Mail file to A.mbox with a new name:
    cp Incoming_Mail A.mbox/mbox
    
  4. Return to Mail and highlight the A mailbox and select "Mailbox | Rebuild" from the menus.
VoilĂ ! Your messages should be visible now. After you confirm that your messages are indeed present, you can delete Incoming_Mail and Incoming_Table_of_Contents. Hope this helps!

Comments (1)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20050126045700980