Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!bloom-beacon.mit.edu!bloom-beacon.mit.edu!panix!not-for-mail From: Grant Edwards Newsgroups: comp.lang.python Subject: imapclient Gmail search() times Date: Fri, 14 Mar 2014 18:53:57 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 30 Message-ID: NNTP-Posting-Host: dsl.comtrol.com X-Trace: reader1.panix.com 1394823237 1764 64.122.56.22 (14 Mar 2014 18:53:57 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Fri, 14 Mar 2014 18:53:57 +0000 (UTC) User-Agent: slrn/1.0.1 (Linux) Xref: csiph.com comp.lang.python:68360 I'm working on a small app to help sort/organize my mail via Gmail's IMAP server, and I'm using imapclient (BTW it's a _huge_ improvement over imaplib). The odd thing I'm seeing is that when searching a large "folder" (All Mail), I get wildly different times depending on what header I search. allmail = IMAPClient(HOST, use_uid=True, ssl=True, port=993) allmail.login(USERNAME, PASSWORD) allmail.select_folder('[Gmail]/All Mail') Searching on "Message-Id:" is fast (sub-second): irt = allmail.search('HEADER Message-ID %s' % msgid) Searching on "In-Reply-To:" takes 10-15 seconds: rt = allmail.search('HEADER In-Reply-To %s' % msgid) [IIRC, I've got about 22000 messages in the 'All Mail' "folder".] I'm assuming this is just due to the way that Google implmented their IMAP server code, but I thought I'd ask if anybody else had noticed this. Perhaps I'm doing something stupid, but I can't imagine what it would be.... -- Grant Edwards grant.b.edwards Yow! I have a TINY BOWL in at my HEAD gmail.com