Labels and IMAP are incompatible (right?)

April 23, 2007

It’s not exactly part 2 of my previous post on labels in Gmail, but I’m going to follow up a bit. We’ve already seen people asking Gmail to add an organization system for their organization system. But they’re also asking for IMAP (don’t feel bad Gmail, they ask Yahoo! Mail for it too). If you look under “Helpful Additions” on the Gmail Suggestions page, you’ll see a checkbox for “IMAP access”.

At first it seems like a reasonable suggestion. Even Om Malik agrees, saying “I for one would love to see IMAP support on GMail.” But think about it. Why did IMAP come to be when POP was already available? There’s several reasons. POP doesn’t have a good client/server synchronization story, POP can’t write to the mailbox (meaning you can’t save drafts back to the server) and so on. But the biggest reason IMAP came to be was folders…the technology obsoleted (at least according to everyone who swears loyalty to Gmail) by Gmail’s labels.

How would you implement labels in IMAP? Would each label be a folder? Given my labeling technique in del.icio.us, I’d have a few hundred folders, many of which would have names very close to one another (imagine “bill” and “bills”). Would you just drop labels and stick to Gmail’s “folders” (“Inbox”, “Sent Mail”, “Drafts”, “Spam” and “Trash”)? It seems unlikely. Now that Yahoo! Mail has gone unlimited storage, labels are really the only platform feature that distinguishes Gmail from the competition. How would you label new mail in your Inbox? IMAP isn’t going to allow you to move a message to multiple folders, so you can really only apply one label to a message through IMAP (I suppose if you’re savvy enough you could do it at the protocol level, but no IMAP client is going to let you do it). It really seems that any Gmail user who wants IMAP access is willing to trade labels for offline access and/or the ability to use an interface other than Gmail.

Maybe I’m perceiving this all wrong, so I’ll put some questions to the pro IMAP Gmail crowd. Are you a Gmail user who wants IMAP? If so…why? How would you want labels to be handled in an IMAP implementation? Would you use a Gmail IMAP service if it didn’t include the labeling functionality?

Update: Ken has pointed out that Thunderbird uses IMAP custom flags to implement message labels. Obviously Thunderbird is probably the only client to support that at this time, but you could imagine other clients following suit. So maybe labels and IMAP aren’t so incompatible after all and you don’t have to resort to some ugly folder label mapping.


Entry Filed under: Development. .

14 Comments

  • 1. koblas  |  April 23, 2007 at 11:17 am

    IMAP labels… You missed the easy way to do it.

    Given a message has a unique signature (think DKIM or just an MD5 of the BODY+SUBJECT), if that signature is in multiple folders it’s labeled with all of those lables.

    The probably is that most IMAP systems say:
    Imap Folder contains a list of messages, message = files.
    not
    Imap folder contains a list of signatures
    – signature has attributes
    – one attribute of a signature is a file

    I know I didn’t make much sense, but it wouldn’t take more than a day or two to hack dovecot or some other mail client to remove the assuption that a message = file.

    Plus with the Y!Mail storage system, it’s easy…

  • 2. ontokyotime  |  April 23, 2007 at 12:03 pm

    I think most people are asking for IMAP because… well, other people are asking for IMAP. And asking for it doesn’t cost anything. The question should be: Would you actually use it? And how?

    You’re probably giving the Gmail users too much credit. I don’t think they have thought how IMAP and labels work together (or don’t).

    Webmail has come a long way. What is missing from it that IMAP provides? Just offline support?

    Well, let’s focus on offline support then. Or alternatively make WIFI available everywhere. We’re not that far away from that today!

  • 3. Dave  |  April 23, 2007 at 12:41 pm

    I agree that IMAP and Gmail do not make sense. I’ve been using both Yahoo Mail Beta (plus version to avert the ads) along with Gmail side by side for over 1 year now. I’ve seriously tried 3 times to convert to using only Gmail mostly because it incorporates Google Docs/Spreadsheets, Calendar, and other web services much better than any other Yahoo service.

    Alas, as of this morning I’m back to using Yahoo solely for email. Gmail just sucks as a user interface and labeling gets mundane, even with multiple filters setup. Biggest benefits I see to Gmail is the threading feature, but even that can get confusing when you want to reply to a message up the thread!

    I’ve used IMAP Yahoo Mail with Outlook Express and the hidden IMAP server no one is supposed to know about, but it’s slow and I have too many message in too many folders for the IMAP backend to keep up.

    And besides, the Yahoo Mail Beta keeps getting better (once you guys actually push the updates to all the users). I love having a desktop looking client on the web.

    Yippee YAHOO MAIL!

  • 4. Ryan  |  April 23, 2007 at 2:40 pm

    Koblas, I’m not sure I understand. You still have this problem. Message is delivered into the Inbox. User wants to use Thunderbird via IMAP to label the message. So they drag it to a folder, thereby “labeling” it. Now they want to apply a different label, so they drag it to a second folder. How would you interpret that? Should you remove the original label and add the new label? Keep both labels? Also, the IMAP client assumes you’re dealing with folders…not labels. If you move the message out of one folder, the IMAP client will assume it doesn’t exist in that folder anymore even though you may simply be adding a label instead of changing one.

  • 5. miles  |  April 25, 2007 at 8:48 am

    Could you make T’Birds labeling method the de facto standard and prepend a header containing the label information (I think T-bird stores them in X-Mozilla-Status: headers)

  • 6. Ryan  |  April 25, 2007 at 3:25 pm

    I suppose. That means IMAP clients have to load the headers for every message in the mailbox in order to be able to do any kind of label view. Not the end of the world, but I imagine it could take a while on first load if you have 30,000+ messages in your folders.

  • 7. koblas  |  April 25, 2007 at 9:24 pm

    IMAP doesn’t have a MOVE operation – per rfc2060

    There is COPY and DELETE operation, which some clients use to “move” a message. Thus tagging is
    COPY .. COPY .. COPY .. if you want ot remove a tag just
    DELETE the message from a FOLDER (aka TAG) that has the message — don’t forget the EXPUNGE to really make it dissapear.

    COPY doesn’t even work based on message ID, it’s based on message index in a folder.

    Make sense?

  • 8. Ryan  |  April 26, 2007 at 8:22 am

    Alright, so what happens when you want to delete a message? You have to find it in each label (folder) and delete it? That’s like saying in order to delete something from Gmail you have to go in and remove every label from it. I suppose if you take the view that the message is really only in one folder (your All Mail folder) then deleting the message from that folder is a true delete while deleting it from the other folders is simply label management. But that’s still pretty confusing. If I find the message under label “A” then I have to go and find that message in the “All Mail” folder in order to delete it. You’d also have to make sure that all of the labels (folders) that contain the message get the memo that the message is no longer there. Presumably IMAP handles that well enough since it’s built to have multiple clients accessing the same mailbox, so it could simply treat it as though another user agent removed those messages.

    I don’t know, it would work…but it would be awkward.

  • 9. Ken  |  April 27, 2007 at 10:52 am

    Don’t labels in IMAP translate pretty directly into FLAGS? That’s what I’ve been using, anyway.

  • 10. Anonymous  |  April 27, 2007 at 11:22 am

    Nice catch Ken.
    http://www.faqs.org/rfcs/rfc3501.html
    (see section 2.3.2. Flags Message Attribute)

    Also, the SEARCH command works with flags nicely. So it seems labels and folders can work quite nicely within the spec.

  • 11. Ryan  |  April 27, 2007 at 6:07 pm

    How would you access custom flags using, say, Thunderbird?

  • 12. Ken  |  April 27, 2007 at 11:11 pm

    Thunderbird 2′s custom labels are implemented on IMAP servers as custom flags.

    I don’t know about previous versions of Thunderbird — they didn’t break in the face of custom flags but they also didn’t appear to expose them in any way.

  • 13. Trip  |  June 27, 2007 at 2:01 pm

    Continuing onward from the Thunderbird 2 idea, I see a possibility of Google creating their own Gmail client for Windows, Mac, etc., with both IMAP and this flagging functionality fully supported. The amount of flags a message would have would be completely independent of which folder it is in. So you could have the best of all worlds, physical folders for message storage, and also multi-flagging, which would locate these single messages based on label selection and/or search (no need for multiple copies of messages then).

    This might force the hand of those whose clients didn’t support the multiple flag/search functions of the Gmail client.

    I know that suggestion way seem a backwards way of bringing Gmail IMAP to the masses, but maybe improved flagging and search functionality across the board is what all these aging email clients need to refresh their appeal.

    Anyone agree?

  • 14. AJ  |  August 3, 2007 at 12:22 pm

    This isn’t my area of technical expertise, but from this _user’s_ perspective, I had to choose between the labeling (cross-referencing, really) of GMail, and the speed I get with Thunderbird/IMAP. My issue with GMail was speed. I click to read a message and then switch to reading CNN while it loads. But I *LOVE* cross-referencing my mail with it’s labeling feature. Need/want both!


Calendar

April 2007
M T W T F S S
« Mar   May »
 1
2345678
9101112131415
16171819202122
23242526272829
30  

Most Recent Posts