-
Notifications
You must be signed in to change notification settings - Fork 71
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
import-mailbox-to-gmail.py: error: argument --dir is required #34
Comments
When in doubt, you can run the script with --help to see the meaning of the various options. The meaning of --dir is: "Path to the directory that contains user directories with mbox files to import" |
Thanks @PMox that is very helpful. Perhaps it's something with how apple mail handled the Export process of the mbox? I'm pretty sure my file path is accurate since the script is running, the target mbox appers to throw the script off. When I exported the mbox from Apple mail (i used the trash folder which had only one email in it for testing purposes) this is how I structured the file path. I kept the script and the target folder for the mbox in the same folder on the desktop.
I noticed the Apple Mail exporter created a [GMAIL] folder inbetween the email address and the actual mbox file. Does that matter? so the mbox folder looks like /mbox I noticed the instructions don't call for that middle folder but if I remove it and put the mbox right in the [email protected] folder I still get that dir error. I think I'm structuring something wrong. |
Ugh...I'm an idiot I had an extra space between -- and dir |
it worked. i also learned Google reserves the word trash. So had to rename to a different label. this is pretty slick. thank you all for creating/contributing to this. |
IIRC you should be able to import a file named 'Trash.mbox' and it will get imported to the 'Trash' label. If you like, please post the exact folder structure and file name you had with Trash that failed to be imported in a new issue, and I'll see if I can fix it. Thanks for the help @PMox. :) |
Here's the file structure I used.... mbox and then within that mbox are two files mbox and table_of_contents respectively. This is exported from Apple mail running on the latest Apple OS. This is the ERROR message I get
email and device name changed for privacy purposes. i think i can run a deeper debug so if that provides more information and helps i will. Also I have the Trash label in Gmail set to hide but it is checked off to show in IMAP. Does show/hide impact the ability to import to that specific label? Now that I think of it that might be it. |
I tried to show the "Trash" label in Gmail and it still Errored. Same error listed above. |
I think I found the issue - can you try to download the new version of the script and see if importing a file called "Trash.mbox" works now? Thanks! |
I gave this a shot thanks. But it didn't work. I downloaded the new version of the script moved some messages that were not imported in previous runs to Trash in Apple Mail. Used Apple Mail to Export the mailbox to an .mbox. Opened the mbox file in a text editor and confirmed that one of the messages not previously imported is in the .mbox file. I then ran the new script with debug level four. Here's the result.... `13:39:50 INFO main @import-mailbox-to-gmail.py *** Starting import-mailbox-to-gmail 1.4 on Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 12:01:12) 13:39:50 INFO main @import-mailbox-to-gmail.py Finished.` I modified the data above to retain privacy but the above is essentially the log Unfortunately with the latest build zero message was imported into the Trash label for Gmail (that is the native Trash label in Gmail, not one I created) |
As far as I can tell, the issue in this case is that you used The way you had it, the directory structure should be something like |
Thanks. I fixed my folder structure and it worked. The script found the messages and threw them in the Gmail Trash label. Problem solved (still stuck with Apple Mail Export Mailbox on Attachments though.) I have to send them another disk image. Other users are reporting it on the Apple Forums so it's not just me and must be something with High Sierra's latest build of Apple Mail 😞 |
Excellent, thanks for confirming! |
Possible fix for issue google#34.
I get an error message running the test that I setup for this.
import-mailbox-to-gmail.py: error: argument --dir is required
Is this the directory of the mbox or the directory of the python script?
The text was updated successfully, but these errors were encountered: