Disabling Mail.app's To Do Mailboxes and Quasi-Debugging Mailbox Creation

Leopard’s Mail.app introduced some nice speed improvements over Tiger’s version but introduced one of the most annoying features (IMNSHO) in Leopard. System Wide “To Dos” in a garish Marker Felt font intent on polluting my IMAP mailboxes with Apple Mail To Do or ToDos.mbox seemingly placed randomly (they aren’t but when your Prefixes differ from account to account it seems random at first). Additionally when I moved servers at my host my accounts on my computer started misbehaving creating nested mailboxes continuously. In the end it’s mostly user error but I’m hoping these tips on how to disable the To Do mailbox (see the edit for the easy way) and force Mail to look properly for the right mailbox will help someone jump to the fix that will stick.

Mailbox Setup Reference

To start with for reference I have several computers and an iPhone that share 4 IMAP accounts (GMail, my webhost and one from work). The main reason I use IMAP is that it keeps them in sync - the backup on the server is just gravy. By default Mail.app uses a mailbox called “Sent Messages” and “Deleted Messages” for it’s Sent and Trash mailboxes. If they do not exist it will attempt to create them - which isn’t entirely interoperable with some webmail clients out of the box (eg. Squirrelmail and RoundCube don’t use those mailboxes by default) or other email clients such as Thunderbird (which doesn’t allow you to change your Trash mailbox in Account Settings so you can’t tell it to use Deleted Messages as well).

Changing Your Sent and Trash Mailboxes Normally

In Mail.app you can click on a mailbox (eg. Trash Man O’ Doom) you’ve created and then under the Mailbox menu scroll down to “Use This Mailbox For” and set the mailbox for what you would like to use it for Drafts, Sent, Trash or as the Junk Mailbox. Nice, easy and it nearly always works. (I’ve had it not work once and that wasn’t Mail’s fault)

To Do Mailboxes Are From Hell

You may have noticed above that there was no option for a “To Do” mailbox or even an option anywhere to disable System wide To Dos which means that once iCal is opened or any To Do is intentionally or accidentally created Mail.app will dutifully create Apple Mail To Do mailboxes for each account you have following the IMAP Prefix if necessary. On my iPhone where To Dos are not even recognized it means I’m always seeing a completely useless Apple Mail To Do mailbox somewhere in the hierarchy of my mailboxes.

Following the publishing of a hint on MacOSXHints.com that described the key used in Mail.app’s Preference file (com.apple.mail.plist) I decided to go digging to see what else was stored there. I discovered that by setting the value to nothing (as in just leave it blank) that To Dos were effectively disabled on that account - I could then delete the Apple Mail To Do mailbox on the account. By doing the same change on the other computers (4 accounts * 4 computers = tedious) I was then Apple Mail To Do mailbox free!

**EDIT: According to a newly published hint there’s another way to avoid ToDo mailboxes being recreated by changing the NewNoteToDoAccount key to the ID of your local account. After deleting all my To Do mailboxes this was auto set so I didn’t notice that it had changed.

**EDIT 2: As far as I can tell this is akin to setting Create Notes & To Do’s in: to On My Mac in the Composing section of the Mail Preferences - which is FAR easier than messing with the plist file.

Multiplying Inboxes

When I changed servers at my webhost, Mail.app got confused about the IMAP Prefixes (I believe the new server was telling Mail.app INBOX and the old server was saying /, but I’m unsure) and decided to whenever I deleted a message to move the message to a new mailbox it would create at INBOX/Deleted Messages. Thinking it was an anomaly I would move the message where it should have gone and delete the newly create mailbox. The next time a message would be deleted (wasn’t necessarily on that computer) it would recreate that mailbox but oddly at INBOX/INBOX/Deleted Messages and the cycle would keep repeating. This was the one time that selecting the Trash Mailbox (Deleted Messages at / and not in INBOX) and telling it to use it failed.

Using the knowledge that the mailbox information is stored in com.apple.mail.plist I edited the offending section setting it properly and haven’t had a problem with it since - it was a good way of having somewhere to write in “I want my Trash to go here”. So it’s useful for making changes and checking to see what path that Mail.app is looking for when it shouldn’t be looking at that location (especially via SSH when VNC is unavailable).

So my frustration ends with that to edit a binary plist the only Apple provided tool is the new Property List Editor 3.0 which is not an optimum solution for editing - it doesn’t provide searching and I find that the extra work using plutil to convert to xml instead of binary and back so I can use TextMate not worth it in the end. Much of what you need to do is in Mail.app itself but when Mail.app is acting up, it’s good to know where you can go to set it back straight and stop the cluttering of your mailbox hierarchies.