django-mailbox
django-mailbox copied to clipboard
command SEARCH illegal in state AUTH, only allowed in states SELECTED
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(' ')
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.
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.
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
Prefixing my folder value with INBOX.* worked for me as well. Thanks @spatialbits!
Looks solved! PS: Feel free to open a pull request to improve the documentation, as you had like to find