OS X Mountain Lion Mail and Smart Mailbox Syncing

Last night, I was reading the Ars Technica review of Mountain Lion, which included the following quote about iCloud:

Then there’s debugging. Sure, this is all supposed to “just work.” But when it doesn’t, even expert users have very little recourse. To help with cases where a particular device is not showing the data that you expect to see, traditional cloud storage services provide a Web interface to the canonical data store. Even Apple’s own iDisk did this. Currently, iCloud provides no such interface.

That certainly rang true in a bizarre problem for me today. I have two machines that were setup independently and both upgraded to Mountain Lion. I make extensive use of Smart Mailboxes to be able to run through certain lists of mail quickly – one of them includes every open source commits list that I subscribe to. When I went to check that on my second machine yesterday, it was empty – and the Smart Mailbox showed that every rule said “No mailbox selected”. I hadn’t used that mailbox on there since the upgrade, so I figured it was probably an upgrade problem – and went ahead and fixed it.

Then I moved back to my iMac this morning and found it had the same problem. I still had the Macbook open and saw that it was all working there, so I fixed it up on the iMac. Almost instantly, I watched it break on the Macbook.

Well, that’s creepy.

With the help of this post, I discovered that Mail now syncs Smart Mailboxes to iCloud (I suppose using the key-value store, as this is for non-iCloud mail accounts). Inspecting the properties files mentioned, I found that the IMAP URLs for the folders differed between the two machines – one using imap.gmail.com and the other imap.googlemail.com. The sync would merge them, and whichever had the account setup differently would fail.

All I had to do was change the IMAP server so both accounts matched, then edit the smart mailbox (without changing anything and pressing Ok). It would be updated to the new server address and synced, magically repopulating on the other machine.

Syncing Smart Mailboxes is an awesome feature that I was wishing for when setting up the Macbook a few weeks ago – and I hadn’t heard about it prior to today. I think the transparent sync is going to be a great thing as more apps add support for it, but hopefully there’ll be more attention paid to making it clear where it is going to happen, and dealing with conflicts. In this case, it was expected behaviour, but it looked like an awful bug in Mail at first glance.

Hopefully this info will avoid someone facing the same confusion!

Other than that, the upgrade has gone really well. In the past I’ve written long blog posts about what was required to upgrade – this time it is basically identical to Lion. Reinstall Java, reinstall Xcode command line tools, done. Now to start playing with new features…

7 responses to “OS X Mountain Lion Mail and Smart Mailbox Syncing

  1. I’m actually trying to STOP smart mailbox syncing. I use my laptop for different purposes that my desktop and want a different set of smart mailboxes. In fact, each of the two computers has different email addresses with only some overlapping, so I wind up with useless smart mailboxes on both.

  2. I thought I’d clean up a bunch of e-mails using the Smart Mailbox feature. I set up a new one that looked for the work “unsubscribe” anywhere in the e-mail to grab any newsletters I get. Worked great and I spent 20 minutes deleting tons of e-mails. Then I went to the trash folder and emptied it. An hour later I open my e-mail on my iMac and all the emails were back again! I tested deleting a couple, emptying the trash, and then click back on the smart mailbox… they reappeared. Is this a bug or am I doing something wrong??

    • It depends, but it sounds like maybe you’re using a google apps mail account (which archives instead of binning trash) and the smart mailbox includes “all mail”. I’d suggest checking what folder Mail reports the reincarnated messages to be in.

  3. Thank you! That solved my problem.

  4. I’ve got smart mailboxes working fine for all incoming mail where I have a smart mailbox set up. All replies I make to any incoming smart mailbox mail also appear however, any message i initiate i.e. not by clicking on reply from an incoming message does not show in the smart mailbox. I can find them easily enough by searching the sent items box. I’ve got the ‘include messages from sent’ box checked in the smart mailbox setup pane. The email address I use is identical to that of the smart mailbox.

    Any ideas.

    Howard

  5. I discovered another scenario where smart mailboxes keep getting reset when you have multiple Macs synching. I had my Gmail account setup on my Mac Pro with just my user name for my login on it but on my MacBook Pro I had my full email address. I.E. if my full Gmail address was example@gmail.com, I was logging in as “example” on one Mac but “example@gmail.com” on the other. Gmail will accept it either way, but this breaks the synching of smart mailboxes.

    I posted this in hopes that I might save somebody some trouble. It took my quite a bit of searching and trial and error to figure this out.

  6. Thanks – this solved a problem I was having on a new MacBook Air keeping the smart mailboxes rules synched between two computers – I had set up iCloud on one of them using xxxx@mac.com and the other as xxxx@me.com – that was enough difference that the rules kept getting forgotten on one or other Mac – I’d fix it on the broken one, and that then broke it on the other one.

    Logging one out of iCloud and then using the same xxxx@me.com to log in on both computers and voila – Smart Mailboxes now working.

    Thank You!!!

Leave a comment