2

I have a number of Mail.app rules whose action is to move the message to mailbox A. I just created a new mailbox B that I want them to move to instead.

Doing this by hand is very tedious. Also, there's a bug in the rule editor that causes the list of actions to shift up each time I edit one of them, and after doing a few rules the dropdown with the list of rules is moving out of the little window so I can't click on it.

So I quit out of Mail.app and loaded ~/Library/Mail/V5/MailData/SyncedRules.plist into a text editor (Emacs in my case) and went through this, changing

        <key>CopyToMailboxURL</key>
        <string>imap://[email protected]/A</string>

and

        <key>MailboxURL</key>
        <string>imap://[email protected]/A</string>

to

        <key>CopyToMailboxURL</key>
        <string>imap://[email protected]/B</string>

and

        <key>MailboxURL</key>
        <string>imap://[email protected]/B</string>

in all the relevant rules.

But when I restarted Mail.app, all the rules I modified reverted to their old actions. How do I get my manual changes to be used?

I don't have iCloud syncing enabled for Mail, so I don't think it should be in iCloud.

Every rule has a field like this:

        <key>TimeStamp</key>
        <integer>96332387</integer>

with the same number.

Do I need to increment that so it will know that the rule changed on macOS High Sierra 10.13.6?

UPDATE:

I tried using

defaults read com.apple.mail

This has lots of preference settings, but it doesn't include the rules.

7
  • Is there a reason why you are not using defaults read ... (or export) and defaults write ... so that you can change the preferences in the database which notifies Mail when running that the preferences have changed and persist them to storage?
    – bmike
    Oct 1, 2020 at 16:15
  • How would I use that? defaults read ~/Library/Mail/V5/MailData/SyncedRules.plist says Domain /Users/barmar/Library/Mail/V5/MailData/SyncedRules.plist does not exist
    – Barmar
    Oct 1, 2020 at 16:19
  • Exactly - you're not getting to where Mail is storing things - you want to avoid thinking of the filesystem and discover where Mail stores these - whether they are stored in system / iCloud / user domain is up to the programmer - not us. defaults read com.apple.mail is where I'd start, but I don't have mail rules - so my results won't help you
    – bmike
    Oct 1, 2020 at 16:20
  • My research has told me that this is where the rules are stored. Whenever I exit Mail, it gets rewritten, and I can see all my criteria and actions in it.
    – Barmar
    Oct 1, 2020 at 16:21
  • If I should be using defaults to update them, I need to know the domain and keys.
    – Barmar
    Oct 1, 2020 at 16:22

0

You must log in to answer this question.

Browse other questions tagged .