Lost mail rules when upgrading to ML, can't restore from time machine

Hi,

I've installed mountain lion and restored from time machine and mail rules were not there. There's only news from apple.

I tried to restore the rules myself (MessageRules.plist and MessageRules.plist.backup) but when opening mail rules were not there yet. Nevertheless, i can add rules manually, so if there was a way of looking at the past rules I could just copy them (though it's not the best way).

Apple Mail-OTHER, OS X Mountain Lion

Posted on Jul 26, 2012 3:51 AM

Reply
55 replies

Jul 29, 2012 3:14 AM in response to lotdrops

Me too.


Looking in the Mail folder (Library/Mail/V2/MailData) showed that the MessageRules.plist and backup files were included with the new Mountain Lion files, and still with earlier dates than "Today" when I installed Mountain Lion.

Property List Editor confirmed that all the rules were intact.

As they're already there in the right folder, there doesn't seem much point in restoring any files from Time Machine.


However, quitting Mail and relaunching it apparently made the Rules reappear, without doing anything to the files. Try it (perhaps more than once).

Jul 29, 2012 12:23 PM in response to lotdrops

So after a little poking around I found that my rules were still intact in the ~/Library/Mail/V2/MailData/MessageRules.plist file. The problem is that Mail is pulling from a new .plist called SyncedRules.plist. I have relaunched Mail. Rebooted the machine. Nothing restores the Rules. I am hesitant to copy the rules over since there might be other files that need updating as well. For the moment, I will continue to try and figure out how to merge the original MessageRules.plist into the SyncedRules.plist. I imagine it has everythign to do with iCloud and having the Rules EVERYWHERE!!

Jul 29, 2012 1:42 PM in response to J3 L U N T

Hi,


I opened the SyncedRules-plist in an editor and it seems we found the problem.


I'm not an actuall programmer, but SyncedFilesInfo.plist lists the files SyncedRules.plist, allSignatures.plist and SyncedSmartFolders.plist and I think 10.8 connects and syncs these files with iCloud-Accounts.


So I compared the .plist files "messageRules" and "SyncedRules" by creating an example-rule. It should look for a string in the sender-field and then delete this matched mails. Now there are a few new meta-keys in the 10.8 rule: "SendNotification" is probably for Notification Center and "Version" looks like autosave stuff. But also there is no more "Active"-key, so I don't know, how Mail recognizes, which rules are active and which are not.


So far I tried to insert an old rule of Lion from my messageRules.plist, added the new Keys and deleted the Active-Key into SyncedRules.plist and started Mail again, but it deleted my old rule immediately. There are some UniqueIDs, perhaps that's the problem.


I hope apple is going to fix this in the next update, because this is just ********. At leat there should be some kind of migration-tool. I wonder why there hasn't been a shitstorm yet.


Sorry for my bad english, I'm working on it. But I hope I could help somehow.

Aug 1, 2012 2:06 AM in response to normdVA

My rules are still there, so perhaps Apple support speak with resource forked tongue.


Comparing an old (pre ML) rules file from 20th June with the ML one, the differences are:


The file name was: MessageRules.plist, the ML one is SynchedRules.plist. Both are in my V2 folder, but the old Rules have been copied (by Mail, not me) into the new SynchedRules file.


In the old file, for each item (Rule) the first line was Active (Key) String (Type) 1 (Value). In the ML file, this line is no longer there, so the first line is AllCriteriaMustBeSatisfied.

You can see these differnces in the "preview" part of Finder Show Info, if you have the two files to compare.


Thus, just copying and renaming the old Rules file probably won't work, because of this difference. Mail probably just makes a new file because the copied file isn't as expected. It should be possible to edit the old plist file to remove the "Active" line, and rename it to SynchedRules.plist (but see below). The top is slightly different, just below <dict>, as this relates to the Active line. There are a couple of lines at the bottom that aren't in the new file.

The "Active" line that has gone is now in a file called RulesActiveState.plist. This file is just a list of RuleIds from the SynchedRules.plist (like this:

AC6F6611-FF61-4AA6-9682-BA100EFAC233)


Doing this does sound rather tedious, but might be quicker than manually re-entering blocked email addresses etc. to replicate old rules. As plist files are in xml format, it should be possible to use a text editor to delete the unwanted "Active" line from the message rules list by Find & Replace All (with nothing). All this could then be copied to the "SynchedRules.plist. You would need to copy the RuleIds into the RulesActiveState.plist as well.

Make a copy of the files first just in case...

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.

Lost mail rules when upgrading to ML, can't restore from time machine

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