Re: [Extra] I-D Action: draft-ietf-extra-sieve-special-use-01.txt

Ned Freed <ned.freed@mrochek.com> Thu, 14 June 2018 01:52 UTC

Return-Path: <ned.freed@mrochek.com>
X-Original-To: extra@ietfa.amsl.com
Delivered-To: extra@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 6F895130FAC for <extra@ietfa.amsl.com>; Wed, 13 Jun 2018 18:52:14 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.457
X-Spam-Level:
X-Spam-Status: No, score=-0.457 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DATE_IN_PAST_06_12=1.543, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=no autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=mrochek.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3VIAVZuGdMfo for <extra@ietfa.amsl.com>; Wed, 13 Jun 2018 18:52:12 -0700 (PDT)
Received: from mauve.mrochek.com (mauve.mrochek.com [68.183.62.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 99C6D1292AD for <extra@ietf.org>; Wed, 13 Jun 2018 18:52:12 -0700 (PDT)
Received: from dkim-sign.mauve.mrochek.com by mauve.mrochek.com (PMDF V6.1-1 #35243) id <01QTO3TNFWOW011NIB@mauve.mrochek.com> for extra@ietf.org; Wed, 13 Jun 2018 18:47:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mrochek.com; s=201712; t=1528940828; bh=KubdVcJ3CRo5YEPa5H+tN7f5y8E0zXnQbBbMYAMpwrk=; h=Cc:Date:From:Subject:In-reply-to:References:To:From; b=JHcktyL++IDHZOGYTsBRoSiAS+A+w+3zWgZORNbrupWYBJjG0Ui5XH0lBquE7wsrp wW0xF7ZmAwhNE823w+aV1FTfKnn6xKUQGUDNZT5II9S0Lkn91Uz0zE2wnEWoja+vt7 hmnnQxQSB+pb7VaSY0yhysycBk79RFTtzsalGBBE=
MIME-version: 1.0
Content-transfer-encoding: 7bit
Content-type: TEXT/PLAIN; CHARSET="us-ascii"; Format="flowed"
Received: from mauve.mrochek.com by mauve.mrochek.com (PMDF V6.1-1 #35243) id <01QTN94JXEB400AI1F@mauve.mrochek.com>; Wed, 13 Jun 2018 18:47:03 -0700 (PDT)
Cc: Ned Freed <ned.freed@mrochek.com>, extra@ietf.org
Message-id: <01QTO3THVZ5I00AI1F@mauve.mrochek.com>
Date: Wed, 13 Jun 2018 08:40:26 -0700
From: Ned Freed <ned.freed@mrochek.com>
In-reply-to: "Your message dated Mon, 21 May 2018 15:13:54 +0200" <83ddcadc-b756-91c1-3664-81955cd8f0d8@dovecot.fi>
References: <151533655607.10858.793231788332492256@ietfa.amsl.com> <ce56fc8f-366a-8e1e-2f00-1ed22da28d15@dovecot.fi> <01QNLYA7BLVQ000051@mauve.mrochek.com> <83ddcadc-b756-91c1-3664-81955cd8f0d8@dovecot.fi>
To: Stephan Bosch <stephan.bosch@dovecot.fi>
Archived-At: <https://mailarchive.ietf.org/arch/msg/extra/MXfB1mrRnE940wPp65U-GQDXLZs>
Subject: Re: [Extra] I-D Action: draft-ietf-extra-sieve-special-use-01.txt
X-BeenThere: extra@ietf.org
X-Mailman-Version: 2.1.26
Precedence: list
List-Id: Email mailstore and eXtensions To Revise or Amend <extra.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/extra>, <mailto:extra-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/extra/>
List-Post: <mailto:extra@ietf.org>
List-Help: <mailto:extra-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/extra>, <mailto:extra-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 14 Jun 2018 01:52:15 -0000

> > This, incidentially, is one of those places where providing the actual IMAP
> > commands will be especially valuable: Pointing out that you should use the
> > NAMESPACE extension and if it isn't present, fallback to LIST "" would be very
> > helpful.

> Here's my initial attempt at addressing this point (separate branch in
> Github):

> https://github.com/ietfextra/draft-ietf-extra-sieve-special-use/commit/035a1af6137a383089c8d54cd733238dc2dfebda

> This adds an IMAP example for specialuse_exists.

> What do you think?

The first step seems fine:

   C: A01 NAMESPACE
   S: * NAMESPACE (("INBOX/" "/")("Archive/" "/")) NIL (("Public/" "/"))
   S: A01 OK NAMESPACE command completed

In the next step:

    Subsequently, when no particular mailbox is of interest (i.e., the
    "specialuse_exists" test has no mailbox argument), the client lists
    all mailboxes with special-use flags in the two returned personal
    namespaces:

    C: A02 LIST (SPECIAL-USE) "" ("INBOX/*" "Archive/*") RETURN (SPECIAL-USE)
    S: * LIST (\Drafts) "/" INBOX/Drafts
    S: * LIST (\Trash) "/" INBOX/Trash
    S: * LIST (\Sent) "/" INBOX/Sent
    S: * LIST (\Archive) "/" Archive/Default

It should be noted that this depends on extended list being available.

The final step is:

    C: A03 SELECT Archive/Default
    S: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
    S: * OK [PERMANENTFLAGS (\Answered \Deleted \Seen \Draft \*)] Flags permitted.
    S: * 11211 EXISTS
    S: * 3 RECENT
    S: * OK [UIDVALIDITY 1526903163] UIDs valid
    S: * OK [UIDNEXT 11278] Predicted next UID
    S: A03 OK [READ-WRITE] SELECT command completed

There are several issues here.

First, if you're going to use SELECT it's probably worth noting that since
inclusion of [READ-WRITE] for writable mailboxes is a SHOULD in RFC 3501 while
inclusion of [READ-ONLY] for non-writable is a MUST, a writability check really
needs to based on the absence of [READ-ONLY]. (RFC 5490 3.1.a appears incorrect
to me in this regard - should I file an errata?)

However, I think use of SELECT for this purpose is problematic: It's
potentially expensive and worse, may cause undesireable state changes. Why
not use the MYRIGHTS command to obtain the access rights (and check for "p" or
"i") without having to select the mailbox?

And as a bonus, if it's available you could use the just-standardized
LIST-MYRIGHTS extension to piggyback getting the rights while getting the list
of special-use mailboxes.

More generally, this is why documenting the things necessary to implement the
necessary semantics of an extension is helpful - there may be optimizations and
concerns that should be called out lest implementors miss them.

It also helps clarify overall implementation difficulty. And while this
extension may be easy to implement in the Sieve-in-IMAP case, from the
perspective of an MTA/MDA implementation, even if all of the steps can be done
efficiently, there's still the question of IMAP server availability and the
handling of temporary errors.

All of which is roundabout way of saying I now think that we may want a
capability for specialuse_exists that's separate from
"special-use"/:specialuse. Or better still, since we already have the "mailbox"
capability for "mailbox access stuff", I think we should require the presence
of both "mailbox" and "special-use" capabilities in order to use
specialuse_exists.

I also reviewed the rest of the revised draft, and it's looking good. My one
remaining concern is with the handling of multiple mailboxes having the
same special-use flag assigned. The draft currently says:

   More than one mailbox in the user's personal namespace can have a
   particular special-use flag assigned.  In case of such ambiguity, the
   mailbox that is chosen for delivery is implementation-defined.
   However, while the set of mailboxes to which the involved special-use
   flags are assigned remains unchanged, implementations MUST ensure
   that the mailbox choice is made consistently, so that the same
   mailbox is used every time.  Conversely, the chosen mailbox MAY
   change once the special-use flag assignments that are relevant for
   the mailbox choice are changed (usually by user interaction).

I don't see a way I can reasonably implement this MUST via IMAP unless the 
IMAP server always returns the list of special-use mailboxes in the same order.
Sure, I can cache the user/special-use-attribute/actual-mailbox-list tuple
somewhere, but caches can always be lost. And mailbox metadata is (a)
Potentially much too expensive and (b) Subject to the vagarities of user
actions.

I'm not happy about it, but I think this needs to become a SHOULD.

Another possibility is to use the default mailbox name as a means of
disambiguating multiple mailboxes with the same special-use attribute:
If the default mailbox is one of these deliver to it preferentially,
otherwise the behavior is implementation-defined. Not perfect, but it
provides a bit more consistent behavior that's easily achievable.

Aside from these issues, this draft looks good to go to me.

				Ned