7

I have a Gmail account that is configured on three different Macs, let's call them Home, Work, and MacBook. Home and MacBook are on iCloud, Work is not, and MacBook is the one experiencing the issue.

No matter what I seem to do, Apple Mail on the MacBook, for only this Gmail account, displays no messages in any folder, and indicates two unread messages in the inbox. Home and Work display the same account correctly, with an accurate reflection of the inbox and messages contained in other folders.

Things I have tried:

  • Synchronize
  • Rebuild
  • Disable account, quit, remove ~/Library/Mail/V2/IMAP-address@imap.gmail.com folder, then restart
  • Removed the keychain items for the account from iCloud, remove folder above

Each time, the account comes back with two unread messages out of zero. The Account Info screen shows accurate numbers for everything except the "Sent Mail" folder (though nothing in any folder displays). In experimenting with enabling and disabling IMAP for labels within Gmail, I have seen the item for the "Sent Mail" folder in Account Info display with the correct number of messages, but a title of "Sent Mail" does not exist. Very odd. Sorry I don't have a screenshot of that.

Any ideas?

  • Well, of course as soon as I give up all hope, something changes. Somewhere in the repeated iCloud enabling/disabling of the account, the message display got un-fscked. But, the damn phantom 2 is still sitting on the Inbox and will not go away after a rebuild... – NReilingh May 9 '14 at 1:59
  • What version of Mail and/or what build of OS X? – bmike May 9 '14 at 15:44
  • @Bmike 7.2/10.9.2 (latest as of now) The issue has been cleared up, but I don't completely understand why. – NReilingh May 9 '14 at 15:57
  • The reason I asked for build, is I'm seeing quite different behavior on systems between builds as Mail is clearly getting redesigned to be more of a threaded / XPC client-server app than a traditional monolithic main loop app. Also, some Macs like Mac Pro have newer builds than the mainstream 10.9.2 build and I wanted to isolate that from the mix. – bmike May 9 '14 at 16:01
  • Iiinteresting -- this is a latest-generation MacBook Air, build 13C1021. – NReilingh May 9 '14 at 16:03
4

I'm not sure if this will work for everyone, but I was able to resolve the issue in two parts. To get messages to display properly for all folders on the account, I needed disable/remove the account from iCloud so that it was no longer being synced. Then I removed the mailbox folder described in the question, and added it locally to the MacBook.

After the folders were displaying properly, the index was still a little messed up in that the inbox was displaying an unread count that didn't exist.

To get rid of this, I had to rebuild the full index -- this appears to be different from the Rebuild function that exists in the Mailbox menu, and is more similar to what happens when you open an upgraded version of mail for the first time.

  1. Quit Mail
  2. Navigate to ~/Library/Mail/V2/MailData
  3. Delete any file that starts with "Envelope Index"
  4. Start Mail
  5. Follow prompts to allow Mail to rebuild the index -- this may take a few restarts of the app.
  • Awesome work. I wonder if just vacuuming the database file would have fixed things up for you? apple.stackexchange.com/a/66725/5472 – bmike May 9 '14 at 15:57
  • It's possible -- intuitively it felt like the initial issues with folders and message display had more to do with the server configuration than with the index, but who knows. – NReilingh May 9 '14 at 15:59
1

You are on the right track with cleaning things "like an animal" in ~/Library, but there are some downsides to this.

The first thing to do is to make sure it's really not a problem with Apple Mail and Gmail server settings. I would make a new user account on the problematic Mac and set up just that mail account. Your theory that the MacBook is the problem is most likely, but what if both other Macs are corrupt and the MacBook is actually getting what Gmail is sending out (albeit Apple Mail is interpreting those bits wrongly).

If I were to mess in ~/Library, I'd do the following:

  • Make a good backup of my Mac (time machine or other)

  • Zip up Mail Downloads - deleting the mailbox data will leave orphan downloads, so I'll need to sort those later.

  • Quit mail and disable all mail accounts in the Internet Accounts pane of system preferences (uncheck them)

  • Move the following directories and files to trash.

~/Library/Mail
~/Library/Containers/com.apple.mail
~/Library/Containers/com.apple.MailServiceAgent
~/Library/Preferences/com.apple.mail-shared.plist

  • Reboot and empty trash / reverify that the above files are really gone.

  • Delete and re-add that one gmail account to Internet Accounts from System Preferences

0

I recommend to prevent the gmail to sync everything.

That can be achieved by going to the "labels" sections of the gmail settings.

You can also go to the IMAP/POP section of the settings and limit the number of messages to sync per IMAP folder, I use 1000 messages.

I know It's not a solution but certainly help me a lot with gmail sync problems with Apple Mail.app.

0

I tried everything you tried, and I also tried bmike's suggestions. Deleting all the preferences/caches etc caused more problems than it solved, so I put them back and decided to try a more surgical approach. For anyone still reading this, the thing that seemed to fix it in the end was

  1. Deleting the relevant folders in ~/Library/Mail/V2/
  2. Editing Accounts.plist in a text editor, and removing the section pertaining to the unwanted account.

As everyone else has suggested, make sure you've got backups before you try anything - but it worked fine for me.

-1

Based on the information you gave, it sounds like Gmail is set up incorrectly on the Macbook. I would make sure that the mail settings in Mail>Preferences>Accounts is exactly the same on all three computers. It really sounds like Gmail on the Macbook is set up as a POP account.

  • If the account were set up incorrectly, wouldn't no mail download and no mail be able to be sent or received? – bmike May 9 '14 at 15:58
  • Mail has two protocols. One for incoming mail and one for outgoing. If you're not getting mail then there's a problem with the incoming settings, but not necessarily the outgoing. Since all other mail is being received then there's a problem with the Gmail incoming settings. This could be anything from authentication errors on the server side to a mistyped server address in the mail settings. – user77771 May 10 '14 at 8:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .