Skip to content
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 get all gmail "folders" (labels) #6

Open
slaecker opened this issue Jun 7, 2017 · 2 comments
Open

How to get all gmail "folders" (labels) #6

slaecker opened this issue Jun 7, 2017 · 2 comments

Comments

@slaecker
Copy link

slaecker commented Jun 7, 2017

Hi (again),

I'd like to archive my gmail account (among others) using IMAPBOX. Currently it only fetches the inbox.
Gmail uses IMAP folders to reflect its labels. An email can be assigned multiple labels so it appears in multiple IMAP folders. All archived emails appear under [Gmail]/All messages "folder".
The hierarchy shown in my email client (evolution) is as follows:

Gmail account

  • INBOX
  • Label 1
  • Label 2
  • Other Labels ...
  • [Gmail]
    • All messages
    • Sent
    • Drafts
    • Spam
    • Important
  • More labels ...

What to set the remote_folder to in order to archive all folders?

Another point (maybe beyond the scope of this script) is that due to the fact that the same email can be in multiple folders to save disk space some kind of checksum and symlinking would be great. So an email assigned to "Label 1" and "Label 2" would be symlinked from the "All messages" folder to the respective label folder.

@polo2ro
Copy link
Owner

polo2ro commented Jun 8, 2017

The emails are stored using the email as folder name, this should prevent duplication

the remote_folder is used in select method from imaplib, you can use this example: https://stackoverflow.com/questions/33684770/python-imap4-select-mailbox-name-contain-space-character-error?rq=1

the bad news is you can select only one folder per connexion

@olajep
Copy link
Contributor

olajep commented Mar 23, 2020

Not tested but #27 and setting

remote_folder=__ALL__

in the config file might fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants