-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to import Apple Mail .mbox format? #521
Comments
@Cubytus A user created a python script for Apple mboxes, however I don't know if it will do what you want. |
There is no single "Messages" folder, but a few to a handful deep down a given hierarchy, depending on how many messages are stored in a way that there are never more than 1000 messages in each, which is great for granularity and presumably, performance. Importing a single "Messages" folder is of course possible and works as designed, but importing 10s of such folders sure is a pain. I tried the python script, but it fails to run for some reason: Therefore having the option to trim 2nd level folders and anything in between would be great |
@cleidigh Sure, should I produce a subset of the messages, not touching the original hierarchy? Or, how should we do that? |
@Cubytus
|
Well my answer still stands :) |
@Cubytus First let's try to see if we hardcode the options if we get any further. |
Hi, not sure what "roping in" means, but I fear it may mean you've misplaced confidence in me. :) |
PS, a few people have suggested it may just work to do this: Export my Mac Mail to MBOX files. Should I try? Or is it sure not to work in your experience? (I have 40-50GB of data in hundreds of nested/subnested local folders in Mac Mail) |
@johnstonesnow So I have an older mac, but I don't have any apple mail setup. It's my understanding that both the active mail and backups use a structure with subfolders that is convoluted, see above. |
Thank you, i feel less intimidated now :) In case I can help shed light, I can tell you exactly what happens when I export mail folders in Mac Mail, but one important point first... I am running OSX 10.14.6 (Mojave). I am told that soon after this version, they changed the export process. So my use case won't match most others these days as I am running an OS version that has been unsupported for years now (I refused to upgrade for reasons I won't waste time going into, suffice to say 'privacy reasons'). That said, in my version of Mac Mail, I learned something by playing today. I have tons of folders. So I just used ONE folder for my test export. I clicked on the top level folder (which contains 5 others underneath) to highlight it, then used Mailbox>Export Mailbox function. The resulting output was a folder called "Archive - Local" Mail Export folder in which is contained just ONE folder named "Tax". That looked good, but there's no other folders inside, and there should be. I found the solution (which you probably already know about), which was to EXPAND the "Tax" folder in Mac Mail's sidebar, and expand any other sub nested folders so that all the folders with other folders inside were expanded, then I clicked on the top level "Tax" folder, and Shift-Clicked the bottom one in the tree (the last in the list of folders contained inside "Tax" folder). Then when I had all those highlighted, and ran the export again, they all came in properly into my export folder, with directory structure looking correct. No idea if that's of any use, but thought I'd mention it. |
@johnstonesnow |
Yes, it has the exact same folder/subfolder structure as shown in Mac Mail sidebar. Maybe I can do this better.... I created a Test Folder in my sidebar under "On My Mac" (Local folders) and created some sub folders underneath. NOTE: I only created sub folders in 1 and 2, not 3, as you'll see. I also sent myself a load of test emails to drop one in each and every folder, just so there is some data in each folder. Rather than explain in words, here's what the Mac sidebar looks like with this little 'test tree': I clicked to highlight JUST THE TOP folder "Test Folder", then right clicked and exported mailbox (same command as Mailbox>ExportMailbox), screenshot of doing that: I opened the target folder for this export in Finder, to see the output. Here's what it shows: That was method 1 which is no good. (I assumed it would bring contenst of any folder highlighted for export, it doesn't, it only brings emails, not folders contained inside). Method 2: Clicking all down arrows in the tree of folders I want to export, so every sub folder is visible, then shift clicking to highlight from top to bottom: (I showed some redacted other folders to show clearly which are highlighted) Looking at the Finder output this time: Please excuse my very non-tech explanations, but here is what seems to be happening to me: In the tree of folders chosen for export:
So if you look at the second column from the left, you can see Test Subfolder 1 and Test Subfolder 2 both have a folder and an mbox file. But TestSubfolder3 does not have a folder, just an mbox, because it doesn't contain any sub folders. Hope that wasn't too painful and explains as best I can! |
We get different layouts then. The mbox file at the end of the path appears to be a text file holding all the messages. Both layouts are very similar to what you had @johnstonesnow . However, going to
In this case, the messages exist individually However, the script doesn't work in this case either: |
@cleidigh That would have been Big Sur. However, it may be irrelevant as many users upgrade from one version to the following. "We definitely need the mbox export." With a proper backup, one can only assume the raw layout will be available. OTOH if you mean you'll need my file, that can be done but I'll have to check if the messages contain sensitive personal data or not. |
@Cubytus So looking at the script it expects folders with .mbox foldername suffix. This doesn't match anything you guys export so I am baffled. Googling so far has not given me anything. It seems that the script was for a long ago time?? |
I haven't dug into this in detail, but from a glance at a screenshot above I see folders with the
An error on line 1 is never a good sign ;) @Cubytus do you have Python 3 installed? Maybe send us the output of this command in your terminal:
|
I didn't do anything "on the server". I am ONLY working with local folders (i.e. "On My Mac" folders) |
One can save just the script using the raw feature in github, here is that
link:
https://github.com/thunderbird/import-export-tools-ng/raw/master/utility-scripts/apple2mboxsbd.py
|
@Cubytus So we have to get @Cubytus and @johnstonesnow to get the script working and we should be good. |
Depends how I access the folder. I'll take the If I first do an export through Mail, then yes, I get both If I access the raw structure as can reasonably be expected in a worst-case scenario (non-working Mac OS X), then no, there's only There are at least 3 numbered folders before getting the "Messages" folders. In other words, for the sake of this script, all the folders between [some_UUID] and the various "Messages" folders aren't necessary, and the "Messages" folders themselves should be merged before further steps. @obar I have two versions of python installed, 2.7.16 and 3.11.7. When
Going back to first step with the now-correct script…
Second try:
So the first step is that, contrary to what I thought, the script doesn't expect a .mbox folder as input, but rather the folder that contains the .mbox folder. The error message is unclear. As for the result, there's no difference between the Is that the expected result? The script doesn't work against the raw folder structure, though. |
@cleidigh That's indeed what I got. Now the concern is that the script can't be used on the raw structure as will be found when trying to transfer existing messages from, say, a backup made by Mac OS X to platform-independant Thunderbird. |
That's precisely what I expected would be an unnecessary step. If a user's Mac computer breaks or is stolen/lost, requiring an additional, considerable expense to export one's emails just doesn't make sense to me. |
Hi there,
I re-discovered this plugin while looking for a way to restore lost messages (a mistake I made while writing a message rule within Thunderbird). I have a third-party backup app that just copied the raw Apple Mail hierarchy, so I'm using that as a source.
Now, Apple Mail's .mbox format is only a folder containing many sub-folders (identified by a single digit), the final one always being "Messages", each with a max of 1000 .emlx files. Importing does work fine, but recreates all the intermediate, empty folders. Therefore it is very time-consuming to move all messages from the myriad of "Messages" folders back to the main folder. (See attached)
So far, I haven't found a way to import all .emlx from a folder, and remove the intermediate folder hierarchy. Is that even possible?
In the screen capture above, I selected "Acq-1" as the target folder for importation, and whatever the original hierarchy was, I'd expect only the content of "Messages" to be listed right under "Acq-1".
The text was updated successfully, but these errors were encountered: