Created
November 14, 2021 09:13
-
-
Save thedanhub/290b4f39e09a69a89d119ea93a2b9aff to your computer and use it in GitHub Desktop.
Export emails and account configuration from Mail.app in macOS to move to a new Mac
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo [1/4] Creating MailExport folder on the Desktop | |
folder=/Users/$(whoami)/Desktop/MailExport | |
mkdir -p $folder | |
echo [2/4] Exporting mail... | |
cp -R /Users/$(whoami)/Library/Mail $folder | |
echo [3/4] Exporting account information... | |
cp -R /Users/$(whoami)/Library/Accounts $folder | |
echo [4/4] Exporting Mail preferences... | |
cp /Users/$(whoami)/Library/Preferences/com.apple.accounts.plist $folder | |
cp /Users/$(whoami)/Library/Preferences/com.apple.accountsd.plist $folder | |
cp /Users/$(whoami)/Library/Preferences/com.apple.mail-shared.plist $folder | |
echo Done! Mail.app mail and configuration has been exported to $folder |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Requires Full Disk Access by Terminal.app in System Preferences > Security & Privacy > Privacy in order to be able to copy folders inside the user's Library.