Apple Event: May 7th at 7 am PT

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 Best 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

Jan 16, 2015 3:12 PM in response to AlconicCF

How sad that this bug still persists right into Yosemite. Thanks, Glenn--this is the first time I've seen this bug, but my hunch is it won't be the last. Your solution is golden!


I did deviate in one little way: rather than move all the Envelope files to the desktop, I just selected them all and made a .zip archive in the same spot. Works just the same.

Mar 22, 2015 11:09 AM in response to quetell

When I moved the Envelope folders to another spot and restarted mail, I get a message saying that it's going to import my mail — but where is it going to import it from. If from my IMAP gmail account, won't a lot of information be missing — like whether I replied or not, and the folder I filed the message in. Not to mention that I have 190,000 messages in that account — how long will this take?

Jul 31, 2015 5:17 AM in response to AlconicCF

I updated an older Mac mini to Yosemite and had the same problem, so I tried the “HACKINT0SH” solution and I had success. Thanks “HACKINT0SH”!


For the faint of heart, here’s what I did:


1. Quit the Mail app.


2a. In OS X Yosemite…

Select your Home icon/folder on the left.

In the Finder menu “View” ⇢ “Show View Options”

Check (tick) “Show Library Folder”

Click on the “Library” folder that just appeared.


2b. For all other versions of OS X…

In the Finder menu item “Go” ⇢ “Go to Folder…” ⇢ then enter “~/Library” NOote


3. Locate any file labeled “Envelope index”.


4. Drag them to the Trash but DO NOT EMPTY TRASH yet.

Note: Whenever messing with any files created by your Mac,

hold them in the trash so they can be retrieved later

if your plans go awry.


5. Start/run Mail. You’ll see it “Import”. Don’t panic.

Note: It is re-indexing your existing mail. Your email wasn’t lost.

I had 8000 emails and it took about 1 minute.

When the Mail app reappears, it needs to re-index your display and it will import them all (again). Once again,

don’t panic, it’s just puting your mail back on display.


6. Test your Mail app by sending yourself an email.

Some people wait a full day, receiving several emails,

to insure everything is working fine, before they empty their Trash.


Finished

Aug 20, 2015 6:35 AM in response to G.Madigan

Update: It's back!


I tried the "HACKINT0SH" solution, seen above, but the problem quickly returned. I'm starting to feel like an MS Windows user; spending more time fixing the computer than using it.


You can delete the Badge App Icon in Finder > System Preferences > Notifications > Mail by unchecking the Badge App Icon completely, but that removes the function completely. I suppose a bad badge count is just about as bad as none at all because you have to check it anyway.


Until this is resolved, you may want to change the notification for mail to an "Alert" so it stays there until it is dismissed.


Is it just me or is Apple getting sloppier with it's quality, more cryptic with its icons, and deleting popular features to (unsuccessfully) move people to a paying service (often with fewer features than existing competition)? There is no way I'm going to pay for something that offers less than what I had a few 2 years ago with more, easier to use, features.


But I digress.


Personally, I'm unchecking (turning off) the Mail badge and setting the Mail notifications to "Alerts".

To everyone else, it's not you, it's your Mac OS X. Good luck.

I'll post any new findings here immediately when I find them.


The king has died, the magic is gone, and Camelot has become just another crumbling ancient castle on a tourist Google (not Apple) map; a tale we can tell our grandchildren of a land with magical devices, nearly mind-reading user interfaces, with spectacular announcements and major technology advancements. They once had industry-leading beautiful stores manned by knowledgeable artists and technicians, no appointment needed.

Our children won't believe us.

Oct 1, 2015 7:09 AM in response to Brian S. Campbell

I, too, just upgraded. I haven't seen anything wonky with Mail other than trying to use Split Screen on it. It didn't work at first, but after a few restarting Mail it seems to work as advertised, but it still falls flat in terms of being an intuitive user interface (as do many other "improved" apps such as Maps) but I digress. I'll tinker with El Capitan as much as possible before I get the Mac support calls from friends and family. Thus far, it's looking more like a Microsoft User Interface with hidden "Easter Egg" gestures, requiring 10 minutes of hunting and pecking to find an "Edit" button, being the new SOP (Standard Operating Procedure). You know it's a terrible GUI when you can't remember it when you need it 30 minutes later.

Oct 22, 2015 12:22 PM in response to Brian S. Campbell

I had the same problem after the El Capitan upgrade: inaccurate unread message count in both the dock icon and inside the mail program. I could get it to temporarily disappear by clicking anywhere in Mail (the inaccurate unread message count of 8 would go back to 0) only to crop back up a few minutes later. Super annoying and none of the solutions upthread worked (deleting envelope files, rebuilding the mailbox, etc.).


The problem was with only 1 Gmail IMAP account. What finally worked for me was going into the Gmail account in my web browser (not the Mail program). It was showing that I had unread messages in my Inbox, but I couldn't find them. I went to Settings>Inbox and temporarily changed Inbox Type to "Unread first." The mysterious unread messages appeared up top, I marked them as read, and when I went back into the Mail program, the problem was gone and hasn't come back.

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.