Re: [imapext] Registering $hasAttachment & $hasNoAttachment

Josef 'Jeff' Sipek <jeff.sipek@dovecot.fi> Sat, 27 January 2018 01:46 UTC

Return-Path: <jeff.sipek@dovecot.fi>
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 2482512D863 for <imapext@ietfa.amsl.com>; Fri, 26 Jan 2018 17:46:50 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.21
X-Spam-Level:
X-Spam-Status: No, score=-4.21 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
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 ZK76NqePrWyJ for <imapext@ietfa.amsl.com>; Fri, 26 Jan 2018 17:46:48 -0800 (PST)
Received: from mail.dovecot.fi (wursti.dovecot.fi [94.237.32.243]) by ietfa.amsl.com (Postfix) with ESMTP id 5311D12D84B for <imapext@ietf.org>; Fri, 26 Jan 2018 17:46:48 -0800 (PST)
Received: from meili (josefsipek.net [71.174.113.7]) by mail.dovecot.fi (Postfix) with ESMTPSA id B55D42B3CD4; Sat, 27 Jan 2018 03:46:45 +0200 (EET)
Date: Fri, 26 Jan 2018 20:46:51 -0500
From: Josef 'Jeff' Sipek <jeff.sipek@dovecot.fi>
To: Alexey Melnikov <aamelnikov@fastmail.fm>
Cc: Neil Jenkins <neilj@fastmailteam.com>, imapext@ietf.org
Message-ID: <20180127014650.GB9033@meili>
References: <20171203235834.GB1632@meili> <1512346907.3913979.1192707160.32EA0EE2@webmail.messagingengine.com> <3A29C592-4FAE-49DB-B6D9-1AC5F3CC42A8@fastmail.fm> <20171204132225.GD1632@meili>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20171204132225.GD1632@meili>
User-Agent: Mutt/1.8.3 (2017-05-23)
Archived-At: <https://mailarchive.ietf.org/arch/msg/imapext/MVE5eNHOaNIVGUvN1RKtBL8b278>
Subject: Re: [imapext] Registering $hasAttachment & $hasNoAttachment
X-BeenThere: imapext@ietf.org
X-Mailman-Version: 2.1.22
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: <https://mailarchive.ietf.org/arch/browse/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: Sat, 27 Jan 2018 01:46:50 -0000

Sorry for the delay, somehow this managed to slip through the cracks during
the holidays and the subsequent email backlog...

On Mon, Dec 04, 2017 at 08:22:26 -0500, Josef 'Jeff' Sipek wrote:
> On Mon, Dec 04, 2017 at 10:25:16 +0000, Alexey Melnikov wrote:
> > > On 4 Dec 2017, at 00:21, Neil Jenkins <neilj@fastmailteam.com> wrote:
> > >> On Mon, 4 Dec 2017, at 10:58 AM, Josef 'Jeff' Sipek wrote:
...
> > >> Note:
> > >> $hasAttachment and $hasNoAttachment are mutually exclusive.  If more than
> > >> one of them is set for a message, the email client MUST treat this as if
> > >> neither of them is set and SHOULD remove both of them from the IMAP
> > >> server.
> > > 
> > > Surely it SHOULD remove the one that is incorrect rather than both?
> > 
> > I think everything after "and SHOULD" can be deleted. As presence of both
> > means neither is present, both what is written above and what you suggest
> > is a reasonable course of action.
> 
> Right.  Dropping the SHOULD would leave it least constrained.  Suggesting
> that either they both get dropped, or that only the correct one remains is
> an additional (but very weak) "constraint".
> 
> So, the options are:
> 
> 1. remove the SHOULD completely
> 2. use SHOULD remove both keywords
> 3. use SHOULD keep only correct keyword
> 
> The $Junk & $NotJunk IANA registration texts [1,2] use option #2.
> 
> Finally, I received a suggestion off-list to possibly add something like:
> 
> 	Whenever a client sets $HasAttachment, the server MAY assist by
> 	automatically clearing $HasNoAttachment. (and vice versa)

Ok, I ended up going with option #1 - removing the SHOULD.  It resolves the
invalid state and nothing more.  Once resolved (by ignoring both keywords),
the email is a known state and the client can proceed as normal - whatever
that may be.

I opted for not adding the 'server-toggling MAY'.  Since this behavior
wouldn't be required to be implemented by the server, all clients wishing to
work with $HasAttachment and $HasNoAttachment would have to assume that the
toggling isn't supported.  As a result, they would have to implement the
non-server-assisted behavior anyway.  In other words, they would have to
implement more than one code path - increasing complexity for no benefit.

Furthermore, most (all?) servers out there don't understand the meaning of
each keyword and instead treat them as simple labels associated with the
email.  Including the MAY here would suggest some expectation of the server
doing more, which is definitely not the intention.

Full texts below.

Jeff.

---
Subject Registration of IMAP keyword $HasAttachment

IMAP keyword name: $HasAttachment

Purpose (description):
Many mail user agents display a hint to the user that a particular email
contains attachments.  Without any help of the server, the user agent needs
to fetch at least a part of the email to determine whether or not the email
contains an attachment.  This is not only wasteful of system resources, but
it also causes a perceivable delay in displaying the mailbox contents to the
user.

The $HasAttachment keyword can be used by the delivery agent to mark a
message as containing an attachment.  The mail user agent can then
efficiently check for the presence of this keyword and convey the
information to the user in whatever way is appropriate.

Private or Shared on a server: BOTH

Is it an advisory keyword or may it cause an automatic action: ADVISORY

When/by whom the keyword is set/cleared:
This keyword can be set by either a delivery agent (e.g., through an internal
mechanism) or an email client (using the normal IMAP protocol).  The client
must be able to set or clear $HasAttachment at any time.  The keyword should
be set when the delivery agent or a client has determined that the email
contains at least one attachment.  If the email does not contain any
attachments, $HasAttachment should be cleared and $HasNoAttachment should be
set instead (see note).

Related keywords: $HasNoAttachment

Related IMAP capabilities: None

Security considerations: None

Published specification (recommended):

Person & email address to contact for further information:
Josef 'Jeff' Sipek <jeff.sipek@dovecot.fi>

Intended usage: COMMON

Owner/Change controller: IESG

Note:
$HasAttachment and $HasNoAttachment are mutually exclusive.  If more than
one of them is set for a message, the email client MUST treat this as if
neither of them is set.

The exact meaning of "has an attachment" is left up to the implementors.
The consequences of implementations disagreeing on what constitutes an
attachment are minor, given that $HasAttachment is intended as only a hint
to the user in the UI.
---
Subject Registration of IMAP keyword $HasNoAttachment

IMAP keyword name: $HasNoAttachment

Purpose (description):
Many mail user agents display a hint to the user that a particular email
contains attachments.  Without any help of the server, the user agent needs
to fetch at least a part of the email to determine whether or not the email
contains an attachment.  This is not only wasteful of system resources, but
it also causes a perceivable delay in displaying the mailbox contents to the
user.

The $HasNoAttachment keyword can be used by the delivery agent to mark a
message as *not* containing an attachment.  The mail user agent can then
efficiently check for the presence of this keyword and convey the
information to the user in whatever way is appropriate.

Private or Shared on a server: BOTH

Is it an advisory keyword or may it cause an automatic action: ADVISORY

When/by whom the keyword is set/cleared:
This keyword can be set by either a delivery agent (e.g., through an internal
mechanism) or an email client (using the normal IMAP protocol).  The client
must be able to set or clear $HasNoAttachment at any time.  The keyword
should be set when the delivery agent or a client has determined that the
email does not contain any attachments.  If the email contains at least one
attachment, $HasNoAttachment should be cleared and $HasAttachment should be
set instead (see note).

Related keywords: $HasAttachment

Related IMAP capabilities: None

Security considerations: None

Published specification (recommended):

Person & email address to contact for further information:
Josef 'Jeff' Sipek <jeff.sipek@dovecot.fi>

Intended usage: COMMON

Owner/Change controller: IESG

Note:
$HasAttachment and $HasNoAttachment are mutually exclusive.  If more than
one of them is set for a message, the email client MUST treat this as if
neither of them is set.

The exact meaning of "has an attachment" is left up to the implementors.
The consequences of implementations disagreeing on what constitutes an
attachment are minor, given that $HasNoAttachment is intended as only a hint
to the user in the UI.
---