Skip to content

imaplib.error: command SEARCH illegal in state AUTH #31

@llamafilm

Description

@llamafilm

Hello. First of all, thank you for this app, it's a great idea. I want to download my Gmail archive so that I can delete my Google account. I set remote_folder to ALL and it started downloading a few folders but it fails when it gets to the main one called [Gmail]. So then I set remote_folder=[Gmail] and it does the same thing. Do you know what is causing this?

$ python imapbox.py 
account1/[Gmail] (on imap.gmail.com)
MailboxClient: Could not select remote folder '[Gmail]'
Traceback (most recent call last):
  File "imapbox.py", line 105, in <module>
    main()
  File "imapbox.py", line 102, in main
    save_emails(account, options)
  File "/usr/home/elliott/imapbox-master/mailboxresource.py", line 123, in save_emails
    stats = mailbox.copy_emails(options['days'], options['local_folder'], options['wkhtmltopdf'])
  File "/usr/home/elliott/imapbox-master/mailboxresource.py", line 44, in copy_emails
    typ, data = self.mailbox.search(None, criterion)
  File "/usr/local/lib/python3.7/imaplib.py", line 723, in search
    typ, dat = self._simple_command(name, *criteria)
  File "/usr/local/lib/python3.7/imaplib.py", line 1196, in _simple_command
    return self._command_complete(name, self._command(name, *args))
  File "/usr/local/lib/python3.7/imaplib.py", line 944, in _command
    ', '.join(Commands[name])))
imaplib.error: command SEARCH illegal in state AUTH, only allowed in states SELECTED

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions