🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
56 messages
56 total messages Page 1 of 2 Started by Russ Allbery Sat, 18 Oct 2003 04:37
Page 1 of 2 • 56 total messages
New NNTP draft -- Sections 1-3
#66849
Author: Russ Allbery
Date: Sat, 18 Oct 2003 04:37
609 lines
30373 bytes
[ See <http://www.davros.org/nntp-texts/draft20.txt> for the complete
  document, including credits and references.  This is the first in a
  series of postings of the sections of the new NNTP draft, which is
  currently in Last Call. ]


NNTP                                                          C. Feather
Internet-Draft                                                  Thus plc
Expires: April 15, 2004                                 October 16, 2003


1. Introduction

   This document specifies the Network News Transport Protocol (NNTP),
   which is used for the distribution, inquiry, retrieval, and posting
   of Netnews articles using a reliable stream-based mechanism. For news
   reading clients, NNTP enables retrieval of news articles that are
   stored in a central database, giving subscribers the ability to
   select only those articles they wish to read.

   The Netnews model provides for indexing, cross-referencing, and
   expiration of aged messages. For server-to-server interaction, NNTP
   is designed for efficient transmission of Netnews articles over a
   reliable full duplex communication channel.

   Every attempt is made to ensure that the protocol specification in
   this document is compatible with the version specified in RFC 977
   [RFC977]. However, this version does not support the ill-defined
   SLAVE command and permits four digit years to be specified in the
   NEWNEWS and NEWGROUPS commands. It changes the default character set
   to UTF-8 [RFC2279] instead of US-ASCII [ANSI1986]. It now requires
   all articles to have a message-id, eliminating the "<0>" placeholder
   used in RFC 977. It also extends the newsgroup name matching
   capabilities already documented in RFC 977.

   Generally, new functionality is made available using new commands. A
   number of such commands (including some commands taken from RFC 2980
   [RFC2980]) are now mandatory. Part of the new functionality involves
   a mechanism to discover what new functionality is available to
   clients from a server. This mechanism can also be used to add more
   functionality as needs merit such additions.

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
   document are to be interpreted as described in RFC 2119 [RFC2119].

   An implementation is not compliant if it fails to satisfy one or more
   of the MUST requirements for this protocol. An implementation that
   satisfies all the MUST and all the SHOULD requirements for its
   protocols is said to be "unconditionally compliant"; one that
   satisfies all the MUST requirements but not all the SHOULD
   requirements for NNTP is said to be "conditionally compliant".

   For the remainder of this document, the term "client" or "client
   host" refers to a host making use of the NNTP service, while the term
   "server" or "server host" refers to a host that offers the NNTP
   service.


2. Notation

   The following notational conventions are used in this document.

     UPPERCASE     indicates literal text to be included in the
                   command;
     lowercase     indicates a token described elsewhere;
     [brackets]    indicate that the argument is optional;
     ellipsis...   indicates that the argument may be repeated any
                   number of times (it must occur at least once);
     vertical|bar  indicates a choice of two mutually exclusive
                   arguments (exactly one must be provided).

   The name "message-id" for a command or response argument indicates
   that it is the message-id of an article as described in Section 3.4,
   including the angle brackets.

   The name "wildmat" for a argument indicates that it is a wildmat as
   defined in Section 4. If the argument does not meet the requirements
   of that section (for example, if it does not fit the grammar of
   Section 4.1) the NNTP server MAY place some interpretation on it (not
   specified by this document) or otherwise MUST treat it as a syntax
   error.

   Responses for each command will be described in tables listing the
   required format of a response followed by the meaning that should be
   ascribed to that response.

   The terms "NUL", "TAB", "LF", "CR, and "space" refer to the octets
   with those codes in US-ASCII [ANSI1986] (that is, %x00, %x09, %x0A,
   %x0D, and %x20 respectively), as do quoted characters (so "." and "<"
   refer to %x2E and %x3C). The term "CRLF" or "CRLF pair" means the
   sequence CR immediately followed by LF (that is, %x0D.0A). A
   "printable US-ASCII character" is an octet in the range %x21-7E.

   Examples in this document are not normative but serve to illustrate
   usages, arguments, and responses. In the examples, a "[C]" will be
   used to represent the client host and a "[S]" will be used to
   represent the server host. Most of the examples do not rely on a
   particular server state. In some cases, however, they do assume that
   the current selected newsgroup (see the GROUP command (Section
   6.1.1)) is invalid; when so, this is indicated at the start of the
   example.

   Terms which might be read as specifying details of a client or server
   implementation, such as "database", are used simply to ease
   description. Providing that implementations conform to the protocol
   and format specifications in this document, no specific technique is
   mandated.


3. Basic Concepts

3.1 Commands and Responses

   NNTP operates over any reliable data stream 8-bit-wide channel.
   Initially, the server host starts the NNTP service by listening on a
   TCP port; when running over TCP/IP, the official port for the NNTP
   service is 119. When a client host wishes to make use of the service,
   it MUST establish a TCP connection with the server host by connecting
   to that host on the same port on which the server is listening. When
   the connection is established, the NNTP server host MUST send a
   greeting. The client host and server host then exchange commands and
   responses (respectively) until the connection is closed or aborted.

   The character set for all NNTP commands is UTF-8 [RFC2279]. Commands
   in NNTP MUST consist of a keyword, which MAY be followed by one or
   more arguments. A CRLF pair MUST terminate all commands. Multiple
   commands MUST NOT be on the same line. Keywords MUST consist of
   printable US-ASCII characters. Unless otherwise noted elsewhere in
   this document, arguments SHOULD consist of printable US-ASCII
   characters. Keywords and arguments MUST be each separated by one or
   more space or TAB characters. Keywords MUST be at least three
   characters and MUST NOT exceed 12 characters. Command lines MUST NOT
   exceed 512 octets, which includes the terminating CRLF pair. The
   arguments MUST NOT exceed 497 octets. A server MAY relax these limits
   for commands defined in an extension.

   Where this specification permits UTF-8 characters outside the range
   U+0000 to U+007F, implementations MUST NOT use the Byte Order Mark
   (U+FEFF, encoding %xEF.BB.BF), and MUST use the Word Joiner (U+2060,
   encoding %xE2.91.A0) for the meaning Zero Width No-Break Space, in
   command lines and the initial lines of responses, and SHOULD apply
   these same principles throughout.

   Commands may have variants, using a second keyword immediately after
   the first to indicate which variant is required. The only such
   commands in this specification are LIST and MODE. Note that such
   variants are sometimes referred to as if they were commands in their
   own right: "the LIST ACTIVE" command should be read as shorthand for
   "the ACTIVE variant of the LIST command".

   Keywords are case-insensitive; the case of keywords for commands MUST
   be ignored by the server. Command and response arguments are case or
   language specific only when stated, either in this document or in
   other relevant specifications.

   An NNTP server MUST implement all the commands in this specification
   except for those marked as optional and those in extensions.

   Each response MUST start with a three-digit response code that is
   sufficient to distinguish all responses. Certain valid responses are
   defined to be multi-line; for all others, the response is contained
   in a single line. The first or only line of the response MUST NOT
   exceed 512 octets, which includes the response code and the
   terminating CRLF pair; an extension MAY specify a greater maximum for
   commands that it defines, but not for any other command.

   All multi-line responses MUST adhere to the following format:

   1.  The response consists of a sequence of one or more "lines", each
       being a stream of octets ending with a CRLF pair. Apart from
       those line endings, the stream MUST NOT include the octets NUL,
       LF, or CR.

   2.  The first such line contains the response code as with a single
       line response.

   3.  If any subsequent line begins with the "termination octet" ("."
       or %x2E), that line MUST be "byte-stuffed" by pre-pending an
       additional termination octet to that line of the response.

   4.  The lines of the response MUST be followed by a terminating line
       consisting of a single termination octet followed by a CRLF pair
       in the normal way. Thus a multi-line response is always
       terminated with the five octets CRLF "." CRLF (%x0D.0A.2E.0D.0A).

   5.  When interpreting a multi-line response, the "byte stuffing" MUST
       be undone; i.e. the client MUST ensure that, in any line
       beginning with the termination octet followed by octets other
       than a CRLF pair, that initial termination octet is disregarded.

   6.  Likewise, the terminating line ("." CRLF or %x2E.0D.0A) MUST NOT
       be considered part of the multi-line response; i.e. the client
       MUST ensure that any line beginning with the termination octet
       followed immediately by a CRLF pair is disregarded; (the first
       CRLF pair of the terminating CRLF "." CRLF is, of course, part of
       the last line of the response).

   Note that texts using an encoding (such as UTF-16 or UTF-32) that may
   contain the octets NUL, LF, or CR other than a CRLF pair cannot be
   reliably conveyed in the above format. However, except when stated
   otherwise, this specification does not require the content to be
   UTF-8 and it is possible for octets above and below 128 to be mixed
   arbitrarily.

   This document does not place any limit on the length of a subsequent
   line in a multi-line response. However, the standards that define the
   format of articles may do so.

   An NNTP server MAY have an inactivity autologout timer. Such a timer
   SHOULD be of at least three minutes duration, with the exception that
   there MAY be a shorter limit on how long the server is willing to
   wait for the first command from the client. The receipt of any
   command from the client during the timer interval SHOULD suffice to
   reset the autologout timer. Similarly, the receipt of any significant
   amount of data from the client while in the midst of sending a
   multi-line message to the server (such as during a POST or IHAVE
   command) SHOULD suffice to reset the autologout timer. When the timer
   expires, the server SHOULD close the TCP connection without sending
   any response to the client.

3.2 Response Codes

   Each response MUST begin with a three-digit status indicator. These
   are status reports from the server and indicate the response to the
   last command received from the client.

   The first digit of the response broadly indicates the success,
   failure, or progress of the previous command:

      1xx - Informative message.
      2xx - Command completed OK.
      3xx - Command OK so far; send the rest of it.
      4xx - Command was syntactically correct but failed for some
      reason.
      5xx - Command unknown, unsupported, unavailable, or syntax error.

   The next digit in the code indicates the function response category:

      x0x - Connection, setup, and miscellaneous messages
      x1x - Newsgroup selection
      x2x - Article selection
      x3x - Distribution functions
      x4x - Posting
      x8x - Reserved for authentication and privacy extensions
      x9x - Reserved for private use (non-standard extensions)

   Certain responses contain arguments such as numbers and names in
   addition to the status indicator. In those cases, to simplify
   interpretation by the client the number and type of such arguments is
   fixed for each response code, as is whether or not the code
   introduces a multi-line response. Any extension MUST follow this
   principle as well, but note that, for historical reasons, the 211
   response code is an exception to this. In all other cases, the client
   MUST only use the status indicator itself to determine the nature of
   the response. The exact response codes that can be returned by any
   given command are detailed in the description of that command.

   Arguments MUST be separated from the numeric status indicator and
   from each other by a single space. All numeric arguments MUST be in
   base 10 (decimal) format, and MAY have leading zeros. String
   arguments MUST contain at least one character and MUST NOT contain
   TAB, LF, CR, or space. The server MAY add any text after the response
   code or last argument as appropriate, and the client MUST NOT make
   decisions based on this text. Such text MUST be separated from the
   numeric status indicator or the last argument by at least one space.

   The server MUST respond to any command with the appropriate generic
   response (given in Section 3.2.1) if it represents the situation.
   Otherwise, each recognized command MUST return one of the response
   codes specifically listed in its description or in an extension. A
   server MAY provide extensions to this specification, including new
   commands, new variants or features of existing commands, and other
   ways of changing the internal state of the server. However, the
   server MUST NOT produce any other responses to a client that does not
   invoke any of the additional features. (Therefore a client that
   restricts itself to this specification will only receive the
   responses that are listed.)

   If a client receives an unexpected response, it SHOULD use the first
   digit of the response to determine the result. For example, an
   unexpected 2xx should be taken as success and an unexpected 4xx or
   5xx as failure.

   Response codes not specified in this document MAY be used for any
   installation-specific additional commands also not specified. These
   SHOULD be chosen to fit the pattern of x9x specified above.

   Neither this document nor any extension registered with IANA (see
   Section 8) will specify any response codes of the x9x pattern.
   (Implementers of extensions are accordingly cautioned not to use such
   responses for extensions that may subsequently be submitted for
   registration.)

3.2.1 Generic Response Codes

   The server MUST respond to any command with the appropriate one of
   the following generic responses if it represents the situation.

   If the command is not recognized, or it is an optional command or
   extension that is not implemented by the server, the response code
   500 MUST be returned.

   If there is a syntax error in the arguments of a recognized command,
   including the case where more arguments are provided than the command
   specifies or the command line is longer than the server accepts, the
   response code 501 MUST be returned. The line MUST NOT be truncated or
   split and then interpreted. Note that where a command has variants
   depending on a second keyword (e.g. LIST ACTIVE and LIST NEWSGROUPS),
   then 501 MUST be used when the base command is implemented but the
   requested variant is not, and 500 MUST be used only when the base
   command itself is not implemented.

   If the server experiences an internal fault or problem that means it
   is unable to carry out the command (for example, a necessary file is
   missing or a necessary service could not be contacted), the response
   code 403 MUST be returned. If the server recognises the command but
   does not provide an optional feature (for example because it does not
   store the required information), or only handles a subset of
   legitimate cases (see the HDR command (Section 8.6.1) for an
   example), the response code 503 MUST be returned. Note that where a
   command is optional (e.g. LIST ACTIVE.TIMES) and is not provided by a
   server, this MAY be treated as an unimplemented command (response
   code 500 or 501 as appropriate) or as a working command where the
   information is not available (response code 503).

   If the client is not authorized to use the specified facility when
   the server is in its current state, then the appropriate one of the
   following response codes MUST be used.

   502: it is necessary to terminate the connection and start a new one
      with the appropriate authority before the command can be used.
      Note that the server MUST NOT close the TCP connection immediately
      after a 502 response except at the initial connection (Section
      5.1) and with the MODE READER (Section 5.2) command. See also the
      latter command for historical usage of this response.

   480: the client must authenticate itself to the server (that is,
      provide information as to the identity of the client) before the
      facility can be used. This will involve the use of an
      authentication extension.

   483: the client must negotiate appropriate privacy protection on the
      connection. This will involve the use of a privacy extension.

   401: the client must change the state of the connection in some other
      manner. The first argument of the response MUST be the
      extension-label (see Section 8) of the extension (which may be a
      private extension) that provides the necessary mechanism, or
      "MODE-READER" if it is necessary to use the MODE READER (Section
      5.2) command.

   If the server has to terminate the connection for some reason, it
   MUST give a 400 response code to the next command and then
   immediately close the TCP connection.

   The client MUST be prepared to receive any of these responses for any
   command (except, of course, that the server MUST NOT generate a 500
   response code for mandatory commands).

3.2.1.1 Examples

   Example of an unknown command:

      [C] MAIL
      [S] 500 Unknown command

   Example of an unsupported extension:

      [C] LIST EXTENSIONS
      [S] 202 Extensions supported:
      [S] LISTGROUP
      [S] .
      [C] OVER
      [S] 500 Unknown command

   Example of an unsupported variant:

      [C] MODE POSTER
      [S] 501 Unknown MODE option

   Example of a syntax error:

      [C] ARTICLE   a.message.id@no.angle.brackets
      [S] 501 Syntax error

   Example of an overlong command line:

      [C] HEAD   53 54 55
      [S] 501 Too many arguments

   Example of a bad wildmat:

      [C] LIST ACTIVE   u[ks].*
      [S] 501 Syntax error

   Example of an attempt to access a facility not available to this
   connection:

      [C] MODE READER
      [S] 200 Reader mode, posting permitted
      [C] IHAVE   <i.am.an.article.you.will.want@example.com>
      [S] 502 Permission denied

   Example of an attempt to access a facility requiring authentication:

      [C] GROUP   secret.group
      [S] 480 Permission denied

   followed by a successful attempt following such authentication:

      [C] XSECRET   fred flintstone
      [S] 290 Password for fred accepted
      [C] GROUP   secret.group
      [S] 211 5 1 20 secret.group selected

   Example of an attempt to access a facility requiring privacy:

      [C] GROUP   secret.group
      [S] 483 Secure connection required
      [C] XENCRYPT
      [Client and server negotiate encryption on the link]
      [S] 283 Encrypted link established
      [C] GROUP   secret.group
      [S] 211 5 1 20 secret.group selected

   Example of a need to change mode before using a facility:

      [C] GROUP   binary.group
      [S] 401 XHOST Not on this virtual host
      [C] XHOST   binary.news.example.org
      [S] 290 binary.news.example.org virtual host selected
      [C] GROUP   binary.group
      [S] 211 5 1 77 binary.group selected

   Example of a temporary failure:

      [C] GROUP   archive.local
      [S] 403 Archive server temporarily offline

   Example of the server needing to close down immediately:

      [C] ARTICLE   123
      [S] 400 Power supply failed, running on UPS
      [Server closes connection.]

3.3 Pipelining

   NNTP is designed to operate over a reliable bi-directional connection
   such as TCP. Therefore, if a command does not depend on the response
   to the previous one, it should not matter if it is sent before that
   response is received. Doing this is called "pipelining". However,
   certain server implementations throw away all text received from the
   client following certain commands before sending their response. If
   this happens, pipelining will be affected because one or more
   commands will have been ignored or misinterpreted, and the client
   will be matching the wrong responses to each command. Since there are
   significant benefits to pipelining, but also circumstances where it
   is reasonable or common for servers to behave in the above manner,
   this document puts certain requirements on both clients and servers.

   Except where stated otherwise, a client MAY use pipelining. That is,
   it may send a command before receiving the response for the previous
   command. The server MUST allow pipelining and MUST NOT throw away any
   text received after a command. Irrespective of whether or not
   pipelining is used, the server MUST process commands in the order
   they are sent.

   If the specific description of a command says it "MUST NOT be
   pipelined", that command MUST end any pipeline of commands. That is,
   the client MUST NOT send any following command until receiving the
   CRLF at the end of the response from the command. The server MAY
   ignore any data received after the command and before the CRLF at the
   end of the response is sent to the client.

   The initial connection must not be part of a pipeline; that is, the
   client MUST NOT send any command until receiving the CRLF at the end
   of the greeting.

   If the client uses blocking system calls to send commands, it MUST
   ensure that the amount of text sent in pipelining does not cause a
   deadlock between transmission and reception. The amount of text
   involved will depend on window sizes in the transmission layer, and
   is typically 4k octets for TCP.

3.3.1 Examples

   Example of correct use of pipelining:

      [C] GROUP   misc.test
      [C] STAT
      [C] NEXT
      [S] 211 1234 3000234 3002322 misc.test
      [S] 223 3000234 <45223423@example.com> retrieved
      [S] 223 3000237 <668929@example.org> retrieved

   Example of incorrect use of pipelining (the MODE READER command may
   not be pipelined):

      [C] GROUP   misc.test
      [C] MODE READER
      [C] DATE
      [C] NEXT
      [S] 211 1234 3000234 3002322 misc.test
      [S] 200 Server ready, posting allowed
      [S] 223 3000237 <668929@example.org> retrieved

   The DATE command has been thrown away by the server and so there is
   no 111 response to match it.

3.4 Articles

   NNTP is intended to transfer articles between clients and servers.
   For the purposes of this specification, articles are required to
   conform to the rules in this section and clients and servers MUST
   correctly process any article received from the other that does so.
   Note that this requirement applies only to the contents of
   communications over NNTP; it does not prevent the client or server
   from subsequently rejecting an article for reasons of local policy.
   Also see Appendix B for further restrictions on the format of
   articles in some uses of NNTP.

   An article consists of two parts: the headers and the body. They are
   separated by a single empty line, or in other words by two
   consecutive CRLF pairs (if there is more than one empty line, the
   second and subsequent ones are part of the body). In order to meet
   the general requirements of NNTP, an article MUST NOT include the
   octet NUL, MUST NOT contain the octets LF and CR other than as part
   of a CRLF pair, and MUST end with a CRLF pair. This specification
   puts no further restrictions on the body; in particular, it MAY be
   empty.

   The headers of an article consist of one or more header lines. Each
   header line consists of a header name, a colon, a space, the header
   content, and a CRLF in that order. The name consists of one or more
   printable US-ASCII characters other than colon and, for the purposes
   of this specification, is not case sensitive. There MAY be more than
   one header line with the same name. The content MUST NOT contain CRLF
   but is otherwise unrestricted; in particular, it MAY be empty. A
   header may be "folded"; that is, a CRLF pair may be placed before any
   TAB or space in the line; there MUST still be some other octet
   between any two CRLF pairs in a header line. (Note that folding means
   that the header line occupies more than one line when displayed or
   transmitted; nevertheless it is still referred to as "a" header
   line.) The presence or absence of folding does not affect the meaning
   of the header line; that is, the CRLF pairs introduced by folding are
   not considered part of the header value. Header lines SHOULD NOT be
   folded before the space after the colon that follows the header name,
   and should include at least one octet other than %x09 or %x20 between
   CRLF pairs. However, if an article has been received from elsewhere
   with one of these, clients and servers MAY transfer it to the other
   without re-folding it.

   Each article MUST have a unique message-id; two articles offered by
   an NNTP server MUST NOT have the same message-id. For the purposes of
   this specification, message-ids are opaque strings that MUST meet the
   following requirements:

   o  A message-id MUST begin with "<" and end with ">", and MUST NOT
      contain the latter except at the end.

   o  A message-id MUST be between 3 and 250 octets in length.

   o  A message-id MUST NOT contain octets other than printable US-ASCII
      characters.

   Two message-ids are the same if and only if they consist of the same
   sequence of octets.

   This specification does not describe how the message-id of an article
   is determined. If the server does not have any way to determine a
   message-id from the article itself, it MUST synthesise one (this
   specification does not require the article to be changed as a
   result).


Full Copyright Statement

   Copyright (C) The Internet Society (2003). All Rights Reserved.

   This document and translations of it may be copied and furnished to
   others, and derivative works that comment on or otherwise explain it
   or assist in its implementation may be prepared, copied, published
   and distributed, in whole or in part, without restriction of any
   kind, provided that the above copyright notice and this paragraph are
   included on all such copies and derivative works. However, this
   document itself may not be modified in any way, such as by removing
   the copyright notice or references to the Internet Society or other
   Internet organizations, except as needed for the purpose of
   developing Internet standards in which case the procedures for
   copyrights defined in the Internet Standards process must be
   followed, or as required to translate it into languages other than
   English.

   The limited permissions granted above are perpetual and will not be
   revoked by the Internet Society or its successors or assignees.

   This document and the information contained herein is provided on an
   "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
   TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
   BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
   HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
   MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: New NNTP draft -- Sections 1-3
#66853
Author: Andrew - Supernews
Date: Sat, 18 Oct 2003 12:24
98 lines
6157 bytes
In article <87fzhryxdc.fsf@windlord.stanford.edu>, Russ Allbery wrote:
> [ See <http://www.davros.org/nntp-texts/draft20.txt> for the complete
>   document, including credits and references.  This is the first in a
>   series of postings of the sections of the new NNTP draft, which is
>   currently in Last Call. ]

Here are the differences I've spotted between the draft and the behaviour
of our server, with comparison notes. (Some features not implemented yet
may be omitted)
 
>    An NNTP server MAY have an inactivity autologout timer. Such a timer
>    SHOULD be of at least three minutes duration, with the exception that
>    there MAY be a shorter limit on how long the server is willing to
>    wait for the first command from the client. The receipt of any
>    command from the client during the timer interval SHOULD suffice to
>    reset the autologout timer. Similarly, the receipt of any significant
>    amount of data from the client while in the midst of sending a
>    multi-line message to the server (such as during a POST or IHAVE
>    command) SHOULD suffice to reset the autologout timer. When the timer
>    expires, the server SHOULD close the TCP connection without sending
>    any response to the client.

Currently we abort the connection (RST) rather than send FIN if the
inactivity timeout is reached.

> 3.2.1 Generic Response Codes
> 
>    The server MUST respond to any command with the appropriate one of
>    the following generic responses if it represents the situation.
> 
>    If the command is not recognized, or it is an optional command or
>    extension that is not implemented by the server, the response code
>    500 MUST be returned.
> 
>    If there is a syntax error in the arguments of a recognized command,
>    including the case where more arguments are provided than the command
>    specifies or the command line is longer than the server accepts, the
>    response code 501 MUST be returned.

We currently abort the connection if a command line is too long (more than
the maximum allowed number of octets). This is possibly suboptimal and may
be fixed in the future if it becomes an issue.

>                                        The line MUST NOT be truncated or
>    split and then interpreted. Note that where a command has variants
>    depending on a second keyword (e.g. LIST ACTIVE and LIST NEWSGROUPS),
>    then 501 MUST be used when the base command is implemented but the
>    requested variant is not, and 500 MUST be used only when the base
>    command itself is not implemented.
> 
>    If the server experiences an internal fault or problem that means it
>    is unable to carry out the command (for example, a necessary file is
>    missing or a necessary service could not be contacted), the response
>    code 403 MUST be returned.

This appears to be new.

We currently return 503 for the only case where this applies to us; if the
client attempts a POST command but no posting server can be contacted (we
tunnel POST operations to a specialised server). This condition is, however,
rare since we maintain availability of the posting servers.

>    502: it is necessary to terminate the connection and start a new one
>       with the appropriate authority before the command can be used.
>       Note that the server MUST NOT close the TCP connection immediately
>       after a 502 response except at the initial connection (Section
>       5.1) and with the MODE READER (Section 5.2) command. See also the
>       latter command for historical usage of this response.

Currently I believe we only return 502 in the initial banner or in response
to a failed authentication; in both cases we close the connection (with FIN).
Since authentication is an extension this does not strictly speaking conflict.

>    If the server has to terminate the connection for some reason, it
>    MUST give a 400 response code to the next command and then
>    immediately close the TCP connection.

Existing clients don't respond wonderfully well to this, according to what
reports we have, but I see no obvious practical alternative. We currently
return this error for sessions that exceed data transfer limits, but
operational experience is still sketchy.

>    The client MUST be prepared to receive any of these responses for any
>    command (except, of course, that the server MUST NOT generate a 500
>    response code for mandatory commands).

One other odd feature of our server: we return a 500 error and close the
connection if the first command of a session appears to be an attempt to
speak HTTP. This is for two reasons: one to prevent abuse via HTTP proxies,
and the other because our server does in fact answer on port 80 as well and
can therefore get into strange conversations with HTTP clients as a result.
This includes cases where the first command is "POST" - we check for the
presence of HTTP-like arguments to distinguish this from legitimate use of
the POST command. This may be outside the scope of a standard.

-- 
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services
Re: New NNTP draft -- Sections 1-3
#66854
Author: Clive D. W. Feather
Date: Sat, 18 Oct 2003 20:04
76 lines
4887 bytes
In article <slrnbp2c8b.2sl5.andrew+nonews@trinity.supernews.net>, Andrew 
- Supernews <andrew+nonews@supernews.com> writes
>> When the timer
>>    expires, the server SHOULD close the TCP connection without sending
>>    any response to the client.
>Currently we abort the connection (RST) rather than send FIN if the
>inactivity timeout is reached.

I don't think we were concerned about that level of detail, since it 
will depend on what facilities are available from your TCP stack.

>>    If there is a syntax error in the arguments of a recognized command,
>>    including the case where more arguments are provided than the command
>>    specifies or the command line is longer than the server accepts, the
>>    response code 501 MUST be returned.
>We currently abort the connection if a command line is too long (more than
>the maximum allowed number of octets). This is possibly suboptimal and may
>be fixed in the future if it becomes an issue.

I would delete the "possibly". Doing it doesn't allow the client to 
discover it's at fault rather than just tickling a server bug, whereas a 
501 is a pretty unambiguous indication.

>>    If the server experiences an internal fault or problem that means it
>>    is unable to carry out the command (for example, a necessary file is
>>    missing or a necessary service could not be contacted), the response
>>    code 403 MUST be returned.
>This appears to be new.

We felt it was desirable to distinguish "the server doesn't do this" 
from "the server can't do this right now, but it might work another 
time".

>We currently return 503 for the only case where this applies to us; if the
>client attempts a POST command but no posting server can be contacted (we
>tunnel POST operations to a specialised server).

That's precisely the sort of situation where 403 is apt.

>>    502: it is necessary to terminate the connection and start a new one
>>       with the appropriate authority before the command can be used.
>>       Note that the server MUST NOT close the TCP connection immediately
>>       after a 502 response except at the initial connection (Section
>>       5.1) and with the MODE READER (Section 5.2) command. See also the
>>       latter command for historical usage of this response.
>
>Currently I believe we only return 502 in the initial banner or in response
>to a failed authentication; in both cases we close the connection (with FIN).

Do you ever respond 502 to MODE READER?

>Since authentication is an extension this does not strictly speaking conflict.

That would depend on the specification of the authentication extension 
you use. The correct action would be, in my opinion, to respond 480 to 
everything until the authentication is retried successfully.

>One other odd feature of our server: we return a 500 error and close the
>connection if the first command of a session appears to be an attempt to
>speak HTTP.
[...]
>This includes cases where the first command is "POST" - we check for the
>presence of HTTP-like arguments to distinguish this from legitimate use of
>the POST command.

I would say this is non-conforming behaviour.

It's a perfect example of when to use 400, I would say, since that 
allows the connection to be closed immediately. If you aren't going to 
close it, you should respond 500 to non-NNTP commands and 501 to POST.

-- 
Clive D.W. Feather, writing for himself  | Home: <clive@davros.org>
Tel: +44 20 8371 1138 (work)             | Web:  <http://www.davros.org>
Fax: +44 870 051 9937                    | Work: <clive@demon.net>
Written on my laptop; please observe the Reply-To address
New NNTP draft -- Section 4
#66856
Author: Russ Allbery
Date: Sat, 18 Oct 2003 21:32
158 lines
8174 bytes
[ See <http://www.davros.org/nntp-texts/draft20.txt> for the complete
  document, including credits and references.  This is the first in a
  series of postings of the sections of the new NNTP draft, which is
  currently in Last Call. ]


NNTP                                                          C. Feather
Internet-Draft                                                  Thus plc
Expires: April 15, 2004                                 October 16, 2003


4. The WILDMAT format

   The WILDMAT format described here is based on the version first
   developed by Rich Salz [SALZ1992], which in turn was derived from the
   format used in the UNIX "find" command to articulate file names. It
   was developed to provide a uniform mechanism for matching patterns in
   the same manner that the UNIX shell matches filenames.

4.1 Wildmat syntax

   A wildmat is described by the following ABNF [RFC2234] syntax (note
   that this syntax contains ambiguities and special cases described at
   the end):

      wildmat = wildmat-pattern *("," ["!"] wildmat-pattern)

      wildmat-pattern = 1*wildmat-item

      wildmat-item = wildmat-exact / wildmat-wild

      wildmat-exact = %x21-29 / %x2B / %x2D-3E / %x40-5A / %x5E-7E /
         UTF8-non-ascii ; exclude * , ? [ \ ]

      wildmat-wild = "*" / "?"

   UTF8-non-ascii is defined in Section 9.

   This syntax must be interpreted subject to the following rule:

   Where a wildmat-pattern is not immediately preceded by "!", it shall
   not begin with a "!".

   Note: the characters \ , [ and ] are not allowed in wildmats, while *
   and ? are always wildcards. This should not be a problem since these
   characters cannot occur in newsgroup names, which is the only current
   use of wildmats. Backslash is commonly used to suppress the special
   meaning of characters while brackets are used to introduce sets.
   However, these usages are not universal and interpretation of these
   characters in the context of UTF-8 strings is both potentially
   complex and differs from existing practice, so they were omitted from
   this specification. A future extension to this specification may
   provide semantics for these characters.

4.2 Wildmat semantics

   A wildmat is tested against a string, and either matches or does not
   match. To do this, each constituent wildmat-pattern is matched
   against the string and the rightmost pattern that matches is
   identified. If that wildmat-pattern is not preceded with "!", the
   whole wildmat matches. If it is preceded by "!", or if no
   wildmat-pattern matches, the whole wildmat does not match.

   For example, consider the wildmat "a*,!*b,*c*":

      the string "aaa" matches because the rightmost match is with "a*"

      the string "abb" does not match because the rightmost match is
      with "*b"

      the string "ccb" matches because the rightmost match is with "*c*"

      the string "xxx" does not match because no wildmat-pattern matches

   A wildmat-pattern matches a string if the string can be broken into
   components, each of which matches the corresponding wildmat-item in
   the pattern; the matches must be in the same order, and the whole
   string must be used in the match. The pattern is "anchored"; that is,
   the first and last characters in the string must match the first and
   last item respectively (unless that item is an asterisk matching zero
   characters).

   A wildmat-exact matches the same character (which may be more than
   one octet in UTF-8).

   "?" matches exactly one character (which may be more than one octet).

   "*" matches zero or more characters. It can match an empty string,
   but it cannot match a subsequence of a UTF-8 sequence that is not
   aligned to the character boundaries.

4.3 Extensions

   An NNTP server or extension MAY extend the syntax or semantics of
   wildmats provided that all wildmats that meet the requirements of
   Section 4.1 have the meaning ascribed to them by Section 4.2. Future
   editions of this document may also extend wildmats.

4.4 Examples

    In these examples, $ and @ are used to represent the two octets %xC2
   and %xA3 respectively; $@ is thus the UTF-8 encoding for the pound
   sterling symbol, shown as # in the descriptions.

     Wildmat    Description of strings that match

       abc      the one string "abc"
       abc,def  the two strings "abc" and "def"
       $@       the one character string "#"
       a*       any string that begins with "a"
       a*b      any string that begins with "a" and ends with "b"
       a*,*b    any string that begins with "a" or ends with "b"
       a*,!*b   any string that begins with "a" and does not end with
                "b"
     a*,!*b,c*  any string that begins with "a" and does not end with
                "b", and any string that begins with "c" no matter
                what it ends with
     a*,c*,!*b  any string that begins with "a" or "c" and does not
                end with "b"
       ?a*      any string with "a" as its second character
       ??a*     any string with "a" as its third character
       *a?      any string with "a" as its penultimate character
       *a??     any string with "a" as its antepenultimate character


Full Copyright Statement

   Copyright (C) The Internet Society (2003). All Rights Reserved.

   This document and translations of it may be copied and furnished to
   others, and derivative works that comment on or otherwise explain it
   or assist in its implementation may be prepared, copied, published
   and distributed, in whole or in part, without restriction of any
   kind, provided that the above copyright notice and this paragraph are
   included on all such copies and derivative works. However, this
   document itself may not be modified in any way, such as by removing
   the copyright notice or references to the Internet Society or other
   Internet organizations, except as needed for the purpose of
   developing Internet standards in which case the procedures for
   copyrights defined in the Internet Standards process must be
   followed, or as required to translate it into languages other than
   English.

   The limited permissions granted above are perpetual and will not be
   revoked by the Internet Society or its successors or assignees.

   This document and the information contained herein is provided on an
   "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
   TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
   BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
   HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
   MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: New NNTP draft -- Section 4
#66857
Author: Russ Allbery
Date: Sat, 18 Oct 2003 21:33
14 lines
1793 bytes
Russ Allbery <rra@stanford.edu> writes:

> [ See <http://www.davros.org/nntp-texts/draft20.txt> for the complete
>   document, including credits and references.  This is the first in a
>   series of postings of the sections of the new NNTP draft, which is
>   currently in Last Call. ]

Actually, this is the second.  Will remember to update that next time.  :)

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: New NNTP draft -- Section 4
#66858
Author: Dr.Ruud
Date: Sat, 18 Oct 2003 21:58
18 lines
1787 bytes
Toen ik Russ Allbery kietelde, kwam er dit uit:
> Russ Allbery:

>> [ See <http://www.davros.org/nntp-texts/draft20.txt> for the complete
>>   document, including credits and references.  This is the first in a
>>   series of postings of the sections of the new NNTP draft, which is
>>   currently in Last Call. ]

> Actually, this is the second.  Will remember to update that next time.
> :)

Ever heard of supersede? <g>
(prevents one from talking to oneself too)

-- 
Affijn, Ruud

Re: New NNTP draft -- Section 4
#66860
Author: Russ Allbery
Date: Sat, 18 Oct 2003 22:25
20 lines
1892 bytes
Ruud <'t.leven.is.fijn@life.i$.great> writes:
> Toen ik Russ Allbery kietelde, kwam er dit uit:

>> Actually, this is the second.  Will remember to update that next time.
>> :)

> Ever heard of supersede? <g>

I'm not going to Supersede 150+ line messages to make minor corrections
that I can make just as easily by following up.

> (prevents one from talking to oneself too)

I don't find followups to one's own message to be a problem.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: New NNTP draft -- Sections 1-3
#66861
Author: Dirk Nimmich
Date: Sat, 18 Oct 2003 23:10
55 lines
3947 bytes
[All this is only indirectly related to the current draft. Yes,
Russ, I read your comment about authentication.]

Clive D. W. Feather wrote:
> In article <slrnbp2c8b.2sl5.andrew+nonews@trinity.supernews.net>,
> Andrew - Supernews <andrew+nonews@supernews.com> writes
>>Currently I believe we only return 502 in the initial banner or in
>>response to a failed authentication; in both cases we close the
>>connection (with FIN).  Since authentication is an extension this
>>does not strictly speaking conflict.
> 
> That would depend on the specification of the authentication
> extension you use. The correct action would be, in my opinion, to
> respond 480 to everything until the authentication is retried
> successfully.

In my opinion the server should fall back to the state "not
authenticated yet" or close the connection.

The first reason to do so is that you can still be able to access
the commands that would have been available if you hadn't
authenticated yet. For example, this allows the reader to access a
support newsgroup even if the credentials were wrong. If you were
stuck in an authentication loop, you could only abort manually.

The second reason is that (from a client's perspective) you don't
know if the server expects an authentication beforehand or not. Some
servers provide restricted access to (a minor set of) newsgroups
without authentication and full access to more or other newsgroups.
Because all commands work without ever encountering a 480 response,
the client would never send any authentication information. To work
around this problem, the client can provide this information without
being asked. Some clients do this by default if credentials are
available; they would also be stuck in your loop if the server
rejects them.

Way back in the 90s, for a while it was impossible to read on the
Microsoft Server with tin, because the server implemented exactly
what you suggested above and tin automatically tried to authenticate
using authinfo generic and authinfo original.  However, the only
method the server accepted at that time was NTLM.  Users were even
unable to read the public newsgroups for which you don't need any
authentication. We fixed that problem by changing the default
behaviour and adding a command line switch to tin.

Another problem in this field (but not related to that "state
problem") is that the client cannot distinguish between different
authentication methods because they are all initiated by 480. Tin
can use both generic and original authinfo, but it can't tell which
one to use just from the response. So it tries both, first generic
and then original authinfo.

I hope the LIST EXTENSIONS command will eventually fix the later two
problems.
Re: New NNTP draft -- Section 4
#66863
Author: Dr.Ruud
Date: Sat, 18 Oct 2003 23:31
13 lines
1573 bytes
Toen ik Russ Allbery kietelde, kwam er dit uit:

> I don't find followups to one's own message to be a problem.

I need those quite often, repairing bits and pieces of solutions
I provided.

About the NNTP-draft: in 3.2.1, oh wait, wrong thread.

-- 
Affijn, Ruud

Re: New NNTP draft -- Sections 1-3
#66862
Author: Dr.Ruud
Date: Sun, 19 Oct 2003 00:11
36 lines
1943 bytes
Toen ik Russ Allbery kietelde, kwam er dit uit:

> 3.2.1 Generic Response Codes
>[...]
>    If the command is not *recognized*, or it is an optional command or
>[...]
>    If there is a syntax error in the arguments of a *recognized*
command,
>[...]
>    If the server *recognises* the command but


Over all sections:

If you prefer US-English, you'll hit on: synthesise, behaviour,
unrecognised,
customised, recognised.

If you prefer UK-English, you'll hit on: standardized, acknowledgments,
setup,
recognized, authorized, unauthorized, Organization:, Coordinated,
neighboring,
emphasized, scrutinized, behavior, authorize, organization, organizations,
acknowledgment.

So it's obvios that US-English was the goal.


Variants: implementors (=implementers)

Lost letters: unfor(e)seen, re(s)ponse, notic(e)able.

-- 
Affijn, Ruud & Word'97

Re: New NNTP draft -- Sections 1-3
#66864
Author: Andrew - Supernews
Date: Sun, 19 Oct 2003 03:13
90 lines
5483 bytes
In article <uTJ89aeAzZk$EwQE@romana.davros.org>, Clive D. W. Feather wrote:
> In article <slrnbp2c8b.2sl5.andrew+nonews@trinity.supernews.net>, Andrew 
> - Supernews <andrew+nonews@supernews.com> writes
>>We currently abort the connection if a command line is too long (more than
>>the maximum allowed number of octets). This is possibly suboptimal and may
>>be fixed in the future if it becomes an issue.
> 
> I would delete the "possibly". Doing it doesn't allow the client to 
> discover it's at fault rather than just tickling a server bug, whereas a 
> 501 is a pretty unambiguous indication.

yes. There are a couple of reasons why we do it that way which would not
apply in a more general case. However, as I said, it will probably change
in the future and 501 looks like the appropriate response.

>>>    If the server experiences an internal fault or problem that means it
>>>    is unable to carry out the command (for example, a necessary file is
>>>    missing or a necessary service could not be contacted), the response
>>>    code 403 MUST be returned.
>>This appears to be new.
> 
> We felt it was desirable to distinguish "the server doesn't do this" 
> from "the server can't do this right now, but it might work another 
> time".
> 
>>We currently return 503 for the only case where this applies to us; if the
>>client attempts a POST command but no posting server can be contacted (we
>>tunnel POST operations to a specialised server).
> 
> That's precisely the sort of situation where 403 is apt.

OK. That doesn't concern me much because no existing clients that I know
of will treat either 403 or 503 in response to POST as anything other than
"unexpected server error".

>>>    502: it is necessary to terminate the connection and start a new one
>>>       with the appropriate authority before the command can be used.
>>>       Note that the server MUST NOT close the TCP connection immediately
>>>       after a 502 response except at the initial connection (Section
>>>       5.1) and with the MODE READER (Section 5.2) command. See also the
>>>       latter command for historical usage of this response.
>>
>>Currently I believe we only return 502 in the initial banner or in response
>>to a failed authentication; in both cases we close the connection (with FIN).
> 
> Do you ever respond 502 to MODE READER?

MODE READER is a no-op here; it always repeats the original 200 or 201
banner. (Our own code does not support doing transit and reader functionality
on the same listening port, so the MODE READER issue does not apply.)

>>Since authentication is an extension this does not strictly speaking
>>conflict.
> 
> That would depend on the specification of the authentication extension 
> you use. The correct action would be, in my opinion, to respond 480 to 
> everything until the authentication is retried successfully.

There are a number of reasons not to permit repeated authentication
attempts. One is to discourage brute-force attacks. Another is to reduce
the possibility of server-side bugs such as the notorious Typhoon auth bug
(which returned 502 responses to failed authentications but then allowed the
client full access if it ignored the error).

Still, this can be re-visited when looking at authentication extensions
(at present we only support AUTHINFO USER/PASS).

>>One other odd feature of our server: we return a 500 error and close the
>>connection if the first command of a session appears to be an attempt to
>>speak HTTP.
> [...]
>>This includes cases where the first command is "POST" - we check for the
>>presence of HTTP-like arguments to distinguish this from legitimate use of
>>the POST command.
> 
> I would say this is non-conforming behaviour.
> 
> It's a perfect example of when to use 400, I would say, since that 
> allows the connection to be closed immediately. If you aren't going to 
> close it, you should respond 500 to non-NNTP commands and 501 to POST.

I guess 400 would work in that scenario, since there is no restriction on
the circumstances in which the server can send 400. In practice it doesn't
make much difference because an HTTP client will not see the response and an
NNTP client will not trigger the error in the first place, so I can change
this.

-- 
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services
Re: New NNTP draft -- Section 4
#66865
Author: Andrew - Supernews
Date: Sun, 19 Oct 2003 03:29
39 lines
2819 bytes
In article <871xta1bbb.fsf@windlord.stanford.edu>, Russ Allbery wrote:
> 4.1 Wildmat syntax
> 
>    A wildmat is described by the following ABNF [RFC2234] syntax (note
>    that this syntax contains ambiguities and special cases described at
>    the end):
> 
>       wildmat = wildmat-pattern *("," ["!"] wildmat-pattern)

Historical usage of commands such as LIST ACTIVE which take wildmat
parameters has not permitted comma-separated wildmat lists (only certain
commands, expressly documented such as NEWNEWS, have allowed that). We do not
currently support comma-separated lists except in the NEWNEWS case.

We support [] character sets but not \-escapes.

We don't yet support UTF-8 character-based matching (so for example a
LIST ACTIVE on dk.test.utf8-??? will not find a group, but dk.test.utf8-*
will). This will be changed in a future update. Literal UTF-8 characters
should work as expected.

> 4.2 Wildmat semantics
> 
>    A wildmat is tested against a string, and either matches or does not
>    match. To do this, each constituent wildmat-pattern is matched
>    against the string and the rightmost pattern that matches is
>    identified. If that wildmat-pattern is not preceded with "!", the
>    whole wildmat matches. If it is preceded by "!", or if no
>    wildmat-pattern matches, the whole wildmat does not match.

Historical usage of wildmat-lists (outside the protocol as such, usually,
such as in configuration files) has usually been to treat a wildmat list
starting with "!" as though there was a preceeding "*,". i.e. a list such
as "!foo*" matches all groups not starting with "foo", just like "*,!foo*".
This is not what the specification says. Is this difference intentional?

-- 
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services
Re: New NNTP draft -- Section 4
#66867
Author: Dirk Nimmich
Date: Sun, 19 Oct 2003 09:26
28 lines
2171 bytes
Russ Allbery wrote:
> 4.2 Wildmat semantics
[...]
>   A wildmat-exact matches the same character (which may be more than
>   one octet in UTF-8).

How is this to be interpreted in the case of combined characters?
Should %xC2.84 (composed Ä) also match %x41.CC.88 (decomposed Ä)
which are semantically the same character, or is a byte-per-byte
matching expected? Or is it intentional that you leave it
undefinded, so that the client must take care of all possible
codings?

Some clarification would be great.

>   "?" matches exactly one character (which may be more than one octet).

Same question here: are those examples above one or two characters?

> 4.4 Examples
> 
>    In these examples, $ and @ are used to represent the two octets %xC2
>   and %xA3 respectively; $@ is thus the UTF-8 encoding for the pound
>   sterling symbol, shown as # in the descriptions.

Ah, ISOC requires protocols to handle UTF-8 but still cannot handle
them themselves, right?
Re: New NNTP draft -- Section 4
#66866
Author: Russ Allbery
Date: Sun, 19 Oct 2003 17:51
43 lines
3123 bytes
Dirk Nimmich <nimmich@muenster.de> writes:

> How is this to be interpreted in the case of combined characters?
> Should %xC2.84 (composed Ä) also match %x41.CC.88 (decomposed Ä)
> which are semantically the same character, or is a byte-per-byte
> matching expected?

I believe byte-for-byte matching is what's expected.  It might be good to
add a sentence specifying that to avoid confusion.

>>   "?" matches exactly one character (which may be more than one octet).

> Same question here: are those examples above one or two characters?

? would match a single Unicode code point.

The expectation right now is that newsgroup names would always be in some
normalized form, which would make the results of such matching
deterministic.  Given that, it's best, I think, to keep the matching rules
as simple as possible.  As soon as one gets into thinking about combined
characters in a way that requires the server to be smart, the server would
have to link with extensive Unicode libraries and do canonicalization, and
that would be both slow and complex.

>> 4.4 Examples
>> 
>>    In these examples, $ and @ are used to represent the two octets %xC2
>>   and %xA3 respectively; $@ is thus the UTF-8 encoding for the pound
>>   sterling symbol, shown as # in the descriptions.

> Ah, ISOC requires protocols to handle UTF-8 but still cannot handle
> them themselves, right?

It's not so much ISOC as it is that RFCs are intended to be maximally
portable, *more* portable than some applications of protocols.  In other
words, the goal is to be able to read the NNTP RFC on a system that may be
unable to implement the UTF-8 matching portions of it.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: New NNTP draft -- Sections 1-3
#66868
Author: Clive D. W. Feather
Date: Mon, 20 Oct 2003 09:07
34 lines
2704 bytes
In article <bmsh91$8p4$06$1@news.t-online.com>, Dirk Nimmich 
<nimmich@muenster.de> writes
>>>Currently I believe we only return 502 in the initial banner or in
>>>response to a failed authentication; in both cases we close the
>>>connection (with FIN).

>> The correct action would be, in my opinion, to
>> respond 480 to everything until the authentication is retried
>> successfully.
>
>In my opinion the server should fall back to the state "not
>authenticated yet" or close the connection.
[...]

Falling back to a "not authenticated yet" state is fine. What I'm saying 
is, I suppose, that the server should not close the connection like 
this. *If* you want to say "authentication failed, so you can do nothing 
else", then either repeatedly 480 or else close the connection with a 
400.

>Another problem in this field (but not related to that "state
>problem") is that the client cannot distinguish between different
>authentication methods because they are all initiated by 480.
[...]
>I hope the LIST EXTENSIONS command will eventually fix the later two
>problems.

This is something LIST EXTENSIONS should solve.

-- 
Clive D.W. Feather, writing for himself  | Home: <clive@davros.org>
Tel: +44 20 8371 1138 (work)             | Web:  <http://www.davros.org>
Fax: +44 870 051 9937                    | Work: <clive@demon.net>
Written on my laptop; please observe the Reply-To address
Re: New NNTP draft -- Sections 1-3
#66869
Author: Clive D. W. Feather
Date: Mon, 20 Oct 2003 09:10
27 lines
2656 bytes
In article <slrnbp40bc.2sl5.andrew+nonews@trinity.supernews.net>, Andrew 
- Supernews <andrew+nonews@supernews.com> writes
>>>>    502: it is necessary to terminate the connection and start a new one
>>>>       with the appropriate authority before the command can be used.
[...]
>> That would depend on the specification of the authentication extension
>> you use. The correct action would be, in my opinion, to respond 480 to
>> everything until the authentication is retried successfully.
>
>There are a number of reasons not to permit repeated authentication
>attempts. One is to discourage brute-force attacks. Another is to reduce
>the possibility of server-side bugs

Those are valid arguments.

I'm just not happy with the "drop the connection immediately" idea. If 
you're only going to allow one go at authentication, then 502 - rather 
than 480 - is the correct response to all future actions that need 
authentication. But don't drop the connection; stuff like HELP, for 
example, should still work. Or use 400 after 480 to indicate it's being 
dropped.

-- 
Clive D.W. Feather, writing for himself  | Home: <clive@davros.org>
Tel: +44 20 8371 1138 (work)             | Web:  <http://www.davros.org>
Fax: +44 870 051 9937                    | Work: <clive@demon.net>
Written on my laptop; please observe the Reply-To address
Re: New NNTP draft -- Section 4
#66871
Author: Clive D. W. Feather
Date: Mon, 20 Oct 2003 09:17
35 lines
3093 bytes
In article <slrnbp419k.2sl5.andrew+nonews@trinity.supernews.net>, Andrew 
- Supernews <andrew+nonews@supernews.com> writes
>Historical usage of commands such as LIST ACTIVE which take wildmat
>parameters has not permitted comma-separated wildmat lists (only certain
>commands, expressly documented such as NEWNEWS, have allowed that). We do not
>currently support comma-separated lists except in the NEWNEWS case.

IIRC, after a lot of discussion within the group we decided that 
consistency was important and shouldn't be hard to provide. Given that 
all these commands need to test a long list of newsgroups against a 
wildmat, there seems no reason to have more than one way of doing it.

>We support [] character sets but not \-escapes.

Both of these are your choice; there wasn't a consensus for anything 
more complicated than what's in the draft because of all the difficult 
edge cases.

>Historical usage of wildmat-lists (outside the protocol as such, usually,
>such as in configuration files) has usually been to treat a wildmat list
>starting with "!" as though there was a preceeding "*,". i.e. a list such
>as "!foo*" matches all groups not starting with "foo", just like "*,!foo*".
>This is not what the specification says. Is this difference intentional?

Yes. Again, IIRC, we saw no benefit in allowing that rather than making 
the client do it. If the leading * was wanted, it's trivial to include. 
If the leading ! is a mistake, this allows it to be pointed out.

Note that you are permitted to provide these semantics as an extension.

-- 
Clive D.W. Feather, writing for himself  | Home: <clive@davros.org>
Tel: +44 20 8371 1138 (work)             | Web:  <http://www.davros.org>
Fax: +44 870 051 9937                    | Work: <clive@demon.net>
Written on my laptop; please observe the Reply-To address
Re: New NNTP draft -- Section 4
#66870
Author: Clive D. W. Feather
Date: Mon, 20 Oct 2003 09:39
32 lines
2216 bytes
In article <bmtlc3$af0$06$1@news.t-online.com>, Dirk Nimmich 
<nimmich@muenster.de> writes
>>   A wildmat-exact matches the same character (which may be more than
>>   one octet in UTF-8).
>How is this to be interpreted in the case of combined characters?
>Should %xC2.84 (composed Ä)

That's one character.

>also match %x41.CC.88 (decomposed Ä)

That's two.

>which are semantically the same character,

Only at *some* levels of semantics. Both produce the same result under 
all four normalisations, but that doesn't make them "the same".

>or is a byte-per-byte
>matching expected?

That's what we intended.

>Some clarification would be great.

And will appear.

-- 
Clive D.W. Feather, writing for himself  | Home: <clive@davros.org>
Tel: +44 20 8371 1138 (work)             | Web:  <http://www.davros.org>
Fax: +44 870 051 9937                    | Work: <clive@demon.net>
Written on my laptop; please observe the Reply-To address
Re: New NNTP draft -- Sections 1-3
#66872
Author: Clive D. W. Feather
Date: Mon, 20 Oct 2003 10:02
61 lines
2553 bytes
In article <bmsrtm.rs.1@news.isolution.nl>, Dr.Ruud 
<'t.leven.is.fijn@life.i$.great> writes
>Over all sections:
[...]

In other words, I need to do a spelling check. Very true, and thank you 
for pointing it out.


>If you prefer US-English,

I don't. I prefer English.

>If you prefer UK-English, you'll hit on: standardized,

Why? The -ize suffix has been in use in English since before 
Shakespeare's day.

>acknowledgments,

The OED is happy with this, though it prefers the extra 'e'.

>setup,

I'll give you this one.

>recognized, authorized, unauthorized, Organization:, Coordinated,

All of those are the preferred spellings in English.

>neighboring,

Fixed.

>emphasized, scrutinized,

Again both preferred spellings.

>behavior,

Fixed.

> authorize, organization, organizations,
>acknowledgment.

See above.

>Variants: implementors (=implementers)

Not acceptable English, which is why I haven't used it that I can see 
(unless it's imported from a boilerplate).

>Lost letters: unfor(e)seen, re(s)ponse, notic(e)able.

Fixed.

-- 
Clive D.W. Feather, writing for himself  | Home: <clive@davros.org>
Tel: +44 20 8371 1138 (work)             | Web:  <http://www.davros.org>
Fax: +44 870 051 9937                    | Work: <clive@demon.net>
Written on my laptop; please observe the Reply-To address
Re: New NNTP draft -- Sections 1-3
#66874
Author: Dr.Ruud
Date: Mon, 20 Oct 2003 11:12
32 lines
1854 bytes
Toen ik Clive D. W. Feather kietelde, kwam er dit uit:
> Dr.Ruud:

>> If you prefer US-English,
>
> I don't. I prefer English.

Many words were used in both the -se and the -ze spelling.
That is fine with me, it only emphasi[sz]es how a group of
people can create a fine document together.
In 3.2.1 I it occured in the same sub-section.
(But see me sig, it was not I.)

>> neighboring, [...] behavior
>
> Fixed.

Why? ;)


>> Variants: implementors (=implementers)
>
> Not acceptable English, which is why I haven't used it that I can see
> (unless it's imported from a boilerplate).

It's at the end, in the "Intellectual Property Statement" of
the IETF.

-- 
Affijn, Ruud

Re: New NNTP draft -- Sections 1-3
#66876
Author: Clive D. W. Feather
Date: Mon, 20 Oct 2003 13:52
26 lines
2153 bytes
In article <bn0n7g.1e4.1@news.isolution.nl>, Dr.Ruud 
<'t.leven.is.fijn@life.i$.great> writes
>Many words were used in both the -se and the -ze spelling.
>That is fine with me,

and with me: in general, both spellings are good English.

>>> neighboring, [...] behavior
>> Fixed.
>Why? ;)

Misspelled.

>>> Variants: implementors (=implementers)
>> Not acceptable English, which is why I haven't used it that I can see
>> (unless it's imported from a boilerplate).
>It's at the end, in the "Intellectual Property Statement" of
>the IETF.

That's boilerplate and I'm not going to mess with it.

-- 
Clive D.W. Feather, writing for himself  | Home: <clive@davros.org>
Tel: +44 20 8371 1138 (work)             | Web:  <http://www.davros.org>
Fax: +44 870 051 9937                    | Work: <clive@demon.net>
Written on my laptop; please observe the Reply-To address
New NNTP draft -- Section 5
#66887
Author: Russ Allbery
Date: Mon, 20 Oct 2003 16:39
358 lines
15177 bytes
[ See <http://www.davros.org/nntp-texts/draft20.txt> for the complete
  document, including credits and references.  This is the third in a
  series of postings of the sections of the new NNTP draft, which is
  currently in Last Call. ]


NNTP                                                          C. Feather
Internet-Draft                                                  Thus plc
Expires: April 15, 2004                                 October 16, 2003


5. Session administration commands

5.1 Initial Connection

5.1.1 Usage

   Responses
      200   Service available, posting allowed
      201   Service available, posting prohibited
      400   Service temporarily unavailable [1]
      502   Service permanently unavailable [1]

      These are the only valid response codes for the initial greeting;
      the server MUST not return any other generic response code.

   [1] Following a 400 or 502 response the server MUST immediately close
      the connection.

5.1.2 Description

   There is no command presented by the client upon initial connection
   to the server. The server MUST present an appropriate response code
   as a greeting to the client. This response informs the client whether
   service is available and whether the client is permitted to post.

   If the server will accept further commands from the client including
   POST, the server MUST present a 200 greeting code. If the server will
   accept further commands from the client, but it is not authorized to
   post articles using the POST command, the server MUST present a 201
   greeting code.

   Otherwise the server MUST present a 400 or 502 greeting code and then
   immediately close the connection. 502 MUST be used if the client is
   not permitted under any circumstances to interact with the server and
   400 otherwise.

5.1.3 Examples

   Example of a normal connection from an authorized client which then
   terminates the session (see Section 5.4):

      [Initial TCP connection setup completed.]
      [S] 200 NNTP Service Ready, posting permitted
      [C] QUIT
      [S] 205 NNTP Service exits normally
      [Server closes connection.]

   Example of a normal connection from an authorized client that is not
   permitted to post; it also immediately terminates the session:

      [Initial TCP connection setup completed.]
      [S] 201 NNTP Service Ready, posting prohibited
      [C] QUIT
      [S] 205 NNTP Service exits normally
      [Server closes connection.]

   Example of a normal connection from an unauthorized client:

      [Initial TCP connection setup completed.]
      [S] 502 NNTP Service permanently unavailable
      [Server closes connection.]

   Example of a connection from a client where the server is unable to
   provide service:

      [Initial TCP connection setup completed.]
      [S] 400 NNTP Service temporarily unavailable
      [Server closes connection.]


5.2 MODE READER

5.2.1 Usage

   This command MUST NOT be pipelined.

   Syntax
      MODE READER

   Responses
      200   Posting allowed
      201   Posting prohibited
      400   Service temporarily unavailable [1]
      502   Service permanently unavailable [1]

   [1] Following a 400 or 502 response the server MUST immediately close
      the connection.

5.2.2 Description

   MODE READER SHOULD be sent by any client that intends to use any
   command in this specification (including Section 8) other than IHAVE,
   HEAD, STAT, LIST ACTIVE, or LIST EXTENSIONS; other extensions MAY
   also require MODE READER to be used. Servers MAY require that this
   command be issued before any commands other than the above are sent
   and MAY reject such commands until after a MODE READER command has
   been sent. Such rejections SHOULD use response code 401 with argument
   "MODE-READER", but for historical reasons response code 502 MAY be
   used, even though this situation does not meet the conditions for
   that response.

   Once MODE READER is sent, IHAVE (and any related extensions) MAY no
   longer be permitted, even if it were permitted before the MODE READER
   command. The results of LIST EXTENSIONS MAY be different following a
   MODE READER command than prior to the issuing of that command.

   The server MUST return a response using the same codes as the initial
   greeting (as described in Section 5.1.1) to indicate its ability to
   provide reading service to the client. Note that the response need
   not be the same as the one presented during the initial greeting.

   Servers are encouraged to not require this command even though
   clients SHOULD send it when appropriate. It is present to support
   some news architectures that switch between modes based on whether a
   given connection is a peer-to-peer connection with another server or
   a news reading client.

5.2.3 Examples

   Example of use of the MODE READER command by an authorized client
   which then terminates the session (see Section 5.4):

      [C] MODE READER
      [S] 200 NNTP Service Ready, posting permitted
      [C] QUIT
      [S] 205 NNTP Service exits normally
      [Server closes connection.]

   Example of use of the MODE READER command by an authorized client
   that is not permitted to post; it also immediately terminates the
   session:

      [C] MODE READER
      [S] 201 NNTP Service Ready, posting prohibited
      [C] QUIT
      [S] 205 NNTP Service exits normally
      [Server closes connection.]

   Example of use of MODE READER by a client not authorized to receive
   service from the server as a news reader:

      [C] MODE READER
      [S] 502 NNTP Service permanently unavailable
      [Server closes connection.]

   Example of a connection from any client where the server is
   temporarily unable to provide news reader service:

      [C] MODE READER
      [S] 400 NNTP Service temporarily unavailable
      [Server closes connection.]

   Example of a facility that requires MODE READER before use, using the
   preferred response:

      [C] GROUP   misc.test
      [S] 401 MODE-READER currently in peering mode
      [C] MODE READER
      [S] 200 NNTP Service Ready, posting permitted
      [C] GROUP   misc.test
      [S] 211 1234 3000234 3002322 misc.test

   Example of a facility that requires MODE READER before use, using the
   historical but deprecated response:

      [C] GROUP   misc.test
      [S] 502 Not available in peering mode
      [C] MODE READER
      [S] 200 NNTP Service Ready, posting permitted
      [C] GROUP   misc.test
      [S] 211 1234 3000234 3002322 misc.test

   Example of a facility that cannot be used after MODE READER:

      [C] IHAVE   <i.am.an.article.you.have@example.com>
      [S] 435 Duplicate
      [C] MODE READER
      [S] 200 Reader mode, posting permitted
      [C] IHAVE   <i.am.an.article.you.have@example.com>
      [S] 502 Permission denied


5.3 LIST EXTENSIONS

5.3.1 Usage

   This command is optional.

   Syntax
      LIST EXTENSIONS

   Responses
      202   Extension list follows (multiline)
      402   Server has no extensions

5.3.2 Description

   The LIST EXTENSIONS command allows a client to determine which
   extensions are supported by the server at any given time. See Section
   8 for further discussion of extensions.

   This command MUST be implemented by any server that implements any
   extensions defined in this document or any other extension in the
   IANA registry, and is optional otherwise.

   This command MAY be issued at anytime during a session. It is not
   required that the client issues this command before attempting to
   make use of any extension. The response generated by this command MAY
   change during a session because of other state information (which in
   turn may be changed by the effects of other commands). An NNTP client
   is only able to get the current and correct information concerning
   available extensions at any point during a session by issuing a LIST
   EXTENSIONS command at that point of that session and processing the
   response, and the server MUST ensure that those extensions currently
   listed in the returned information are available. Therefore, if an
   extension (including those in Section 8) is only available before or
   after a MODE READER command, the LIST EXTENSIONS command MUST only
   include the extension in that situation. Similarly, if only some of
   the commands in an extension will be available, or if the behaviour
   of the extension will change in some other manner, before or after a
   MODE READER command, this MUST be indicated by different arguments to
   the extension-label in the results of LIST EXTENSIONS in each
   situation.

   While some extensions are likely to be always available or never
   available, others will "appear" and "disappear" depending on server
   state changes within the session or external events between sessions.
   An NNTP client may cache the results of this command, but MUST NOT
   rely on the correctness of any cached results, whether from earlier
   in this session or from a previous session, MUST cope gracefully with
   the cached status being out of date, and SHOULD (if caching results)
   provide a way to force the cached information to be refreshed.
   Furthermore, a client MUST NOT use cached results in relation to
   security, privacy, and authentication extensions. See Section 11.6
   for further discussion of this topic.

   The list of extensions is returned as a multi-line response following
   the 202 response code. Each extension is listed on a separate line;
   the line MUST begin with an extension-label and optionally one or
   more arguments (separated by single spaces). The extension-label and
   the meaning of the arguments are specified as part of the definition
   of the extension. The extension-label is a string of 1 to 12 US-ASCII
   letters and MUST be in uppercase. Arguments are strings of 1 or more
   printable UTF-8 characters (that is, either printable US-ASCII
   characters or any UTF-8 sequence outside the US-ASCII range, but not
   space or TAB).

   The server MUST NOT list the same extension twice in the response,
   and MUST list all supported extensions. The order in which the
   extensions are listed is not significant. The server need not even
   consistently return the same order. If the server does not support
   any extensions, it MUST return an empty list. The 402 response code
   is documented for historic reasons only; clients SHOULD handle it
   gracefully, but servers MUST NOT generate it.

   Following a generic failure response, such as 403, an extension might
   still be available, and the client MAY attempt to use it.

5.3.3 Examples

   Example of a successful response:

      [C] LIST EXTENSIONS
      [S] 202 Extensions supported:
      [S] OVER
      [S] HDR
      [S] LISTGROUP
      [S] .

   The particular extensions shown here are simply examples of what
   might be defined in other places, and no particular meaning should be
   attributed to them.

   Example where no extensions are available:

      [C] LIST EXTENSIONS
      [S] 202 Extensions supported:
      [S] .

   Example from a non-conforming server which indicates "no extensions
   available" using the 402 response code:

      [C] LIST EXTENSIONS
      [S] 402 Server has no extensions


5.4 QUIT

5.4.1 Usage

   Syntax
      QUIT

   Responses
      205   Connection closing

5.4.2 Description

   The client uses the QUIT command to terminate the session. The server
   MUST acknowledge the QUIT command and then close the connection to
   the client. This is the preferred method for a client to indicate
   that it has finished all its transactions with the NNTP server.

   If a client simply disconnects (or the connection times out or some
   other fault occurs), the server MUST gracefully cease its attempts to
   service the client, disconnecting from its end if necessary.

5.4.3 Examples

      [C] QUIT
      [S] 205 closing connection
      [Server closes connection.]


Full Copyright Statement

   Copyright (C) The Internet Society (2003). All Rights Reserved.

   This document and translations of it may be copied and furnished to
   others, and derivative works that comment on or otherwise explain it
   or assist in its implementation may be prepared, copied, published
   and distributed, in whole or in part, without restriction of any
   kind, provided that the above copyright notice and this paragraph are
   included on all such copies and derivative works. However, this
   document itself may not be modified in any way, such as by removing
   the copyright notice or references to the Internet Society or other
   Internet organizations, except as needed for the purpose of
   developing Internet standards in which case the procedures for
   copyrights defined in the Internet Standards process must be
   followed, or as required to translate it into languages other than
   English.

   The limited permissions granted above are perpetual and will not be
   revoked by the Internet Society or its successors or assignees.

   This document and the information contained herein is provided on an
   "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
   TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
   BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
   HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
   MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: New NNTP draft -- Section 5
#66884
Author: Graham Drabble
Date: Mon, 20 Oct 2003 17:08
39 lines
2836 bytes
On 20 Oct 2003 Russ Allbery <rra@stanford.edu> wrote in
news:874qy3hnhl.fsf_-_@windlord.stanford.edu: 

> 5.1 Initial Connection
> 
> 5.1.1 Usage
> 
>    Responses
>       200   Service available, posting allowed
>       201   Service available, posting prohibited

> 5.1.2 Description
> 
>    If the server will accept further commands from the client
>    including POST, the server MUST present a 200 greeting code. If
>    the server will accept further commands from the client, but it
>    is not authorized to post articles using the POST command, the
>    server MUST present a 201 greeting code.
 
What is the expected response code if posting is currently prohibited 
but may become allowed after a udername/password? The best example I 
can think of is news.readfreenews.net which is open to reading by all 
but for posting only after login. It responds 201 and gives a 440 
response to a POST command before authentication takes place. After 
succesful AUTHINFO PASS it issues 281 and POST is then responded to 
by 340. How is a client supposed to know this is possible? Would 
something like

200 Service available, posting allowed
201   Service available, posting currently prohibited
202   Service available, posting prohibited

be more useful?

-- 
Graham Drabble
If you're interested in what goes on in other groups or want to find 
an interesting group to read then check news.groups.reviews for what 
others have to say or contribute a review for others to read.
Re: New NNTP draft -- Section 5
#66879
Author: Russ Allbery
Date: Mon, 20 Oct 2003 17:25
24 lines
2133 bytes
Graham Drabble <graham.drabble@lineone.net> writes:

> What is the expected response code if posting is currently prohibited 
> but may become allowed after a udername/password?

200.  Maybe an additional paranthetical would be worthwhile there.  You
have to send 200 in that case; if you send 201, some clients will decide
the connection is permanently read-only and refuse to ever try POST.

> Would something like

> 200 Service available, posting allowed
> 201   Service available, posting currently prohibited
> 202   Service available, posting prohibited

> be more useful?

Probably, but I doubt the interoperability issues would be worth it.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: New NNTP draft -- Section 5
#66880
Author: Andrew - Supernews
Date: Mon, 20 Oct 2003 18:34
50 lines
3361 bytes
In article <874qy3hnhl.fsf_-_@windlord.stanford.edu>, Russ Allbery wrote:
> 5.1 Initial Connection
> 
> 5.1.1 Usage
> 
>    Responses
>       200   Service available, posting allowed
>       201   Service available, posting prohibited
>       400   Service temporarily unavailable [1]
>       502   Service permanently unavailable [1]
> 
>       These are the only valid response codes for the initial greeting;
>       the server MUST not return any other generic response code.
> 
>    [1] Following a 400 or 502 response the server MUST immediately close
>       the connection.
> 
> 5.1.2 Description
> 
>    There is no command presented by the client upon initial connection
>    to the server. The server MUST present an appropriate response code
>    as a greeting to the client. This response informs the client whether
>    service is available and whether the client is permitted to post.
> 
>    If the server will accept further commands from the client including
>    POST, the server MUST present a 200 greeting code. If the server will
>    accept further commands from the client, but it is not authorized to
>    post articles using the POST command, the server MUST present a 201
>    greeting code.
> 
>    Otherwise the server MUST present a 400 or 502 greeting code and then
>    immediately close the connection. 502 MUST be used if the client is
>    not permitted under any circumstances to interact with the server and
>    400 otherwise.

Current practice here (and in a number of other implementations, but not all)
is to return 502 if the connection is not allowed because a limit, such as
maximum connecions from a single IP or user, or customer domain, has been
reached.

The above implies that 400 is the correct code for this, but in general that's
probably not going to happen consistently because of the number of cases where
a generic authentication interface with only a "yes/no" response is involved.
i.e. the limit is being tracked in an authentication subsystem independent of
the server itself, and therefore there is no way to return distinguished
response codes based on the reason for the rejection.

-- 
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services
Re: New NNTP draft -- Section 5
#66881
Author: Graham Drabble
Date: Mon, 20 Oct 2003 21:42
46 lines
3084 bytes
On 20 Oct 2003 Russ Allbery <rra@stanford.edu> wrote in
news:87ekx7g6tb.fsf@windlord.stanford.edu: 

> Graham Drabble <graham.drabble@lineone.net> writes:
> 
>> What is the expected response code if posting is currently
>> prohibited but may become allowed after a udername/password?
> 
> 200.  Maybe an additional paranthetical would be worthwhile there.

Something needs clarifying because were I to write a server based on 
that then I would not have a clue which way to go.

>  You have to send 200 in that case; if you send 201, some clients
> will decide the connection is permanently read-only and refuse to
> ever try POST. 

Conversly if you try 200 then clients will try POST and if it fails 
not think about authenticating. After all the client has been told 
that posting is allowed.

Out of interest does anyone know if news/allnews.readfreenews.net has 
given anyone a problem posting? I know that both Xnews and Hamster 
are quite happy with 201 being returned.
 
>> Would something like
> 
>> 200 Service available, posting allowed
>> 201   Service available, posting currently prohibited
>> 202   Service available, posting prohibited
> 
>> be more useful?
> 
> Probably, but I doubt the interoperability issues would be worth
> it. 

I'm not sure what problems it would cause, especially if you reversed 
201 and 202 above. What would clients do now if they received a 202? 
200 and 201 wouldn't have changed meaning.

BTW, would people rather this go taken to the relevent mailing list?
-- 
Graham Drabble
If you're interested in what goes on in other groups or want to find 
an interesting group to read then check news.groups.reviews for what 
others have to say or contribute a review for others to read.
Re: New NNTP draft -- Section 5
#66882
Author: Russ Allbery
Date: Mon, 20 Oct 2003 22:39
40 lines
2845 bytes
Graham Drabble <graham.drabble@lineone.net> writes:
> Russ Allbery <rra@stanford.edu> wrote:

>> You have to send 200 in that case; if you send 201, some clients will
>> decide the connection is permanently read-only and refuse to ever try
>> POST.

> Conversly if you try 200 then clients will try POST and if it fails not
> think about authenticating. After all the client has been told that
> posting is allowed.

No, that's not a problem.  POST will return 480, which will tell the
client that it has to authenticate.

> I'm not sure what problems it would cause, especially if you reversed 
> 201 and 202 above. What would clients do now if they received a 202?

They could believe that the server is broken and abort the connection
entirely.  I'm worried about how many people may have written code like:

    if (code == 200)
        continue_post();
    else if (code == 201)
        continue_nopost();
    else
        die_horribly();

Sure, the standard says you should proceed based on the first character,
but it's actually somewhat harder to write code that works that way.

> BTW, would people rather this go taken to the relevent mailing list?

I think it's fine here... either location excludes some possibly
interested people, unfortunately.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: New NNTP draft -- Section 5
#66901
Author: Graham Drabble
Date: Mon, 20 Oct 2003 23:33
75 lines
3974 bytes
On 20 Oct 2003 Russ Allbery <rra@stanford.edu> wrote in
news:87ptgredpn.fsf@windlord.stanford.edu: 

> Graham Drabble <graham.drabble@lineone.net> writes:
>> Russ Allbery <rra@stanford.edu> wrote:
> 
>>> You have to send 200 in that case; if you send 201, some clients
>>> will decide the connection is permanently read-only and refuse
>>> to ever try POST.
> 
>> Conversly if you try 200 then clients will try POST and if it
>> fails not think about authenticating. After all the client has
>> been told that posting is allowed.
> 
> No, that's not a problem.  POST will return 480, which will tell
> the client that it has to authenticate.

6.3.1 POST

6.3.1.1 Usage

   This command MUST NOT be pipelined.

   Syntax
      POST

   Responses

      Initial responses
         340   Send article to be posted
         440   Posting not permitted

No mention of 480 there. At that point it is either allowed or not.

 
>> I'm not sure what problems it would cause, especially if you
>> reversed 201 and 202 above. What would clients do now if they
>> received a 202? 
> 
> They could believe that the server is broken and abort the
> connection entirely.  I'm worried about how many people may have
> written code like: 
> 
>     if (code == 200)
>         continue_post();
>     else if (code == 201)
>         continue_nopost();
>     else
>         die_horribly();
> 
> Sure, the standard says you should proceed based on the first
> character, but it's actually somewhat harder to write code that
> works that way. 

I'm surprised at that. Either /^2/ or substr(code,0,1) == 2 (or the 
equivelent syntax for other languages) would seem to cover it (I 
assume most people treat it as a text string of numbers rather than 
as numeric data, if not then a simple code >=200 && <300 is standards 
compliant).

It would be interesting to know what clients actually do on receipt 
of such as response.

Also going back to the original 200/201 response, what do servers 
currently do and whether there are actually clients that have a 
problem with either. The readfreenews servers (diablo) respond 201 
and I've not heard of any problems. news.individual.net responds 200. 
201 feels right to me as, at the time of it being issued, posting is 
not allowed.

-- 
Graham Drabble
If you're interested in what goes on in other groups or want to find 
an interesting group to read then check news.groups.reviews for what 
others have to say or contribute a review for others to read.
Re: New NNTP draft -- Section 5
#66900
Author: Russ Allbery
Date: Mon, 20 Oct 2003 23:51
35 lines
3062 bytes
Graham Drabble <graham.drabble@lineone.net> writes:
> Russ Allbery <rra@stanford.edu> wrote:

>> No, that's not a problem.  POST will return 480, which will tell
>> the client that it has to authenticate.

> No mention of 480 there. At that point it is either allowed or not.

It's listed in the generic responses section (which I posted the other
day) and will be elaborated on in a future authentication extension RFC
(as I noted, authentication is currently out of scope).
 
> I'm surprised at that. Either /^2/ or substr(code,0,1) == 2 (or the
> equivelent syntax for other languages) would seem to cover it (I assume
> most people treat it as a text string of numbers rather than as numeric
> data, if not then a simple code >=200 && <300 is standards compliant).

You have to add a separate code path to check for that, and then you have
to think about whether to treat it like 200 or 201.  It's not always a lot
more complexity, but it's complexity that you have to add every single
place you process an NNTP response.

> Also going back to the original 200/201 response, what do servers
> currently do and whether there are actually clients that have a problem
> with either.

INN responses 200 if there's any hope that the user can authenticate to be
able to post, and does so precisely because when for a short time it
returned 201, there were multiple reports of problems.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: New NNTP draft -- Section 5
#66902
Author: Ken Murchison
Date: Mon, 20 Oct 2003 23:57
47 lines
2645 bytes
Graham Drabble wrote:
> On 20 Oct 2003 Russ Allbery <rra@stanford.edu> wrote in
> news:87ptgredpn.fsf@windlord.stanford.edu: 
> 
> 
>>Graham Drabble <graham.drabble@lineone.net> writes:
>>
>>>Russ Allbery <rra@stanford.edu> wrote:
>>
>>>>You have to send 200 in that case; if you send 201, some clients
>>>>will decide the connection is permanently read-only and refuse
>>>>to ever try POST.
>>
>>>Conversly if you try 200 then clients will try POST and if it
>>>fails not think about authenticating. After all the client has
>>>been told that posting is allowed.
>>
>>No, that's not a problem.  POST will return 480, which will tell
>>the client that it has to authenticate.
> 
> 
> 6.3.1 POST
> 
> 6.3.1.1 Usage
> 
>    This command MUST NOT be pipelined.
> 
>    Syntax
>       POST
> 
>    Responses
> 
>       Initial responses
>          340   Send article to be posted
>          440   Posting not permitted
> 
> No mention of 480 there. At that point it is either allowed or not.


See section 3.2.1

-- 
Kenneth Murchison     Oceana Matrix Ltd.
Software Engineer     21 Princeton Place
716-662-8973 x26      Orchard Park, NY 14127
--PGP Public Key--    http://www.oceana.com/~ken/ksm.pgp
Re: New NNTP draft -- Section 4
#66903
Author: Dirk Nimmich
Date: Tue, 21 Oct 2003 12:07
33 lines
2774 bytes
Russ Allbery wrote:
> Dirk Nimmich <nimmich@muenster.de> writes:
>> How is this to be interpreted in the case of combined characters?
>> Should %xC2.84 (composed Ä) also match %x41.CC.88 (decomposed Ä)
>> which are semantically the same character, or is a byte-per-byte
>> matching expected?
> 
> I believe byte-for-byte matching is what's expected.  It might be good to
> add a sentence specifying that to avoid confusion.
[...]
> ? would match a single Unicode code point.

Ok.

> The expectation right now is that newsgroup names would always be in some
> normalized form, which would make the results of such matching
> deterministic.  Given that, it's best, I think, to keep the matching rules
> as simple as possible.  As soon as one gets into thinking about combined
> characters in a way that requires the server to be smart, the server would
> have to link with extensive Unicode libraries and do canonicalization, and
> that would be both slow and complex.

The question is, what is slower? A) Build a normalized list of
newsgroups once when the server is started and require the client to
send only normalized forms (and so be able to do a simple
byte-per-byte comparison) or b) say nothing and require the client
to send all variations of a unicode string in a complex wildmat
pattern (or in multiple patterns each doing a byte-per-byte
comparison).

It's just a thought. I see that there is also the problem that the
normalization form for newsgroups hasn't been chosen yet.
Re: New NNTP draft -- Section 5
#66904
Author: Dirk Nimmich
Date: Tue, 21 Oct 2003 12:41
25 lines
2841 bytes
Russ Allbery wrote:
> Graham Drabble <graham.drabble@lineone.net> writes:
>> I'm surprised at that. Either /^2/ or substr(code,0,1) == 2 (or the
>> equivelent syntax for other languages) would seem to cover it (I assume
>> most people treat it as a text string of numbers rather than as numeric
>> data, if not then a simple code >=200 && <300 is standards compliant).
> 
> You have to add a separate code path to check for that, and then you have
> to think about whether to treat it like 200 or 201.

Given the explanations of both of you, there is no real difference
in treating 200 or 201. If the client receives a 200 it always has
to find out using the POST command whether it is allowed to post or
not (Russ' way). If it receives a 201 and has to recheck after
authentication (Graham's observation), it can also find out the same
way by just doing POST. So the easiest way (and code path) is to
ignore the response code altogether unless it doesn't begin with 2.

Tin, BTW, looks at the greeting response code and turns posting off
when receiving a 201. But it corrects this after authentication and
looking at the response code of a following MODE READER. So if your
server sends 201 initially and only asks for authentication after
issueing a POST command, you have to authenticate in advance because
otherwise tin doesn't enable the keys to post.
Re: New NNTP draft -- Section 4
#66905
Author: Russ Allbery
Date: Tue, 21 Oct 2003 17:04
38 lines
3260 bytes
Dirk Nimmich <nimmich@muenster.de> writes:
> Russ Allbery wrote:

>> The expectation right now is that newsgroup names would always be in
>> some normalized form, which would make the results of such matching
>> deterministic.  Given that, it's best, I think, to keep the matching
>> rules as simple as possible.  As soon as one gets into thinking about
>> combined characters in a way that requires the server to be smart, the
>> server would have to link with extensive Unicode libraries and do
>> canonicalization, and that would be both slow and complex.

> The question is, what is slower? A) Build a normalized list of
> newsgroups once when the server is started and require the client to
> send only normalized forms (and so be able to do a simple byte-per-byte
> comparison) or b) say nothing and require the client to send all
> variations of a unicode string in a complex wildmat pattern (or in
> multiple patterns each doing a byte-per-byte comparison).

Well, the first sure sounds faster to me!  :)

Particularly since I don't expect the server will need to build a
normalized list.  My expectation is that hierarchy administrators will
only create already normalized groups, and that this will likely be
enforced by software down the road.  It's already a requirement in the
draft UTF-8 newsgroup name proposal floated in USEFOR that all newsgroup
names be canonicalized on the wire.

> It's just a thought. I see that there is also the problem that the
> normalization form for newsgroups hasn't been chosen yet.

Yes.  Hopefully we'll be able to leverage off some other effort rather
than having to invent our own wheel.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: New NNTP draft -- Section 5
#66906
Author: Russ Allbery
Date: Tue, 21 Oct 2003 17:06
28 lines
2851 bytes
Dirk Nimmich <nimmich@muenster.de> writes:

> Given the explanations of both of you, there is no real difference in
> treating 200 or 201. If the client receives a 200 it always has to find
> out using the POST command whether it is allowed to post or not (Russ'
> way).

Or it just proceeds, assuming that it can authenticate, and if POST
returns 480 it does authentication on the fly right away.  I think that's
what most news readers do.

> Tin, BTW, looks at the greeting response code and turns posting off when
> receiving a 201. But it corrects this after authentication and looking
> at the response code of a following MODE READER. So if your server sends
> 201 initially and only asks for authentication after issueing a POST
> command, you have to authenticate in advance because otherwise tin
> doesn't enable the keys to post.

Right, which breaks authentication on the fly in response to actually
posting and is a good reason to return 200 if the user is going to be able
to post after authentication (or the server at least thinks that's
possible).

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
New NNTP draft -- Section 6
#66908
Author: Russ Allbery
Date: Tue, 21 Oct 2003 17:21
1011 lines
39137 bytes
[ See <http://www.davros.org/nntp-texts/draft20.txt> for the complete
  document, including credits and references.  This is the fourth in a
  series of postings of the sections of the new NNTP draft, which is
  currently in Last Call. ]


NNTP                                                          C. Feather
Internet-Draft                                                  Thus plc
Expires: April 15, 2004                                 October 16, 2003


6. Article posting and retrieval

   News reading clients have available a variety of mechanisms to
   retrieve articles via NNTP. The news articles are stored and indexed
   using three types of keys. One key is the message-id of an article.
   Another key is composed of the newsgroup name and the article number
   within that newsgroup. That key MUST be unique to a particular server
   (there will be only one article with that number within a particular
   newsgroup), but is not required to be globally unique. Additionally,
   because the same article can be cross-posted to multiple newsgroups,
   there may be multiple keys that point to the same article on the same
   server. The final key is the arrival timestamp, giving the time that
   the article arrived at the server.

   The server MUST ensure that article numbers are issued in order of
   arrival timestamp; that is, articles arriving later MUST have higher
   numbers than those that arrive earlier. The server SHOULD allocate
   the next sequential unused number to each new article.

   Article numbers MUST lie between 1 and 4,294,967,295 inclusive. The
   client and server SHOULD NOT use leading zeroes in specifying article
   numbers, and MUST NOT use more than 16 digits. In some situations,
   the value zero replaces an article number to show some special
   situation.

6.1 Group and article selection

   The following commands are used to set the "current selected
   newsgroup" and the "current article number", which are used by
   various commands. At the start of an NNTP session, both of these
   values are set to the special value "invalid".

6.1.1 GROUP

6.1.1.1 Usage

   Syntax
      GROUP group

   Responses
      211 number low high group   Group successfully selected
      411                         No such newsgroup

   Parameters
      group  = name of newsgroup
      number = estimated number of articles in the group
      low    = reported low water mark
      high   = reported high water mark

6.1.1.2 Description

   The required argument is the name of the newsgroup to be selected
   (e.g. "news.software.b"). A list of valid newsgroups may be obtained
   by using the LIST ACTIVE command (see Section 7.6.1).

   The successful selection response will return the article numbers of
   the first and last articles in the group at the moment of selection
   (these numbers are referred to as the "reported low water mark" and
   the "reported high water mark"), and an estimate of the number of
   articles in the group currently available.

   If the group is not empty, the estimate MUST be at least the actual
   number of articles available, and MUST be no greater than one more
   than the difference between the reported low and high water marks.
   (Some implementations will actually count the number of articles
   currently stored. Others will just subtract the low water mark from
   the high water mark and add one to get an estimate.)

   If the group is empty, one of the following three situations will
   occur. Clients MUST accept all three cases; servers MUST NOT
   represent an empty group in any other way.

   o  The high water mark will be one less than the low water mark, and
      the estimated article count will be zero. Servers SHOULD use this
      method to show an empty group. This is the only time that the high
      water mark can be less than the low water mark.

   o  All three numbers will be zero.

   o  The high water mark is greater than or equal to the low water
      mark. The estimated article count might be zero or non-zero; if
      non-zero, the same requirements apply as for a non-empty group.

   The set of articles in a group may change after the GROUP command is
   carried out. That is:

   o  articles may be removed from the group

   o  articles may be reinstated in the group with the same article
      number, but those articles MUST have numbers no less than the
      reported low water mark (note that this is a reinstatement of the
      previous article, not a new article reusing the number)

   o  new articles may be added with article numbers greater than the
      reported high water mark (if an article that was the one with the
      highest number has been removed, the next new article will not
      have the number one greater than the reported high water mark)

   Except when the group is empty and all three numbers are zero,
   whenever a subsequent GROUP command for the same newsgroup is issued,
   either by the same client or a different client, the reported low
   water mark in the response MUST be no less than that in any previous
   response for that newsgroup sent to any client. The client may make
   use of the low water mark to remove all remembered information about
   articles with lower numbers, as these will never recur. This includes
   the situation when the high water mark is one less than the low water
   mark. No similar assumption can be made about the high water mark, as
   this can decrease if an article is removed, and then increase again
   if it is reinstated or if new articles arrive.

   When a valid group is selected by means of this command, the current
   selected newsgroup MUST be set to that group and the current article
   number MUST be set to the first article in the group. If an empty
   newsgroup is selected, the current article pointer is made invalid.
   If an invalid group is specified, the current selected newsgroup and
   current article number MUST NOT be changed.

   The GROUP command (or the LISTGROUP command, if implemented) MUST be
   used by a client and a successful response received before any other
   command is used that depends on the value of the current selected
   newsgroup or current article number.

   If the group specified is not available on the server, a 411 response
   MUST be returned.

6.1.1.3 Examples

   Example for a group known to the server:

      [C] GROUP   misc.test
      [S] 211 1234 3000234 3002322 misc.test

   Example for a group unknown to the server:

      [C] GROUP   example.is.sob.bradner.or.barber
      [S] 411 example.is.sob.bradner.or.barber is unknown

   Example of an empty group using the preferred response:

      [C] GROUP   example.currently.empty.newsgroup
      [S] 211 0 4000 3999 example.currently.empty.newsgroup

   Example of an empty group using an alternative response:

      [C] GROUP   example.currently.empty.newsgroup
      [S] 211 0 0 0 example.currently.empty.newsgroup

   Example of an empty group using a different alternative response:

      [C] GROUP   example.currently.empty.newsgroup
      [S] 211 0 4000 4321 example.currently.empty.newsgroup


6.1.2 LAST

6.1.2.1 Usage

   Syntax
      LAST

   Responses
      223 n message-id   Article found
      412                No newsgroup selected
      420                Current article number is invalid
      422                No previous article in this group

   Parameters
      n          = article number
      message-id = article message-id

6.1.2.2 Description

   If the current selected newsgroup is valid, the current article
   number MUST be set to the previous article in that newsgroup (that
   is, the highest existing article number less than the current article
   number). If successful, a response indicating the new current article
   number and the message-id of that article MUST be returned. No
   article text is sent in response to this command.

   There MAY be no previous article in the group, although the current
   article number is not the reported low water mark. There MUST NOT be
   a previous article when the current article number is the reported
   low water mark.

   Because articles can be removed and added, the results of multiple
   LAST and NEXT commands MAY not be consistent over the life of a
   particular NNTP session.

   If the current article number is already the first article of the
   newsgroup, a 422 response MUST be returned. If the current article
   number is invalid, a 420 response MUST be returned. If the current
   selected newsgroup is invalid, a 412 response MUST be returned. In
   all three cases the current selected newsgroup and current article
   number MUST NOT be altered.

6.1.2.3 Examples

   Example of a successful article retrieval using LAST:

      [C] GROUP   misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] NEXT
      [S] 223 3000237 <668929@example.org> retrieved
      [C] LAST
      [S] 223 3000234 <45223423@example.com> retrieved

   Example of an attempt to retrieve an article without having selected
   a group (via the GROUP command) first:

      [Assumes current selected newsgroup is invalid.]
      [C] LAST
      [S] 412 no newsgroup selected

   Example of an attempt to retrieve an article using the LAST command
   when the current article number is that of the first article in the
   group:

      [C] GROUP   misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] LAST
      [S] 422 No previous article to retrieve

   Example of an attempt to retrieve an article using the LAST command
   when the current selected newsgroup is empty:

      [C] GROUP   example.empty.newsgroup
      [S] 211 0 0 0 example.empty.newsgroup
      [C] LAST
      [S] 420 No current article selected


6.1.3 NEXT

6.1.3.1 Usage

   Syntax
      NEXT

   Responses
      223 n message-id   Article found
      412                No newsgroup selected
      420                Current article number is invalid
      421                No next article in this group

   Parameters
      n          = article number
      message-id = article message-id

6.1.3.2 Description

   If the current selected newsgroup is valid, the current article
   number MUST be set to the next article in that newsgroup (that is,
   the lowest existing article number greater than the current article
   number). If successful, a response indicating the new current article
   number and the message-id of that article MUST be returned. No
   article text is sent in response to this command.

   If the current article number is already the last article of the
   newsgroup, a 421 response MUST be returned. In all other aspects
   (apart, of course, from the lack of 422 response) this command is
   identical to the LAST command (Section 6.1.2).

6.1.3.3 Examples

   Example of a successful article retrieval using NEXT:

      [C] GROUP   misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] NEXT
      [S] 223 3000237 <668929@example.org> retrieved

   Example of an attempt to retrieve an article without having selected
   a group (via the GROUP command) first:

      [Assumes current selected newsgroup is invalid.]
      [C] NEXT
      [S] 412 no newsgroup selected

   Example of an attempt to retrieve an article using the NEXT command
   when the current article number is that of the last article in the
   group:

      [C] GROUP   misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] STAT   3002322
      [S] 223 3002322 <411@example.net> retrieved
      [C] NEXT
      [S] 421 No next article to retrieve

   Example of an attempt to retrieve an article using the NEXT command
   when the current selected newsgroup is empty:

      [C] GROUP   example.empty.newsgroup
      [S] 211 0 0 0 example.empty.newsgroup
      [C] NEXT
      [S] 420 No current article selected


6.2 Retrieval of articles and article sections

   The ARTICLE, BODY, HEAD, and STAT commands are very similar. They
   differ only in the parts of the article that are presented to the
   client and in the successful response code. The ARTICLE command is
   described here in full, while the other commands are described in
   terms of the differences. As specified in Section 3.4, an article
   consists of two parts: the article headers and the article body. When
   responding to one of these commands, the server MUST present the
   entire article or appropriate part and MUST NOT attempt to alter or
   translate it in any way.

6.2.1 ARTICLE

6.2.1.1 Usage

   Syntax
      ARTICLE message-id
      ARTICLE number
      ARTICLE

   Responses

      First form (message-id specified)
         220 0 message-id   Article follows (multiline)
         430                No article with that message-id

      Second form (article number specified)
         220 n message-id   Article follows (multiline)
         412                No newsgroup selected
         423                No articles in that range

      Third form (current article number used)
         220 n message-id   Article follows (multiline)
         412                No newsgroup selected
         420                Current article number is invalid

   Parameters
      number     = Requested article number
      n          = Returned article number
      message-id = Article message-id

6.2.1.2 Description

   The ARTICLE command selects an article based on the arguments and
   presents the entire article (that is, the headers, an empty line, and
   the body in that order). The command has three forms.

   In the first form, a message-id is specified and the server presents
   the article with that message-id. In this case, the server MUST NOT
   alter the current selected newsgroup or current article number. This
   is both to facilitate the presentation of articles that may be
   referenced within another article being read, and because of the
   semantic difficulties of determining the proper sequence and
   membership of an article that may have been crossposted to more than
   one newsgroup.

   In the response, the article number is replaced with zero (that is,
   the server is not required to determine whether the article is in the
   current selected newsgroup or what article number(s) it has).

   In the second form, an article number is specified. If there is an
   article with that number in the current selected newsgroup, the
   server MUST set the current article number to that number.

   In the third form, the article indicated by the current article
   number in the current selected newsgroup is used.

   Note that a previously valid article number MAY become invalid if the
   article has been removed. A previously invalid article number MAY
   become valid if the article has been reinstated, but such an article
   number MUST be no less than the reported low water mark for that
   group.

   The server MUST NOT change the current selected newsgroup as a result
   of this command. The server MUST NOT change the current article
   number except when an article number argument was provided and the
   article exists; in particular, it MUST NOT change it following an
   unsuccessful response.

   Since the message-id is unique for each article, it may be used by a
   client to skip duplicate displays of articles that have been posted
   more than once, or to more than one newsgroup.

   The article is returned as a multi-line response following the 220
   response code.

   If the argument is a message-id and no such article exists, a 430
   response MUST be returned. If the argument is a number or is omitted
   and the current selected newsgroup is invalid, a 412 response MUST be
   returned. If the argument is a number and that article does not exist
   in the current selected newsgroup, a 423 response MUST be returned.
   If the argument is omitted and the current article number is invalid,
   a 420 response MUST be returned.

6.2.1.3 Examples

   Example of a successful retrieval of an article (using no article
   number):

      [C] GROUP   misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] ARTICLE
      [S] 220 3000234 <45223423@example.com>
      [S] Path: pathost!demo!whitehouse!not-for-mail
      [S] From: "Demo User" <nobody@example.net>
      [S] Newsgroups: misc.test
      [S] Subject: I am just a test article
      [S] Date: 6 Oct 1998 04:38:40 -0500
      [S] Organization: An Example Net, Uncertain, Texas
      [S] Message-ID: <411@example.net>
      [S]
      [S] This is just a test article.
      [S] .

   Example of a successful retrieval of an article by message-id:

      [C] ARTICLE   <45223423@example.com>
      [S] 220 0 <45223423@example.com>
      [S] Path: pathost!demo!whitehouse!not-for-mail
      [S] From: "Demo User" <nobody@example.net>
      [S] Newsgroups: misc.test
      [S] Subject: I am just a test article
      [S] Date: 6 Oct 1998 04:38:40 -0500
      [S] Organization: An Example Net, Uncertain, Texas
      [S] Message-ID: <411@example.net>
      [S]
      [S] This is just a test article.
      [S] .

   Example of an unsuccessful retrieval of an article by message-id:

      [C] ARTICLE   <i.am.not.there@example.com>
      [S] 430 No Such Article Found

   Example of an unsuccessful retrieval of an article by number:

      [C] GROUP   misc.test
      [S] 211 1234 3000234 3002322 news.groups
      [C] ARTICLE   300256
      [S] 423 No such article number in this group

   Example of an unsuccessful retrieval of an article by number because
   no newsgroup was selected first:

      [Assumes current selected newsgroup is invalid.]
      [C] ARTICLE   300256
      [S] 412 No newsgroup selected

   Example of an attempt to retrieve an article when the current
   selected newsgroup is empty:

      [C] GROUP   example.empty.newsgroup
      [S] 211 0 0 0 example.empty.newsgroup
      [C] ARTICLE
      [S] 420 No current article selected


6.2.2 HEAD

6.2.2.1 Usage

   Syntax
      HEAD message-id
      HEAD number
      HEAD

   Responses

      First form (message-id specified)
         221 0 message-id   Headers follow (multiline)
         430                No article with that message-id

      Second form (article number specified)
         221 n message-id   Headers follow (multiline)
         412                No newsgroup selected
         423                No articles in that range

      Third form (current article number used)
         221 n message-id   Headers follow (multiline)
         412                No newsgroup selected
         420                Current article number is invalid

   Parameters
      number     = Requested article number
      n          = Returned article number
      message-id = Article message-id

6.2.2.2 Description

   The HEAD command behaves identically to the ARTICLE command except
   that, if the article exists, the response code is 221 instead of 220
   and only the headers are presented (the empty line separating the
   headers and body MUST NOT be included).

6.2.2.3 Examples

   Example of a successful retrieval of the headers of an article (using
   no article number):

      [C] GROUP   misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] HEAD
      [S] 221 3000234 <45223423@example.com>
      [S] Path: pathost!demo!whitehouse!not-for-mail
      [S] From: "Demo User" <nobody@example.net>
      [S] Newsgroups: misc.test
      [S] Subject: I am just a test article
      [S] Date: 6 Oct 1998 04:38:40 -0500
      [S] Organization: An Example Net, Uncertain, Texas
      [S] Message-ID: <411@example.net>
      [S] .

   Example of a successful retrieval of the headers of an article by
   message-id:

      [C] HEAD   <45223423@example.com>
      [S] 221 0 <45223423@example.com>
      [S] Path: pathost!demo!whitehouse!not-for-mail
      [S] From: "Demo User" <nobody@example.net>
      [S] Newsgroups: misc.test
      [S] Subject: I am just a test article
      [S] Date: 6 Oct 1998 04:38:40 -0500
      [S] Organization: An Example Net, Uncertain, Texas
      [S] Message-ID: <411@example.net>
      [S] .

   Example of an unsuccessful retrieval of the headers of an article by
   message-id:

      [C] HEAD   <i.am.not.there@example.com>
      [S] 430 No Such Article Found

   Example of an unsuccessful retrieval of the headers of an article by
   number:

      [C] GROUP   misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] HEAD   300256
      [S] 423 No such article number in this group

   Example of an unsuccessful retrieval the headers of an article by
   number because no newsgroup was selected first:

      [Assumes current selected newsgroup is invalid.]
      [C] HEAD   300256
      [S] 412 No newsgroup selected

   Example of an attempt to retrieve the headers of an article when the
   current selected newsgroup is empty:

      [C] GROUP   example.empty.newsgroup
      [S] 211 0 0 0 example.empty.newsgroup
      [C] HEAD
      [S] 420 No current article selected


6.2.3 BODY

6.2.3.1 Usage

   Syntax
      BODY message-id
      BODY number
      BODY

   Responses

      First form (message-id specified)
         222 0 message-id   Body follows (multiline)
         430                No article with that message-id

      Second form (article number specified)
         222 n message-id   Body follows (multiline)
         412                No newsgroup selected
         423                No articles in that range

      Third form (current article number used)
         222 n message-id   Body follows (multiline)
         412                No newsgroup selected
         420                Current article number is invalid

   Parameters
      number     = Requested article number
      n          = Returned article number
      message-id = Article message-id

6.2.3.2 Description

   The BODY command behaves identically to the ARTICLE command except
   that, if the article exists, the response code is 222 instead of 220
   and only the body is presented (the empty line separating the headers
   and body MUST NOT be included).

6.2.3.3 Examples

   Example of a successful retrieval of the body of an article (using no
   article number):

      [C] GROUP   misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] BODY
      [S] 222 3000234 <45223423@example.com>
      [S] This is just a test article.
      [S] .

   Example of a successful retrieval of the body of an article by
   message-id:

      [C] BODY   <45223423@example.com>
      [S] 222 0 <45223423@example.com>
      [S] This is just a test article.
      [S] .

   Example of an unsuccessful retrieval of the body of an article by
   message-id:

      [C] BODY   <i.am.not.there@example.com>
      [S] 430 No Such Article Found

   Example of an unsuccessful retrieval of the body of an article by
   number:

      [C] GROUP   misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] BODY   300256
      [S] 423 No such article number in this group

   Example of an unsuccessful retrieval of the body of an article by
   number because no newsgroup was selected first:

      [Assumes current selected newsgroup is invalid.]
      [C] BODY   300256
      [S] 412 No newsgroup selected

   Example of an attempt to retrieve the body of an article when the
   current selected newsgroup is empty:

      [C] GROUP   example.empty.newsgroup
      [S] 211 0 0 0 example.empty.newsgroup
      [C] BODY
      [S] 420 No current article selected


6.2.4 STAT

6.2.4.1 Usage

   Syntax
      STAT message-id
      STAT number
      STAT

   Responses

      First form (message-id specified)
         223 0 message-id   Article exists
         430                No article with that message-id

      Second form (article number specified)
         223 n message-id   Article exists
         412                No newsgroup selected
         423                No articles in that range

      Third form (current article number used)
         223 n message-id   Article exists
         412                No newsgroup selected
         420                Current article number is invalid

   Parameters
      number     = Requested article number
      n          = Returned article number
      message-id = Article message-id

6.2.4.2 Description

   The STAT command behaves identically to the ARTICLE command except
   that, if the article exists, it is NOT presented to the client and
   the response code is 223 instead of 220. Note that the response is
   NOT multi-line.

   This command allows the client to determine whether an article
   exists, and in the second and third forms what its message-id is,
   without having to process an arbitrary amount of text.

6.2.4.3 Examples

   Example of STAT on an existing article (using no article number):

      [C] GROUP   misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] STAT
      [S] 223 3000234 <45223423@example.com>

   Example of a STAT of an existing article by message-id:

      [C] STAT   <45223423@example.com>
      [S] 223 0 <45223423@example.com>

   Example of an STAT of an article not on the server by message-id:

      [C] STAT   <i.am.not.there@example.com>
      [S] 430 No Such Article Found

   Example of STAT of an article not in the server by number:

      [C] GROUP   misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] STAT   300256
      [S] 423 No such article number in this group

   Example of STAT of an article by number when no newsgroup was
   selected first:

      [Assumes current selected newsgroup is invalid.]
      [C] STAT   300256
      [S] 412 No newsgroup selected

   Example of STAT of an article when the current selected newsgroup is
   empty:

      [C] GROUP   example.empty.newsgroup
      [S] 211 0 0 0 example.empty.newsgroup
      [C] STAT
      [S] 420 No current article selected


6.3 Article posting

   Article posting is done in one of two modes: individual article
   posting from news reading clients using POST, and article transfer
   from other news servers using IHAVE.

6.3.1 POST

6.3.1.1 Usage

   This command MUST NOT be pipelined.

   Syntax
      POST

   Responses

      Initial responses
         340   Send article to be posted
         440   Posting not permitted

      Subsequent responses
         240   Article received OK
         441   Posting failed


6.3.1.2 Description

   If posting is allowed, a 340 response MUST be returned to indicate
   that the article to be posted should be sent. If posting is
   prohibited for some installation-dependent reason, a 440 response
   MUST be returned.

   If posting is permitted, the article MUST be in the format specified
   in Section 3.4 and MUST be sent by the client to the server in the
   manner specified in (Section 3.1) for multi-line responses (except
   that there is no initial line containing a response code). Thus a
   single dot (".") on a line indicates the end of the text, and lines
   starting with a dot in the original text have that dot doubled during
   transmission.

   Following the presentation of the termination sequence by the client,
   the server MUST return a response indicating success or failure of
   the article transfer. Note that response codes 340 and 440 are used
   in direct response to the POST command. Others are returned following
   the sending of the article.

   A response of 240 SHOULD indicate that, barring unforseen server
   errors, the posted article will be made available on the server and/
   or transferred to other servers as appropriate, possibly following
   further processing. In other words, articles not wanted by the server
   SHOULD be rejected with a 441 response and not accepted and silently
   discarded. However, the client SHOULD NOT assume that the article has
   been successfully transferred unless it receives an affirmative
   response from the server, and SHOULD NOT assume that it is being made
   available to other clients without explicitly checking (for example
   using the STAT command).

   If the session is interrupted before the response is received, it is
   possible that an affirmative response was sent but has been lost.
   Therefore, in any subsequent session, the client SHOULD either check
   whether the article was successfully posted before resending or
   ensure that the server will allocate the same message-id to the new
   attempt (see Appendix B.2) - the latter approach is preferred since
   the article might not have been made available for reading yet (for
   example, it may have to go through a moderation process).

6.3.1.3 Examples

   Example of a successful posting:

      [C] POST
      [S] 340 Input article; end with <CR-LF>.<CR-LF>
      [C] From: "Demo User" <nobody@example.net>
      [C] Newsgroups: misc.test
      [C] Subject: I am just a test article
      [C] Organization: An Example Net
      [C]
      [C] This is just a test article.
      [C] .
      [S] 240 Article received OK

   Example of an unsuccessful posting:

      [C] POST
      [S] 340 Input article; end with <CR-LF>.<CR-LF>
      [C] From: "Demo User" <nobody@example.net>
      [C] Newsgroups: misc.test
      [C] Subject: I am just a test article
      [C] Organization: An Example Net
      [C]
      [C] This is just a test article.
      [C] .
      [S] 441 Posting failed

   Example of an attempt to post when posting is not allowed:

      [C] MODE READER
      [S] 201 NNTP Service Ready, posting prohibited
      [C] POST
      [S] 440 Posting not permitted


6.3.2 IHAVE

6.3.2.1 Usage

   This command MUST NOT be pipelined.

   Syntax
      IHAVE message-id

   Responses

      Initial responses
         335   Send article to be transferred
         435   Article not wanted
         436   Transfer not possible; try again later

      Subsequent responses
         235   Article transferred OK
         436   Transfer failed; try again later
         437   Transfer rejected; do not retry

   Parameters
      message-id = Article message-id


6.3.2.2 Description

   The IHAVE command informs the server that the client has an article
   with the specified message-id. If the server desires a copy of that
   article a 335 response MUST be returned, instructing the client to
   send the entire article. If the server does not want the article (if,
   for example, the server already has a copy of it), a 435 response
   MUST be returned, indicating that the article is not wanted. Finally,
   if the article isn't wanted immediately but the client should retry
   later if possible (if, for example, another client is in the process
   of sending the same article to the server), a 436 response MUST be
   returned.

   If transmission of the article is requested, the client MUST send the
   entire article, including headers and body, in the format defined
   above (Section 3.1) for multi-line responses (except that there is no
   initial line containing a response code). Thus a single dot (".") on
   a line indicates the end of the text, and lines starting with a dot
   in the original text have that dot doubled during transmission. The
   server MUST return either a 235 response, indicating that the article
   was successfully transferred, a 436 response, indicating that the
   transfer failed but should be tried again later, or a 437 response,
   indicating that the article was rejected.

   This function differs from the POST command in that it is intended
   for use in transferring already-posted articles between hosts. It
   SHOULD NOT be used when the client is a personal news reading
   program, since use of this command indicates that the article has
   already been posted at another site and is simply being forwarded
   from another host. However, despite this, the server MAY elect not to
   post or forward the article if, after further examination of the
   article, it deems it inappropriate to do so. Reasons for such
   subsequent rejection of an article may include such problems as
   inappropriate newsgroups or distributions, disc space limitations,
   article lengths, garbled headers, and the like. These are typically
   restrictions enforced by the server host's news software and not
   necessarily the NNTP server itself.

   The client SHOULD NOT assume that the article has been successfully
   transferred unless it receives an affirmative response from the
   server. A lack of response (such as a dropped network connection or a
   network timeout) SHOULD be treated the same as a 436 response.

   Because some news server software may not be able immediately to
   determine whether or not an article is suitable for posting or
   forwarding, an NNTP server MAY acknowledge the successful transfer of
   the article (with a 235 response) but later silently discard it.

6.3.2.3 Examples

   Example of successfully sending an article to another site:

      [C] IHAVE   <i.am.an.article.you.will.want@example.com>
      [S] 335 Send it; end with <CR-LF>.<CR-LF>
      [C] Path: pathost!demo!somewhere!not-for-mail
      [C] From: "Demo User" <nobody@example.com>
      [C] Newsgroups: misc.test
      [C] Subject: I am just a test article
      [C] Date: 6 Oct 1998 04:38:40 -0500
      [C] Organization: An Example Com, San Jose, CA
      [C] Message-ID: <i.am.an.article.you.will.want@example.com>
      [C]
      [C] This is just a test article.
      [C] .
      [S] 235 Article transferred OK

   Example of sending an article to another site that rejects it. Note
   that the message-id in the IHAVE command is not the same as the one
   in the article headers; while this is bad practice and SHOULD NOT be
   done, it is not forbidden.

      [C] IHAVE   <i.am.an.article.you.will.want@example.com>
      [S] 335 Send it; end with <CR-LF>.<CR-LF>
      [C] Path: pathost!demo!somewhere!not-for-mail
      [C] From: "Demo User" <nobody@example.com>
      [C] Newsgroups: misc.test
      [C] Subject: I am just a test article
      [C] Date: 6 Oct 1998 04:38:40 -0500
      [C] Organization: An Example Com, San Jose, CA
      [C] Message-ID: <i.am.an.article.you.have@example.com>
      [C]
      [C] This is just a test article.
      [C] .
      [S] 437 Article rejected; don't send again

   Example of sending an article to another site where the transfer
   fails:

      [C] IHAVE   <i.am.an.article.you.will.want@example.com>
      [S] 335 Send it; end with <CR-LF>.<CR-LF>
      [C] Path: pathost!demo!somewhere!not-for-mail
      [C] From: "Demo User" <nobody@example.com>
      [C] Newsgroups: misc.test
      [C] Subject: I am just a test article
      [C] Date: 6 Oct 1998 04:38:40 -0500
      [C] Organization: An Example Com, San Jose, CA
      [C] Message-ID: <i.am.an.article.you.will.want@example.com>
      [C]
      [C] This is just a test article.
      [C] .
      [S] 436 Transfer failed

   Example of sending an article to a site that already has it:

      [C] IHAVE   <i.am.an.article.you.have@example.com>
      [S] 435 Duplicate

   Example of sending an article to a site that requests the article be
   tried again later:

      [C] IHAVE   <i.am.an.article.you.defer@example.com>
      [S] 436 Retry later


Full Copyright Statement

   Copyright (C) The Internet Society (2003). All Rights Reserved.

   This document and translations of it may be copied and furnished to
   others, and derivative works that comment on or otherwise explain it
   or assist in its implementation may be prepared, copied, published
   and distributed, in whole or in part, without restriction of any
   kind, provided that the above copyright notice and this paragraph are
   included on all such copies and derivative works. However, this
   document itself may not be modified in any way, such as by removing
   the copyright notice or references to the Internet Society or other
   Internet organizations, except as needed for the purpose of
   developing Internet standards in which case the procedures for
   copyrights defined in the Internet Standards process must be
   followed, or as required to translate it into languages other than
   English.

   The limited permissions granted above are perpetual and will not be
   revoked by the Internet Society or its successors or assignees.

   This document and the information contained herein is provided on an
   "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
   TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
   BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
   HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
   MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: New NNTP draft -- Section 6
#66909
Author: nospam
Date: Tue, 21 Oct 2003 18:54
17 lines
1715 bytes
Russ Allbery <rra@stanford.edu> wrote:


>   Except when the group is empty and all three numbers are zero,
>   whenever a subsequent GROUP command for the same newsgroup is issued,
>   either by the same client or a different client, the reported low
>   water mark in the response MUST be no less than that in any previous
>   response for that newsgroup sent to any client. 

Is this not at odds with current practice on large systems which use an
array of reader servers? 

The reader servers carry out article expiration asynchronously so
subsequent connection to a different reader in the array may well yield a
low water mark lower than previously seen. 

Re: New NNTP draft -- Section 6
#66910
Author: Clive D. W. Feather
Date: Wed, 22 Oct 2003 09:12
29 lines
2789 bytes
In article <ivuapvgl56s0q5egfk4fufl5cvuff1qbml@4ax.com>, nospam 
<nospam@nospam.invalid> writes
>>   Except when the group is empty and all three numbers are zero,
>>   whenever a subsequent GROUP command for the same newsgroup is issued,
>>   either by the same client or a different client, the reported low
>>   water mark in the response MUST be no less than that in any previous
>>   response for that newsgroup sent to any client.
>
>Is this not at odds with current practice on large systems which use an
>array of reader servers?
>
>The reader servers carry out article expiration asynchronously so
>subsequent connection to a different reader in the array may well yield a
>low water mark lower than previously seen.

If so, then it is up to those large systems to fix the problem.

This was a topic that got debated some years ago, which is when and why 
I wrote the present wording. Clients make a number of assumptions in 
maintaining the .newsrc file or equivalent, and this is a common one.

Cluster systems have a whole range of issues with synchronisation. This 
is just another of them.

-- 
Clive D.W. Feather, writing for himself  | Home: <clive@davros.org>
Tel: +44 20 8371 1138 (work)             | Web:  <http://www.davros.org>
Fax: +44 870 051 9937                    | Work: <clive@demon.net>
Written on my laptop; please observe the Reply-To address
Re: New NNTP draft -- Sections 1-3
#66918
Author: Juergen Helbing
Date: Wed, 22 Oct 2003 12:45
15 lines
1288 bytes
Russ Allbery <rra@stanford.edu> wrote:

>   An NNTP server MUST implement all the commands in this specification
>   except for those marked as optional and those in extensions.

So from the moment this draft becomes a valid RFC the 'older NNTP servers'
are what ? - Just 'NEWS servers' ?   :-)

This statment would be right if NNTP is invented by it.
But this draft re-specifies NNTP. 
So perhaps it would be wiser to talk about "NNTPv2 - Servers"....

-- 
Juergen
Re: New NNTP draft -- Section 6
#66926
Author: nospam
Date: Wed, 22 Oct 2003 17:14
45 lines
3124 bytes
"Clive D. W. Feather" <clive@on-the-train.demon.co.uk> wrote:

>In article <ivuapvgl56s0q5egfk4fufl5cvuff1qbml@4ax.com>, nospam 
><nospam@nospam.invalid> writes
>>>   Except when the group is empty and all three numbers are zero,
>>>   whenever a subsequent GROUP command for the same newsgroup is issued,
>>>   either by the same client or a different client, the reported low
>>>   water mark in the response MUST be no less than that in any previous
>>>   response for that newsgroup sent to any client.
>>
>>Is this not at odds with current practice on large systems which use an
>>array of reader servers?
>>
>>The reader servers carry out article expiration asynchronously so
>>subsequent connection to a different reader in the array may well yield a
>>low water mark lower than previously seen.
>
>If so, then it is up to those large systems to fix the problem.

The Canute approach to specification then. 

>This was a topic that got debated some years ago, which is when and why 
>I wrote the present wording. Clients make a number of assumptions in 
>maintaining the .newsrc file or equivalent, and this is a common one.

And when they currently connect to many of the largest servers their
assumptions are proved wrong, yet it appears to cause no problems for the
majority. 

>Cluster systems have a whole range of issues with synchronisation. This 
>is just another of them.

But an onerous and  relatively unimportant one which the draft is elevating
to a mandatory requirement. 

Who cares if connecting to a different machine in an array you see a bunch
of the oldest articles you thought had expired 'phoenix'? They are about to
expire anyway and could be safely ignored. 

Advising clients to ignore any falling low water mark and use the
previously seen value would be a simple solution only causing a problem if
the server resets its article numbering - something which this section of
the draft prohibits anyway. 

Re: New NNTP draft -- Section 6
#66927
Author: Francois Petillon
Date: Wed, 22 Oct 2003 17:28
80 lines
5892 bytes
On Wed, 22 Oct 2003 10:12:35 +0100, Clive D. W. Feather wrote:
>>The reader servers carry out article expiration asynchronously so
>>subsequent connection to a different reader in the array may well yield a
>>low water mark lower than previously seen.
> If so, then it is up to those large systems to fix the problem.
> This was a topic that got debated some years ago, which is when and why 
> I wrote the present wording. Clients make a number of assumptions in 
> maintaining the .newsrc file or equivalent, and this is a common one.

This issue was not really debated (or there was another debate than the
one who took place in ietf-nntp in december 96/january 97). Your initial
wording at that time was :
---- http://www.academ.com/pipermail/ietf-nntp/1996-December/000365.html
3.2.1.  GROUP

   The successful selection response will return the article numbers of
   the first and last articles in the group, and an estimate of the
   number of articles on file in the group.  It is not necessary that
   the estimate be correct, although that is helpful; it must only be
   equal to or larger than the actual number of articles on file.  (Some
   implementations will actually count the number of articles on file.
   Others will just subtract first article number from last to get an
   estimate.)
---- which became
    The successful selection response will return the article numbers of the
    first and last articles in the group at the moment of selection, and an
    estimate of the number of articles on file in the group. The estimate
    MUST be at least the actual number of articles available. (Some
    implementations will actually count the number of articles on file.
    Others will just subtract first article number from last to get an
    estimate.)
[...]
    When a subsequent GROUP command for the same newsgroup is issued,
    either by the same client or a different client, the first and last
    article numbers MUST be no less than those in the previous response
    for that newsgroup.
---- 
the last paragraph was changed to allow high water mark to decrease
(cf http://www.academ.com/pipermail/ietf-nntp/1996-December/000387.html )
as Inn returns the last available article in a group.

As far as I understood the discussions (but english is not my native
language), the reason why the last article number should not decrease was 
related to backfilling and newsrc management :
http://www.academ.com/pipermail/ietf-nntp/1996-December/000255.html

This problem is mainly client-side related and may be easily solved
by client software (even if it is simply by forgetting these newly
"reinstated" articles), is probably already fixed by most of them (in the
case of "reinstated" articles, not in the case of newly added articles
returned by newnews) but is really painful to solve at the server level
(see below). Unfortunately, the draft was written at a time when clusters
were quite uncommon and where this kind of problem "should not happen with
Inn"... ;-)

> Cluster systems have a whole range of issues with synchronisation. This 
> is just another of them.

No, as far as I know, cluster systems do not manage much issues on
synchronisation. For diablo/dreaderd, the only issue dealed is about xref
synchronisation for front-ends. For typhoon, lo/hi marks are probably
mastered by the first defined spooler (I do not know if it had changed
but only the first server was used by a front-end, the second spooler
is used only if the first is unreachable, etc.) and there is probably no
synchronisation on lo/hi marks between spoolers (as with diablo/dreaderd,
you must have a numbering server).

I really dislike the idea of having to keep in sync servers for
"real-time" information. First, servers are already running without a
"strong synchronisation" and, in my case, I do not have users complaints
about this issue (excepted when hi water mark decreases between two
front-ends which is quite uncommon). Second, asking to sync lo water mark
will probably lead to set an async lo water mark (either servers lowest or
highest lo water mark will be use to set synced lo water mark every x
seconds/minutes/hours), which is "far from a nice solution" (c). Third, it
will complexicate the server side as you will have to deal with
crash/reboot/new installs/remove of others servers and, as a consequence,
it will weaken them.

   François
Re: New NNTP draft -- Section 6
#66928
Author: Russ Allbery
Date: Wed, 22 Oct 2003 17:59
35 lines
2857 bytes
Clive D W Feather <clive@on-the-train.demon.co.uk> writes:
> nospam <nospam@nospam.invalid> writes:

>>>   Except when the group is empty and all three numbers are zero,
>>>   whenever a subsequent GROUP command for the same newsgroup is issued,
>>>   either by the same client or a different client, the reported low
>>>   water mark in the response MUST be no less than that in any previous
>>>   response for that newsgroup sent to any client.

>> Is this not at odds with current practice on large systems which use an
>> array of reader servers?

>> The reader servers carry out article expiration asynchronously so
>> subsequent connection to a different reader in the array may well yield
>> a low water mark lower than previously seen.

> If so, then it is up to those large systems to fix the problem.

Hm.

I don't remember what the previous discussion was, but the actual problem
caused by this isn't really so much an interoperability problem as it is
that clients will never notice that decrease in the low water mark and
those articles won't be seen.  In practice, this mostly doesn't cause any
difficulties.

I'm currently wondering why this was a MUST rather than a SHOULD.  I think
SHOULD makes more sense (which provides wiggle room for clusters such as
described here).

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: New NNTP draft -- Sections 1-3
#66929
Author: Russ Allbery
Date: Wed, 22 Oct 2003 18:03
39 lines
2851 bytes
Juergen Helbing <archiver@i3w.com> writes:
> Russ Allbery <rra@stanford.edu> wrote:

>>   An NNTP server MUST implement all the commands in this specification
>>   except for those marked as optional and those in extensions.

> So from the moment this draft becomes a valid RFC the 'older NNTP
> servers' are what ? - Just 'NEWS servers' ?  :-)

They're not compliant with the NNTP draft if they don't implement all of
those commands.  However, I believe that most existing news servers do
implement all the required commands; the substantially new work like OVER
and HDR is optional.

Note that it's not a crime to not be compliant; I've written small
special-purpose servers that only implement a small portion of the NNTP
protocol before, and I expect that lots of people will run transit-only
servers that "implement" such commands as ARTICLE by always returning 502.

> This statment would be right if NNTP is invented by it.
> But this draft re-specifies NNTP. 
> So perhaps it would be wiser to talk about "NNTPv2 - Servers"....

That's not generally how IETF standards are written, at least in my
limited experience.

However, one shouldn't advertise a transit-only server as an NNTP server
because it doesn't implement the entire protocol.  It's a useful server
for a particular purpose, but one should be clear that it only implements
a limited subset of the draft.

This is mostly just a semantics thing that won't matter very much in
practice.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: New NNTP draft -- Section 4
#66930
Author: Dirk Nimmich
Date: Wed, 22 Oct 2003 19:49
17 lines
2043 bytes
Russ Allbery wrote:
> Particularly since I don't expect the server will need to build a
> normalized list.  My expectation is that hierarchy administrators will
> only create already normalized groups, and that this will likely be
> enforced by software down the road.

Have you ever been called an optimist? :)

> It's already a requirement in the draft UTF-8 newsgroup name
> proposal floated in USEFOR that all newsgroup names be
> canonicalized on the wire.

UTF-8 has been postponed until after the first basic RfCs are
published, remember? And unfortunately there hasn't much progress on
USEFOR for the last months. But this is another topic belonging to
another working group.
Re: New NNTP draft -- Section 5
#66932
Author: Dirk Nimmich
Date: Wed, 22 Oct 2003 20:01
21 lines
2481 bytes
Russ Allbery wrote:
> Dirk Nimmich <nimmich@muenster.de> writes:
>> Given the explanations of both of you, there is no real difference in
>> treating 200 or 201. If the client receives a 200 it always has to find
>> out using the POST command whether it is allowed to post or not (Russ'
>> way).
> 
> Or it just proceeds, assuming that it can authenticate, and if POST
> returns 480 it does authentication on the fly right away.  I think that's
> what most news readers do.

Yes, but that's exactly the reason why they don't need a distinction
between 200 and 201. They just do the POST command regardless of the
greeting response because both variations of implementation occur in
practice, and tell the user when it failed (440) or the server asked
for authentication (480).

The two possible ways of implementing the greeting response makes it
unreliable so that it isn't really used -- or in a way you didn't
expect.
Re: New NNTP draft -- Section 5
#66933
Author: Russ Allbery
Date: Wed, 22 Oct 2003 20:16
20 lines
2426 bytes
Dirk Nimmich <nimmich@muenster.de> writes:

> Yes, but that's exactly the reason why they don't need a distinction
> between 200 and 201. They just do the POST command regardless of the
> greeting response because both variations of implementation occur in
> practice, and tell the user when it failed (440) or the server asked for
> authentication (480).

> The two possible ways of implementing the greeting response makes it
> unreliable so that it isn't really used -- or in a way you didn't
> expect.

Right.  In practice, I think the best way to use them is to only return
201 if the server is definitely and permanently read-only.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: New NNTP draft -- Sections 1-3
#66934
Author: Juergen Helbing
Date: Thu, 23 Oct 2003 07:27
67 lines
3157 bytes
Russ Allbery <rra@stanford.edu> wrote:

>They're not compliant with the NNTP draft if they don't implement all of
>those commands.  However, I believe that most existing news servers do
>implement all the required commands; the substantially new work like OVER
>and HDR is optional.

Please understand me right:
It would be really OK that the term "NNTP-Server" would be reserved
from now on for demons which are _real_ NNTP-Servers.
>From the point of a client programmer I hate nothing more than
to do a number of checks BEFORE I can even use a host.
The fact that the "substantially new work" is 'optional' does not
make it better. From now one we client programmers have to 
take care about FOUR different type of NNTP-servers:

1) Compliant to RFC 9977 including 'options'
2) Compliant to RFC 9977 without 'options'
3) Not compliant to RFC 9977 but has all the new options
4) Anything else - check yourself  :->


>Note that it's not a crime to not be compliant; 

Am I misinterpreting the word 'MUST' in the draft ?

>> This statment would be right if NNTP is invented by it.
>> But this draft re-specifies NNTP. 
>> So perhaps it would be wiser to talk about "NNTPv2 - Servers"....
>
>That's not generally how IETF standards are written, at least in my
>limited experience.

http 1.1   ?

How do you expect that a client programmer is finding out what kind
of host his client is contacting ?

Are you the one who will write the sample code to find out
'which level of compliance' is reached on a special host ?

Will there be a GNKSA for 'NNTP' servers ?


>This is mostly just a semantics thing that won't matter very much in
>practice.

That 'just semantics' is adding confusion to NNTP and Usenet
instead of making it better - from my point of view.

Will there be ever anything a client programmer can rely on ?
With this level of 'confidence' in an RFC the client programmers
have to continue to use RFC977 basics together with XOVER
basics to write their programs.

I've been following the discussion about NNTP+UseFor for 
a very long, almost from the beginning. This way all the
work is useless. 


Just a very personal impression.
No offense intended. 
Giving up (again) <sigh>
-- 
Juergen

Re: New NNTP draft -- Sections 1-3
#66936
Author: Dr.Ruud
Date: Thu, 23 Oct 2003 10:40
31 lines
1891 bytes
Toen ik Juergen Helbing kietelde, kwam er dit uit:

> Will there be a GNKSA for 'NNTP' servers ?


Maybe the initial greeting can be allowed to be
more verbose, something remotely like this:

$ telnet smtp 25
Trying 11.22.33.44...
Connected to smtp.example.com.
Escape character is '^]'.
250-smtp1.example.com Hello someone.example.com [11.22.0.44], pleased
    to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE 15000000
250-DSN
250-ETRN
250-DELIVERBY
220 smtp1.example.com ESMTP Sendmail 8.12.9/8.12.9; Wed, 22 Oct 2003
    21:49:13 +0200 (CEST)

(faked greeting, I need to enter an 'ehlo <domain-address>'
to get that info).

-- 
Affijn, Ruud

Re: New NNTP draft -- Sections 1-3
#66937
Author: iMeowbot
Date: Thu, 23 Oct 2003 12:34
30 lines
2427 bytes
In article <bn8i86.1fc.1@news.isolution.nl>,
 "Dr.Ruud" <'t.leven.is.fijn@life.i$.great> wrote:

> Maybe the initial greeting can be allowed to be
> more verbose, something remotely like this:
> 
> $ telnet smtp 25
> Trying 11.22.33.44...
> Connected to smtp.example.com.
> Escape character is '^]'.
> 250-smtp1.example.com Hello someone.example.com [11.22.0.44], pleased
>     to meet you
> 250-ENHANCEDSTATUSCODES
> 250-PIPELINING
> 250-8BITMIME
> 250-SIZE 15000000
> 250-DSN
> 250-ETRN
> 250-DELIVERBY
> 220 smtp1.example.com ESMTP Sendmail 8.12.9/8.12.9; Wed, 22 Oct 2003
>     21:49:13 +0200 (CEST)

This would break all existing news software because that type of 
extended response was never allowed in the past, and one of the goals of 
the NNTP revision was to avoid breaking old programs where practical.

> (faked greeting, I need to enter an 'ehlo <domain-address>'
> to get that info).

The NNTP draft does have EHLO, it's called "LIST EXTENSIONS".
Re: New NNTP draft -- Sections 1-3
#66938
Author: Dr.Ruud
Date: Thu, 23 Oct 2003 13:05
58 lines
2866 bytes
Toen ik iMeowbot kietelde, kwam er dit uit:
> Dr.Ruud:

>> Maybe the initial greeting can be allowed to be
>> more verbose, something remotely like this:
>>
>> $ telnet smtp 25
>> Trying 11.22.33.44...
>> Connected to smtp.example.com.
>> Escape character is '^]'.
>> 250-smtp1.example.com Hello someone.example.com [11.22.0.44], pleased
>>     to meet you
>> 250-ENHANCEDSTATUSCODES
>> 250-PIPELINING
>> 250-8BITMIME
>> 250-SIZE 15000000
>> 250-DSN
>> 250-ETRN
>> 250-DELIVERBY
>> 220 smtp1.example.com ESMTP Sendmail 8.12.9/8.12.9; Wed, 22 Oct 2003
>>     21:49:13 +0200 (CEST)

> This would break all existing news software because that type of
> extended response was never allowed in the past, and one of the goals of
> the NNTP revision was to avoid breaking old programs where practical.

That depends on the format. But some will break of course.


>> (faked greeting, I need to enter an 'ehlo <domain-address>'
>> to get that info).

> The NNTP draft does have EHLO, it's called "LIST EXTENSIONS".

   $ telnet news 119
   Trying 11.22.33.45...
   Connected to news.example.com.
   Escape character is '^]'.
   202-Extensions supported: HDR, OVER
   200 news.example.com NNRP Service Ready (posting ok).

or:

   $ telnet news 119
   Trying 11.22.33.45...
   Connected to news.example.com.
   Escape character is '^]'.
   202-news1.example.com Hello someone.example.com [11.22.0.44], pleased
       to meet you
   202-Extensions supported:
   202-HDR
   202-OVER
   200 news.example.com NNRP Service Ready (posting ok).

-- 
Affijn, Ruud

Re: New NNTP draft -- Sections 1-3
#66939
Author: Ken Murchison
Date: Thu, 23 Oct 2003 13:52
59 lines
2856 bytes
Dr.Ruud wrote:
> Toen ik iMeowbot kietelde, kwam er dit uit:
> 
>>The NNTP draft does have EHLO, it's called "LIST EXTENSIONS".
> 
> 
>    $ telnet news 119
>    Trying 11.22.33.45...
>    Connected to news.example.com.
>    Escape character is '^]'.
>    202-Extensions supported: HDR, OVER
>    200 news.example.com NNRP Service Ready (posting ok).
> 
> or:
> 
>    $ telnet news 119
>    Trying 11.22.33.45...
>    Connected to news.example.com.
>    Escape character is '^]'.
>    202-news1.example.com Hello someone.example.com [11.22.0.44], pleased
>        to meet you
>    202-Extensions supported:
>    202-HDR
>    202-OVER
>    200 news.example.com NNRP Service Ready (posting ok).
> 

Don't make up your own syntax.  Its already in the draft, and it looks 
like this:

S: 200 eagle.oceana.com Cyrus NNTP Murder v2.2.1-BETA server ready, 
posting allowed
C: LIST EXTENSIONS
S: 202 Extension list follows:
S: AUTHINFO USER
S: SASL OTP NTLM ANONYMOUS CRAM-MD5 SRP DIGEST-MD5
S: HDR ALL
S: LISTGROUP
S: OVER
S: STARTTLS
S: STREAMING
S: .
C: AUTHINFO SASL CRAM-MD5
S: 383 PDExMjM3OTY5OTYuOTk1MjI2N0BlYWdsZS5vY2VhbmEuY29tPg==
Please enter your password:
C: a2VuIDkxNmRmNWQ1YTA0MTRiM2IwZDI3MWQyZTQ1NWVlZDBh
S: 281 Success (no protection)
Authenticated.
Security strength factor: 0
C: QUIT
Connection closed.


-- 
Kenneth Murchison     Oceana Matrix Ltd.
Software Engineer     21 Princeton Place
716-662-8973 x26      Orchard Park, NY 14127
--PGP Public Key--    http://www.oceana.com/~ken/ksm.pgp
Re: New NNTP draft -- Sections 1-3
#66945
Author: Russ Allbery
Date: Fri, 24 Oct 2003 00:01
103 lines
5533 bytes
Juergen Helbing <archiver@i3w.com> writes:

> Please understand me right:

> It would be really OK that the term "NNTP-Server" would be reserved
> from now on for demons which are _real_ NNTP-Servers.

Note that IETF does not have a trademark on the term NNTP and no one is
going to go after someone for calling something an NNTP server that
doesn't fully comply with the latest RFC.

> The fact that the "substantially new work" is 'optional' does not make
> it better. From now one we client programmers have to take care about
> FOUR different type of NNTP-servers:

> 1) Compliant to RFC 9977 including 'options'
> 2) Compliant to RFC 9977 without 'options'
> 3) Not compliant to RFC 9977 but has all the new options
> 4) Anything else - check yourself  :->

I don't believe that this is any more complicated than the current
situation.  In fact, I think it's much simpler.

>> Note that it's not a crime to not be compliant; 

> Am I misinterpreting the word 'MUST' in the draft ?

Maybe.

MUST means that you have to follow this in order to claim compliance with
the draft.  If you don't want to claim compliance with the draft, you can
obviously do whatever you want.  It says that this is an interoperability
issue and that other programs which speak the NNTP protocol expect this
functionality to be available, and that going forward they should be able
to rely on it being available (although they may not be authorized to use
it).

It doesn't strike me as something that's likely to have a substantial
impact on how people work on news software.  It's just the way that one
writes a standard.

>> That's not generally how IETF standards are written, at least in my
>> limited experience.

> http 1.1   ?

HTTP has a version negotation protocol, changes that were not backward
compatible, and extensive revisions.  None of these are true for NNTP.
The changes relative to 977 are fairly minor and, apart from support for
UTF-8 newsgroup names that frankly is not at all demanding or difficult
even if the news software is completely unaware of anything related to
non-ASCII character sets (I should know, I added support in INN and INN
has no conception of character sets at all), the changes are mostly things
that people have already done in working code because they're areas in
which RFC 977 is broken.

> How do you expect that a client programmer is finding out what kind
> of host his client is contacting ?

I expect them to use LIST EXTENSIONS.  For the things not covered by LIST
EXTENSIONS, it shouldn't matter.  If you examine the updated protocol
carefully, I think you'll see that it does indeed not matter.  If there
are specific places where you're worried about backward compatibility,
please raise them.

> Are you the one who will write the sample code to find out 'which level
> of compliance' is reached on a special host ?

There is no need.

> Will there be a GNKSA for 'NNTP' servers ?

Feel free, if you want to do such evaluations.  I think that might be
useful.  I don't have time, personally.

> That 'just semantics' is adding confusion to NNTP and Usenet instead of
> making it better - from my point of view.

I hear your point of view, but I don't agree.

> Will there be ever anything a client programmer can rely on ?
> With this level of 'confidence' in an RFC the client programmers
> have to continue to use RFC977 basics together with XOVER
> basics to write their programs.

I really don't understand why you think this is a step backwards.

> I've been following the discussion about NNTP+UseFor for 
> a very long, almost from the beginning. This way all the
> work is useless. 

Please don't confuse any of this with USEFOR.  This is a completely
different effort with little, if any, relation to the USEFOR work.  This
revision to the NNTP protocol is very conservative, is primarly
documentation of existing practice and paving the way for extensions to be
formally specified in the future, and provides a far better guide to
implementors than RFC 977.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Page 1 of 2 • 56 total messages
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads