Problem
Apple Mail is very slow in it’s response. Message lists take ages to update and the app itself seems to pause for 15-20 seconds.
Cause
The SQL database that Mail uses to catalog your email addresses needs a bit of housekeeping now and again, you really need to have a tidy up!
Solution
First quit Mail – then:
For OSX Lion (10.7) and Mountain Lion (10.8) you need to do the following:
- Open the Terminal App – You can find this by using spotlight and typing terminal.
- Copy and paste this command into the command line of Terminal:
sqlite3 ~/Library/Mail/V2/MailData/Envelope\ Index vacuum;
For Snow Leopard (10.6) you need to do the following:
- Open the Terminal App – You can find this by using spotlight and typing terminal.
- Copy and paste this command into the command line of Terminal:
/usr/bin/sqlite3 ~/Library/Mail/Envelope\ Index vacuum;
You should now find that Mail runs much faster.
This fixed my problem. Thanks!
thanks a lot
really worked like magic
thanks. It works !!
good tip; I should note that the terminal command did not occur instantly – it took a few minutes before the vacuum finished and the prompt returned.
Wow! I don’t know much about how computers run and I was worried my macbook pro was getting too old (I guess a good excuse to buy a new one, but as a poor grad student that would have been painful to my wallet), but this fixed everything! Thanks
OMG. Relief. And instructions a non-techie could totally do. Worked instantly with my Lion as soon as I did a force quit on mail.
Perfect – problem solved
Works perfectly! Very Nice. Worked on my snow leopard.
Often scared to try these things I find online but I have to say THIS WORKS.
I have a new MacBook Air and I thought there was something wrong with it.
Thank you!
I have Mountain Lion, and before trying this it took sometimes 30 seconds or more for Mail to open. After running this command, everything now works very fast. Great solution!
excellent ! Thanks a lot, it’s changing my life 🙂
I was having the same problem and the fix worked for me also!! thanks so much!
Great fix – thanks.
The fix works! ………. excellent
Worked like a charm! thank you!
I am a hero to my wife! Thank you!!!
Worked for me too; thanks!
Sweet job, thank you!
Works perfectly! Thx
Thanks so much. I was so frustrated with my computer until I found this.
Instant fix! Many thanks
Amazing, stumbled on this site and have had two separate major problems resolved in a flash. Been through a few others as in a nightmare…
Thanks!! This is absolutely awesome. You have relieved me of a great worry. Mail is one of the most frequent apps I use and it was extremely distracting to have it slow and frozen. 🙂
Amazing–Tank you!
Bless you!
Thank you! sure made a difference
Fixed 😉 Thank you
Worked perfectly! Thanks!
Awesome fix!
Fixed it totally thank you
Wow . Was a bit worried before trying…. It worked so well . Thanks a lot
Yep. A perfect fix. Mail was taking 20-30 seconds to display a message from my “unread” smart mailbox (which usually has about 20 messages in it). Now, no delay.
Thanks!
What would I do without stuff like this on the web? Go Crazy Thanks
Thanks! Worked perfectly.
Nice fix, worked like a charm! Thanks!
Thank you so very much this worked beautifully
Many thanks!
Loving your work!
This has been bugging me for a while, will be using again.
This worked great! Thanks!
Awesome. It just worked!
Thanks! life saver!
OMG you saved my comp from a drowning (by me)!! Thank you, thank you, thank you! Bookmarking this page!
WOW! Awesome. Worked great!
Is there a command like that would speed up my entire mac !?!
Thank you. My message window was taking for eeeeeeever to load, especially when there were attachments. Seems much better.
Immediate relief from a plaguing problem. My question is “Why didn’t Apple make it easy to diagnose and remedy the problem”. Thank you for making the explanation and the “clean up” available to all the frustrated Mail users.
Follow-up! Worked fine for a very short time. The problem returned and the “cleanup fix” does not stop the slow response time that I am experiencing with Mail. After the second “pasting” to terminal, I checked the activity monitor and Mail is using 95% of CPU. Something else is going on other than the SQL Database needing “housecleaning”.
Does anyone notice only positive comments in the review section. The next day I added a follow-up to my comment that stated the fix only worked for a short time and I still had the original problem with Mail. This comment was not displayed which leaves me wondering why the moderator would prevent it. It was not intended to be negative, but it was an attempt to seek further help for the problem.
Im having the same issue, it works temporarily, i donno why it suddenly became so slow. Its so frustrating !
Thanks! Worked like a charm!
While this seems to work for all.. I have the problem that it says
Unable to open database “~/Library/Mail/Envelope\”: unable to open database file
What can I do about it – or is this normal? Thanks a lot
This is a vital tool in the toolbox…. Thank you!
thank you it worked very well
Worked for me! Thanks
I had the same problem and I just quit mail right click and quit and then when it was opened back up all was good? Maybe it doesn’t like being open all the time……….
hi I am getting a terminal error that says
-sqlite3: Error: too many options: “vacuum;”
Can you help?
Thanks!
Mary Anne
Thank you so much! Thought my Mac was dying on me! And many thanks for giving easy to follow directions for all of us non-techies!!
This worked BEAUTIFULLY!!!! Thank you so much!
excelent!!!!
Worked great. Thx!
On Mac OSXv10.7.5 I got error database is locked for the sqlite3 ~/Library/Mail/V2/MailData/Envelope\ Index vacuum; command but I tried the /usr/bin/sqlite3 ~/Library/Mail/Envelope\ Index vacuum; and that didn’t get any problems. I have relaunched mail but it still slow.
Any advise?
Its ok I didn’t quit mail first so ignore the last comment from me.
Thanks.
That totally worked! Thanks
How come Apple support does not know about this?
Well done
For Snow Leopard (10.6) you need to do the following:
Open the Terminal App – You can find this by using spotlight and typing terminal.
Copy and paste this command into the command line of Terminal:
/usr/bin/sqlite3 ~/Library/Mail/Envelope\ Index vacuum
I did that nothing happen so i click enter no change ?
And i still have the same problem.
My problem is the same in both of my computer, Mac book 10.6.8 and IMac 10.8.4, when i send a mail through my routeur, DLink Dir-815, in WiFI for my Mac Book and normal with my IMac it take about 1 to minutes to go. i call DLink and Apple nobody find a solution. Look like there is a conflit between Mail and the routeur. Please HELP !!!
Thank you .JM
fantastic!
Works like a charm.. Thank you!
Fabulous! Thank you. Read, tried and fixed in less than 30 seconds!
bless your effing heart for this.
It’s been running like a snail on and off for some months now. Just tried this and it seems to be a lot better. I’ll keep monitoring it and see how it goes. Many thanks.
thanks it fix well
It worked a treat!
It really is super.. and such an instant fix!
I have to do this once a week. Why? Is there a bigger reason it keeps coming back?
WOW, that was easy, and back to super quick
Worked immediately! thank you
Absolutely have to try this but some dumb questions: 1) when you say ‘quit’ mail – does this mean force quit or just close it? If force quit – when done with the copy and paste, do I need to do anything re macMail? 2) when I bring up ‘terminal’, see two lines of stuff there already – do I just paste at the end of the second line??
Perfect solution – easy to follow, took seconds and made all the difference. Thank you!
Wonderful !!!
I have been working with mail pain for months。。。。crying , but not Hahaha
Thank you !
It looks like the 10.8.5 update may have fixed the problem: “fixes an issue that may prevent Mail from displaying messages”. So far it is working well.
I have had this problem on two occasions in the last 9 months. I spent a total of around an hour with Apple technical support who fixed the problem with lots of cache deletion and other “magic”
I did this myself in 30 seconds………….it worked, many thanks
Worked perfectly, thanks a lot!
Holy cow! This did the trick! Thanks a lot!
I could kiss you! Thank you so much.
yes it worked – thank you!!
I have a problem. I pasted the wrong link to terminal line of command. I am using mountain lion, but i paste the snow leopard command.
Now i have problem with my mail, it hangs, with spinning disc sign – red,blue, green.
Can help me to restore.
All the earlier download mail is gone, all folders are empty.
Thank you.
Wow, THANKS! Clearly if I cannot figure out mail on my own, a lot of other things are slowly building and getting hosed up. Any tips for doing maintenance such as this to prevent problems in the future?
Great… your a genius.
Wow! Thank you!
HELP!!! i run the command on Mtn Lion and restart my Mac, but it won’t boot up!? it’s stuck on grey startup screen with Mac icon and spinner…
Wow, Fantastic tip. Thank You Much.
Yes, It worked.. Thanks a lot!
OMG!!!!!! it actually worked!!!!!! thanks a million!! i was devastated my outgoing mail was taking about an hour to send!!
I tried this and got the following error message in Terminal: ‘Unable to open database “/Users/salimsalam/Library/Mail/V2/MailData/Envelope Index”: unable to open database file’
ANy suggestions? I am running Snow Leopard with Mail.4.6 and I am finding emails are taking ages to send, if they send at all, and that updating folders is very slow. The Mail icon in the dock shows there are unread messages even when I have opened all messages and deleted everything that needs deleting.
Sorry, worked it out – I cut and paste the command line for the wrong version of OSX. Doh!
OK, but it didn’t work!
Did not work for me. My mailbox is huge though, is that the issue?
Will this work on Mavericks as well? You only mention OSX Lion (10.7) and Mountain Lion (10.8).
Does anybody know if this will work on Mavericks?
Hi….I need wait to reopen the mail….because noting happen….Im using Maverick
So, after pasting that in the Terminal window, then what does one do? I closed Terminal and launched Mail again but nothing has changed.
Worked like a charm! Thanks
I’m wondering (before I try this) if it works the same way for Mavericks? Or will that mess things up?
My slllllooooooowwwww Mail app is driving me bonkers!
Thanks,
ea/
I’m with you…nobody has mentioned Mavericks…although I did ask originally. It’s painful that Mail is so slow now. Any attachments above 1Mb just won’t send…..massively frustrating. Apple online help weren’t able to amend anything either. I’ve tried the Terminal copy and paste solution with little or no effect. Apple seriously need to fix this.
A
Worked like magic, thanks!
Mine has been running terrible slow since the upgrade to Mavericks. I had this problem once before, but can’t remember how to fix it. This prompt didn’t seem to fix my problem, maybe there is a different prompt for Mavericks?
What do I use for the new operating system? I get “error database is locked” which I try the newest one listed above. Thanks!
THANK YOU SO MUCH!!!!!! :))))
Amazing! thank you!
Great! Thanks!
WOW, it works wonderful, for Mail 7.0 under OS X 10.9 (Mavericks). I was annoyed by Mail’s performance but now my faith in this excellent piece of software is restored.
I tried your fix and this is the response I got:
-sqlite3: Error: too many options: “vacuum;”
Use -help for a list of options.
[Process completed]
Now what?
Holy cow–it works!
A thousand thanks!
Wowsers – even with all the comments above, I wasn’t expecting it to work quite as well as that – t hank you so much, you have saved me hours of frustration!
Thanks man, worked perfectly! Cheers.
awesome. a neat trick that has reived my mac! thanks
Hi all, does anybody know if this fix works with the 10.9.1 Mavericks OS?
Thanks!
Andy
Immediate fix – amazing!
Hello,
Do you know if this fix will work in the new apple OS: Mavericks 10.9?
Thanks very much, Matthew
Thanks! Indeed that worked like a magical Hogwarts Charm!
Works for Maverick too! Thanks so much for this help.
thank you, this brings a smile to this day!
I tried the proposed solution without success. My system is OS X 10.8.5 but i don’t know is my macbook air system is Lion or lion mountain. Also let me know if ; should also be part of the copy paste
Thank
This worked the first two times I used it but my email has slowed down dramatically again and it doesn’t seem to do the trick anymore. Any other suggestions?
I suffered the same problem Corinne….I just have to keep quitting Mail, and restarting it. Eventually the email sends. I’m running Mavericks 10.9.1. I’ve tried sorting it out with Apple with an online chat, but to no avail, as I’m back to square one. Any emails with an attachment over 1Mb just won’t send, which is crazy considering I used to be able to send attachments up to 10mb! Apple really need to sort this out…
I tried this but get an error message which says ‘too many options: “vacuum;”
What does this mean I wonder?
When I pasted the link into the command field, this error message appeared:
-sqlite3: Error: too many options: “vacuum;”
Use -help for a list of options.
[Process completed]
Does anyone know what this means? I would really like to speed up my mail application. Thanks in advance.
Thanks, a noticeable improvement.
Brilliant! Worked on Mavericks too
With the multitude of positive results including mine, I’m wondering why Apple doesn’t address vacuuming into the functionality of the OS
Brilliant. Thank you so much
sqlite3 ~/Library/Mail/V2/MailData/Envelope\ Index vacuum;
This trick worked really well!!! THANK you!!!!!
Wonderful still works in 2014
Wish I had found this site a long time ago! Thanks for posting. Worked great!
Hooray, thank you!! 2 days of suffering slow emails and multiple pauses until I found this fix.
This worked great! Thanks
THANK YOU THANK YOU !!!
It worked for me running Mavericks. Thank you!
This has just worked for me running Mavericks (10.9.4) too. Thanks!
Amazing fix. Thanks very much!
Is there a new fix for OS 10.9.4 ?
My mail program is painfully slow.
Hi,
Try the command for 10.8 and it should work fine.
Great! – thanks a lot!
How is a mere user expected to find such essential fix?
Fantastic. Instant, and total fix. Solved all my problems. Why can’t all solutions be this easy and effective??
Yes!! Copied and Paster the code for Lion and Mountain Lion on Mavericks. I was surprised it actually worked!
Will this work for OS X 10.9.5?
This is great!!
Any method for OS X Yosemite?
worked for me – many thanks
This worked very well for me on 10.8.5 – many thanks. I’ve been looking for this for a long time!
Just used this to fix problems with Mail on Mavericks – delighted that it worked and fixed the issues immediately. The issues I was facing were poor performance, delays in downloading and more recently inability to file messages via Mail. This seems to have fixed all that.
Thanks. A. Million!
it works!Thank you