Apple Mail application very slow to respond

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:

  1. Open the Terminal App – You can find this by using spotlight and typing terminal.
  2. 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:

  1. Open the Terminal App – You can find this by using spotlight and typing terminal.
  2. 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.

Published
Categorized as Mac

153 comments

  1. 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.

  2. 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

  3. 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.

  4. 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!

  5. 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!

  6. 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…

  7. 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. 🙂

  8. 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!

  9. OMG you saved my comp from a drowning (by me)!! Thank you, thank you, thank you! Bookmarking this page!

  10. Thank you. My message window was taking for eeeeeeever to load, especially when there were attachments. Seems much better.

  11. 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.

    1. 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”.

    2. 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.

      1. Im having the same issue, it works temporarily, i donno why it suddenly became so slow. Its so frustrating !

  12. 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

  13. 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……….

  14. hi I am getting a terminal error that says
    -sqlite3: Error: too many options: “vacuum;”

    Can you help?

    Thanks!

    Mary Anne

  15. 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!!

  16. 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?

  17. 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

  18. 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.

  19. 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??

  20. Wonderful !!!
    I have been working with mail pain for months。。。。crying , but not Hahaha
    Thank you !

  21. 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.

  22. 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

  23. 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.

  24. 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?

  25. 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…

  26. OMG!!!!!! it actually worked!!!!!! thanks a million!! i was devastated my outgoing mail was taking about an hour to send!!

  27. 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.

  28. So, after pasting that in the Terminal window, then what does one do? I closed Terminal and launched Mail again but nothing has changed.

  29. 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/

    1. 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

  30. 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?

  31. What do I use for the new operating system? I get “error database is locked” which I try the newest one listed above. Thanks!

  32. 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.

  33. 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?

  34. 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!

  35. Hello,
    Do you know if this fix will work in the new apple OS: Mavericks 10.9?

    Thanks very much, Matthew

  36. 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

  37. 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?

    1. 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…

  38. I tried this but get an error message which says ‘too many options: “vacuum;”

    What does this mean I wonder?

  39. 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.

  40. With the multitude of positive results including mine, I’m wondering why Apple doesn’t address vacuuming into the functionality of the OS

  41. Hooray, thank you!! 2 days of suffering slow emails and multiple pauses until I found this fix.

  42. Fantastic. Instant, and total fix. Solved all my problems. Why can’t all solutions be this easy and effective??

  43. This worked very well for me on 10.8.5 – many thanks. I’ve been looking for this for a long time!

  44. 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!

Leave a comment

Your email address will not be published. Required fields are marked *