This may be a newbie question, but I can't figure out why I can't successfully pass parameterized search criteria to imaplib.
Setup code is:
M = imaplib.IMAP4_SSL("imap.gmail.com", 993)
M.login("usrname", "passwd")
typ, data = self.M.select() # Select default mailbox
The following works:
typ, data = M.uid('search', None, '(SENTSINCE 01-Jan-2010)')
But if I try to pass the search criteria as a string I get
imaplib.error: UID command error: BAD ['Could not parse command']
This is the code that fails:
f = "'(SENTSINCE 01-Jan-1994)'"
typ, data = M.uid('search', None, f)
I've tried numerous syntax, read RFC3501. Is this a charset problem?