django-mailbox icon indicating copy to clipboard operation
django-mailbox copied to clipboard

command SEARCH illegal in state AUTH, only allowed in states SELECTED

Open pushpan opened this issue 8 years ago • 4 comments

occurred when fetching mails from imap.163.com: (imap.py) error at /admin/django_mailbox/mailbox/ command SEARCH illegal in state AUTH, only allowed in states SELECTED

def _get_all_message_ids(self):
    # Fetch all the message uids
    response, message_ids = self.server.uid('search', None, 'ALL') ...
    message_id_string = message_ids[0].strip()
    # Usually `message_id_string` will be a list of space-separated
    # ids; we must make sure that it isn't an empty string before
    # splitting into individual UIDs.
    if message_id_string:
        return message_id_string.decode().split(' ')

pushpan avatar May 29 '16 02:05 pushpan

At a glance, that sounds like you may not have entered the right password; have you double checked?

On May 28, 2016, at 19:23, pan [email protected] wrote:

occurred when fetching mails from imap.163.com: (imap.py) error at /admin/django_mailbox/mailbox/ command SEARCH illegal in state AUTH, only allowed in states SELECTED

def _get_all_message_ids(self): # Fetch all the message uids response, message_ids = self.server.uid('search', None, 'ALL') ... message_id_string = message_ids[0].strip() # Usually message_id_string will be a list of space-separated # ids; we must make sure that it isn't an empty string before # splitting into individual UIDs. if message_id_string: return message_id_string.decode().split(' ') — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

coddingtonbear avatar May 29 '16 03:05 coddingtonbear

Hi there, I am getting this error as well for an imap mailbox. The exception occurs if I specify a folder on the end of the uri; it works fine without the folder parameter. bombs: imap://user:[email protected]?folder=django_folder works fine: imap://user:[email protected]

Very nice library btw.

spatialbits avatar Aug 04 '16 15:08 spatialbits

It was just a bad foldername. For my imap server I needed to prefix the folder name with INBOX.; so the uri is now: imap://user:[email protected]?folder=INBOX.django_folder

spatialbits avatar Aug 04 '16 15:08 spatialbits

Prefixing my folder value with INBOX.* worked for me as well. Thanks @spatialbits!

tonyflo avatar Oct 19 '16 02:10 tonyflo

Looks solved! PS: Feel free to open a pull request to improve the documentation, as you had like to find

pfouque avatar Dec 17 '23 08:12 pfouque