imapclient Gmail search() times

G

Grant Edwards

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....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top