The Mac Observer

MGG Answers

How to Clean Up and Rebuild Apple Mail Data

Jim Tanous Jim Tanous
TMO Talk (13)

Question:

Joe writes: My Apple Mail mailboxes appear to have become corrupted; when I click on a mailbox in Mail, no messages appear. Following the instructions in Mail’s help files, I used the Mailbox > Rebuild command on an individual mailbox and it solved the issue.

My problem is that I have hundreds of mailboxes and it would be too time consuming to perform this step on each box individually. Is there a way to perform the rebuild command on all my mailboxes at once?

Answer:

Mail Mail Mail!

MAIL MAIL MAIL!

There are two methods to rebuild your entire mail library, including all of your mailboxes. The first is to navigate to a folder in your user directory. In Snow Leopard, this folder is ~/Library/Mail and in Lion it’s ~/Library/Mail/V2/MailData. Inside both of these folders is a file called “Envelope Index” that stores all your mailbox data, among other things.

Quit Mail, then delete this file. Once deleted, relaunch Mail and the file will be rebuilt, along with your mailboxes.

The second method involves using Terminal. Open up Terminal and type the following command using the correct path for your operating system. For Lion, it’s:

sqlite3 ~/Library/Mail/V2/MailData/Envelope\ Index vacuum index 

For Snow Leopard, the command is:

sqlite3 ~/Library/Mail/Envelope\ Index vacuum index

Remember, you should only have to perform one of these methods, not both. That should solve your problem and rebuild all of your mailboxes.

This question was originally answered on MGG 365: Building Mac & iOS Apps, Cleaning Mail, Taming Spotlight

About MGG Answers:

Each week Dave Hamilton and John F. Braun provide some great troubleshooting advice to listeners of the Mac Geek Gab podcast. Here with MGG Answers we share some of those tips with the rest of the world!

 

Recent Headlines - Updated May 25th

Thu, 7:56 PM
News - Jonathan Ive Tells BBC He Wants to Stay at Apple
7:44 PM
News - Apple’s European Head Departs
6:01 PM
News - Apple Pulls Rogue Amoeba’s Airfoil Speakers Touch from App Store
5:33 PM
Product News - Apple Updates Aperture for External Editors, Snow Leopard
5:23 PM
Mac Geek Gab Premium Podcast - MGG 399: Five Questions from Three Scotts
5:16 PM
News - Apple & Others Settle Mobile Lawsuit With Patent Firm SimpleAir
4:44 PM
Editorial - How the Ripples in Apple’s TechSphere Will Influence Us
4:02 PM
News - Microsoft Wins Motorola Android Device Ban in Germany
3:14 PM
News - Jury: Google’s Android Doesn’t Infringe on Oracle’s Java Patents
2:41 PM
Quick Look Review - Casellet: iPhone 4S Case and Wallet Combined
1:12 PM
Deal Brothers - 13” MacBook Air 1.86 GHz Intel Core 2 Duo:  $1,099
11:18 AM
News - Sharp Teams with Foxconn for iPhone Display Production
 

The Mac Observer Reader Specials

  • Macsales Add 2nd Hard Drive or SSD to Mac mini, MacBook or MacBook Pro. 1TB of Hard Drive or SSD Capacity from $64.99! Video Guides Make it easy - OWC DataDoubler - Macsales.com
  • Mac RAM Upgrades: MacBook Pro 16GB kits $475, 8GB Kits for $119.99! iMac 16GB RAM Kits (4x 4GB) for $229.99! Mac Pro Memory 32GB Kit for $399.99, 64GB Kit for $889.99! Mac Hard Drives 2TB Seagate SATA II for $249.99! Click Here!
  • Macpokeronline.com If you're using a Mac, then you've gotta check out PokerOnAMac.com. Online casinos and poker rooms are literally giving away cash and the casino sites at Poker on a Mac do the unthinkable, they actually reward! Join today, the download is free!
  •  Looking to find online casinos for mac? We can help you find the best real money casino sites where you can play your favorite casino games including blackjack and slots.

Apple Stock Quote (AAPL)

Loading...

Hot Topics

TMO Express

Join the TMO Express Daily Newsletter to get the latest Mac headlines in your e-mail every weekday. Find out more!

Top Deals From DealBrothers.com

Recent Features

Support The Mac Observer

We noticed you may be running AdBlock on your computer. It takes real money to run this site and to deliver the news, tips, and opinions you love to read.

If you wish to block the ads that pay for the creation of our content, we ask that you instead support TMO Directly, either with a $5 monthly recurring contribution, or a one-time donation of any amount of your choice. Thanks!

Subscribe with Paypal Donate with Paypal