🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #90011

Re: Proposal specifications for MAXARTNUM

#90011
From: Michael Bäuerle
Date: Sat, 07 Jan 2023 10:10
162 lines
7393 bytes
Julien ÉLIE wrote:
> Michael Bäuerle wrote:
> > Julien ÉLIE wrote:
> > > 
> > > If we're going to have only a very few, if any, more general "ENABLE"
> > > commands, is it worth the complexification of defining its parsing
> > > instead of just having top-level commands?
> > > 
> > > ENABLE MAXARTNUM=18446744073709551615 UTF8=ACCEPT NULCHARS=ACCEPT
> > > MAXRESPLINES=UNLIMITED
> > 
> > There are potential problems if not all of the features are supported
> > by the server. The command likely will be rejected with an error code,
> > no feature will be enabled and the client doesn't know which subcommand
> > was responsible for the problem.
> 
> The ENABLE command in IMAP does:
> 
>    - If the argument is not an extension known to the server, the server
>      MUST ignore the argument.
> 
>    - If the argument is an extension known to the server, and it is not
>      specifically permitted to be enabled using ENABLE, the server MUST
>      ignore the argument.  (Note that knowing about an extension doesn't
>      necessarily imply supporting that extension.)

Anything unknown or not permitted is ignored.

>    - If the argument is an extension that is supported by the server and
>      that needs to be enabled, the server MUST enable the extension for
>      the duration of the connection.  At present, this applies only to
>      CONDSTORE ([RFC4551]).  Note that once an extension is enabled,
>      there is no way to disable it.
> 
>    The ENABLE command can be issued multiple times in a session.  It is
>    additive; i.e., "ENABLE a b", followed by "ENABLE c" is the same as a
>    single command "ENABLE a b c".

Could be simplified by only allowing one extension per command:

    ENABLE a
    ENABLE b
    ENABLE c
 
>    The server MUST NOT change the CAPABILITY list as a result of
>    executing ENABLE; i.e., a CAPABILITY command issued right after an
>    ENABLE command MUST list the same capabilities as a CAPABILITY
>    command issued before the ENABLE command.
> 
> 
> For the last point about going on advertising the capability, I am 
> unsure we should do the same for NNTP, if we use ENABLE.  Once the 
> maximum article number is negotiated, it cannot be changed a second 
> time, so there's no need in advertising the capability.

For IMAP this would match the case "not specifically permitted to be
enabled using ENABLE" (should be ignored, if enabled again).

> > The client has to parse the response
> > for information or test all features individually.
> > In theory this should not happen, if the client has parsed CAPABILITIES
> > carefully, but in real world there may be bugs somewhere.
> 
> I agree that parsing ENABLE commands and results without error will be 
> challenging...
> It is far more work than unique commands, one per feature.
> 
> Capability list:
> [S] ENABLE MAXARTNUM=18446744073709551615 UTF8=NEWSGROUPS,HEADERS 
> NULCHARS MAXRESPLINES=4096
> (or a variant on several lines with individual MAXARTNUM, UTF8 and 
> MAXRESPLINES capabilities - not needed for NULCHARS)
> 
> Command:
> [C] ENABLE MAXARTNUM=9223372036854775807 UTF8=NEWSGROUPS MAXRESPLINES=2048
> [S] 206 UTF8=NEWSGROUPS MAXARTNUM=9223372036854775807 MAXRESPLINES=2048
> 
> Responding what has been enabled, without trailing comment.
> 
> We may have instead of a 501 syntax error, not giving useful information:
> [C] ENABLE MAXARTNUM=badnumber UTF8=NONE MAXRESPLINES=2048
> [S] 506 MAXARTNUM UTF8
> (new error code to indicate syntax error in recognized commands, listed 
> after 506, and MAXRESPLINES is not enabled)
> Or we can just use 501 without that complexity.
> 
> A bit of work...

Because adoption of new features is already so slow for Usenet, I think
we should look for a simpler solution.
 
> > I would prefer simplicity, this means only one feature per command.
> > But maybe the toplevel command "ENABLE", to enable/negotiate features,
> > is useful to share the same return codes for all features.
> 
> Defining shared return codes, and enabling all features in only 1 
> command, may be the only advantages for ENABLE.
> I don't know if that's worth the extra work in complexity of 
> coding/debugging/getting it right.
> Notably if we end up only having MAXARTNUM as a feature to enable...

Maybe for VERSION 3, if there would really be a lot of extensions.

> > C ENABLE UTF-8=ACCEPT
> > S 500
> 
> Might be 503 (feature not supported) in case the extension is unknown 
> to the server.  (500 is for the base command.)

Yes, 500 only if ENABLE itself would be not supported.

> > This has to be done only once per session and the additional roundtrip
> > times should be acceptable if the number of features is small.
> 
> We already have many roundtrips in sessions like this one, where the 
> client sends CAPABILITIES several times:
> 
> CAPABILITIES (gosh, MODE-READER is advertised)
> MODE READER
> CAPABILITIES (gosh, there is no argument to AUTHINFO)
> STARTTLS
> CAPABILITIES (yes, I can now authenticate)
> AUTHINFO USER
> AUTHINFO PASS
> CAPABILITIES (I now have more capabilities available)
> COMPRESS DEFLATE
> ENABLE MAXARTNUM=18446744073709551615
> 
> And now after 10 commands (sic), I can send LIST ACTIVE & co.
>
> Using implicit TLS on port 563, which is the most wide-spread 
> situation, we have 4 less commands.

For your server I already have 8 commands even with implicit TLS and
without MODE-READER:

    CAPABILITIES
    AUTHINFO USER
    AUTHINFO PASS
    CAPABILITIES
    COMPRESS DEFLATE
    CAPABILITIES
    LIST OVERVIEW.FMT
    LIST DISTRIB.PATS

Would be 9 commands with MAXARTNUM.

The capability refresh after COMPRESS may be required because flnews
supports immediate and 480-triggered authentication (the order listed
above is not guaranteed).

<https://www.rfc-editor.org/rfc/rfc8054#section-2.2.2>
| 
| [...], a server MUST either list the AUTHINFO capability with
| no arguments or not advertise it at all, in response to a
| CAPABILITIES command received from an unauthenticated client after a
| successful use of the COMPRESS command, [...]

> Seems reasonable after all to have separate commands (MAXARTNUM, and 
> other possible future extensions) instead of ENABLE...

Agreed.
Technical Details
Message-ID: <AABjuUUYqSEAAAnM.A3.flnews@Server4.micha.freeshell.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
References: <tnqm14$35bas$1@news.trigofacile.com> <tou5si$1na9g$1@dont-email.me> <tp53et$7clk$1@news.trigofacile.com> <AABjtplGZckAAAqY.A3.flnews@WStation7.micha.freeshell.org> <tp76sd$90fs$2@news.trigofacile.com>

Show Full Headers
Complete Article Headers
Message-ID: <AABjuUUYqSEAAAnM.A3.flnews@Server4.micha.freeshell.org>
Subject: Re: Proposal specifications for MAXARTNUM
Date: Sat, 7 Jan 2023 10:10:32 -0000
From: Michael Bäuerle <michael.baeuerle@gmx.net>
References: <tnqm14$35bas$1@news.trigofacile.com> <tou5si$1na9g$1@dont-email.me> <tp53et$7clk$1@news.trigofacile.com> <AABjtplGZckAAAqY.A3.flnews@WStation7.micha.freeshell.org> <tp76sd$90fs$2@news.trigofacile.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
Newsgroups: news.software.nntp
Lines: 162
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=fixed
Content-Transfer-Encoding: 8bit
X-Trace: individual.net Pr+Vb1fupUvwVDHQfPZb/gKhuz8dZuNa0LiZbt/YmEP2EgV475
X-Orig-Path: not-for-mail
Cancel-Lock: sha1:rm7htuzo/4jRdg/VX3DiYXwTPNU=
Injection-Date: Sat, 7 Jan 2023 10:10:32 -0000
User-Agent: flnews/1.1.0 (for HP-UX)