Skip to content

Instantly share code, notes, and snippets.

@CodeBrauer
Last active February 8, 2021 08:10
Show Gist options
  • Save CodeBrauer/243e61655fb7229069e469bf2e47e271 to your computer and use it in GitHub Desktop.
Save CodeBrauer/243e61655fb7229069e469bf2e47e271 to your computer and use it in GitHub Desktop.
This will reset Apple Mail to factory settings.
killall Mail &> /dev/null
# optional, if you want to backup any not-synced data
mv ~/Library/Containers/com.apple.mail ~/Desktop/com.apple.mail.backup
# Attention, these commands will delete everything about Apple Mail except the app itself (factory reset)
rm -rf ~/Library/Caches/com.apple.mail
rm -rf ~/Library/Saved\ Application\ State/com.apple.mail.savedState
rm -rf ~/Library/Application\ Support/AddressBook/MailRecents-v4.abcdmr
rm -rf ~/Library/Preferences/com.apple.mail.plist
rm -rf ~/Library/Preferences/com.apple.mail.searchhistory.plist
# Because of macOS own System Integrity Protection you can't delete this folders with your terminal.
# Open it instead with finder, and delete them.
open ~/library/Containers/
echo "and delete ~/library/Containers/com.apple.mail"
open ~/Library/
echo "and delete ~/Library/Mail"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment