Skip to content

Instantly share code, notes, and snippets.

@xiangyu-sun
Created July 10, 2013 08:00
Show Gist options
  • Save xiangyu-sun/5964313 to your computer and use it in GitHub Desktop.
Save xiangyu-sun/5964313 to your computer and use it in GitHub Desktop.
IMAP4.Serach.Error
import imaplib
conn = imaplib.IMAP4("imap.qq.com")
conn.login("182430273","password")
conn.select("INBOX")
type, data = conn.search(None, 'FROM', '"LDJ"')
Traceback (most recent call last):
File "import imaplib.py", line 9, in <module>
type, data = conn.search(None, 'FROM', '"LDJ"')
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/imaplib.py", line 627, in search
typ, dat = self._simple_command(name, *criteria)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/imaplib.py", line 1070, in _simple_command
return self._command_complete(name, self._command(name, *args))
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/imaplib.py", line 905, in _command_complete
raise self.error('%s command error: %s %s' % (name, typ, data))
imaplib.error: SEARCH command error: BAD ['Missing or invalid argument to SEARCH']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment