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. Once the script is executable, you may see the following error
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...
If so, the program you are using to serve up the shell, .e.g. Terminal, iTerm2, XQuartz, does not have permission to view files in ~/Library. To read the plist files, you need configure your server program to have full disk access to read the plist files:
- System Preferences :
- Security & Privacy :
- Full Disk Access :
and add "Terminal" or whatever program you are using to provide shell in which to run the script.
8-March-2022: Updated script to detect version of Mail in use and work as long as Apple does not change their scheme.