Re: [Extra] Comments on draft-ietf-extra-sieve-special-use-03

Ned Freed <ned.freed@mrochek.com> Thu, 01 November 2018 14:11 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 3BB17124D68 for <extra@ietfa.amsl.com>; Thu, 1 Nov 2018 07:11:12 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.208
X-Spam-Level:
X-Spam-Status: No, score=-1.208 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RDNS_NONE=0.793, SPF_PASS=-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 zI5wdf-53c-7 for <extra@ietfa.amsl.com>; Thu, 1 Nov 2018 07:11:11 -0700 (PDT)
Received: from mauve.mrochek.com (unknown [66.159.242.17]) (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 5853512785F for <extra@ietf.org>; Thu, 1 Nov 2018 07:11:10 -0700 (PDT)
Received: from dkim-sign.mauve.mrochek.com by mauve.mrochek.com (PMDF V6.1-1 #35243) id <01QZ257ULIMO000CW6@mauve.mrochek.com> for extra@ietf.org; Tue, 30 Oct 2018 16:20:34 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mrochek.com; s=201712; t=1540941634; bh=AjnCzC4j76PnuE8ooHNjtqUCLG0Bp4r5oF6guHd59W0=; h=Cc:Date:From:Subject:In-reply-to:References:To:From; b=KcgVS6vN8NzHsV1gaJ1c8w5YI6tcMk2XrSacTuctBkQjwlBw2xMFr72Hc9wBj8Ioi SZrs2oNPHqtE6LU2TM9AZ3Hb0L59+nnNZ3aeCfPaiPJrLHbCht9PEet9xpcbpuzppZ JqSGkOGpevfvumcZfzX0brHEfW8IrTAmkUoNjU/A=
MIME-version: 1.0
Content-transfer-encoding: 8bit
Content-type: TEXT/PLAIN; charset="utf-8"
Received: from mauve.mrochek.com by mauve.mrochek.com (PMDF V6.1-1 #35243) id <01QYZWQSAX6O00008A@mauve.mrochek.com>; Tue, 30 Oct 2018 16:20:23 -0700 (PDT)
Cc: Stephan Bosch <stephan.bosch@dovecot.fi>, extra@ietf.org, Ned Freed <ned.freed@mrochek.com>
Message-id: <01QZ257P6DGE00008A@mauve.mrochek.com>
Date: Tue, 30 Oct 2018 16:11:25 -0700
From: Ned Freed <ned.freed@mrochek.com>
In-reply-to: "Your message dated Tue, 30 Oct 2018 20:15:00 +0000" <6b72363d-6f00-3ef7-2398-05690926b6f5@isode.com>
References: <a519d410-babd-36ee-8343-6fe3bea3a414@isode.com> <d9522e99-5078-01d5-3645-c3b7c8b36ba3@dovecot.fi> <6b72363d-6f00-3ef7-2398-05690926b6f5@isode.com>
To: Alexey Melnikov <alexey.melnikov@isode.com>
Archived-At: <https://mailarchive.ietf.org/arch/msg/extra/0pZddKnMSn6XfVaXhQCvGqhIBzI>
Subject: Re: [Extra] Comments on draft-ietf-extra-sieve-special-use-03
X-BeenThere: extra@ietf.org
X-Mailman-Version: 2.1.29
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, 01 Nov 2018 14:11:12 -0000

> Hi Stephan,

> On 29/10/2018 12:06, Stephan Bosch wrote:
> > Hi Alexey,
> >
> >
> > Op 28-10-2018 om 16:07 schreef Alexey Melnikov:
> >> Hi all,
> >> I've just tried to implement this Sieve extension and I have a couple of
> >> comments:
> >>
> >> 3.  Test "specialuse_exists"
> >>
> >>     Usage:  specialuse_exists [<mailbox: string>]
> >>                               <special-use-flags: string-list>
> >>
> >> This defines an optional argument. According to the base Sieve RFC 5228,
> >> optional arguments must be tagged:
> >>
> >>    2.6.1.  Positional Arguments
> >>
> >>     Positional arguments are given to a command that discerns their
> >>     meaning based on their order.  When a command takes positional
> >>     arguments, all positional arguments must be supplied and must be in
> >>     the order prescribed.
> >>
> >>   and
> >>
> >>    2.6.3.  Optional Arguments
> >>
> >>     Optional arguments are exactly like tagged arguments except that they
> >>     may be left out, in which case a default value is implied.  Because
> >>     optional arguments tend to result in shorter scripts, they have been
> >>     used far more than tagged arguments.
> >>
> >> So I don't think you can have "mailbox" being positional without a tag!
> >
> > Then what about the entirety of the "imap4flags" extension?

> Guilty as charged :-). I entirely forgot about that and the reason why I
> haven't noticed is because my implementation doesn't support "variables"
> extension, so variable name parameter to addflag/removeflag/setflag is
> never allowed.

> Any other opinions (Ned?). I just want to make sure that if we violating
> some kind of architectural principle specified in the base Sieve script,
> than we decide to do this deliberately. (Or maybe we just agree that
> there is no architectural principle to begin with.)

There was some principle in play, I think - Sieve copies this aspect from
Common LISP, and if memory serves, &optional in Common LISP makes all
subsequent parameter optional, so you can do something like:

    (defun fu (a b &optional c d) ...

but there is nothing like:

    (defun bar (a (&optional b) c) ...

But it looks like we've already crossed this bridge with imap4flags, and
nobody has complained. So let's note it and move on.

> > Lots of
> > tag-less optional arguments can be found there. I am not against having
> > some ":mailbox" tag here, but the current syntax does make things more
> > concise.
> >
> >> 4.  ":specialuse" Argument to "fileinto" Command
> >>
> >>     Usage:  fileinto [:specialuse <special-use-flag: string>]
> >>                      <mailbox: string>
> >>
> >> Can I suggest that all special-use-flag strings should not include the
> >> leading "\" character? It requires escaping in Sieve, so people might
> >> make mistakes when writing scripts.
> >
> > I have no strong opinion about that. Disadvantage of doing that is that
> > it can be confusing for people with IMAP experience and it becomes
> > inconsistent with imap4flags.

> Yes, that is true. At the same time in JMAP we can do remove leading "\"
> character from flag names as well.

> So yes, I am not fully decided on this issue. Anybody else wants to comment?

I'm not fond of having multiple forms for things, so I'd prefer to keep
the "\". It's not a strong preference, however.

				Ned