Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

How to undo Mail Rebuild.

O.K. I did it one more time by blindly following leads to solve a problem with my mail

When starting Mail I -was able to- read the messages in my inbox. After awhile they disappear giving me a msg where normally the email body is read: "The message from Wayne Mallett <wayne@domain.com> concerning “Mail Subject” has not been downloaded from the server. You need to take this account online in order to download it."

So I looked online here :

http://forums.macosxhints.com/showthread.php?s=&threadid=29787

and followed the following link from one of the postings:

http://docs.info.apple.com/article.html?artnum=25812

And did a mail rebuild .

All the files in my in-box disappreared.

I quit and restarted mail and it did someindexing and total files in inbox now is zero ( + a couple of new emails), and thousands of mails in my inbox seem to be gone.

Is there any way that I can undo this rebuild and get the files in the inbox back?

Someone please help!

emac, Mac OS X (10.3.x), Mail1.3.11 (v622/624)

Posted on Nov 26, 2007 6:16 PM

Reply
Question marked as Best reply

Posted on Nov 27, 2007 11:11 AM

As you can see, letting a mailbox grow indefinitely is a really bad idea. If you’re just starting to experience the problem, doing what the Overstuffed mailbox is unexpectedly empty article suggests might work. If you’ve let the problem to become worse over time, however, it may be too late to solve it as described in the article, but you may still be able to fix it as follows:

1. Quit Mail if it’s running.

2. Assuming this is a POP account, in the Finder go to ~/Library/Mail/POP-username@mailserver/.

3. Locate INBOX.mbox and move it to the Desktop.

4. Open Mail. A new empty INBOX.mbox will automatically be created within the account folder, and this will allow you to continue using Mail normally while trying to solve the problem.

Although INBOX.mbox appears to be a file, it’s actually a special kind of folder (a package) that contains several files. Ctrl-click on INBOX.mbox and choose Show Package Contents from the contextual menu to see the files it contains. Of these files, mbox is the most important and is where all your messages are stored. What’s the size of that file? Depending on its size, you may or may not be able to directly import it back into Mail in the next step.

An Incoming_Mail file may also be present, in which case it might contain messages that Mail couldn’t transfer to mbox. Incoming_Mail is also a standard mbox file like mbox proper, just named differently, and can be imported back into Mail in the same way.

5. In Mail, do File > Import Mailboxes and follow the instructions to import the INBOX.mbox that’s on the Desktop. I’m not sure what the import options available in Mail 1.x are, but you should choose Other / Standard mbox or something like that, so that Mail looks at the mbox file only (and Incoming_Mail, if present) and ignores the other files in the package.

If Mail doesn’t let you select INBOX.mbox in step 5 because it’s a package instead of a plain folder, rename INBOX.mbox to just INBOX (i.e. remove the .mbox suffix) so that it becomes a normal folder, and try again. You cannot do this directly in the Finder because removing a suffix by normal means causes the Finder to hide the suffix instead of renaming the file. To remove the suffix from the name, you must do File > Get Info (⌘I) on the file and change the name there.

If the mbox file is too big for Mail to handle it, however, you’ll have to break it into smaller pieces. You can do that with an MBOX Breaker Script available at Allan Sampson’s website, or with Emailchemy. The former will ignore the Incoming_Mail file that I mentioned previously, but you may try importing that file directly if it’s not too big or just ignore it if all your messages are in mbox. Also, if you removed the .mbox suffix from the name of the mailbox, you may need to add it back again for the script to recognize it.

If all is well and you don’t miss anything, the files on the Desktop can be deleted, although you may want to keep them for a while, just in case.

Note: For those not familiarized with the ~/ notation, it refers to the user’s home folder. That is, ~/Library is the Library folder within the user’s home folder, i.e. /Users/username/Library.
13 replies
Question marked as Best reply

Nov 27, 2007 11:11 AM in response to hadjibaba

As you can see, letting a mailbox grow indefinitely is a really bad idea. If you’re just starting to experience the problem, doing what the Overstuffed mailbox is unexpectedly empty article suggests might work. If you’ve let the problem to become worse over time, however, it may be too late to solve it as described in the article, but you may still be able to fix it as follows:

1. Quit Mail if it’s running.

2. Assuming this is a POP account, in the Finder go to ~/Library/Mail/POP-username@mailserver/.

3. Locate INBOX.mbox and move it to the Desktop.

4. Open Mail. A new empty INBOX.mbox will automatically be created within the account folder, and this will allow you to continue using Mail normally while trying to solve the problem.

Although INBOX.mbox appears to be a file, it’s actually a special kind of folder (a package) that contains several files. Ctrl-click on INBOX.mbox and choose Show Package Contents from the contextual menu to see the files it contains. Of these files, mbox is the most important and is where all your messages are stored. What’s the size of that file? Depending on its size, you may or may not be able to directly import it back into Mail in the next step.

An Incoming_Mail file may also be present, in which case it might contain messages that Mail couldn’t transfer to mbox. Incoming_Mail is also a standard mbox file like mbox proper, just named differently, and can be imported back into Mail in the same way.

5. In Mail, do File > Import Mailboxes and follow the instructions to import the INBOX.mbox that’s on the Desktop. I’m not sure what the import options available in Mail 1.x are, but you should choose Other / Standard mbox or something like that, so that Mail looks at the mbox file only (and Incoming_Mail, if present) and ignores the other files in the package.

If Mail doesn’t let you select INBOX.mbox in step 5 because it’s a package instead of a plain folder, rename INBOX.mbox to just INBOX (i.e. remove the .mbox suffix) so that it becomes a normal folder, and try again. You cannot do this directly in the Finder because removing a suffix by normal means causes the Finder to hide the suffix instead of renaming the file. To remove the suffix from the name, you must do File > Get Info (⌘I) on the file and change the name there.

If the mbox file is too big for Mail to handle it, however, you’ll have to break it into smaller pieces. You can do that with an MBOX Breaker Script available at Allan Sampson’s website, or with Emailchemy. The former will ignore the Incoming_Mail file that I mentioned previously, but you may try importing that file directly if it’s not too big or just ignore it if all your messages are in mbox. Also, if you removed the .mbox suffix from the name of the mailbox, you may need to add it back again for the script to recognize it.

If all is well and you don’t miss anything, the files on the Desktop can be deleted, although you may want to keep them for a while, just in case.

Note: For those not familiarized with the ~/ notation, it refers to the user’s home folder. That is, ~/Library is the Library folder within the user’s home folder, i.e. /Users/username/Library.

Nov 27, 2007 12:36 PM in response to hadjibaba

Hi Sol. You’re welcome.

Moving the inbox to desktop just creates a copy and the inbox


Not sure what you mean. Moving a file/folder (be it a mailbox or anything else) to another place on the same disk using the Finder doesn’t create a copy. A new (empty) INBOX.mbox will be created automatically by Mail the next time you launch it, however, as I explain in step 4...

Nov 27, 2007 1:00 PM in response to David Gimeno Gost

David,

I am aware of the fact that moving files on the same disk, should just move them and not copy them but it did so.

I dragged INBOX.mbox in POP directory to the desktop.

I looked under the POP directory and INBOX.mbox is still there and still 990 meg in size.

Mail is not active and has not been active during the time that I have done this. Mail is still not running so the INBOX.mbox that is under the POP directory of library/mail is still the one that was there and not a recreated one by running the mail program.

Nov 27, 2007 1:46 PM in response to hadjibaba

This doesn’t make sense. It’s as if ~/Desktop and ~/Library/Mail were on different volumes on your computer...

Verify/repair the startup disk (not just permissions), as described here:

The Repair functions of Disk Utility: what's it all about?

What happens if you trash the original mailbox that remains in the account folder after having “moved” it out of there? (Quit Mail first and don’t empty the Trash afterwards, just in case).

Nov 27, 2007 2:40 PM in response to David Gimeno Gost

David,

I will not start mail until I get to the point where I am going to try to import the inbox.

I did not read through the link you listed and kind of assumed that I know disk repair . If I should have, please let me know. I am pretty much aware of Disk Utility , and its functionality as far as Verify/repair of Permissions / Disk.

I am aware of the fact that it should move a file if the origin and destination are on the same disk. Maybe that is an exception ?

I have repaired disk permissions using apple's disk utility. It makes the follwoing corrections:

Permissions differ on ./private/var/log/install.log . should be -rw-r--r-- , they are -rw-r-----

Corrected

Permissions differ on ./private/var/log/wtmp . should be -rw-r--r-- , they are -rw-r-----

Corrected.

I ran repair disk. No problems were encountered and disk is clean.

I thereafter moved the INbox.mbox to trash. It moved it to trash. I then moved it back from trash to the pop directory.

Just for the sake of it, I made a duplicate of INBOX.mbox ( File Duplicate command) which I hope is not a no no, and left it in the pop directory. If this is a problem , let me know and I will delete it. I just wanted to try to keep a copy just in case I trash the main INBOX.mbox which is now on the desktop.

I then tried to move the INBOX.mbox to the desktop. It moved it this time.

So should I now proceed with starting mail and continuing on the path you set previously?

Thank you again,

Sol.

Message was edited by: hadjibaba

Nov 27, 2007 2:58 PM in response to hadjibaba

You’re welcome.

What you described doesn’t make sense to me and I’ve never seen anybody reporting something like that before, but if it works as expected now, or you can copy the mailbox elsewhere then trash the original, you may follow the procedure I suggested.

What I don’t recommend you to do is to keep extraneous files within the ~/Library/Mail/ folder. Whatever you do should be equivalent to moving the problematic INBOX.mbox out of there. If you want to keep an additional copy of the mailbox, just in case, put it elsewhere — be careful you don’t run out of disk space, though.

Nov 27, 2007 3:36 PM in response to David Gimeno Gost

Hi David,

I restarted mail.

I tried importing the INBOX.mbox using two different options one being other and the other being Mail for Mac OS X. Neither is seeing INBOX.mbox as an acceptable file format.

I then renamed INBOX.mbox through the GET INFO pane to INBOX

I then tried again to Import again, using both "OTHER" and "Mail for MAc OS X" option. They both see the INBOX ( which is a folder) but the file mbox under the INBOX folder does not highlight which I guess means that it does not recognize it as an acceptable format.

So I am at a loss at this point as if I should proceed with the break script you suggested or if I should do something else?

Mail is also running currently with a basically empty Inbox.

Sol.

Message was edited by: hadjibaba

Nov 27, 2007 4:08 PM in response to hadjibaba

Importing that mailbox as Mail for Mac OS X wouldn’t work, just like rebuilding the mailbox didn’t work in the first place. You must choose Other so that Mail looks at the mbox files only and ignores the rest.

Pay attention to the instructions that Mail displays when choosing Other as the data format. In the next step, Mail wants you to select the folder that contains the mbox files to be imported, not the mbox files themselves, which is why they appear greyed out.

Mail could very well be unable to import the mbox file directly, but it should at least let you try to do so, and is worth a try if for no other reason because Mail may be able to import the Incoming_Mail file if present, which is simply ignored by the breaker script.

Nov 27, 2007 4:33 PM in response to David Gimeno Gost

Hi David,

I really appreciate you taking time to run me through this step by step. It seems like one becomes blind when working on one's own problem. I am not really as ignorant as it might seem but tend to be not focused when I work on a problem of my own. I guess its just the stress that causes it. Had I opened my eyes nd read everything , I should have known that its looking for the folder and not file.

At any rate, I tried importing the mbox file in the INBOX folder on desktop. It goes to next step, recognizes the mbox and on the next step when the import starts, mail crashes. I have saved a copy of crash dump should you want to look at it. I did not want to post it on here and I don't know how to send it to you through email.

I guess it crashes because the mbox file is too big . It is 990.2 MB or ( 1,038,325,655 ) bytes.

So where to next? Should I attempt to fragment the mbox through the scripts you suggested?

Sol.

Nov 27, 2007 5:00 PM in response to hadjibaba

You’re welcome. Don’t worry.

So where to next? Should I attempt to fragment the mbox through
the scripts you suggested?


Yes. The information to fix this problem is all in my first post. As I said there, if the mbox file is too big for Mail to handle it, you’ll have to break it into smaller pieces.

BTW, not sure why your profile says Mac OS X 10.2 now. Please update the Operating System field on your My Settings’s profile (and click Save), so that it accurately reflects the version of Mac OS X you’re running now — and providing the exact Mac OS X version would be better than just saying 10.3.x.

Nov 27, 2007 7:58 PM in response to David Gimeno Gost

Hi David,

I am done and hopefully what I recovered is everything and in its entirety.

Here are some points for the others that might be having my problem.

If you are getting the message "Message has not been downloaded from the server, take this account online to view.", DONT JUST RUN REBUILD. Make another mailbox and move 1/2 of the stuff in the affected mailbox to the new mailbox, and then spend time to clean up both the problemed mailbox and the new one you created by deleting emails that you dont need and are done with or moving them into other / new mailboxes. Had I had ran into a message like this , I probably would not have had to do any of this.

I downloaded and ran the script which has some shortcomings ( at end it asks you if you want to import the broken down files and then quits) and it basically split the file under INBOX.mbox in to 4 files. I then tried to import them through mail ( File/import) which has its own shortcoming ( it lists all 4 broken down files and selects them but only imports one, so basically you have to move each .mbox file to a different directory and import them one at a time. The naming convention stays ( YOu start with INBOX.mbox on your desktop to use as input for the script, and the broken down files will all be in .mbox format . You can use both "Mac OS format" or "other" format when importing ( I used other for the first and Mac OS Mail format for the other three.

I am not sure if all files are here as the start should reflect like August of 2004 but reflects may of 2006 , and classically the import function on mail is really poor and not trustable ( I did import bunch from another computer several years ago and after doing so , I started a one to one comparisson and dound out that just the first few hundered were imported and rest were just blank).

At least I have something that I can look at now and worry less. Maybe a couple of years down the road , I will find out that a whole bunch of files were gone and or not imported but for now I am happy.

And last but not the least, I greatly appreciate your minutewise assistance, as without it , I probably would have committed suiside by now.

Thank you again so very much.

Sol.

Nov 29, 2007 10:07 AM in response to hadjibaba

Hi Sol.

Glad to know, and thanks for posting back with your observations.

If you are getting the message "Message has not been
downloaded from the server, take this account online to
view.", DONT JUST RUN REBUILD. Make another mailbox
and move 1/2 of the stuff in the affected mailbox to the
new mailbox, and then spend time to clean up both


Not sure what you mean. You wouldn’t be able to move anywhere a message for which Mail shows that error, because what the error means is precisely that Mail has lost access to the contents of the message. You can only move to other mailboxes messages to which Mail has full access, i.e. messages for which it doesn’t display the error instead of the message contents...

What you can do if the problem is starting to happen and hasn’t become unmanageable by normal means yet, is try what the Overstuffed mailbox is unexpectedly empty article suggests (other than rebuilding the mailbox) to try to regain access to those messages, then move them to other mailboxes.

I downloaded and ran the script which has some shortcomings


That’s why I always suggest trying to import directly into Mail first and also mention a more robust (albeit not free) alternative ( Emailchemy) — I must say that I personally haven’t tried either, though.

A shortcoming you haven’t mentioned, but I did in a previous post, is that the script ignores the Incoming_Mail file that, if present, may contain messages not in mbox proper. That file is usually smaller than mbox, and hence, can usually be imported directly into Mail as Other / Standard mbox.

it lists all 4 broken down files and selects them but only
imports one, so basically you have to move each .mbox file
to a different directory and import them one at a time.


This doesn’t make sense to me. If there is nothing wrong with any of the mbox files being imported and you can import them separately, you should be able to import all of them at once as well. Actually, that’s precisely the reason Mail wants you to select the folder that contains the mbox files to be imported rather than the mbox files themselves, i.e. to make it possible to import multiple mailboxes at once...

Maybe a couple of years down the road, I will find out that a
whole bunch of files were gone and or not imported


Don’t get rid of the original mbox files until you’re sure you don’t miss anything.

Best wishes.

How to undo Mail Rebuild.

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.