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

From: Ned Freed <[email-masked]>
Date: Tue, 30 Oct 2018 16:11:25 -0700 (PDT)

> 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

---

From: Stephan Bosch <[email-masked]>
Date: Thu, 1 Nov 2018 20:01:12 +0100

Hi Ned,

BTW, can you review the IMAP examples in this specification?

Regards,

Stephan.

Op 31/10/2018 om 00:11 schreef Ned Freed:
> _______________________________________________
> Extra mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/extra

---

From: Ned Freed <[email-masked]>
Date: Fri, 02 Nov 2018 14:28:36 -0700 (PDT)

> On Thu, Nov 1, 2018 at 7:11 AM Ned Freed <[email-masked]> wrote:

> > subsequent parameter optional, so you can do something like: [...]

> This was exactly the idea.

> We could probably change a MUST to a SHOULD somewhere for compatibility to
> legitimize this, but this does make argument parsing a little less regular
> than it otherwise might be. (A similar argument is why you have to have
> header :contains ["To"] "whatever", instead of header ["To"] :contains
> :whatever"; one ancient version of the spec allowed any ordering.)

A future change to a SHOULD sounds like a good idea to me.

				Ned