Skip to content

Instantly share code, notes, and snippets.

@cdwilson
Created January 22, 2012 00:53
Show Gist options
  • Save cdwilson/1654841 to your computer and use it in GitHub Desktop.
Save cdwilson/1654841 to your computer and use it in GitHub Desktop.
Fix mail.app plists to sort all mailboxes by date in descending order
#!/bin/bash
: ${MAILDIR:="$HOME/Library/Mail"}
find "$MAILDIR" -type f -name Info.plist -print0 | xargs -0 perl -i -pe 'BEGIN{undef $/;} s/\t<key>SortedDescending<\/key>\n\t<string>NO<\/string>/\t<key>SortedDescending<\/key>\n\t<string>YES<\/string>/smg'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment