10.4: Allow 'Is Not In Mailbox' For Smart Mailboxes

Jun 21, '05 10:06:00AM

Contributed by: nicalderton

Tiger only hintI use Smart Mailboxes to filter various collections of messages (from family, from friends, from hardware vendors, etc.). I wanted a simple way to filter any remaining unsorted messages. I assumed that I could use another Smart Mailbox with multiple 'Message Is Not In Mailbox' filters applied to the already-sorted contents of those first Smart Mailboxes. It seems, however, that whilst one can apply the 'Message Is In Mailbox' filter to Smart Mailboxes, the 'Message Is Not In Mailbox' filter doesn't allow them as an option.

A simple, if fiddly, solution is as follows. Set up a new Smart Mailbox with your required filters in the form of Message Is In Mailbox = SMART MAILBOX. You can specify multiple Smart Mailboxes and also include regular Mailboxes if you like. Now quit Mail.

Open the file SmartMailboxes.plist file in your user's Library/Mail folder with your favourite property list editor. Find the Mailbox you created; the name you specified is in Root -> mailboxes -> # -> MailboxName. Under MailboxCriteria, ignore keys 0 and 1, which are special instances requiring Mail to ignore messages in Trash and in Special mailboxes, and head straight for key 2. Here you will find the Criteria keys of the mailbox; one for each filter you added.

For each Smart Mailbox filter, change the Qualifier from IsEqualTo to IsNotEqualTo. When your are finished, save the plist and restart Mail. Voila, you now have a working Smart Mailbox filtering against message that are NOT in other Smart Mailboxes.

I'm surprised Apple doesn't allow logical != for Smart Mailboxes. I have encountered no problems use this method thus far; however, my Mail database is modest.

Comments (5)


Mac OS X Hints
http://hints.macworld.com/article.php?story=2005060508251727