Skip to content

Instantly share code, notes, and snippets.

@rwoeber
Created January 1, 2014 17:03
Show Gist options
  • Select an option

  • Save rwoeber/8209572 to your computer and use it in GitHub Desktop.

Select an option

Save rwoeber/8209572 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# A script for fixing disabled Mail.app bundles due to SupportedPluginCompatibilityUUIDs
# Author: Jaeho Shin <netj@sparcs.org>
# Created: 2011-03-24
# See-Also: http://stib.posterous.com/how-to-fix-unsupported-plugins-after-upgradin
# via https://gist.github.com/netj/930384
set -eu
newMailUUID=$(defaults read /Applications/Mail.app/Contents/Info PluginCompatibilityUUID)
newMsgUUID=$(defaults read /System/Library/Frameworks/Message.framework/Resources/Info PluginCompatibilityUUID)
cd ~/Library/Mail
for bundle in "Bundles"*"("*")"/*.mailbundle; do
[ -d "$bundle" ] || continue
if [ -w "$bundle"/Contents/Info.plist ]; then
echo "$bundle: Re-enabling with fixed SupportedPluginCompatibilityUUIDs"
defaults write "$PWD"/"$bundle"/Contents/Info SupportedPluginCompatibilityUUIDs -array-add "$newMailUUID"
defaults write "$PWD"/"$bundle"/Contents/Info SupportedPluginCompatibilityUUIDs -array-add "$newMsgUUID"
mv "$bundle" Bundles/
else
echo "$bundle: Skipping (Info.plist not writable)"
fi
done
rmdir -p "Bundles"*"("*")" 2>/dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment