New Smart Mailboxes Disappear (again & again)

There are two smart mailboxes setup in the "Mail" application on my desktop Mac ("All Mail" & "Newspaper"). These mailboxes also exist on my laptop. On my desktop, I deleted the "Newspaper" mail box and created several new smart mailboxes. The next time I looked, the new mailboxes "self-deleted" and restored the "Newspaper" mailbox. I tried this several times with the same result. I then created a new smart mailbox on the laptop and deleted the "newspaper" mail box. Same thing happed; the new mailbox disappears and ther "newspaper" mailbox returns.



I use use IMAP with my Gmail account and forward my "iCloud" mail to my Gmail account. The "Mail" setting is "checked" in my iCloud system settings (but not sure what impact that has on my setup). I thought this setting may allow the smart mailboxes to synchronize between the Mac and possibly my iPhone. I am using OS X 10.9.3. I recently returned to mac "Mail" after several years of simply using the Gmail web interface on the Mac (plus iOS Mail) and am a bit unclear how the iCloud sync should work. I am pretty happy with the newer IMAP capabilities after using POP in the past.


Any suggestions on how I can create (and keep) my smart mailboxes?


Thanks,

Dave

PowerMac, OS X Mavericks (10.9), 2009 2.66 GHz 8 Core, 24 GB RAM,

Posted on Jun 14, 2014 3:16 PM

Reply
16 replies

Sep 15, 2014 6:07 AM in response to David Strait

Hey David, did you ever find a solution to the disappearing smart mailboxes issue?


Every month or so, all of my smart mailboxes are gone and I have to recreate them (things like all non-mailing-list new messages, all unread messages today, etc.) This morning I sat down at my machine that has been running all night, and viewed the "today's messages" smart mailboxes, which was the one that was open on the screen from when I went to bed. Then when I changed mailboxes to check the inbox for a particular account, when I went to view the "today's messages" smart mailboxes, all of the smart mailboxes were gone. No restart of mail, just gone mailboxes.


dianeoforegon's and all the discussion in the other thread is about IMAP and syncing issues, which seems unrelated to these smart mailbox issues.


Anyone have any idea?

Sep 16, 2014 7:12 AM in response to Eric Root

I got rid of com.apple.mail.savedState (buried inside of ~/Library/Containers/com.apple.mail/Data/Library/Saved Application State/ ) and that did not make things re-appear. The three plists inside ~/Library/Mail/V2/MailData that mention SmartMailboxes are all still there, with text inside of them seeming to indicate that they have the information about the smart-mailboxes that I have created:

SmartMailboxes.plist

SmartMailboxes.plist.backup

SmartMailboxesLocalProperties.plist


I will try trashing these, and the savedState file again, and then recreating the SmartMailboxes by hand.


At the very least I would love to know a way to save a copy of the smartmailboxes outside of Mail.app so that I can more easily import them if they again disappear like they have a half dozen times.


Maybe I need to do the create new login account and set up things there dance that "dizzyboy" said worked for him, however my problem is a bit different. The people in the Mountain Lion thread would lose their smart mailboxes after every new launch of Mail.app, while mine disappear on a longer time scale.

Sep 17, 2014 8:59 AM in response to David Strait

I have your solution. 🙂


The cause is likely an iCloud sync problem, which will come as no surprise to anybody, and can be fixed by restoring from a Time Machine or other backup.


Quit Apple Mail and then restore from backup the file at:

~/Library/Mobile Documents/com~apple~mail/Data/MailData/ubiquitous_SyncedSmartMailboxes.plist


I too have experienced this problem numerous times over the last couple of years, and twice in the last two days, so I understand how frustrating this can be. This is one of the main reasons some of us rush to install the next OS X version because we're thinking, "Surely, Apple has fixed this long-standing bug this time." And it might, but we often gain whole new problems that will then go unfixed for years.


In trying to resolve this problem I noticed that when I tried Time Machine to see if I could restore the smart mailboxes, no matter what I selected I always got an "Invalid snapshot" and "No mailbox selected" errors. So here's yet another serious bug.


I'll describe the way I found out which file to restore so that you can use this technique for other problems.

  1. Switch to Finder
  2. Select File > Find.
  3. Enter search criteria of:
    • Last modified data is within last 0 days
    • System files are included

      (select Other… to add this in if it's not available and make sure to add it to the menu.)

    • File visibility Visible or invisible

      (as above)

  4. Reverse sort by Date Modified.

    If that column is not available, right click on one of the other columns and add it in.

  5. Wait several seconds for the files in the window to populate and settle down.
  6. In Mail, create a new smart mailbox.
  7. Observe in the Finder window that a new file is created: iCloud > MailData > ubiquitous_SyncedSmartMailboxes.plist
    • My guess is that this file was deleted during a sync.
    • iCloud/MailData is an alias to ~/Library/Mobile Documents/com~apple~mail/Data/.

Sep 17, 2014 10:08 AM in response to Tom Sheppard

Thanks Tom, that is a great suggestion. I turned off iCloud "Documents & Data" a long time back, so I don't think there should be any syncing of this type going on, but I recall such syncing from the MobileMe days. In any case when i do the "find" dance as described and make a new smart mailbox, no plist seems to be modified, and I do not have a ~/Library/Mobile Documents/ folder at all, though two other users on the system have the ~/Library/Mobile Documents/com-apple-mail/Data/MailData/ubiquitous_SyncedSmartMailboxes.plist file.


There are some "Info.plist" files within IMAP and Exchange .mbox folders within ~/Library/Mail/V2/ that have recent modification times, but these are unlikely to be the storage space for Smart Mailbox information.


Suprisingly, the search to recently modified files does NOT turn up SmartMailboxesLocalProperties.plist within ~/Library/Mail/V2/MailData/ even though it should show up, being modified within the last minute.

Sep 17, 2014 10:16 AM in response to Johann Beda

For me, if I rename the two files

~/Library/Mail/V2/SmartMailboxesLocalProperties.plist

~/Library/Mail/V2/SyncedSmartMailboxes.plist

my SmartMailboxes are gone and two new files named as above appear. If I then replace the newly created files with the original ones, my SmartMailboxes again reappear (quitting mail before doing the file manipulations and then relaunching mail each time).


Maybe just saving copies of these two files will allow me to quickly recreate my setup if things get screwy again will work.

Sep 23, 2014 9:47 AM in response to Johann Beda

WHAT DIDNT WORK for me:


I have the problem, but I never had Docs & Data switched on, so Sheppard's solution does not apply for my case (there are no such files as mentioned there). Neither did Beda's move work for me. Causing fresh copies of the two files he mentioned to be created does bring back the Smart Mailbox category and a default Today smart mailbox, but putting the original files back in position, puts the problem back to square one -- no smartmailboxes appear.


WHAT DID WORK for me:


What I found worked was moving smartmailbox specifications from SmartMailboxes.plist into a clean SyncedSmartMailboxes.plist file.


Steps: (This procedure requires something that enables you to open and edit plist files (e.g. Xcode). As always, keep safeties of everything before you mess around.)


0) Before starting, check this file and confirm your smart mailbox specifications are actually still in there. If not, this won't work.

~/Library/Mail/V2/SmartMailboxes.plist


1) Taking a tip from Beda, move the following files out and then launch Mail and quit it, to force creation of new copies of these files.

~/Library/Mail/V2/SmartMailboxesLocalProperties.plist

~/Library/Mail/V2/SyncedSmartMailboxes.plist


2 ) Open the new SyncedMailboxes.plist. It contains a single item (a default Today smartmailbox specification). Delete that.


3) Open your SmartMailboxes.plist. It contains a sublist called 'mailboxes' where all your smart mailbox specifications reside. Copy each of these items over to (the top level of) SyncedMailboxes.plist. You have to do this one at a time if you are using Xcode, because there is no multiple selection available.


4) Save and close SyncedMailboxes.plist (and close any other plists for good measure).


5) Launch Mail and your smart mailboxes should be back.


Hope it works for you as it did for me.

Mar 10, 2015 8:10 PM in response to gbris

So far, gbris' procedure has come closest to helping me to resolve my issues with smart mailboxes in Mail. I've also learned that it helps both to lock the actual file SyncedSmartMailboxes.plist and to keep a separate locked copy of the current version (just in case all else fails): When the unexpected loss of smart mailboxes occurs, closing and reopening Mail has been sufficient to restore the correct list inside the program.


Today I found a relatively easy way to make changes and/or additions, as long as a locked copy of the file is available:

1) Rename or move file SyncedSmartMailboxes.plist so that Mail can't find it.

2) Open Mail; as stated previously, Mail makes a new (cleared/empty) version of the file.

3) Create a new smart mailbox for each one you want to add to your existing list, and set it up as needed.

4) Open the new (cleared) SyncedSmartMailboxes.plist and find the name of the *first* new mailbox in the file. (The order of the smart mailboxes should be the same as their order in Mail; since it's still open, feel free to check!)

5) When you find the first mailbox name, backtrack to locate the starting dictionary tag for that mailbox ("<dict>").

6) Select multiple lines, starting from the beginning of the line containing that tag, and select all lines through the closing tag (</dict>) for the last of the new mailboxes. If your intention is to select all of the newly created mailboxes (the easiest option), you'll need to select all of the lines between (but not including) the tags "<array>" and "</array>". Copy the multiple lines.

7) Unlock and open the renamed (or moved) SyncedSmartMailboxes.plist in TextEdit. Search on the name of the existing smart mailbox *after* which you want to include the new mailboxes.

8) Position the cursor at the beginning of the first line after the positioning mailbox and paste the text.

9) Verify that the copied <dict></dict> string ended up in the correct spot.

10) Delete or rename the "dummy" file SyncedSmartMailboxes.plist so that it's not used anymore.

11) Rename and re-lock the original file SyncedSmartMailboxes.plist.

11) Close and reopen Mail. The mailboxes should be in the correct order, with the new mailboxes added.

Mar 10, 2015 8:59 PM in response to lrws

P.S. When you're comfortable with the above procedure (it's easier than it looks!), you can use the reverse process to copy one or more mailboxes (between the <dict></dict> tags) from the "renamed original" file into the "newly cleared" file; then make changes from inside Mail; and, finally, copy the modified mailboxes back to the "original" file. As before, do steps 10-12 above.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

New Smart Mailboxes Disappear (again & again)

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.