Reprinted from TidBITS by permission; reuse governed by Creative Commons license BY-NC-ND 3.0. TidBITS has offered years of thoughtful commentary on Apple and Internet topics. For free email subscriptions and access to the entire TidBITS archive, visit http://www.tidbits.com/ Mail in Mavericks Changes the Gmail Equation Joe Kissell Apple Mail in Mavericks treats Gmail accounts differently than any previous version of Mail did. Although some of the changes are quite clever, the implementation has flaws. Your mileage may vary, of course, but I've seen a number of folks on Twitter complaining about some of the same things I've found. Here's what I've observed and what you can (and can't) do about it. Pseudo-IMAP Changes -- Mail and Gmail were never a fantastic combination out of the box, because Gmail has a wacky, highly nonstandard way of using IMAP, and Mail always wanted to treat Gmail as though it were a conventional IMAP server. But, after much trial and error, I eventually found a combination of Mail settings and Gmail settings that, prior to Mavericks, resulted in a stable ' and indeed largely pleasant 'experience. As I documented in '[1]Achieving Email Bliss with IMAP, Gmail, and Apple Mail,' 2 May 2009, you just do x, y, and z (well, 21 steps' worth of x, y, and z), and it'll all work smoothly. Well, forget about that under Mavericks. In fact, following those old directions now will lead you far from bliss. And if you followed them before upgrading to Mavericks, you'll need to take some steps to undo some of the problems. Before Mavericks, the approach that worked best with Gmail accounts in Mail was to go into Gmail's settings and prevent the All Mail label from being exposed to IMAP clients. All Mail is exactly what it sounds like 'all your saved and sent messages, regardless of whether or how they're labeled ' and having All Mail enabled, prior to Mavericks, meant that Mail would download at least two copies of every message (one in All Mail and one each in a mailbox corresponding to any labels you applied in Gmail). That led to lots of duplicate messages, wasted disk space and bandwidth, and reduced performance. But hiding All Mail prevented the problem. Mail in Mavericks treats archiving Gmail messages essentially the way Gmail itself does 'moving a message from the Inbox to Archive removes the Inbox label, which means it shows up only in Gmail's All Mail list (unless you apply another label in Gmail or move it to another mailbox in Mail). Unfortunately, if you hide the All Mail label from Mail in Mavericks, then any messages you move from your Inbox (by filing or deleting) magically reappear there later 'after you switch to another mailbox and switch back, or close and reopen Mail. That will, of course, drive anyone to distraction. I reported this to Apple as a bug, and it was marked as a duplicate, which means only that I wasn't the first person to report it, not necessarily that Apple is planning to fix it. The only way to 'solve' this problem is to reenable All Mail (which, by the way, affects all IMAP clients, not just Mail). Which I'll now tell you how to do, but don't do it until you read about the consequences. To reenable All Mail, log in to your Gmail account on Google's Web site. Click the gear icon and choose Settings from the pop-up menu. Click Labels. Find All Mail (under System Labels, near the top) and select its Show in IMAP checkbox. Now, here's what's going to happen. Mail ' despite the fact that it has already cached all your Gmail messages 'will download all of them again. For me, with about 321,000 messages totaling over 4 GB, that took nearly two full days, even with a super-fast Internet connection. That's an unreasonably long period of time, and a crazy waste of bandwidth since you already have copies of all those messages! Mail actually does this in stages, and I won't bore you with the details, but I will say that at a certain point in the process, your ~/Library/Mail folder could be twice as large as it should be. Don't panic about that. When that big download is done, the good news is that Mail will have only one copy of each message 'the one in All Mail! Messages you'd labeled in Gmail will still show up in mailboxes bearing the same name. (And, for the first time, Mail will have a copy of all your messages that didn't have any label at all ' ones you'd archived without explicitly filing.) But those messages are not really in those mailboxes. What Mail does behind the scenes is to add a little invisible XML code to the end of each message telling it which other mailbox(es) it should be displayed in. And that's an entirely reasonable strategy, as far as it goes. However, it seems Apple didn't entirely think through the implications. Most seriously, with All Mail enabled, Mail periodically gets into a state in which, according to the Activity panel (Window > Activity), it's synchronizing my Gmail Archive (that is, All Mail) and updating the cache directory for my Gmail account. That's all well and good as long as it happens in the background. But when one of these syncing fits starts, changes to messages in my Inbox made in other clients or on the Gmail Web site aren't reflected in Mail. Not even if I quit and restart Mail, or rebuild the Inbox, or force a synchronization! There appears to be nothing I can do but wait, and sometimes that wait is hours. It's not like this all the time; sometimes Mail syncs up with IMAP servers instantly, as it should. But this is the behavior that makes me truly crazy 'if I have to keep Gmail open in a Web browser to make sure I'm getting all my messages, I might as well not be running Mail at all. Another problem is that AppleScript breaks badly with Gmail accounts. If you have any AppleScripts that operate on messages in Gmail mailboxes (I have some that are crucial to my workflow), the scripts will report the mailboxes (except Inbox and All Mail) as being completely empty. Of course, they are empty in reality, but they don't look empty in Mail because Mail does the right thing when interpreting Gmail's labels. Unfortunately, AppleScript doesn't know anything about this. (I also reported this as a bug, and it, too, was marked as a duplicate.) In the meantime, my workaround is to run Mountain Lion in a VMware Fusion virtual machine so I can still use my old Mail AppleScripts. As I mentioned, turning on All Mail affects not just Mail but any other email client you may use on other devices, as well as older versions of Mail. So, 'fixing' Gmail on my Mavericks system breaks it on other systems (including my Mountain Lion virtual machine!), forcing me to choose which set of problems I'm willing to cope with. I find it particularly upsetting that Mail doesn't tell you about the need to enable All Mail. Mail could pop up a little message saying, 'Hey there! I noticed that you have a Gmail account and I'm not seeing All Mail. That's going to be a problem from now on; here's how you fix it.' But this is something you just have to work out for yourself 'a major architectural change that isn't even mentioned in Help > What's New in Mail? let alone addressed in a helpful error message. But until I can count on Mail to give me a reasonably live view of my Inbox, any such warnings are pretty much moot. Other Issues -- I don't use Mail's smart mailboxes much, but the word on the street is that Mail in Mavericks is having some trouble with those, even in non-Gmail accounts. As in, the mailbox has a badge indicating it contains unread messages, but when you look inside, there aren't any. I've also heard that rules don't work consistently, especially when applied after the fact (Message > Apply Rules) to incoming messages that were marked as read on another device. I haven't seen this problem myself, but the report comes from a reliable source on the TidBITS staff. And, I haven't bothered to mention the fact that most third-party Mail plugins broke under Mavericks. That's normal ' however, irritatingly, some of the plugins I depend on most were updated for the first golden master of Mavericks but haven't yet been updated for the final release, because Apple didn't officially inform developers that there was a second golden master, much less give them sufficient time to work with it before shipping Mavericks. So we may have to wait a while for those updates. If you've noticed other wonky behavior with Mail in Mavericks (whether pertaining to Gmail or not), please tell us in the comments. I'd like to think that an OS X 10.9.1 update will magically fix all this stuff, but I won't hold my breath. I'm sorely tempted to look for a different email provider (something I was pondering anyway, for unrelated reasons), but it irks me to no end that I should have to do so now just because Apple broke Mail so severely in the very process of trying to improve the way it works with Gmail. The alternative, of course, would be to switch email clients, but although I've tried many of them, I have yet to find one that offers all the crucial behaviors I get from Mail and my carefully chosen set of plugins. What I really want to do is continue liking Mail, but Mavericks makes that impossible at the moment. References 1. http://tidbits.com/article/10253 .