🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
4 messages
4 total messages Started by Russ Allbery Mon, 27 Oct 2003 01:49
New NNTP draft -- Section 8
#66972
Author: Russ Allbery
Date: Mon, 27 Oct 2003 01:49
909 lines
36373 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


8. Framework for NNTP extensions

   Although NNTP is widely and robustly deployed, some parts of the
   Internet community might wish to extend the NNTP service. This
   document defines a means whereby an extended NNTP client can query
   the server to determine the service extensions that it supports.

   It must be emphasized that any extension to the NNTP service should
   not be considered lightly. NNTP's strength comes primarily from its
   simplicity. Experience with many protocols has shown that:

      Protocols with few options tend towards ubiquity, whilst protocols
      with many options tend towards obscurity.

   This means that each and every extension, regardless of its benefits,
   must be carefully scrutinized with respect to its implementation,
   deployment, and interoperability costs. In many cases, the cost of
   extending the NNTP service will likely outweigh the benefit.

   Given this environment, the framework for extensions described in
   this document consists of:

   o  a mechanism for clients to determine a server's available
      extensions

   o  a registry of NNTP service extensions

   The LIST EXTENSIONS command is described in this document (see
   Section 5.3) and is the mechanism for clients to use to determine
   what extensions are available. Except where stated otherwise, the
   commands in this document are understood (even if not supported) by
   all servers and are not described in the list of features returned by
   the LIST EXTENSIONS command.

   The IANA shall maintain a registry of NNTP service extensions.

   An extension is identified by a unique extension-label, which is a
   string of 1 to 12 uppercase US-ASCII letters. The extension-label
   will often be the name of a new command that the extension adds.
   However this is not a requirement: an extension might not add any new
   commands or keywords.

   An extension is either a private extension or else it is included in
   the IANA registry and is defined in an RFC. Such RFCs either must be
   on the standards track or must define an IESG-approved experimental
   protocol.

   The definition of an extension must include:

   o  a descriptive name for the extension;

   o  the extension-label (which is returned by LIST EXTENSIONS to
      indicate to the client that the server supports this particular
      extension) - the extension-label of a registered extension MUST
      NOT begin with "X";

   o  the syntax, values, and meanings of any arguments following the
      extension-label in the output of LIST EXTENSIONS;

   o  any new NNTP commands associated with the extension - the names of
      commands associated with registered extensions MUST NOT begin with
      "X";

   o  the syntax and possible values of arguments associated with the
      new NNTP commands;

   o  the response codes and possible values of arguments for the
      responses of the new NNTP commands;

   o  any new arguments the extension associates with any other
      pre-existing NNTP commands;

   o  how support for the extension affects the behavior of a server and
      NNTP client;

   o  any increase in the maximum length of commands and initial
      response lines over the value specified in this document;

   o  a specific statement about the effect on pipelining this extension
      may have (if any);

   o  a specific statement about the circumstances when use of this
      extension can alter the output from LIST EXTENSIONS;

   o  the circumstances under which the extension can cause any
      pre-existing command to produce a 401, 480, or 483 response;

   o  whether the extension can be used before or after the MODE READER
      command, and what changes (if any) the latter has on the
      extension.

   A private extension need not be included in the output of LIST
   EXTENSIONS. A server MAY provide additional keywords - either for new
   commands or new variants of existing commands - as part of a private
   extension. To avoid the risk of a clash with a future registered
   extension, the names of private extensions and commands defined by
   them SHOULD begin with "X".

   A server MUST NOT send different response codes to basic NNTP
   commands documented here or commands documented in registered
   extensions in response to the availability or use of a private
   extension.

8.1 Initial IANA registry

    The IANA's initial registry of NNTP service extensions consists of
   these entries:

   +-------------------------+--------------+--------------------------+
   | Extension               | Label        | Added behaviour          |
   +-------------------------+--------------+--------------------------+
   | Specific article        | LISTGROUP    | Defined in this document |
   | numbers                 |              |                          |
   |                         |              |                          |
   | Overview support        | OVER         | Defined in this document |
   |                         |              |                          |
   | Batched header          | HDR          | Defined in this document |
   | retrieval               |              |                          |
   +-------------------------+--------------+--------------------------+


8.2 Standard extensions

   Each of the following sections describes an extension that a server
   MAY provide. If the server provides the extension, it MUST include
   the appropriate extension label in the response to LIST EXTENSIONS.
   If it does not provide it, it MUST NOT include the appropriate
   extension label. The descriptions of facilities in each section are
   written as if the extension is provided. If it is not provided, the
   entire section should be ignored.

   The formal definitions of these extensions are provided in Appendix
   D.

   If the server provides an extension, it MUST implement all of the
   commands in the specification of the extension except for those
   marked as optional. If it does not provide an extension, it MUST NOT
   implement any of the commands in the specification of that extension.

8.3 The LISTGROUP extension

   This extension provides one command and has the extension label
   LISTGROUP.

8.3.1 LISTGROUP

8.3.1.1 Usage

   Syntax
      LISTGROUP [group]

   Responses
      211 number low high group   Article numbers follow (multiline)
      411                         No such newsgroup
      412                         No newsgroup selected [1]

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

   [1] The 412 response can only occur if no group has been specified.

8.3.1.2 Description

   The LISTGROUP command is used to get a listing of all the article
   numbers in a particular newsgroup.

   The optional argument is the name of the newsgroup to be selected
   (e.g. "news.software.misc"). A list of valid newsgroups may be
   obtained from the LIST ACTIVE command. If no group is specified, the
   current selected newsgroup is used.

   The list of article numbers is returned as a multi-line response
   following the 211 response code (the arguments on the initial
   response line are the same as for the GROUP command (see Section
   6.1.1). The list contains one number per line, is in numerical order,
   and lists precisely those articles that exist in the group.

   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 LISTGROUP command MAY be used by a client as a replacement for
   the GROUP command in establishing a valid current selected newsgroup
   and current article number.

   If the group specified is not available on the server, a 411 response
   MUST be returned. If no group is specified and the current selected
   newsgroup is invalid, a 412 response MUST be returned.

8.3.1.3 Examples

   Example of LISTGROUP on an empty group:

      [C] LISTGROUP   example.empty.newsgroup
      [S] 211 0 0 0 example.empty.newsgroup list follows
      [S] .

   Example of LISTGROUP on a valid current selected newsgroup:

      [C] GROUP   misc.test
      [S] 211 2000 3000234 3002322 misc.test
      [C] LISTGROUP
      [S] 211 2000 3000234 3002322 misc.test list follows
      [S] 3000234
      [S] 3000237
      [S] 3000238
      [S] 3000239
      [S] 3002322
      [S] .

   Example of LISTGROUP failing because no group has been selected:

      [Assumes current selected newsgroup is invalid.]
      [C] LISTGROUP
      [S] 412 no current group
      [C] GROUP   example.is.sob.bradner.or.barber
      [S] 411 no such group
      [C] LISTGROUP
      [S] 412 no current group


8.4 Article metadata

   The OVER and HDR extensions refer to the concept of "article
   metadata". This is data about articles that does not occur within the
   article itself. Each metadata item has a name which MUST begin with a
   colon (and which MUST NOT contain a colon elsewhere within it).

   When generating a metadata item, the server MUST compute it for
   itself and MUST NOT trust any related value provided in the article.
   (In particular, a Lines or Bytes header in the article MUST NOT be
   assumed to specify the correct number of lines or bytes in the
   article.)

   This specification defines two metadata items: ":bytes" and ":lines".
   Other metadata items may be defined by extensions. The names of
   metadata items defined by registered extensions MUST NOT begin with
   ":x-". To avoid the risk of a clash with a future registered
   extension, the names of metadata items defined by private extensions
   SHOULD begin with ":x-".

8.4.1 The :bytes metadata item

   The :bytes metadata item for an article is a decimal integer. It MUST
   equal the number of octets in the entire article - headers, body, and
   separating empty line - except that each CRLF pair MAY (but SHOULD
   NOT) be counted as a single octet.

8.4.2 The :lines metadata item

   The :lines metadata item for an article is a decimal integer. It MUST
   equal the number of lines in the article body (excluding the empty
   line separating headers and body); equivalently, it is two less than
   the number of CRLF pairs that the BODY command would return for that
   article (the extra two are those following the response code and the
   termination octet).

8.5 The OVER extension

   This extension provides two commands, OVER and LIST OVERVIEW.FMT. The
   label for this extension is OVER.

   The OVER extension provides access to the "overview database", which
   is a database of headers extracted from incoming articles. Only
   certain headers are included in the database. The database also
   includes some article metadata. The information stored in the
   database may change over time. If the database records the content or
   absence of a given field (that is, a header or metadata item) for all
   articles, it is said to be "consistent" for that field. If it records
   the content of a header for some articles but not for others that
   nevertheless included that header, or records a metadata item for
   some articles but not others to which that item applies, it is said
   to be "inconsistent" for that field.

   The LIST OVERVIEW.FMT command SHOULD list all the fields for which
   the database is consistent at that moment. It MAY omit such fields
   (for example if it is not known whether the database is consistent or
   inconsistent). It MUST NOT include fields for which the database is
   inconsistent or which are not stored in the database. Therefore if a
   header appears in the LIST OVERVIEW.FMT output but not the OVER
   output for a given article, that header does not appear in the
   article, and similarly for metadata items.

   These rules assume the fields being stored in the database remain
   constant for long periods of time, with the database therefore being
   consistent. When the set of fields to be stored is changed, it will
   be inconsistent until either the database is rebuilt or the only
   articles remaining are those received since the change. Therefore the
   output from LIST OVERVIEW.FMT needs to be altered twice: before any
   fields stop being stored, they MUST be removed from the output, then
   when the database is once more known to be consistent, the new fields
   SHOULD be added to the output.

   This extension is based on the Overview/NOV database [ROBE1995]
   developed by Geoff Collyer.

8.5.1 OVER

8.5.1.1 Usage

   Syntax
      OVER message-id
      OVER range
      OVER

   Responses

      First form (message-id specified)
         224   Overview information follows (multiline)
         430   No article with that message-id

      Second form (range specified)
         224   Overview information follows (multiline)
         412   No newsgroup selected
         423   No articles in that range

      Third form (current article number used)
         224   Overview information follows (multiline)
         412   No newsgroup selected
         420   Current article number is invalid

   Parameters
      range      = number(s) of articles
      message-id = message-id of article

8.5.1.2 Description

   The OVER command returns the contents of the headers and metadata in
   the database for an article specified by message-id, or from a
   specified article or range of articles in the current selected
   newsgroup.

   The message-id argument indicates a specific article. The range
   argument may be any of the following:

   o  an article number

   o  an article number followed by a dash to indicate all following

   o  an article number followed by a dash followed by another article
      number

   If neither is specified, the current article number is used.

   If the information is available, it is returned as a multi-line
   response following the 224 response code and contains one line per
   article, sorted in numerical order of article number (note that
   unless the argument is a range including a dash, there will only be
   one line but it will still be in multi-line format). Each line
   consists of a number of fields separated by a TAB. A field may be
   empty (in which case there will be two adjacent TABs), and a sequence
   of trailing TABs may be omitted.

   The first 8 fields MUST be the following, in order:

      "0" (first form) or article number (second form)
      Subject header content
      From header content
      Date header content
      Message-ID header content
      References header content
      :bytes metadata item
      :lines metadata item

   If the article is specified by message-id rather than by article
   range, the article number is given as "0".

   Any subsequent fields are the contents of the other headers and
   metadata held in the database.

   For the five mandatory headers, the content of each field MUST be
   based on the content of the header (that is, with the header name and
   following colon and space removed). If the article does not contain
   that header, or if the content is empty, the field MUST be empty. For
   the two mandatory metadata items, the content of the field MUST be
   just the value, with no other text.

   For all subsequent fields that contain headers, the content MUST be
   the entire header line other than the trailing CRLF. For all
   subsequent fields that contain metadata, the field consists of the
   metadata name, a single space, and then the value.

   For all fields, the value is processed by first removing all CRLF
   pairs (that is, undoing any folding and removing the terminating
   CRLF) and then replacing each TAB with a single space. If there is no
   such header in the article, or no such metadata item, or no header or
   item stored in the database for that article, the corresponding field
   MUST be empty.

   Note that, after unfolding, the characters NUL, LF, and CR cannot
   occur in the header of an article offered by a conformant server.
   Nevertheless, servers SHOULD check for these characters and replace
   each one by a single space (so that, for example, CR LF LF TAB will
   become two spaces, since the CR and first LF will be removed by the
   unfolding process). This will encourage robustness in the face of
   non-conforming data; it is also possible that future versions of this
   specification may permit these characters to appear in articles.

   The server SHOULD NOT produce output for articles that no longer
   exist.

   If the argument is a message-id and no such article exists, a 430
   response MUST be returned. If the argument is a range or is omitted
   and the current selected newsgroup is invalid, a 412 response MUST be
   returned. If the argument is a range and no articles in that number
   range 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.

8.5.1.3 Examples

   In the first three examples, TAB has been replaced by vertical bar
   and some lines have been folded for readability.

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

      [C] GROUP   misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] OVER
      [S] 224 Overview information follows
      [S] 300234|I am just a test article|"Demo User"
      <nobody@example.com>|6 Oct 1998 04:38:40 -0500|
      <45223423@example.com>|<45454@example.net>|1234|
      17|Xref: news.example.com misc.test:3000363
      [S] .

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

      [C] OVER   <45223423@example.com>
      [S] 224 Overview information follows
      [S] 0|I am just a test article|"Demo User"
      <nobody@example.com>|6 Oct 1998 04:38:40 -0500|
      <45223423@example.com>|<45454@example.net>|1234|
      17|Xref: news.example.com misc.test:3000363
      [S] .

   Note that the article number has been replaced by "0".

   Example of a successful retrieval of overview information for a range
   of articles:

      [C] GROUP   misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] OVER   3000234-3000240
      [S] 224 Overview information follows
      [S] 300234|I am just a test article|"Demo User"
      <nobody@example.com>|6 Oct 1998 04:38:40 -0500|
      <45223423@example.com>|<45454@example.net>|1234|
      17|Xref: news.example.com misc.test:3000363
      [S] 3000235|Another test article|nobody@nowhere.to
      (Demo User)|6 Oct 1998 04:38:45 -0500|<45223425@to.to>||
      4818|37||Distribution: fi
      [S] 3000238|Re: I am just a test article|somebody@elsewhere.to|
      7 Oct 1998 11:38:40 +1200|<kfwer3v@elsewhere.to>|
      <45223423@to.to>|9234|51
      [S] .

   Note the missing "References" and Xref headers in the second line,
   the missing trailing field(s) in the first and last lines, and that
   there are only results for those articles that still exist.

   Example of an unsuccessful retrieval of overview information on an
   article by number:

      [C] GROUP   misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] OVER   300256
      [S] 420 No such article in this group

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

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

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

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


8.5.2 LIST OVERVIEW.FMT

8.5.2.1 Usage

   This command is optional.

   Syntax
      LIST OVERVIEW.FMT

   Responses
      215   Information follows (multiline)

8.5.2.2 Description

   The LIST OVERVIEW.FMT command returns a description of the fields in
   the database for which it is consistent (as described above).

   If the information is available, it is returned as a multi-line
   response following the 215 response code. The information contains
   one line per field in the order they are returned by the OVER
   command; the first 7 lines MUST be exactly:

       Subject:
       From:
       Date:
       Message-ID:
       References:
       :bytes
       :lines

   except that, for compatibility with existing implementations, the
   last two lines MAY instead be:

       Bytes:
       Lines:

   even though they refer to metadata, not headers.

   All subsequent lines MUST consist of either a header name followed by
   ":full", or the name of a piece of metadata.

   There are no leading or trailing spaces in the output.

   Note that the 7 fixed lines describe the 2nd to 8th fields of the
   OVER output. The "full" suffix is a reminder that the corresponding
   fields include the header name.

   This command MAY generate different results if used more than once in
   a session.

8.5.2.3 Examples

   Example of LIST OVERVIEW.FMT output corresponding to the example OVER
   output above, using the preferred format:

      [C] LIST OVERVIEW.FMT
      [S] 215 Order of fields in overview database.
      [S] Subject:
      [S] From:
      [S] Date:
      [S] Message-ID:
      [S] References:
      [S] :bytes
      [S] :lines
      [S] Xref:full
      [S] Distribution:full
      [S] .

   Example of LIST OVERVIEW.FMT output corresponding to the example OVER
   output above, using the alternative format:

      [C] LIST OVERVIEW.FMT
      [S] 215 Order of fields in overview database.
      [S] Subject:
      [S] From:
      [S] Date:
      [S] Message-ID:
      [S] References:
      [S] Bytes:
      [S] Lines:
      [S] Xref:full
      [S] Distribution:full
      [S] .

   Example of LIST OVERVIEW.FMT returning an error where the command is
   recognised but the software does not maintain this information:

      [C] LIST OVERVIEW.FMT
      [S] 503 overview.fmt not available


8.6 The HDR extension

   This extension provides two new commands: HDR and LIST HEADERS. The
   label for this extension is HDR.

   The HDR extension provides access to specific headers and metadata
   items (collectively "fields") of articles or groups of articles. In
   the case of headers, an implementation MAY restrict the use of this
   extension to a specific list of headers or MAY allow it to be used
   with any header. In the latter case it MUST use the argument "ALL"
   following the extension label in the output of LIST EXTENSIONS; in
   the former case it MUST NOT use any argument.

   The HDR command may take information from a database rather than
   directly from the articles. If so, the same issues of consistency and
   inconsistency apply as with the OVER extension (Section 8.5) and the
   LIST HEADERS command SHOULD take the same approach as the LIST
   OVERVIEW.FMT command in resolving them.

8.6.1 HDR

8.6.1.1 Usage

   Syntax
      HDR header message-id
      HDR header range
      HDR header

   Responses

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

      Second form (range specified)
         225   Headers follow (multiline)
         412   No newsgroup selected
         423   No articles in that range

      Third form (current article number used)
         225   Headers follow (multiline)
         412   No newsgroup selected
         420   Current article number is invalid

   Parameters
      header     = name of header, without the colon
      range      = number(s) of articles
      message-id = message-id of article

8.6.1.2 Description

   The HDR command retrieves specific headers from an article specified
   by message-id, or from a specified article or range of articles in
   the current selected newsgroup. It can also return certain metadata
   about the article or articles.

   The required header argument is the name of a header (e.g. "subject")
   in an article, or the name of a metadata item, and is
   case-insensitive. Names of metadata items always begin with a colon.
   Except where stated otherwise, metadata items are treated as if they
   were header contents, and references to headers in this description
   apply equally to metadata items.

   The message-id argument indicates a specific article. The range
   argument may be any of the following:

   o  an article number

   o  an article number followed by a dash to indicate all following

   o  an article number followed by a dash followed by another article
      number

   If neither is specified, the current article number is used.

   If the information is available, it is returned as a multi-line
   response following the 225 response code and contains one line for
   each article where the relevant header line or metadata item exists
   (note that unless the argument is a range including a dash, there
   will be at most one line but it will still be in multi-line format).
   The line consists of the article number, a space, and then the
   contents of the header (without the header name or the colon and
   space that follow it) or metadata item. If the article is specified
   by message-id, the article number is given as "0".

   Header contents are modified as follows: all CRLF pairs are removed,
   and then each TAB is replaced with a single space (note that this is
   the same transformation as is performed by the OVER extension
   (Section 8.5.1.2), and the same comment concerning NUL, CR, and LF
   applies).

   The header content is in all cases taken from the article. This means
   that, for example, a request for the header "Lines" returns the
   contents of the "Lines" header of the specified articles, if any, not
   the line count metadata or any other server-generated value. If the
   header occurs in a given article multiple times, only the content of
   the first occurrence is returned by HDR.

   If the requested header is not present in the article or if it is
   present but empty, a line for that article is included in the output
   but the header content portion of the line is empty (the space after
   the article number MAY be retained or omitted). If any article number
   in the provided range does not exist in the group, no line for that
   article number is included in the output.

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

   A server MAY only allow HDR commands for a limited set of headers and
   metadata items. If so, it MUST respond with the generic 503 response
   to attempts to request other headers, rather than returning erroneous
   results such as a successful empty response.

   If HDR uses a separate database and it is inconsistent for the
   requested header or metadata item, the server MAY return what results
   it can or it MAY respond with the generic 503 response; in the latter
   case, the field MUST NOT appear in the output from LIST HEADERS.

8.6.1.3 Examples

   Example of a successful retrieval of subject lines from a range of
   articles (3000235 has no Subject header, and 3000236 is missing):

      [C] GROUP   misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] HDR   Subject 3000234-300238
      [S] 225 Headers follow
      [S] 3000234 I am just a test article
      [S] 3000235
      [S] 3000237 Re: I am just a test article
      [S] 3000238 Ditto
      [S] .

   Example of a successful retrieval of line counts from a range of
   articles:

      [C] GROUP   misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] HDR   :lines 3000234-300238
      [S] 225 Headers follow
      [S] 3000234 42
      [S] 3000235 5
      [S] 3000237 11
      [S] 3000238 2378
      [S] .

   Example of a successful retrieval of the subject line from an article
   by message-id:

      [C] GROUP   misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] HDR   subject <i.am.a.test.article@example.com>
      [S] 225 Header information follows
      [S] 0 I am just a test article
      [S] .

   Example of a successful retrieval of the subject line from the
   current article:

      [C] GROUP   misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] HDR   subject
      [S] 225 Header information follows
      [S] 3000234 I am just a test article
      [S] .

   Example of an unsuccessful retrieval of a header from an article by
   message-id:

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

   Example of an unsuccessful retrieval of headers from articles by
   number because no newsgroup was selected first:

      [Assumes current selected newsgroup is invalid.]
      [C] HDR   subject 300256-
      [S] 412 No newsgroup selected

   Example of an unsuccessful retrieval of headers because the current
   selected newsgroup is empty:

      [C] GROUP   example.empty.newsgroup
      [S] 211 0 0 0 example.empty.newsgroup
      [C] HDR   subject 1-
      [S] 423 No articles in that range

   Example of an unsuccessful retrieval of headers because the server
   does not allow HDR commands for that header:

      [C] GROUP   misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] HDR   Content-Type 3000234-300238
      [S] 503 HDR not permitted on Content-Type


8.6.2 LIST HEADERS

8.6.2.1 Usage

   Syntax
      LIST HEADERS

   Responses
      215   Header and metadata list follows (multiline)

8.6.2.2 Description

   The LIST HEADERS command returns a list of headers and metadata items
   that may be retrieved using the HDR command.

   The information is returned as a multi-line response following the
   215 response code and contains one line for each header or metadata
   item name (excluding the colon in the former case). If the
   implementation allows any header to be retrieved (also indicated by
   the "ALL" argument to the extension label) it MUST NOT include any
   header names in the list but MUST include the special entry ":" (a
   single colon on its own); it MUST still list any metadata items that
   are available. The order of items in the list is not significant; the
   server need not even consistently return the same order. The list MAY
   be empty (though in this circumstance there is little point in
   providing the extension).

   An implementation that also supports the OVER extension SHOULD at
   least permit all the headers and metadata items listed in the output
   from the LIST OVERVIEW.FMT command.

8.6.2.3 Examples

   Example of an implementation providing access to only a few headers:

      [C] LIST EXTENSIONS
      [S] 202 extensions supported:
      [S] HDR
      [S] .
      [C] LIST HEADERS
      [S] 215 headers supported:
      [S] Subject
      [S] Message-ID
      [S] Xref
      [S] .

   Example of an implementation providing access to the same fields as
   the first example in Section 8.5.2.3:

      [C] LIST EXTENSIONS
      [S] 202 extensions supported:
      [S] OVER
      [S] HDR
      [S] .
      [C] LIST HEADERS
      [S] 215 headers and metadata items supported:
      [S] Date
      [S] Distribution
      [S] From
      [S] Message-ID
      [S] References
      [S] Subject
      [S] Xref
      [S] :bytes
      [S] :lines
      [S] .

   Example of an implementation providing access to all headers:

      [C] LIST EXTENSIONS
      [S] 202 extensions supported:
      [S] HDR ALL
      [S] .
      [C] LIST HEADERS
      [S] 215 metadata items supported:
      [S] :
      [S] :lines
      [S] :bytes
      [S] :x-article-number
      [S] .


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/>
Re: New NNTP draft -- Section 8
#66976
Author: Andrew - Supernews
Date: Mon, 27 Oct 2003 10:54
168 lines
7865 bytes
In article <87r80ze9fq.fsf@windlord.stanford.edu>, Russ Allbery wrote:
> 8.4.1 The :bytes metadata item
> 
>    The :bytes metadata item for an article is a decimal integer. It MUST
>    equal the number of octets in the entire article - headers, body, and
>    separating empty line - except that each CRLF pair MAY (but SHOULD
>    NOT) be counted as a single octet.

shouldn't there be an explicit comment in here about accuracy (or rather
the lack thereof)? While it's semi-implied by the ambiguity over CRLF, it
should be explicitly stated somewhere.

Something like:

    The :bytes metadata item for an article is a decimal integer
    representing the number of octets in the entire article - headers, body,
    and separating empty line.

    The :bytes value may differ from the actual number of octets returned
    in response to an ARTICLE command (and, moreover, the number of octets
    returned by ARTICLE may in some cases vary between calls. Accordingly
    clients MUST NOT rely on the accuracy of this value. The following
    variations may be observed:

      - the :bytes value may (but SHOULD NOT) count CRLF pairs as a single
        octet (this provision is only intended for historical compatibility,
        servers SHOULD treat CRLF pairs as two octets)

      - the :bytes value MAY (or may not) include inserted dot-stuffing '.'
        octets, and MAY (or may not) include the final '.' CRLF response
        terminator

      - the server may have at its disposal multiple copies of an article
        which vary in ways permitted according to the applicable article
        format specification. The :bytes value may have been taken from a
        different copy of the article to the one actually returned.

> 8.5 The OVER extension
> 
>    This extension provides two commands, OVER and LIST OVERVIEW.FMT. The
>    label for this extension is OVER.
> 
>    The OVER extension provides access to the "overview database", which
>    is a database of headers extracted from incoming articles. Only
>    certain headers are included in the database. The database also
>    includes some article metadata. The information stored in the
>    database may change over time. If the database records the content or
>    absence of a given field (that is, a header or metadata item) for all
>    articles, it is said to be "consistent" for that field. If it records
>    the content of a header for some articles but not for others that
>    nevertheless included that header, or records a metadata item for
>    some articles but not others to which that item applies, it is said
>    to be "inconsistent" for that field.
> 
>    The LIST OVERVIEW.FMT command SHOULD list all the fields for which
>    the database is consistent at that moment. It MAY omit such fields
>    (for example if it is not known whether the database is consistent or
>    inconsistent). It MUST NOT include fields for which the database is
>    inconsistent or which are not stored in the database. Therefore if a
>    header appears in the LIST OVERVIEW.FMT output but not the OVER
>    output for a given article, that header does not appear in the
>    article, and similarly for metadata items.

We presently return a fixed response for LIST OVERVIEW.FMT, listing only the
7 standard fields and Xref:full. All these fields are, given the server
design, "consistent" (as defined above).

Although our "overview database" stores other values too, we do not return
them in response to OVER (or XOVER) commands. This is mainly to avoid
bloating the amount of data transferred with information that only a small
subset of clients want to see.

> 8.5.1 OVER
> 
> 8.5.1.1 Usage
> 
>    Syntax
>       OVER message-id

When did this creep back in?

Essentially every major server design in use treats the overview database as
an article index by group, and has no way to retrieve precomputed overview
entries by message-id. The obvious approach of implementing (in the server)
the equivalent of HEAD <id> plus conversion to overview format fails badly
on some server designs where the Xref: field is not accessible in such cases.

Needless to say we don't support it (and never will; the solution for
NEWNEWS-type clients is to provide an extension to NEWNEWS itself that
returns additional requested overview fields _along with_ the message-ids;
this can be done efficiently, whereas handling a huge stream of OVER <id>
requests from a client can not).

> 8.6 The HDR extension
> 
>    This extension provides two new commands: HDR and LIST HEADERS. The
>    label for this extension is HDR.

we don't support LIST HEADERS yet, but it's trivial enough to fix that.

> 8.6.1 HDR
> 
> 8.6.1.1 Usage
> 
>    Syntax
>       HDR header message-id

Some existing designs won't be able to support HDR Xref <id> without rather
extreme contortions in the server (see comments for OVER <id>). Also,
HDR :lines <id> may be problematic.

> 8.6.2 LIST HEADERS
> 
> 8.6.2.1 Usage
> 
>    Syntax
>       LIST HEADERS
> 
>    Responses
>       215   Header and metadata list follows (multiline)
> 
> 8.6.2.2 Description
> 
>    The LIST HEADERS command returns a list of headers and metadata items
>    that may be retrieved using the HDR command.
> 
>    The information is returned as a multi-line response following the
>    215 response code and contains one line for each header or metadata
>    item name (excluding the colon in the former case). If the
>    implementation allows any header to be retrieved (also indicated by
>    the "ALL" argument to the extension label) it MUST NOT include any
>    header names in the list but MUST include the special entry ":" (a
>    single colon on its own); it MUST still list any metadata items that
>    are available. The order of items in the list is not significant; the
>    server need not even consistently return the same order. The list MAY
>    be empty (though in this circumstance there is little point in
>    providing the extension).
> 
>    An implementation that also supports the OVER extension SHOULD at
>    least permit all the headers and metadata items listed in the output
>    from the LIST OVERVIEW.FMT command.

ok. So if I'm reading this right, our server should return something like
this for LIST HEADERS:

215 list follows
Subject
From
Date
Message-ID
References
Xref
Followup-To
Content-Type
Content-Transfer-Encoding
NNTP-Posting-Host
X-Trace
:bytes
:lines
..

(In future we are likely to move to supporting all headers, but that's
contingent on a number of changes to the way the data is stored to avoid
serious problems with overhead on the common OVER case.)

-- 
Andrew, Supernews
http://www.supernews.com - individual and corporate NNTP services
Re: New NNTP draft -- Section 8
#68429
Author: Russ Allbery
Date: Thu, 04 Mar 2004 21:27
96 lines
5128 bytes
Andrew - Supernews <andrew+nonews@supernews.com> writes:
> In article <87r80ze9fq.fsf@windlord.stanford.edu>, Russ Allbery wrote:

>> 8.4.1 The :bytes metadata item
>> 
>>    The :bytes metadata item for an article is a decimal integer. It MUST
>>    equal the number of octets in the entire article - headers, body, and
>>    separating empty line - except that each CRLF pair MAY (but SHOULD
>>    NOT) be counted as a single octet.

> shouldn't there be an explicit comment in here about accuracy (or rather
> the lack thereof)? While it's semi-implied by the ambiguity over CRLF,
> it should be explicitly stated somewhere.

There was much discussion of this point on the NNTP list since Andrew
posted about this, and the wording has been changed in the current draft.
About :bytes, it now says:

8.4.1 The :bytes metadata item

   The :bytes metadata item for an article is a decimal integer. It
   SHOULD equal the number of octets in the entire article - headers,
   body, and separating empty line (counting a CRLF pair as two octets,
   and not including either the "." CRLF terminating the response nor
   any "." added for "byte-stuffing" purposes).

   Note to client implementers: some existing servers return a value
   different to that above. The commonest reasons for this are:

   o  counting a CRLF pair as one octet;

   o  including the "." character used for byte-stuffing in the number;

   o  including the terminating "." CRLF in the number;

   o  using one copy of an article for counting the octets but then
      returning another one that differs in some (permitted) manner.

   Implementations should be prepared for such variation and MUST NOT
   rely on the value being accurate.

I think this will resolve Andrew's issue.  Please follow up here if you
feel this is the wrong approach to take for the bytes value in overview.

>> 8.5.1 OVER
>> 
>> 8.5.1.1 Usage
>> 
>>    Syntax
>>       OVER message-id

> When did this creep back in?

> Essentially every major server design in use treats the overview
> database as an article index by group, and has no way to retrieve
> precomputed overview entries by message-id. The obvious approach of
> implementing (in the server) the equivalent of HEAD <id> plus conversion
> to overview format fails badly on some server designs where the Xref:
> field is not accessible in such cases.

> Needless to say we don't support it (and never will; the solution for
> NEWNEWS-type clients is to provide an extension to NEWNEWS itself that
> returns additional requested overview fields _along with_ the
> message-ids; this can be done efficiently, whereas handling a huge
> stream of OVER <id> requests from a client can not).

OVER with a message ID is now optional, and the draft explains the error
code to return if it's not supported by the server:

   Support for the first (message-id) form is optional. If it is not
   supported, the generic response code 503 MUST be returned.

>> 8.6.1 HDR
>> 
>> 8.6.1.1 Usage
>> 
>>    Syntax
>>       HDR header message-id

> Some existing designs won't be able to support HDR Xref <id> without rather
> extreme contortions in the server (see comments for OVER <id>). Also,
> HDR :lines <id> may be problematic.

The LIST HEADERS command now takes an optional parameter that requests
information about what headers are available by message ID rather than by
article number.  Those two lists are permitted to differ.

We're heading into last call on the draft starting early next week.  I'll
post the URL for the new I-D when we go to internal last call.  IETF-wide
last call will start two weeks after that.

-- 
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 8
#68482
Author: Clive D. W. Feather
Date: Tue, 09 Mar 2004 10:06
26 lines
2150 bytes
In article <87hdx4cnfl.fsf@windlord.stanford.edu>, Russ Allbery 
<rra@stanford.edu> writes
>>>    Syntax
>>>       OVER message-id
>
>> When did this creep back in?
[...]
>OVER with a message ID is now optional, and the draft explains the error
>code to return if it's not supported by the server:
>
>   Support for the first (message-id) form is optional. If it is not
>   supported, the generic response code 503 MUST be returned.

Furthermore, LIST EXTENSIONS is now required to return:

     OVER MSGID         if it is supported
     OVER               if it is not supported

in its output.

-- 
Clive D.W. Feather, writing for himself  | Home: <clive@davros.org>
Tel: +44 20 8495 6138 (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
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