Chapter in this post:
For a few days now, I've been struggling with Apple's mail program, which closes after a few seconds after it starts. Apple Support has not been able to help me so far and has offered me a support ticket for 49 EUR, but to be honest, the stupid Apple Mail has now grabbed my honor. And of course I would like to save the 49 EUR ... :-)
What I only recently discovered: There is one free Mac app called "OnyX"which has an option "Mailboxes> Delete current index" under the menu area "Optimize". So you can forget these instructions below and simply have the app delete the corresponding files. If you don't want to work your way through the Apple Mail Library folder, you are welcome to use the tool. Everyone else can read on below.
But this tip is only supposed to help people who want to rebuild their Apple Mail database. In earlier versions of OS X there was a trick where you had to hold down the ALT key while starting Mail to have Mail rebuild the DB, but that works on OS X. Mavericks (more ouch available) no more. For this reason, here are the instructions on how to solve it (works from OS X 10.7 to 10.15 (macOS Catalina)):
Update 30.05.2016: The instructions also work with OS X 10.10 "El Capitan", but in the 3rd step you have to open the folder "V3" and not "V2". This is where the corresponding data are under El Capitan.
Update 12.01.2019: I have just checked whether you can also follow these instructions under macOS Mojave (10.14). This works so far, only that the subfolder in "Mail" is not called "V2" or "V3" but "V6".
Here is another screenshot with my view of the MailData folder (under OS X 10.9) and the selected files that I have removed:
Under the macOS High Sierra system, I have the "V5" folder, which is probably the corresponding folder for the current macOS. The folder is named "V6" for Mojave and "V7" for Catalina. Just take a look at what the highest value after the "V" in the file name is and access this folder. This means that these instructions should also work for future macOS versions.
Jens has been running the blog since 2012. He appears as Sir Apfelot for his readers and helps them with problems of a technical nature. In his free time he drives electric unicycles, takes photos (preferably with his iPhone, of course), climbs around in the Hessian mountains or hikes with the family. His articles deal with Apple products, news from the world of drones or solutions for current bugs.