imbox icon indicating copy to clipboard operation
imbox copied to clipboard

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

Open zhao-ji opened this issue 10 years ago • 3 comments

error Traceback (most recent call last) in () ----> 1 mails.next()

/usr/local/lib/python2.7/dist-packages/imbox/init.pyc in fetch_list(self, **kwargs) 32 33 def fetch_list(self, **kwargs): ---> 34 uid_list = self.query_uids(**kwargs) 35 36 for uid in uid_list:

/usr/local/lib/python2.7/dist-packages/imbox/init.pyc in query_uids(self, **kwargs) 20 query = build_search_query(**kwargs) 21 ---> 22 message, data = self.connection.uid('search', None, query) 23 return data[0].split() 24

/usr/lib/python2.7/imaplib.pyc in uid(self, command, *args) 756 "only allowed in states %s" % 757 (command, self.state, --> 758 ', '.join(Commands[command]))) 759 name = 'UID' 760 typ, dat = self._simple_command(name, command, *args)

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

zhao-ji avatar Jan 13 '15 14:01 zhao-ji

The same problem

liuyu121 avatar Mar 13 '15 10:03 liuyu121

select folder first, then query

self.conn.connection.select(TRASH)
messages = self.conn.messages(TRASH)

d1ffuz0r avatar Jul 06 '15 21:07 d1ffuz0r

I hit the same problem, and it appears to only occur when I've used an incorrect folder name.

I suspect it'd be worth checking if a supplied folder name appears in imbox.folders() and raising a helpful exception or similar

(http://stackoverflow.com/q/5161053/928098 and http://stackoverflow.com/a/5161338/928098 were insightful!)

doismellburning avatar Aug 24 '15 11:08 doismellburning