You’ve got 99 Problems but IMAP Shouldn’t be One

by Sarah-Jane on December 14, 2011

“My name is Waseem Sadiq and I have built 3 e-mail clients; one for Windows, one on the web and one for iOS. I am here to tell you, you do NOT want to mess with IMAP or any other type of email protocol. Use Context.IO, I should have”

This is a direct quote from one of our friends at 500 Startups when we reached out to offer our services to the startups in their latest batch.

Waseem knows working with IMAP is a pain in the you know what. Anyone who has tried to do more than list folders and messages with IMAP has learned first hand that it has a funny concept of  message id, times out and is no fun to work with at scale.

If you’re havin’ IMAP problems, I feel bad for you son

Here are just some of the reasons why building business applications using IMAP is a pain, and what Context.IO is doing to ease that pain:

Folders in IMAP servers are separate: to fetch desired data, it’s necessary to search each folder individually to extract what’s needed. Gmail makes that easier with the “All Mail” folder but dealing with labels still implies dealing with all those IMAP folders. With Context.IO the whole mailbox is one database and folders are optional filters.

In IMAP, there are no fixed/persistent message IDs. There are sequence ID and UID but the former is reset every time a client deletes a message and the latter is set on a per-folder basis (ie. it will change if the message moves to a different folder) and can be invalidated by the server at any time. Context.IO assigns a unique and persistent ID to every message. Alternatively, you can use the Gmail message/thread ID or the RFC-822 Message-ID header to query for messages.

Using IMAP as a live datasource is a pain: a simple query like history of messages with a contact turns into long sequence of IMAP commands and the performance is so bad that you need to maintain your own cache to feed your application with an acceptable response time. Maintaining that cache involves building, scaling and maintaining your own syncing mechanisms. Context.IO takes care of that by maintaing it own metadata index exposed via an HTTPS interface that is responsive enough to be used as a live datasource.

- Email is so much more than just folders and message lists: Your mailbox contains years of important conversations with contacts, revisions of documents are scattered everywhere and so are discussions about strategic projects. IMAP ignores all of that, Context.IO doesn’t. We go beyond IMAP by exposing 5 key data resources on top of mailboxes: contacts, files, messages, threads and webhooks.

For these reasons and more, when we speak to developers that have experience building on top of IMAP, they ask us where we’ve been all their lives. Indeed, we’re flattered and blush a little, but mostly, we are determined to let the world know that they don’t have to deal with the pain of IMAP any longer! With just a few lines of code, Context.IO replaces multiple complex IMAP requests with simple JSON responses, and ensures a stable connection with mailboxes that can easily scale as your app grows.

What kind of problems has IMAP caused for you? Better yet, how have we helped make your life easier by helping you avoid these problems? Let us know and we’ll send you a t-shirt.

If you enjoyed this post, please consider leaving a comment or subscribing to the RSS feed to have future articles delivered to your feed reader.

Previous post:

Next post: