Some times Apple mail not showing inbox unread count on dock. In OS X Yosemite, mail app not showing total message count. This issue triggered when you view a smart folder. Once you view a smart folder, the count in the title bar disappear until you relaunch the mail.
Devices & OS : OS X Mavericks, Mac OS X Yosemite, Gmail
Go to System Preferences -> Notifications -> Mail and ensure “Badge app icon” option checked.
If its already checked, try to remove the preference and select it again.
1. Completely close your mail app.
2. Open Terminal and enter the following command.
mv ~/Library/Mail/V2/MailData/Envelope* ~/Desktop
This command moves all your “Envelope Index” files to desktop. You can delete this files later.
3. After the “Envelope Index” files have been moved, relaunch mail app.
This should reload emails and updating unread count.
SEE ALSO : Mac Mail App not showing new messages in inbox, fix
Solution 3:- (for total message count)
It a bug in Mac OS X Yosemite.Do not view smart folder in OS X Yosemite. Relaunch the mail app to get total message count.
If you have any other issues about Mac mail app, do let us via comment.