A few other e-mail applications allow you to set their dock counter to the number of messages in the inbox, rather than just the number of unread messages. The idea being that until it's out of the inbox, it's still an active task that needs to be resolved.

So what I'm after is the ability to do this with Mail.app in OS X Mavericks. Currently there's only a drop-down preference for:

Dock unread count: Inbox only
                   All Mailboxes

Perhaps there's a plug-in or some other app that allows you to override the inbox count with the total count?

Unfortunately, searching on Google for anything to do with the inbox count just brings up hundreds of posts about how the count is wrong/not showing. Hard to find anything useful amongst countless pages about bugs.

  • For pre-Mavericks users, DockStar may solve the issue, but it's no longer supported from Mavericks onwards. Jun 6, 2014 at 3:21

4 Answers 4


DockStar solved the issue for me. It now has an update to support both Mavericks and Yosemite when it comes out. I only tested in on Mavericks though, works great.

The great thing for me was that I have exactly 4 inboxes, so I can add a badge for all of them.


I managed to find a workaround: I have an AppleScript running every 10 minutes on my machine to set ALL my Inbox emails to status: unread. This updates the Dock badge icon. Since I follow the Inbox Zero philosophy, I don't care if emails I've read get marked unread.

tell application "Mail" set read status of every message of inbox to false end tell

I run it every 10 minutes on Mac using this excellent lanchd scheduling tool: LaunchControl by Soma Zone software.


I would recommend you try this script first.

You can modify the output report to your desire (not email it to your self).

The reason I recommend this is, if you are anything like me and have multiple accounts with hundreds of folders and thousands of emails the badge count could be confusing.

I just run it on my MBA and it took a while but the produced a 3 pages report of ALL emails in all accounts in all folders, while differentiating between read and Unread.

tell application "Mail"
set localMailboxes to every mailbox
if (count of localMailboxes) is greater than 0 then
set messageCountDisplay to "Local mailboxes (On My Mac)" & return & my getMessageCountsForMailboxes(localMailboxes)
set messageCountDisplay to ""
end if

set everyAccount to every account
repeat with eachAccount in everyAccount
set accountMailboxes to every mailbox of eachAccount
if (count of accountMailboxes) is greater than 0 then
set messageCountDisplay to messageCountDisplay & return & "Mailboxes for Account: " & name of eachAccount & return & my getMessageCountsForMailboxes(accountMailboxes)
end if
end repeat

set outputMessage to make new outgoing message with properties {content:messageCountDisplay, subject:"Message counts for all my mailboxes", visible:true}
tell outputMessage
set font to "Courier"
set size to 12
end tell
end tell

on getMessageCountsForMailboxes(theMailboxes)
-- (list of mailboxes)
-- returns string

set displayString to ""

tell application "Mail"
repeat with eachMailbox in theMailboxes
set mailboxName to name of eachMailbox
set messageCount to (count of (messages of eachMailbox)) as string
set unreadCount to unread count of eachMailbox as string

set displayString to displayString & " " & my padString(mailboxName, 40) & " " & messageCount & " (" & unreadCount & " unread)" & return
end repeat
end tell

return displayString
end getMessageCountsForMailboxes

on padString(theString, fieldLength)
-- (string, integer)
-- returns string

set stringLength to length of theString

if stringLength is greater than fieldLength then
set paddedString to (text from character 1 to character (fieldLength - 3) of theString) & "..."
else -- stringLength is less than or equal to fieldLength
set paddedString to theString

set paddingLength to fieldLength - stringLength
repeat paddingLength times
set paddedString to paddedString & space
end repeat
end if

return paddedString
end padString


Here is a snippet of what it looks like (me blocking my personal information)

mail count


In system preferences, go to Notifications. Click on the Mail application, then check the box to the right that says "badge app icon." That's it. Just worked for me.

  • That just shows the unread count, not all messages in the inbox. Jul 27, 2014 at 14:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .