I want to make an exact copy of my Mail app and all the data, settings, preferences, and more from one Mac and put it on another. I spent a lot of time researching and can find ways to transfer SOME of the data, but not ALL of it. (At the end of the question, in a note, I do point out some of what can be done, but I have yet to find a way to do it all. To actually clone the app and the data, there are multiple things that need to be transferred:
- The actual Mail program
- The main data
- Account/server information
- Preferences (including all the rules)
- The folder structure
- Any other miscellaneous settings or data
First, forget Migration Assistant. Often there are reasons to not use it. We may not want some apps copied over to a new Mac for many reasons, like business issues, wanting to start with a brand new version, or because some apps were a problem, or other reasons. Migration Assistant is a sledge hammer and really needs more features so we can be more selective about what is and isn't transferred over. (In my case, some VPN apps I was testing have left stuff behind I can't find or deactivate that I need to lose!)
The actual Mail program can be copied by sharing your home directory with the new system and simply dragging and dropping it, but it's also not necessary to do that with a new Mac, since the program is there. But that's just the executable, not any settings or other information. So that one is solved.
The main data, for IMAP accounts, doesn't really need to be transferred, since that's on the IMAP server. But for POP3 accounts, that data is on the local computer. They can be transferred by exporting from the Mail program on the source Mac and imported on the new Mac. But when imported, these show up as mailboxes without names and there is no attempt to preserve the folder structure. So the data is saved, but the organization of it is lost. The folder structure can't be saved, but can be recreated by restoring one folder at a time and renaming them and moving them around by hand. That is a tedious and lengthy process. (And anything tedious is error-prone.) This is partially solved, since the data can be transferred over, but not in the structure it was in before exporting it.
Email account and server info. I know at least the passwords are in the Keychain on a Mac, but I don't know if the server info, like the server address, the port, whether it's secure or not, or how it's authenticated, is kept in the keychain as well.
Preferences and rules are probably together, but I can't find where. I saw one page that said they were in ~/Library/Preferences/com.apple.mail.plist, but that file was not there on my Mac running Ventura. I did write a quick experimental script in zsh, using the find command, along with grep to find all files with "com.apple.mail" in the name and then copy them to the same location on my new Mac. That did copy over preferences, but it was a number of files and I have no idea which one contained all the various settings. (For example, it got my rules, but I don't know if they were in the same file with the rest of the settings or with serve info.) This may be solved, but I can't verify that until being able to verify the Keychain has what's needed.
Folder structure - this is one of the few items that I can't find a single clue about where it's stored. I have over 2 dozen folders and subfolders - here's a shot of just one part of them:
I know I can search for things, but I've got emails going back more than 25 years that I still refer to once in a while. I know I can search, but search can be frustrating. But I know, for example, emails that I can find quickly in Business - Mine/T-Digital/Clients. But I cannot find anything, anywhere about how to copy the actual folder structure from one Mac to another, and this is the one item that, for me, will take the longest to handle because it has to be done while importing MBOX files and by hand - AND once done, not only has the folder (which is treated as MBOX) lost its name, and its location, but all the emails in it have lost their status - they are all, on import, marked unread. This is the one that is completely unknown - where is this info?
- Any other settings or data - since the folders are not stored with preferences, I'm not sure how many pieces of information there are for Mail. When I searched for com.apple.mail files I found a lot of them in different locations. I don't know which ones are permanent storage for settings or assorted pieces of information and which ones Mail will reconstruct and which ones just aren't needed.
A lot of this can be redone by hand, but that's a pain (and why can't Apple make it easy to transfer email over?!?) But the key piece that doesn't seem to be easily found or transferred is the folder structure.
Is there any resource anywhere that helps clarify anything about the preferences/settings file or the folder structure, or the current location of the settings information and any other info mail needs?
I realize MBOX files and other info may need to be handled separately, but if it were possible to drag and drop everything (while Mail is not running) or to use rysnc and copy all the data over, that would be solve the whole "transfer email" issue.
Edit/Addition: I've discovered another issue. While it's possible to export multiple folders at a time and import multiple folders (and always import as Apple Mail - seems to include more info than importing as MBOX), the Sent messages are a different issue. You can import them into a new setup, but they can't be imported into the Sent folders. I had to import them into a separate set of folders. They're still there and searchable and show up in threads, but they are not in the actual Sent folders.
Note: This is not the same question as How to transfer E-Mails from one mac to another? or Can I transfer all Mail accounts to a new Mac?. These, and the answers, deal with partial transfers. I'm looking for a 100% clone of the installation in one Mac to another one.
~/Library/Mail/