Skip to content

Instantly share code, notes, and snippets.

@netj
Created April 20, 2011 04:41
Show Gist options
  • Save netj/930384 to your computer and use it in GitHub Desktop.
Save netj/930384 to your computer and use it in GitHub Desktop.
A script for fixing disabled Mail.app bundles due to SupportedPluginCompatibilityUUIDs
#!/usr/bin/env bash
# A script for fixing disabled Mail.app bundles due to SupportedPluginCompatibilityUUIDs
# Author: Jaeho Shin <[email protected]>
# Created: 2011-03-24
# See-Also: http://stib.posterous.com/how-to-fix-unsupported-plugins-after-upgradin
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
@koenlek
Copy link

koenlek commented May 15, 2014

It can be easily fixed by removing line 9 and 17. The script was tested on osx 10.9.3 and worked like a charm after this small adaption.

The script should become:

#!/usr/bin/env bash
# A script for fixing disabled Mail.app bundles due to SupportedPluginCompatibilityUUIDs
# Author: Jaeho Shin <[email protected]>
# Created: 2011-03-24
# See-Also: http://stib.posterous.com/how-to-fix-unsupported-plugins-after-upgradin
set -eu

newMailUUID=$(defaults read /Applications/Mail.app/Contents/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"
        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