Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Restoring Rules in Mail 6

I made a mistake (helped by nont weel described new functonality): Upgrading from lion to ML I accidentally activate the "document & data" sharing on icloud. This synced the rules of mail 6 of one of my user in icloud. Then in theother user I lost my hundred of rules built in years of work...
I my backup I found the "MessageRules.plist" file but the new mail uses three file to accomplish the job....


file://localhost/Users/macbook/Library/Mail/V2/MailData/RulesActiveState.plist

file://localhost/Users/macbook/Library/Mail/V2/MailData/UnsyncedRules.plist

file://localhost/Users/macbook/Library/Mail/V2/MailData/SyncedRules.plist


After a few try I realized that the file to modify is "UnsyncedRules.plist". I've been able to add a rule (ONLY ONE) from my backup files opening the UnsyncedRules.plist and the MessageRules.plist with XCode draggin it from the second to the first one...

That worked but only for one rule...


Adding other rules causes mail 6 not to recognize the file formatting and report an error or simply rewrite the file from scratch...


I've made a try also with text wrangler but with bad result....


How can i solve (without loosing the email downloaded in this 2 weeks)?


In order to not mistake anymore, where can I find an updated explanation of the meaning of "Document & Data" sharing in iCloud?


Thanks

Mac mini Server (Mid 2011), OS X Mountain Lion

Posted on Aug 13, 2012 2:48 AM

Reply
Question marked as Best reply

Posted on Aug 13, 2012 3:16 AM

reading this post


https://discussions.apple.com/thread/4139498?answerId=19084819022#19084819022


I solved the problem, using textwrabgler and simply deleting at the beginning of my backup MessageRules.plist file:


<dict>

<key>rules</key>


and thit at the end


<key>version</key>

<integer>999</integer>

</dict>


Renaming and replacing (with mail closed) in here:

file://localhost/Users/macbook/Library/Mail/V2/MailData/SyncedRules.plist


I still can't understand the UnsyncedRules.plist file....

4 replies
Question marked as Best reply

Aug 13, 2012 3:16 AM in response to melastudio

reading this post


https://discussions.apple.com/thread/4139498?answerId=19084819022#19084819022


I solved the problem, using textwrabgler and simply deleting at the beginning of my backup MessageRules.plist file:


<dict>

<key>rules</key>


and thit at the end


<key>version</key>

<integer>999</integer>

</dict>


Renaming and replacing (with mail closed) in here:

file://localhost/Users/macbook/Library/Mail/V2/MailData/SyncedRules.plist


I still can't understand the UnsyncedRules.plist file....

Apr 2, 2014 2:59 AM in response to melastudio

I had to do the following to restore the signatures and mail rules:


1. Quit Apple Mail


2. Turn of these settings: System settings / iCloud:

[ ] Mail

[ ] Documents & Data


3. Copy the old Rules to the new location:

cd /Users/phil/Library/Mail/V2/MailData

cp "/Volumes/TimeMachine/Backups.backupdb/Computername/Latest/Macintosh HD/Users/phil/Library/Mail/V2/MailData/RulesActiveState.plist" .

cp "/Volumes/TimeMachine/Backups.backupdb/Computername/Latest/Macintosh HD/Users/phil/Library/Mail/V2/MailData/SyncedRules.plist" .

cp "/Volumes/TimeMachine/Backups.backupdb/Computername/Latest/Macintosh HD/Users/phil/Library/Mail/V2/MailData/SyncedRules.plist" UnsyncedRules.plist

cp "/Volumes/TimeMachine/Backups.backupdb/Computername/Latest/Macintosh HD/Users/phil/Library/Mail/V2/MailData/MessageRules.plist" .


rm -rf Signatures

cp -r "/Volumes/TimeMachine/Backups.backupdb/Computername/Latest/Macintosh HD/Users/phil/Library/Mail/V2/MailData/Signatures" .


4. Restart Apple Mail. The old rules and newly copied rules are both there. So I deleted the old rules.


5. System settings / iCloud:

[ ] Mail

[x] Documents & Data


6. As old rules moved mails to wrong mailboxes I had to identify these old wrong mailboxes and apply the restored rules to them.


If Apple Mail didn't find the old (wrong) mailboxes it created it new and placed the emails in there. So no emails were lost!


See also "iCloud problem with Mail.app": https://discussions.apple.com/thread/4626416

Mar 1, 2015 2:20 PM in response to melastudio

Thanks for this! Fixed my problem as well.


I deleted the lines you mentioned, then copied and pasted everything that was between them -- from the top <array> tag to the bottom </array> tag -- and pasted it in to replace the enclosing <array> tags in syncedrules.plist. Restarted Mail and the rules were displayed.f this started when I chaged Apple


I also had my signatures disappear, so I had to restore them from a backup.


For me, all of this started when I changed iCloud accounts. After signing out of one and into the other, calendars disappeared (expected), and Mail's Rules and Signatures also disappeared -- which was very unexpected, since I did NOT have Mail checked to sync in the iCloud Preference Pane in System Preferences.


Apparently, if you have Documents and Data checked for syncing, Mail's settings will be synced, even if Mail syncing is turned off. This is entirely non-intuitive.


I ended up going back to the old iCloud account and settling on using a separate Apple ID for non-sync stuff like iTunes purchases.

So the question is -- now that I have Document and Data syncing turned off (on both my Mac and my iPhone, for safety) why is Mail.app still using the syncedrules.plist file instead of going back to using the messagerules.plist file?


Again, that seems entirely non--intuitive.


Things have stabilized for now, but I trust iCloud syncing less and less with each experience like this.

Restoring Rules in Mail 6

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