Re: [imapext] GMail's extensions: X-GM-THRID immutability

Brandon Long <blong@google.com> Thu, 09 May 2013 21:53 UTC

Return-Path: <blong@google.com>
X-Original-To: imapext@ietfa.amsl.com
Delivered-To: imapext@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 5D37921F8F27 for <imapext@ietfa.amsl.com>; Thu, 9 May 2013 14:53:46 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -98.211
X-Spam-Level:
X-Spam-Status: No, score=-98.211 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, J_CHICKENPOX_64=0.6, J_CHICKENPOX_65=0.6, J_CHICKENPOX_74=0.6, MIME_8BIT_HEADER=0.3, NO_RELAYS=-0.001, SARE_HTML_USL_OBFU=1.666, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9EFERpTqv7Qa for <imapext@ietfa.amsl.com>; Thu, 9 May 2013 14:53:45 -0700 (PDT)
Received: from mail-qa0-x229.google.com (mail-qa0-x229.google.com [IPv6:2607:f8b0:400d:c00::229]) by ietfa.amsl.com (Postfix) with ESMTP id C4F3F21F8F17 for <imapext@ietf.org>; Thu, 9 May 2013 14:53:44 -0700 (PDT)
Received: by mail-qa0-f41.google.com with SMTP id bv4so22875qab.14 for <imapext@ietf.org>; Thu, 09 May 2013 14:53:44 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=0S9HVNrPRRlokMUc19PxRtSCFpdg1uIOn1kP1zlVFuI=; b=H+cZ/fFdjvSIA2bghcBrVhLWi4Ns1aUcLh85VYoS7NL/Qgtj4TWDigIl56Oqstd8y1 5Ti/KgxszbIQ84/zdOwg1LmGtzX2bZsG20y221Wv9ATv1EEX410kSxzJ63EShbzg+eT1 DRHW6GM7OsSJvfvmKj1jJjCNMDyrmzl23mpI0HdJcqsUWqWv48MDxaZfRLT5T6zQs/X6 VsWfM8YxMDyr/YW7teX54ZEzblvY5sEAUpCixqvdkFODIRGCiQAP4e8m6FAonypM/nkF 2UKE9l8e8wkwmY7uU3yIKIv6NIAd7ab+TDNmwzRqp8leI4aT/u+iTlkEJc+s9z+c5m8I qIfg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:x-gm-message-state; bh=0S9HVNrPRRlokMUc19PxRtSCFpdg1uIOn1kP1zlVFuI=; b=VcCVP6OGEOsec3fi5D4fruLFpFQtc52EsaSa39vjajAdp2NhGr3qlTyA8l+xzqtMuQ ZGquYIlHoJB40/AdKxZ3T1RDL7w45K1f1EaubHVQTyT4e0H/o6VOb7Eb22eye+Yia6+U L6vCfRqDBGQqT0etNfC19mjdzttEElm3gTDo11M1Az5UwW/K3fqGGZ9qMLHtmVoZgz7U hD6qBofUl+mpkDvkzJWd8Aiu2OLP9OYQ9UL2glegQZSw8Lq8uSgt0Uwq34NNw03kzaTO 9qC/5lgZyES2Qk7ph0Fl8/G8yIZW2vu/LOSgCgyP/jE7O8uraUT4jnzlr7+OhGLM3ezO 9Q8A==
MIME-Version: 1.0
X-Received: by 10.49.3.6 with SMTP id 6mr11074723qey.64.1368136424170; Thu, 09 May 2013 14:53:44 -0700 (PDT)
Received: by 10.229.92.145 with HTTP; Thu, 9 May 2013 14:53:44 -0700 (PDT)
In-Reply-To: <05c6cf93-2e5e-469d-b356-0751f2bdd5df@flaska.net>
References: <05c6cf93-2e5e-469d-b356-0751f2bdd5df@flaska.net>
Date: Thu, 09 May 2013 14:53:44 -0700
Message-ID: <CABa8R6sdzxwq5P1ZZGqjn_XkciV=f-u=Xrp=kGpkTdh16ktSMQ@mail.gmail.com>
From: Brandon Long <blong@google.com>
To: Jan Kundrát <jkt@flaska.net>
Content-Type: multipart/alternative; boundary="047d7bdc0aba916f3c04dc5015b0"
X-Gm-Message-State: ALoCoQlhBBn9bWG/g5vovB4s5PCU8keCMUOqOW0EdHTBCKA5Zd3aQNJ5z9yrKdBUcIvUwalIJ7gyVqnIJnGLCbUEnt30b4JvFAOTuC/0XPFA5NjeipHr+Eq8ZVQ7M5O8qhYcfYiYxI6k6iMHk1seD9AAP3aJ0XmqrzK2TZ4LC13IV1QujaAcfG3oEG0Xgn07M2VBAVFIFHHN
Cc: "imapext@ietf.org" <imapext@ietf.org>
Subject: Re: [imapext] GMail's extensions: X-GM-THRID immutability
X-BeenThere: imapext@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Discussion of IMAP extensions <imapext.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/imapext>, <mailto:imapext-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/imapext>
List-Post: <mailto:imapext@ietf.org>
List-Help: <mailto:imapext-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/imapext>, <mailto:imapext-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 09 May 2013 21:53:46 -0000

On Thu, May 9, 2013 at 9:27 AM, Jan Kundrát <jkt@flaska.net> wrote:

> Hi,
> this might be a bit OT for this mailing list, but given that GMail is a
> rather dominant player among the IMAP service providers and due to the
> usefulness of having data available to other, I'm posting here anyway.
>
> - It isn't clear to me what the immutability guarantees of the returned
> data of the X-GM-THRID [1] extension are. It would be terrific if it was
> safe to cache these values in the same manner as any other immutable
> per-message data, but I suspect this is not possible -- if the threading is
> "right", delivery of any new message could potentially join independent
> threads together, thereby changing the thread IDs. How is GMail handling
> this? How is the threading computed?
>

You should be able to consider X-GM-THRID as immutable, that should have
been called out in the documents.  We never join threads.

Gmail does not thread by references, its closest to threading by subject.
 Our user facing parlance is typically "conversation" instead of thread.  A
conversation is basically up to 100 messages with the same "clean" subject.
 IIRC, we will start a new conversation if there is sufficient time gap
between the two, but we will use references to put a reply on an old
conversation regardless of time... though the 100 message is a "hard" limit.

Having a limit was chosen for performance reasons, we don't want to load a
couple thousand message indexes from disk or have paging in the
conversation view interface.  The conversation view doesn't lend itself to
true threading either, where "new" messages may be in multiple places in
the page.... and most email communication doesn't have that complicated of
a thread structure to begin with.  It also fixes the typical use cases of
"find a message from foo and reply and change the subject" instead of using
an address book and some other corner cases.


>
> - Any plans to support the THREAD=REFS [2] in GMail?
>

So, the new search terms might be interesting.  MESSAGEID is basically how
we handle HEADER MESSAGEID already (ie, its not substring, its actually
mapped to the rfc822messageid: term in our index).  INTHREAD is more odd
because our threads can cross folder boundaries (since they're not folders,
they're labels) but nothing overly complicated for us.

THREAD=REFS is just as unlikely as THREAD=REFERENCES for us.  We're not
computing threads on the fly just for IMAP.  We had one early engineer on
the project joke about implementing THREAD=GMAIL, but the THREAD= concept
seems fundamentally flawed to me that both the client and server require
understanding of the threading algorithm.  X-GM-THRID is basically "the
server knows the threads, trust it".


> - Any plans for support of the SORT extensions?
>

We have only the single SORT order in everything we do, so no.  Again, we
can't load the entire folder into memory just to SORT it on the server, and
we're not going to pre-compute and store each possible order.  You'll note
there is only the one order in all of the Gmail interfaces.  Our marketing
would say, don't sort, search!


> - Any plans for CONTEXT=SORT and CONTEXT=SEARCH? :)
>

No.  We'd probably have to create a filter on the fly for CONTEXT=SEARCH,
get updates that the filter has hit, and then load and finish testing
against the new message to see if it actually hit (not all of the IMAP
SEARCH syntax is translatable to our own search syntax, some things require
loading parts of the message).  That just seems like an overall large
effort for supporting "online" low caching clients, and we don't really
support them well in many other ways, mostly because almost all clients are
actually offline caching clients.


>
> The reason why I'm asking is because I'd like to enable threading for
> Trojita's users who are accessing GMail. Any threading algorithm apart from
> THREAD=REFS has significant limitations without a server-side sorting
> simply because old threads with new arrivals are not listed as recent. The
> only remedy is giving up and hoping that UIDs somehow correlate with the
> age of a any message, which is rather crude heuristic.
>

What does "old thread with new arrivals are not listed as recent" mean?
 New messages are clearly new, since they have newer UIDs (well, new to
that folder at least).  We always display messages in our "threads" in
INTERNALDATE order.

Brandon


>
> With kind regards,
> Jan
>
> [1] https://developers.google.com/**google-apps/gmail/imap_**
> extensions#access_to_the_**gmail_thread_id_x-gm-thrid<https://developers.google.com/google-apps/gmail/imap_extensions#access_to_the_gmail_thread_id_x-gm-thrid>
> [2] http://tools.ietf.org/html/**draft-ietf-morg-inthread-01<http://tools.ietf.org/html/draft-ietf-morg-inthread-01>
>
> --
> Trojitá, a fast Qt IMAP e-mail client -- http://trojita.flaska.net/
> ______________________________**_________________
> imapext mailing list
> imapext@ietf.org
> https://www.ietf.org/mailman/**listinfo/imapext<https://www.ietf.org/mailman/listinfo/imapext>
>