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

Unread message count is wrong in Mail and Dock

Just last week I noticed that both my Email Inbox & Mail Dock Icon is showing an incorrect unread message count on both my MacBook & iMac. I am using a Microsoft Exchange Hosted account (Office 365) and it is the only email account tied to both of my Macs. My iPhone shows the correct unread message count as well as Outlook Web Access, and on a seperate windows-based computer, Outlook is showing the correct unread message count of 3. Both Mac systems are using OS X 10.7.3 and I have never experienced this issue before.


The MacBook is showing 39 unread messages, and the iMac is showing 16, in actuality there are 3 unread messages. If I create a smart mailbox that shows only unread messages - it shows up with the correct number (3), when I sort by "Unread Messages" for Inbox, it only shows that I have three unread messages.


I have rebuilt the inbox, I have deleted the email account from the computer, restarted the computer and then readded it, all it did was bring the unread message count from 19 to 16 on my iMac (still - it should be 3).


I have also gone to Mail -> Preferences -> General and verified that Show Dock Unread County is set to "Inbox" but oddly enough, when I click "All Mailboxes" the unread count on the Dock changes to 3.


Is there a file I can delete to reset that unread message count? I feel like I've done everything that's suggested to no avail.


Thanks!

iMac (21.5-inch Mid 2011), Mac OS X (10.7.3)

Posted on Mar 4, 2012 7:10 PM

Reply
99 replies

Aug 9, 2012 9:01 AM in response to AlconicCF

This happened to me too, but in Mountain Lion. Same file location as in Lion and there were three "envelope Index" prefixed files. I have 1 iCloud, 3 Exchange and 1 Gmail accounts, if that matters. Deleted all three and the indexing took about 10 minutes for 31,000 messages but it worked. Even found a few more errors of items that weren'y actually read.

Sep 19, 2012 5:05 AM in response to HACKINT0SH

When I tried this, nothing happened in Outlook but when I restarted Apple Mail it started to reimport old mail (or at least that what i think it said). I am running 10.7.4, I have Outlook and Mail running against different accounts (Outlook for work) (Mail for personal)


Can somebody offer a little more help to me as a beginner please


Thanks😕

Nov 10, 2012 12:33 AM in response to AlconicCF

It worked. The rebuilding took a while -- it's like installing MAIL from scratch -- the absence of the folders makes MAIL import all the mailboxes it finds and this reconstruction for me was about 65K messages and took about 9 minutes. The inboxes (I have 7 email accounts) seem to be intact although there was a brief panic when the Exchange served account looked empty -- closing and reopening MAIL a couple of times seemed to fix things.


The solution is brute force, but it works. The underlying database was corrupted in some way that let MAIL work with it but without a correct count. The fix is to force the database manager to recreate the database from scratch. This is a recurring problem with databases and it is disturbing to me that it occurs with a critical application like MAIL. Software quality remains the Achilles heel of modern computing.


Thanks for the solution... now back to work for Dr. Bunsen Honeydew!


--beaker

Nov 13, 2012 3:58 AM in response to Glenn Leblanc

Thanks to Glenn Leblanc for his posts. I had actually spoken to Apple about an issue where blank emails were landing (in work exchange server) and bumping up my unread badge count — permanently. Very frustrating and Apple engineers (after a couple of hours on seperate phone calls) couldn't resolve it! Deleting them made no difference and because the badge count was ever-changing, I eventually switched it off! (in Settings / Notifications). Then I came here last night and bingo! All good again.


For the record — in Mountain Lion — I had to quit Mail. Then hold alt/option key in Finder's 'Go' menu to find Library: then Library/Mail/V2/MailData. Found files: Envelope Index-wal, Envelope Index-shm and Envelope Index and moved them to the Desktop.


When you restart Mail it begins reindexing all your Mail accounts. This should be all it takes to get a correct badge count. It took 15-20 mins for app. 45,000 mails.


When it's all done you can delete the Envelope Index-wal, Envelope Index-shm and Envelope Index files on your desktop — they will have been replaced in Library/Mail/V2/MailData anyway.


Hope this helps Mountain Lion users and, seriously, massive thanks to Glenn for solving this! 🙂


Edit. After restarting Mail for the first time things may still be a bit muddled. Don't panic. Disabling then re-enabling the account will clear that up.

Unread message count is wrong in Mail and Dock

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