You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

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
Question marked as Top-ranking reply

Posted on Apr 2, 2012 7:52 PM

Ok, let's go with Glenn's suggestion here:


  • Quit Mail if it’s open.
  • In ~/Library/Mail/V2/MailData, delete any file that begins with “Envelope Index,” such as Envelope Index or Envelope Index-shm.
  • Your home Library folder is hidden by default. To display it, choose Finder > “Go to Folder” and then enter “~/Library.”
  • Open Mail.
  • Mail creates new Envelope Index files. This process may take a few minutes, depending on how many messages Mail is reindexing.
99 replies

May 10, 2013 6:04 PM in response to AlconicCF

I have a MacBook Pro running 10.7.5. I tried methods mentioned here with no luck on my office 365 exchange account in Mac Mail. Was showing 5 unread in junk and 17 unread in the inbox. I resolved by disabling the account in Mail preferences. Closed and saved preferences. Enabled the account in Mail preferences. Closed and saved preferences. Unread messages count cleared. Hope this helps.


*** Sorry, No happiness here! Unread message count is back when after I Quit and Opened Mac Mail ***

Jun 2, 2013 4:17 PM in response to PCJ46

Hi guys,


Sorry to be a nudnick but I cannot actuate this fix because I do not see a Mail folder in my Library. Can anybody give me advice on that? I would love to make the fix, because I still show a phantom "1" message unread in one of my ten mail accounts....but don't have the Mail folder visible in my Library to work with....any suggestions?


thanks so much

scott

Jun 6, 2013 3:07 AM in response to Purple M

Hi everybody...well, I've tried every one of these suggestions and still no luck. Anybody got another idea? Here's what I've done:


1. Deleted all "Envelope Index" file in Library/Mail/V2/Maildata folder and re-launched Mail and allowed it to re-populate....done this several times, including re-starting the machine


2. Disabled the account, quit mail, re-started Mail, re-enabled the account


3. Said a few choice words over it, begging it to stop its errant behavior


4. Mark as unread, close mail, re-open mail, Mark as read


I'm stumped. The offending account is a gmail account, but I have a few other gmail accounts that are not doing this. Is there perhaps anything I can do in the actual gmail account online that would help it?


Anybody got any more ideas? I have a 15" MBP retina running OSX 10.8.3 and Apple Mail 6.3.


Thanks and have a great day,

Scott

Jun 23, 2013 8:40 PM in response to HACKINT0SH

Absolutely! I finally had enough when, after seeing 2 phantom new Exchange emails that weren't, I now had 7 new Exchange junk mails that weren't. This worked. I was a little worried, reopening Mail that responded like it was new and then had to wait for 99K + emails to import and then had to quit and restart...but all is 100% fixed. Thanks Glenn and HACKINTOSH!!!

Aug 8, 2013 3:32 AM in response to AlconicCF

I have a different approach to reset the counting without rebuilding the index.


DO THIS AT YOUR OWN RISK


The Envelop Index is actually a sqlite database, the counting is being placed in "mailboxes" table;


For example ,when the counting shows "2" when you really read all of them...

enter the following command in terminal:


cd ~/Library/Mail/V2/MailData

sqlite3 Envelope\ Index

select ROWID from mailboxes where unread_count_adjusted_for_duplicates = 2;


this command should return result like this:

ROWID

17


Set the counting of this ROWID to 0...


update mailboxes set unread_count_adjusted_for_duplicates = 0 where ROWID = 17;


Done!

Aug 21, 2013 6:40 PM in response to scottv1

Not sure this is pertinent... but I had a similar problem. Deleting the 'envelope' files didn't work, de-activating the (IMAP) account only worked for 10 seconds, restarting my 2 month old MacBook Air not at all helpful, etc.


I had 7 invisible inbox unreads for several days, which suddenly today ballooned to 210!


Turned out that the culprit was a particular email thread ("the Gadgeteer"). I get a post from them once or twice a week, about new tech products. Not sure how this happened (since I do indeed read them), but deleting this thread of consecutive emails (which were all bunched in one long 'conversation', as Mail 6.5 calls it), from this site solved my problem. All 210 gone. Never had this issue with older versions of Mail, and I've subscribed to this site for a couple of years... well, whoever said 10.6 was less buggy may be right.

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