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
@netj
Copy link
Author

netj commented Apr 20, 2011

If you find your Mail bundles broken after some Software Updates on Snow Leopard,

  1. Download this gist.
  2. Quit Mail,
  3. Then, run the .command script.
  4. Launch Mail.

Most of your bundles will continue to work from now on.

Otherwise, if Mail keeps crashing, then this means your bundle really isn't compatible with the new Mail app. Go to ~/Library/Mail/Bundles/ from Finder and delete the suspicious ones to recover.

@mattorb
Copy link

mattorb commented Oct 30, 2013

Just a quick note. I stumbled on this looking for a method to update a plugin after upgrading to Mavericks. Message.framework has been renamed to Mail.framework, moved to PrivateFrameworks, and no longer has a plugincompatibilityuuid. Thus the 'newMsgUUID' var in the above script will not be set properly on Mavericks. I had to go get a plug-in update from the plug-in author for mavericks compatibility.

@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