~/Library/Mail/V9/MailData
/usr/libexec/PlistBuddy -c print <filename>
or
/usr/bin/plutil -p <filename>
Could you post the script you wrote? I've held off on writing many more rules because worried I'd lose track of them.It would be nice to be able to print out all the Rules as you see them in Preferences, but I have what I need for now.
Since I am primarily interested seeing the Rules name and destination folder for each rules, I wrote a simple shell script to parse the syncedRules.plist file and print out this info. This works because the plist file has the Rules in the order they are applied. The script just parses the plist file without using PlistBuddy or plutil, although the script would have been simpiler using either of these utilities.
Although others may think me nuts for having about 300 Mail rules, I've been dealing with email this way for ~40 years and don't want to change now...
inDir=~/Library/Mail/V9/MailData
$ do.showMailRules > MailRules.txt
$ less MailRules.txt
reading from Mail directory: /Users/jw/Library/Mail/V9/MailData
Sat Mar 5 11:02:45 EST 2022
......................................
usps -> imap://jdw.js13%40gmail.com/USPS
bankofamerica.com -> imap://johnwiggins%40mac.com/bankofamerica.com
Tablet -> imap://jdw.js13%40gmail.com/Tablet
...snip...
VUDU Forums -> imap://johnwiggins%40mac.com/VUDU%20forums
WhiteHouse -> imap://johnwiggins%40mac.com/WhiteHouse
me -> imap://johnwiggins%40mac.com/family/me
DELETE MSG ->
Bank of America -> imap://johnwiggins%40mac.com/Bank%20of%20America%20Alert
Junk_ -> Junk
......................................
303 Rules in syncedRules.plist
(/Users/jw/Library/Mail/V9/MailData)
Sat Mar 5 11:03:21 EST 2022
version: do.showMailRules,v 1.3 2022/03/05 12:29:14 jw Exp $
(END)
mv do.showMailRules.txt do.showMailRules
$ chmod 755 do.showMailRules
do.showMailRules reading from Mail directory: /Users/<YourUserName>/Library/Mail/V9/MailData Sun Mar 6 08:55:49 EST 2022 <Path>/do.showMailRules: line 85: /Users/<YourUserName>/Library/Mail/V9/MailData/SyncedRules.plist: Operation not permitted
...snip...
Thank you very much!Sure, but keep in mind it has very limited functionality to do just what I need.
It is an 'old-school' sh shell script and assumes that your Rules syncedRules and UnsyncedRules plist files are in the default location.
So if your data are in another location you need to change the line
inDir=~/Library/Mail/V9/MailData
The usage is very simple from the CLI. If you provide an arg, it will parse Unsynced Rules, otherwise your user-defined.
YMMV, so user beware. At least it should do no harm as it is read-only.
Just download and put in your execution path or call directly from Terminal or your favorite shell program.
Output goes to your screen. Example directing output to file:
$ do.showMailRules > MailRules.txt $ less MailRules.txt reading from Mail directory: /Users/jw/Library/Mail/V9/MailData Sat Mar 5 11:02:45 EST 2022 ...................................... usps -> imap://jdw.js13%40gmail.com/USPS bankofamerica.com -> imap://johnwiggins%40mac.com/bankofamerica.com Tablet -> imap://jdw.js13%40gmail.com/Tablet ...snip... VUDU Forums -> imap://johnwiggins%40mac.com/VUDU%20forums WhiteHouse -> imap://johnwiggins%40mac.com/WhiteHouse me -> imap://johnwiggins%40mac.com/family/me DELETE MSG -> Bank of America -> imap://johnwiggins%40mac.com/Bank%20of%20America%20Alert Junk_ -> Junk ...................................... 303 Rules in syncedRules.plist (/Users/jw/Library/Mail/V9/MailData) Sat Mar 5 11:03:21 EST 2022 version: do.showMailRules,v 1.3 2022/03/05 12:29:14 jw Exp $ (END)
NOTE: I had to add extension txt in order to get the forum to upload the file so after you download, you should:
mv do.showMailRules.txt do.showMailRules
I just did a test download and see you need do the chmod command I just added to my entry.Thank you very much!
I tried it, but I'm getting this reply: zsh: permission denied: /Users/bruce/do.showMailRules.Sure, but keep in mind it has very limited functionality to do just what I need.
It is an 'old-school' sh shell script and assumes that your Rules syncedRules and UnsyncedRules plist files are in the default location.
So if your data are in another location you need to change the line
inDir=~/Library/Mail/V9/MailData
The usage is very simple from the CLI. If you provide an arg, it will parse Unsynced Rules, otherwise your user-defined.
YMMV, so user beware. At least it should do no harm as it is read-only.
Just download and put in your execution path or call directly from Terminal or your favorite shell program.
Output goes to your screen. Example directing output to file:
$ do.showMailRules > MailRules.txt $ less MailRules.txt reading from Mail directory: /Users/jw/Library/Mail/V9/MailData Sat Mar 5 11:02:45 EST 2022 ...................................... usps -> imap://jdw.js13%40gmail.com/USPS bankofamerica.com -> imap://johnwiggins%40mac.com/bankofamerica.com Tablet -> imap://jdw.js13%40gmail.com/Tablet ...snip... VUDU Forums -> imap://johnwiggins%40mac.com/VUDU%20forums WhiteHouse -> imap://johnwiggins%40mac.com/WhiteHouse me -> imap://johnwiggins%40mac.com/family/me DELETE MSG -> Bank of America -> imap://johnwiggins%40mac.com/Bank%20of%20America%20Alert Junk_ -> Junk ...................................... 303 Rules in syncedRules.plist (/Users/jw/Library/Mail/V9/MailData) Sat Mar 5 11:03:21 EST 2022 version: do.showMailRules,v 1.3 2022/03/05 12:29:14 jw Exp $ (END)
NOTE: I had to add extension txt in order to get the forum to upload the file so after you download, you should:
mv do.showMailRules.txt do.showMailRules
P.S. If the file is not executable, you will need to
$ chmod 755 do.showMailRules
or similar command from your shell.
Have you doneI tried it, but I'm getting this reply: zsh: permission denied: /Users/bruce/do.showMailRules.
Terminal has full disk permissions and I have read/write on the file do.showMailRules.
I have read/write permissions for Librar and all the subfolders and files down to the MailData folder. All files are in their original locations.
Perhaps my lesser experience in terminal is causing me to miss something?
chmod 755 /Users/bruce/do.showMailRules/Users/bruce/do.showMailRulesI wonder if you have added and new commands to your terminal that allow you to do this but not me?Have you done
chmod 755 /Users/bruce/do.showMailRules
I added this to my post, it occurred to me in the shower. After that you should be able to execute with command
/Users/bruce/do.showMailRules
Perhaps it is the file ownership. The chmod command I gave makes the file executable by the owner. Please let me know what happens if you make it executable by everyone:I wonder if you have added and new commands to your terminal that allow you to do this but not me?
chmod 777 /Users/bruce/do.showMailRulessudo chmod 777 /Users/bruce/do.showMailRulessudo /Users/bruce/do.showMailRulesls -l /Users/bruce/do.showMailRules-rwxrwxrwx 1 bruce staff 2320 Mar 5 12:13 do.showMailRules.txt
^^^^^^^^^ ^^^^^
So I redownloaded the file, ran the chmod 755 command again, and this time it worked. No idea what went wrong before, but very happy to have this info. Thanks!Have you done
chmod 755 /Users/bruce/do.showMailRules
I added this to my post, it occurred to me in the shower. After that you should be able to execute with command
/Users/bruce/do.showMailRules
IMPORTANT NOTE IF YOU WANT TO USE do.showMailRules shell script on Monterey:So I redownloaded the file, ran the chmod 755 command again, and this time it worked. No idea what went wrong before, but very happy to have this info. Thanks!
do.showMailRules
reading from Mail directory: /Users/<YourUserName>/Library/Mail/V9/MailData
Sun Mar 6 08:55:49 EST 2022
<Path>/do.showMailRules: line 85: /Users/<YourUserName>/Library/Mail/V9/MailData/SyncedRules.plist: Operation not permitted
...snip...