Sunday, November 09, 2008

Crap. Gmail IMAP doesn't support searching by header Message-ID

I just spent the last hour trying to figure out why my IMAP query is failing. I'm testing an IMAP integration with gmail. Here is my query:

>>> type, data =, '(HEADER Message-ID "<>")')
>>> data

I should have mentioned that I'm using python IMAPLIB.

Even though the message-id is valid (there is a message with this ID), nothing is returned. Why? It's just not supported. From google:

Does Gmail support all IMAP features?

Gmail IMAP is a fairly complete implementation of IMAP, but the following features are currently unsupported:

  • \Answered and \Recent flags on messages.
  • Substring search. All searches are assumed to be words.
  • Searching arbitrary headers. Only some headers are available for searches: From/CC/BCC/To/Subject.
  • There is no SIEVE interface to Gmail filters.
  • Only plain-text LOGIN over SSL tunneled connections are supported.
Yep, that's pretty much the feature I needed. Poop!