rgladwell / imap-upload

Python script for uploading a local mbox file to IMAP4 server.
Other
130 stars 30 forks source link

Import to Specific Label/Sub-Label #47

Open seanpmgallagher opened 2 years ago

seanpmgallagher commented 2 years ago

There doesn't seem to be a way to import emails to google workspace to a specific sub-label. I've tried using the --box command which creates the label, but the emails end up in the main inbox/drafts/important/sent mail folders. Any way to avoid this and just upload all to a label and have it create the sub-labels under that based on structure? Example structure of Mac Mail mbox eport below:

Just list mail boxes! "INBOX""
"[Gmail]"" #Noselect +- "All Mail"" #All +- "Drafts"" #Drafts +- "Important"" #Important +- "Sent Mail"" #Sent +- "Spam"" #Junk +- "Starred"" #Flagged +- "Trash"" #Trash

rgladwell commented 2 years ago

Interesting. What arguments are you using for this import?

adriangibanelbtactic commented 2 years ago

There doesn't seem to be a way to import emails to google workspace to a specific sub-label. I've tried using the --box command which creates the label, but the emails end up in the main inbox/drafts/important/sent mail folders. Any way to avoid this and just upload all to a label and have it create the sub-labels under that based on structure? Example structure of Mac Mail mbox eport below:

Just list mail boxes! "INBOX"" "[Gmail]"" #Noselect +- "All Mail"" #All +- "Drafts"" #Drafts +- "Important"" #Important +- "Sent Mail"" #Sent +- "Spam"" #Junk +- "Starred"" #Flagged +- "Trash"" #Trash

I think the option that you are looking for is --google-takeout-box-as-base-folder. It is originally aimed at google takeout mbox files so it might not work 100%. Give it a go and give us feedback.