A recent tip shows how smart Mac Mail's dynamic Smart Mailbox feature can be. It really can make using Mac Mail more convenient.
Mail.app lets users create rule-based Smart Mailboxes that can dynamically show messages located in other mailboxes. The nice thing about this is that messages aren't moved, but you can interact with them as if they were in your primary Inbox. The tip in question was on Macosxhints.com from reader Cran, who wanted to customize the Dock badge, which enumerates the unread messages in the Mailbox.
The Dock counter is customizable in Mail.app. Under the General tab in Mail Preferences, there's a number of selections available for the count: All Mailboxes (providing the count of all unread messages in all folders and subfolders), Inbox only (providing the count of messages in the primary mailboxes but not those moved by rules), and any Smart Mailboxes that you've created.
Cran didn't care about listing or counting all unread messages. Rather, he/she was concerned about certain messages. So, Cran created a Smart Mailbox that looked in certain folders. (I don't know why Apple insists on calling folders in Mail.app "mailboxes." After all, the icon is a folder. Hello?!?)
For most of my other mailboxes, it is sufficient to check them once in a while, but I do not want them to show in the Dock unread count. This makes the dock unread count badge much more useful for me.
If you don't care about the messages from list services or other publications, you can create a rule to move them to a folder and then have the Smart Mailbox ignore them for the count.
Now, Mail's Inbox already ignores moved messages, which can be confusing to some users.
I suggest making a Smart Mailbox called Unread Messages that includes all unread messages. If like me, you make lots of folders, subfolders and rules, this makes managing message reading easy.