ietf-mta-filters
[Top] [All Lists]

Re: [sieve] Notify (RFC 5435) questions

2009-09-29 10:18:28
Hello!

On Mon, Sep 28, 2009 at 01:32:02PM -0400, Barry Leiba wrote:
On Mon, Sep 28, 2009 at 10:36 AM, Hannah Schroeter 
<hannah(_at_)schlund(_dot_)de> wrote:
Section 3.4. Notify Tag ":importance" says that the :importance tag
specifies a numerical value from one through three as a string. However,
it doesn't specify what happens when a script fails to comply with that,
i.e. the string specifies a different number, or not a number at all

What happens is the same as what happens with any other syntax error:
it causes a compile-time error (or, if variable substitution is used,
a run-time error after the variable substitution).
   ^^^^^^^^^^^^^^           ^^^^^^^^^^^^^^^^^^^^^

This doesn't fit with the ductus of other parts of the spec (such as
:from, or the parameter method) where error handling or ignoring things
(e.g. from values that are syntactically correct but not allowed for the
script owner for policy reasons) are clearly specified.

I don't know what "ductus" means, but this isn't a case of policy.
There's no need to say specifically what happens if a script violates
the grammar in this case, because we know what to do when a script
violates the grammar in general.

Grammar is usually not a run-time property in computer languages,
and that's why I think it *does* need specification.

By the way, the ABNF suggests that the number has to be given literally,
but the specification doesn't spell it out whether that really implies
the :importance parameter has to be a *constant* string in the sense of
the variables extension.

We thought it was clear that these were strings, which could be put in
as variables, but I see how it can be confusing.  The intent is
certainly that variables may be used here.  Perhaps we should enter an
erratum suggesting a comment in the ABNF that makes this clear.

A bit of history:
The parameter was originally called "priority", and had text-string
values.  From the -00 draft version:

   The priority parameter specifies the importance of the notification.
   The priority parameter has the following values: ":high" (very
   important), ":normal", and ":low" (not very important). If no
   priority is given, a default priority of ":normal" SHOULD be
   assumed.

Were those *keywords* in that version or *strings* with a value
containing a colon as first character?

[...]

To the specific questions:

 1. Is the parameter of :importance a *constant* string (as the ABNF
    suggests) or can it expand variables (as the variables extension
    says all strings do if one uses it unless *explicitly* told to be
    constant)?

The latter.

Then, the ABNF-like spec is misleading, as it might suggest a deviation
from that "default" of expanding.

 2. If the string of the parameter doesn't specify a number at all,
    is that an error or is the parameter silently ignored and the
    default importance ("2") used?

Error, as with any other incorrect parameter that doesn't give other
explicit guidance.

This isn't a clear line in Sieve with respect to *run-time* values.

 3. If the string of the parameter *does* specify a number, but one
    out of range, is that an error or is it ignored? In the latter
    case, is the default importance used or is the number clipped
    to the range (from below 1 to 1, from above 3 to 3)?

The same as 2.

 4. Are leading zeroes tolerated as the *text* suggests "a numeric
    value represented as a string" or not, as the ABNF suggests,
    [":importance" <"1" / "2" / "3">]?

We didn't explicitly consider this, but the grammar specifies a
string, and does not allow leading zeroes.  I would anticipate that
implementations might take that as specified.

That means error, if I understand you right?

Kind regards,

Hannah.
_______________________________________________
sieve mailing list
sieve(_at_)ietf(_dot_)org
https://www.ietf.org/mailman/listinfo/sieve

<Prev in Thread] Current Thread [Next in Thread>