Displaying number of messages in a folder in Mail.app
Something has been annoying me with my current email setup. I have a Powerbook G4 running Mac OS X 10.4.9 and I use the standard Apple Mail program that comes with it. I won’t bore you with all the plug-ins I have, but I’ve got everything the way I want it, except one thing. When I receive an email that I want to later send a reply to, I mark it as “flagged.” I created a smart folder that displays all the messages I’ve marked as tagged. When I first created the folder it automatically showed the number of items next to its name. For some reason the program stopped doing this. I thought this was handy because I knew at a glance how many replies I needed to make. I’ve really missed this feature. Tonight, after being annoyed at this for the Nth time, I hit the internet looking for solutions. None were to be found, so I took it upon myself to find one. I’m happy to report that I have! Here’s a screenshot of my success:

Here are the steps I followed, starting with creating the smart folder itself:
- Open Apple Mail and make a new smart folder.
- Name the folder something intelligible and set the rules to what you want in the smart folder. In my instance, I put all messages that were flagged.
- Close Mail.app
- Now the fun part. Open ~/Library/Mail/SmartMailboxes.plist in your favorite text editor (Mine happens to be TextMate).
- Scroll down until you come to the key MailboxName with the string of your new smart folder.
- The next key should be MailboxType. It probably has an integer of “7″ following it. Change the “7″ to “5“.
At this point you can open Mail and you will have a smart folder that will display the number of items it contains when you click on it. There’s only one small problem. Changing the integer to “5″ also changes the icon for the smart folder. The icon is now “Mail.app/Contents/Resources/ToBeDeliveredMailbox.tiff“. It’s also a small (16×16) icon. In my settings that use the large icons, it stands out of place and really doesn’t give any clue to what’s inside the folder. If you want your folder to use the normal smart folder icon, duplicate SmartFolderLarge.tiff and rename it to ToBeDeliveredMailbox.tiff. It’s probably a good idea to back up the old ToBeDeliveredMailbox.tiff. If you’re like me, though, and want to have a more meaningful icon, go find your own or make one. I took one of the free Kombine icons and changed the tint from red to orange. Any icon will work as long as it is 32×32, is a TIFF and has a transparent background.
I found one other integer that will display numbers next to your smart folder. That number is “4” and its icon is DraftsMailbox.tiff. So there is a limit of two separate mailbox types that will display the number of messages and their own icons.
NOTICE: Making these changes will not have pretty results if you are in the habit of displaying the folder types used by these icons. I am not responsible for anything you do to your computer. Make backups before you change anything.
Update: I’ve actually found that using 4 and DraftsMailbox is more reliable. I don’t even have to click on the folder to have the number appear. And using the ToBeDeliveredMailbox had an annoying habit of not showing the number after sending/receiving mail.
Tags: Technology
You can comment below, or link to this permanent URL from your own site.
February 11, 2008 at 1:47 pm
Awesome! Thank you so much for finding this out! FYI, changing the folder type also works on Leopard with the latest Mail.app version 3.1 (914/915).
April 26, 2008 at 10:00 pm
[...] Source: ”Displaying number of messages in a folder in Mail.app” from Unpack [...]
September 25, 2008 at 2:28 am
Fantastic modification! A great Improvement in interface for processing mail.
Tested under 10.5.5 and integer 4 seems to be more reliable than integer 5 in presenting message count me too.
Seems like the functionality breaks if you do anything at all to modify the smart folder.
November 1, 2008 at 5:15 pm
You are my hero! Thanks so much.
December 12, 2008 at 7:20 pm
Where is Mail.app/Contents/Resources/ToBeDeliveredMailbox.tiff?
December 15, 2008 at 2:53 pm
nevermind, didn’t realize I had to right-click the app to view contents.
But using 4 doesn’t work for me. The “count” disappears every few minute until I click on the folder.
February 6, 2009 at 4:47 pm
This is a great tip! The only problem is that the number seems to go away whenever the mailbox changes, when I flag a new message. It comes back when I click the folder as mentioned before. The nice thing though is that the number stays there when I restart mail, so really, I only need to click the folder when changes are made, so its not a big deal. Thanks so much!