.\" automatically generated by xml2rfc v1.25 on 30 Dec 2004 16:36:34 +0000
.\" 
.pl 10.0i
.po 0
.ll 7.2i
.lt 7.2i
.nr LL 7.2i
.nr LT 7.2i
.ds LF Feather
.ds RF FORMFEED[Page %]
.ds CF Expires June 30, 2005
.ds LH Internet-Draft
.ds RH December 2004
.ds CH Network News Transfer Protocol
.hy 0
.nh
.ad l
.nf
NNTP                                                          C. Feather
\%Internet-Draft                                                  Thus plc
Expires: June 30, 2005                                 December 30, 2004


.ce
Network News Transfer Protocol
.ce
\%draft-ietf-nntpext-base-25

.in 3
.ti 0
Status of this Memo

.fi
This document is an \%Internet-Draft and is subject to all provisions
of section 3 of RFC 3667.  By submitting this \%Internet-Draft, each
author represents that any applicable patent or other IPR claims of
which he or she is aware have been or will be disclosed, and any of
which he or she become aware will be disclosed, in accordance with
RFC 3668.

\%Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups.  Note that
other groups may also distribute working documents as
\%Internet-Drafts.

\%Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any
time.  It is inappropriate to use \%Internet-Drafts as reference
material or to cite them other than as "work in progress."

The list of current \%Internet-Drafts can be accessed at
\%http://www.ietf.org/ietf/1id-abstracts.txt.

The list of \%Internet-Draft Shadow Directories can be accessed at
http://www.ietf.org/shadow.html.

This \%Internet-Draft will expire on June 30, 2005.

.ti 0
Copyright Notice

Copyright (C) The Internet Society (2004).

.ti 0
Abstract

The Network News Transfer Protocol (NNTP) has been in use in the
Internet for a decade and remains one of the most popular protocols
(by volume) in use today.  This document is a replacement for RFC 977
and officially updates the protocol specification.  It clarifies some
vagueness in RFC 977, includes some new base functionality, and
provides a specific mechanism to add standardized extensions to NNTP.
.bp
.ti 0
Administration

This document is a product of the NNTP Working Group, chaired by Russ
Allbery and Ned Freed.

This is draft 25 \%pre-publication version 5.

.ti 0
Outstanding issues

OUTSTANDING ISSUE
.in 6
.ti 6
[2500] Outstanding substantive (as opposed to editorial) issues
in the text are shown thus.  Each is given a number for convenient
reference (this \%meta-issue is number 2500); these numbers have no
intrinsic meaning.
.in 3

.ti 0
Author\'s Note

This document is written in XML using an \%NNTP-specific DTD.  Custom
software is used to convert this to RFC 2629 [RFC2629] format, and
then the public "xml2rfc" package to further reduce this to text,
nroff source, and HTML.

No perl was used in producing this document.

.ti 0
Rights

UNIX is a registered trademark of The Open Group.
.bp
.in 0
Table of Contents

.nf
   1.  Introduction . . . . . . . . . . . . . . . . . . . . . . . .    6
   2.  Notation . . . . . . . . . . . . . . . . . . . . . . . . . .    7
   3.  Basic Concepts . . . . . . . . . . . . . . . . . . . . . . .    9
     3.1   Commands and Responses . . . . . . . . . . . . . . . . .    9
     3.2   Response Codes . . . . . . . . . . . . . . . . . . . . .   11
       3.2.1   Generic Response Codes . . . . . . . . . . . . . . .   12
         3.2.1.1   Examples . . . . . . . . . . . . . . . . . . . .   14
     3.3   Reading and Transit Servers  . . . . . . . . . . . . . .   16
     3.4   Pipelining . . . . . . . . . . . . . . . . . . . . . . .   17
       3.4.1   Examples . . . . . . . . . . . . . . . . . . . . . .   18
     3.5   Articles . . . . . . . . . . . . . . . . . . . . . . . .   18
     3.6   Capabilities and Extensions  . . . . . . . . . . . . . .   20
       3.6.1   Capability descriptions  . . . . . . . . . . . . . .   20
       3.6.2   Standard capabilities  . . . . . . . . . . . . . . .   21
       3.6.3   Capability modifiers . . . . . . . . . . . . . . . .   22
       3.6.4   Extensions . . . . . . . . . . . . . . . . . . . . .   23
       3.6.5   Initial IANA register  . . . . . . . . . . . . . . .   24
   4.  The WILDMAT format . . . . . . . . . . . . . . . . . . . . .   27
     4.1   Wildmat syntax . . . . . . . . . . . . . . . . . . . . .   27
     4.2   Wildmat semantics  . . . . . . . . . . . . . . . . . . .   27
     4.3   Extensions . . . . . . . . . . . . . . . . . . . . . . .   28
     4.4   Examples . . . . . . . . . . . . . . . . . . . . . . . .   29
   5.  Session administration commands  . . . . . . . . . . . . . .   30
     5.1   Initial Connection . . . . . . . . . . . . . . . . . . .   30
     5.2   CAPABILITIES . . . . . . . . . . . . . . . . . . . . . .   31
     5.3   MODE READER  . . . . . . . . . . . . . . . . . . . . . .   34
     5.4   QUIT . . . . . . . . . . . . . . . . . . . . . . . . . .   36
   6.  Article posting and retrieval  . . . . . . . . . . . . . . .   38
     6.1   Group and article selection  . . . . . . . . . . . . . .   38
       6.1.1   GROUP  . . . . . . . . . . . . . . . . . . . . . . .   38
       6.1.2   LAST . . . . . . . . . . . . . . . . . . . . . . . .   41
       6.1.3   NEXT . . . . . . . . . . . . . . . . . . . . . . . .   42
     6.2   Retrieval of articles and article sections . . . . . . .   43
       6.2.1   ARTICLE  . . . . . . . . . . . . . . . . . . . . . .   44
       6.2.2   HEAD . . . . . . . . . . . . . . . . . . . . . . . .   47
       6.2.3   BODY . . . . . . . . . . . . . . . . . . . . . . . .   48
       6.2.4   STAT . . . . . . . . . . . . . . . . . . . . . . . .   50
     6.3   Article posting  . . . . . . . . . . . . . . . . . . . .   52
       6.3.1   POST . . . . . . . . . . . . . . . . . . . . . . . .   52
       6.3.2   IHAVE  . . . . . . . . . . . . . . . . . . . . . . .   54
   7.  Information commands . . . . . . . . . . . . . . . . . . . .   58
     7.1   DATE . . . . . . . . . . . . . . . . . . . . . . . . . .   58
     7.2   HELP . . . . . . . . . . . . . . . . . . . . . . . . . .   58
     7.3   NEWGROUPS  . . . . . . . . . . . . . . . . . . . . . . .   59
     7.4   NEWNEWS  . . . . . . . . . . . . . . . . . . . . . . . .   60
     7.5   Time . . . . . . . . . . . . . . . . . . . . . . . . . .   61
.bp
       7.5.1   Examples . . . . . . . . . . . . . . . . . . . . . .   62
     7.6   The LIST commands  . . . . . . . . . . . . . . . . . . .   62
       7.6.1   LIST . . . . . . . . . . . . . . . . . . . . . . . .   63
       7.6.2   Standard LIST keywords . . . . . . . . . . . . . . .   65
       7.6.3   LIST ACTIVE  . . . . . . . . . . . . . . . . . . . .   65
       7.6.4   LIST ACTIVE.TIMES  . . . . . . . . . . . . . . . . .   67
       7.6.5   LIST DISTRIB.PATS  . . . . . . . . . . . . . . . . .   67
       7.6.6   LIST NEWSGROUPS  . . . . . . . . . . . . . . . . . .   68
   8.  Standard extensions  . . . . . . . . . . . . . . . . . . . .   70
     8.1   The LISTGROUP extension  . . . . . . . . . . . . . . . .   70
       8.1.1   LISTGROUP  . . . . . . . . . . . . . . . . . . . . .   70
     8.2   Article metadata . . . . . . . . . . . . . . . . . . . .   72
       8.2.1   The :bytes metadata item . . . . . . . . . . . . . .   72
       8.2.2   The :lines metadata item . . . . . . . . . . . . . .   73
     8.3   The OVER extension . . . . . . . . . . . . . . . . . . .   73
       8.3.1   OVER . . . . . . . . . . . . . . . . . . . . . . . .   74
       8.3.2   LIST OVERVIEW.FMT  . . . . . . . . . . . . . . . . .   78
     8.4   The HDR extension  . . . . . . . . . . . . . . . . . . .   79
       8.4.1   HDR  . . . . . . . . . . . . . . . . . . . . . . . .   80
       8.4.2   LIST HEADERS . . . . . . . . . . . . . . . . . . . .   84
   9.  Deprecated commands  . . . . . . . . . . . . . . . . . . . .   87
   10.   Augmented BNF Syntax for NNTP  . . . . . . . . . . . . . .   88
     10.1  Commands . . . . . . . . . . . . . . . . . . . . . . . .   88
     10.2  Command continuation . . . . . . . . . . . . . . . . . .   90
     10.3  Responses  . . . . . . . . . . . . . . . . . . . . . . .   90
       10.3.1  Generic responses  . . . . . . . . . . . . . . . . .   90
       10.3.2  Initial response line contents . . . . . . . . . . .   91
       10.3.3  \%Multi-line response contents . . . . . . . . . . . .   92
     10.4  Capability lines . . . . . . . . . . . . . . . . . . . .   93
     10.5  LIST variants  . . . . . . . . . . . . . . . . . . . . .   93
     10.6  Articles . . . . . . . . . . . . . . . . . . . . . . . .   95
     10.7  General \%non-terminals  . . . . . . . . . . . . . . . . .   95
   11.   IANA Considerations  . . . . . . . . . . . . . . . . . . .   97
   12.   Security Considerations  . . . . . . . . . . . . . . . . .   98
     12.1  Personal and Proprietary Information . . . . . . . . . .   98
     12.2  Abuse of Server Log Information  . . . . . . . . . . . .   98
     12.3  Weak Authentication and Access Control . . . . . . . . .   98
     12.4  DNS Spoofing . . . . . . . . . . . . . . . . . . . . . .   99
     12.5  \%UTF-8 issues . . . . . . . . . . . . . . . . . . . . . .   99
     12.6  Caching of capability lists  . . . . . . . . . . . . . .  100
   13.   Acknowledgements . . . . . . . . . . . . . . . . . . . . .  102
   14.   References . . . . . . . . . . . . . . . . . . . . . . . .  104
   14.1  Normative References . . . . . . . . . . . . . . . . . . .  104
   14.2  Informative References . . . . . . . . . . . . . . . . . .  104
       Author\'s Address . . . . . . . . . . . . . . . . . . . . . .  105
   A.  Interaction with other specifications  . . . . . . . . . . .  106
     A.1   Header folding . . . . . . . . . . . . . . . . . . . . .  106
     A.2   \%Message-IDs  . . . . . . . . . . . . . . . . . . . . . .  106
.bp
     A.3   Article posting  . . . . . . . . . . . . . . . . . . . .  107
   B.  Summary of Response Codes  . . . . . . . . . . . . . . . . .  109
   C.  Formal specification of the standard extensions  . . . . . .  113
     C.1   The LISTGROUP extension  . . . . . . . . . . . . . . . .  113
     C.2   The OVER extension . . . . . . . . . . . . . . . . . . .  113
     C.3   The HDR extension  . . . . . . . . . . . . . . . . . . .  114
       Intellectual Property and Copyright Statements . . . . . . .  115
.bp
.fi
.in 4
.ti 0
1.  Introduction
.in 3

This document specifies the Network News Transfer 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.  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 [RFC3629] instead of \%US-ASCII [ANSI1986] (note that \%US-ASCII
is a subset of \%UTF-8).  It now requires all articles to have a
\%message-id, eliminating the "<0>" placeholder used in RFC 977 in some
responses.  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.
.bp
.in 4
.ti 0
2.  Notation
.in 3

The following notational conventions are used in this document.
.nf

  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).

.fi
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.5,
including the angle brackets.

The name "wildmat" for an 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
%x00, %x09, %x0A, %x0D, and %x20 respectively (that is, the octets
with those codes in \%US-ASCII [ANSI1986] and thus \%UTF-8 [RFC3629]). 
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.  Quoted characters refer to the
octets with those codes in \%US-ASCII (so "." and "<" refer to %x2E and
%x3C) and will always be printable \%US-ASCII characters; similarly,
"digit" refers to the octets \%%x30-39.

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.  Examples may use commands (or other names) not defined in
this specification (such as an XENCRYPT command).  These will be used
to illustrate some point and do not imply that any such command is
.bp
defined elsewhere or needs to exist in any particular implementation.

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.
.bp
.in 4
.ti 0
3.  Basic Concepts
.in 3

.in 5
.ti 0
3.1  Commands and Responses
.in 3

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 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 [RFC3629].  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 only of
\%US-ASCII letters, digits, and the characters dot (".") and dash
\%("-"), and must begin with a letter.  Keywords MUST be at least three
characters and MUST NOT exceed 12 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.  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.

The term "character" means a single Unicode code point and
implementations are not required to carry out normalisation.  Thus
U+0084 \%(A-dieresis) is one character while U+0041 U+0308 (A composed
with dieresis) is two; the two need not be treated as equivalent.

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-
.bp
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 in the standard extensions (see Section 8), but for
certain commands MAY provide "stub" implementations that simply
return an error (see Section 3.3 for further details).

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:
.in 7
.ti 3
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.
.ti 3
2.  The first such line contains the response code as with a single
line response.
.ti 3
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.
.ti 3
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).
.ti 3
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. 
.ti 3
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).
.in 3

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 (that is, they violate the MUST
requirement above).  However, except when stated otherwise, this
specification does not require the content to be \%UTF-8 and therefore
it MAY include octets above and below 128 mixed arbitrarily.

.bp
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.

.in 5
.ti 0
3.2  Response Codes
.in 3

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:
.in 6
.ti 6
1xx \%- Informative message.
.br
2xx \%- Command completed OK.
.br
3xx \%- Command OK so far; send the rest of it.
.br
4xx \%- Command was syntactically correct but failed for some
reason.
.br
5xx \%- Command unknown, unsupported, unavailable, or syntax error. 
.in 3

The next digit in the code indicates the function response category:
.in 6
.ti 6
x0x \%- Connection, \%set-up, and miscellaneous messages
.br
x1x \%- Newsgroup selection
.br
x2x \%- Article selection
.br
x3x \%- Distribution functions
.br
x4x \%- Posting
.br
x8x \%- Reserved for authentication and privacy extensions
.br
x9x \%- Reserved for private use \%(non-standard extensions)
.in 3

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 that the response may be
\%multi-line or not depending on the command (GROUP or LISTGROUP) that
.bp
generated it.  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 registered extension (see Section
3.6.4) 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.)

.in 7
.ti 0
3.2.1  Generic Response Codes
.in 3

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
.bp
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.

As a special case, if an argument is required to be a \%base64-encoded
string [RFC3548] (there are no such arguments in this specification,
but there may be in extensions) and is not validly encoded, the
response code 504 MUST be returned.

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 recognizes 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.4.1) for an
example), the response code 503 MUST be returned.

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.
.in 6
.ti 3
502: it is necessary to terminate the connection and start a new one
with the appropriate authority before the command can be used.  On
a \%mode-switching server in \%transit-only mode (see Section 3.3),
this response MAY also indicate that the client needs to change
the mode using the MODE READER (Section 5.3) command.  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 command.
.ti 3
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 on this connection.  This will involve the
use of an authentication extension such as \%[NNTP-AUTH].
.ti 3
483: the client must negotiate appropriate privacy protection on the
connection.  This will involve the use of a privacy extension such
as \%[NNTP-TLS].
.bp
.ti 3
401: the client must change the state of the connection in some other
manner.  The first argument of the response MUST be the capability
label (see Section 5.2) of the facility (usually an extension,
which may be a private extension) that provides the necessary
mechanism.
.in 3

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.  Following a 400 response,
clients SHOULD NOT simply reconnect immediately and retry the same
actions.  Rather, a client SHOULD either use an exponentially
increasing delay between retries (e.g.  double the waiting time after
each 400 response) or present any associated text to the user for
them to decide whether and when to retry.

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).

.in 9
.ti 0
3.2.1.1  Examples
.in 3

Example of an unknown command:
.in 6
.ti 6
[C] MAIL
.br
[S] 500 Unknown command
.in 3

Example of an unsupported extension:
.in 6
.ti 6
[C] CAPABILITIES
.br
[S] 101 Capability list:
.br
[S] VERSION 2
.br
[S] READER
.br
[S] LIST ACTIVE NEWSGROUPS
.br
[S] LISTGROUP
.br
[S] .
.br
[C] OVER
.br
[S] 500 Unknown command
.in 3

Example of an unsupported variant:
.in 6
.ti 6
[C] MODE POSTER
.br
[S] 501 Unknown MODE option
.in 3

Example of a syntax error:
.in 6
.ti 6
[C] ARTICLE   a.message.id@no.angle.brackets
.br
[S] 501 Syntax error
.in 3

Example of an overlong command line:
.in 6
.ti 6
[C] HEAD   53 54 55
.br
[S] 501 Too many arguments
.in 3

.bp
Example of a bad wildmat:
.in 6
.ti 6
[C] LIST ACTIVE   u[ks].*
.br
[S] 501 Syntax error
.in 3

Example of a \%base64-encoding error (the second argument is meant to
be \%base64-encoded):
.in 6
.ti 6
[C] XENCRYPT   RSA abcd=efg
.br
[S] 504 Base64 encoding error
.in 3

Example of an attempt to access a facility not available to this
connection:
.in 6
.ti 6
[C] MODE READER
.br
[S] 200 Reader mode, posting permitted
.br
[C] IHAVE   <i.am.an.article.you.will.want@example.com>
.br
[S] 502 Permission denied
.in 3

Example of an attempt to access a facility requiring authentication:
.in 6
.ti 6
[C] GROUP   secret.group
.br
[S] 480 Permission denied
.in 3
followed by a successful attempt following such authentication:
.in 6
.ti 6
[C] XSECRET   fred flintstone
.br
[S] 290 Password for fred accepted
.br
[C] GROUP   secret.group
.br
[S] 211 5 1 20 secret.group selected
.in 3

Example of an attempt to access a facility requiring privacy:
.in 6
.ti 6
[C] GROUP   secret.group
.br
[S] 483 Secure connection required
.br
[C] XENCRYPT
.br
[Client and server negotiate encryption on the link]
.br
[S] 283 Encrypted link established
.br
[C] GROUP   secret.group
.br
[S] 211 5 1 20 secret.group selected
.in 3

Example of a need to change mode before using a facility:
.in 6
.ti 6
[C] GROUP   binary.group
.br
[S] 401 XHOST Not on this virtual host
.br
[C] XHOST   binary.news.example.org
.br
[S] 290 binary.news.example.org virtual host selected
.br
[C] GROUP   binary.group
.br
[S] 211 5 1 77 binary.group selected
.in 3

Example of a temporary failure:
.in 6
.ti 6
[C] GROUP   archive.local
.br
[S] 403 Archive server temporarily offline
.in 3

Example of the server needing to close down immediately:
.bp
.in 6
.ti 6
[C] ARTICLE   123
.br
[S] 400 Power supply failed, running on UPS
.br
[Server closes connection.]
.in 3

.in 5
.ti 0
3.3  Reading and Transit Servers
.in 3

NNTP is traditionally used in two different ways.  The first use is
"reading", where the client fetches articles from a large store
maintained by the server for immediate or later presentation to a
user, and sends articles created by that user back to the server (an
action called "posting") to be stored and distributed to other stores
and users.  The second use is for the bulk transfer of articles from
one store to another.  Since the hosts doing this transfer tend to be
peers in a network that transmit articles among one another, rather
than \%end-user systems, this process is called "peering" or "transit"
(even so, one host is still the client and the other is the server). 

In practice these two uses are so different that some server
implementations are optimised for reading or for transit and, as a
result, do not offer the other facility.  Other implementations are
more general and offer both.  This specification permits all three
cases.

The specific description of each command will describe it as a
"transit command", a "reader command", or a "general command".  An
NNTP server may be \%"transit-only", \%"reader-only", or \%"general-use".
.in 6
.ti 3
o  A \%general-use server MUST fully implement all the commands in this
specification.
.ti 3
o  All servers MUST recognise all the commands in this specification
(and so MUST NOT return a 500 response code for them).
.ti 3
o  All servers MUST fully implement all general commands.
.ti 3
o  A \%transit-only server MUST fully implement all transit commands,
but does not need to implement reader commands.
.ti 3
o  A \%reader-only server MUST fully implement all reader commands, but
does not need to implement transit commands.
.in 3
For this purpose, "commands in this specification" includes the
commands in any extensions that the server supports (except where the
command is optional) but not those in Section 8 where the server does
not support the relevant extension.

Where a \%transit-only or \%reader-only server does not implement a
reader or transit command, it MUST always generate a 502 generic
response code.  Otherwise the command must be fully implemented as
specified; a server MUST NOT only partially implement any of the
commands in this specification.

Note: some commands have variants that require other commands to be
used first.  If the former command is implemented but the latter is
.bp
not, the former MUST still generate the relevant specific response
code and not the 502 generic code.  For example, if ARTICLE (Section
6.2.1) is implemented but GROUP (Section 6.1.1) is not, the correct
response to "ARTICLE 1234" remains 412.

OUTSTANDING ISSUE
.in 6
.ti 6
[2503] The following paragraph will be deleted if we decide
that we don\'t want a meaningful MODE READER.
.in 3

A server may also be a \%"mode-switching" server.  In this case,
following the initial connection it will behave as a \%transit-only
server.  However, if the client issues a MODE READER command, a
\%mode-switching server MUST cease being a \%transit-only server and
become a \%reader-only server or a \%general-use server; the list of
commands that the server implements will be different in each of the
two modes.  The server MUST generate a 502 generic response code for
any command it does not implement in the current mode.  Servers
SHOULD NOT be \%mode-switching.

A server MAY provide different modes of behaviour \%(transit-only,
\%reader-only, \%general-use, or \%mode-switching) to different client
connections and MAY use external information, such as the IP address
of the client, to determine which mode to provide to any given
connection.

The official TCP port for the NNTP service is 119.  However, if a
host wishes to offer separate \%transit-only  and \%reader-only servers,
port 433 SHOULD be used for the former and 119 for the latter.

.in 5
.ti 0
3.4  Pipelining
.in 3

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
.bp
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.  (Since the server only sends data in
response to commands from the client, the converse problem does not
occur.)

.in 7
.ti 0
3.4.1  Examples
.in 3

Example of correct use of pipelining:
.in 6
.ti 6
[C] GROUP   misc.test
.br
[C] STAT
.br
[C] NEXT
.br
[S] 211 1234 3000234 3002322 misc.test
.br
[S] 223 3000234 <45223423@example.com> retrieved
.br
[S] 223 3000237 <668929@example.org> retrieved
.in 3

Example of incorrect use of pipelining (the MODE READER command may
not be pipelined):
.in 6
.ti 6
[C] GROUP   misc.test
.br
[C] MODE READER
.br
[C] DATE
.br
[C] NEXT
.br
[S] 211 1234 3000234 3002322 misc.test
.br
[S] 200 Server ready, posting allowed
.br
[S] 223 3000237 <668929@example.org> retrieved
.in 3
The DATE command has been thrown away by the server and so there is
no 111 response to match it.

.in 5
.ti 0
3.5  Articles
.in 3

NNTP is intended to transfer articles between clients and servers. 
For the purposes of this specification, articles are required to
.bp
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 A 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; 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
content.  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.

The content of a header SHOULD be in \%UTF-8.  However, if a server
receives an article from elsewhere that uses octets in the range 128
to 255 in some other manner, it MAY pass it to a client without
modification.  Therefore clients MUST be prepared to receive such
headers and also data derived from them (e.g.  in the responses from
the OVER extension (Section 8.3)) and MUST NOT assume that they are
always \%UTF-8.  How the client will then process those headers,
including identifying the encoding used, is outside the scope of this
document.

.bp
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:
.in 6
.ti 3
o  A \%message-id MUST begin with "<" and end with ">", and MUST NOT
contain the latter except at the end.
.ti 3
o  A \%message-id MUST be between 3 and 250 octets in length.
.ti 3
o  A \%message-id MUST NOT contain octets other than printable \%US-ASCII
characters.
.in 3
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 synthesize one (this
specification does not require the article to be changed as a
result).  See also Appendix A.2.

.in 5
.ti 0
3.6  Capabilities and Extensions
.in 3

Not all NNTP servers provide exactly the same facilities, both
because this specification allows variation and because servers may
provide extensions.  A set of facilities that are related are called
a "capability".  This specification provides a way to determine what
capabilities are available, includes a list of standard capabilities,
and includes a mechanism (the extension mechanism) for defining new
capabilities.

.in 7
.ti 0
3.6.1  Capability descriptions
.in 3

A client can determine the available capabilities of the server by
using the CAPABILITIES command (Section 5.2).  This returns a
capability list, which is a list of capability lines.  Each line
describes one available capability.

Each capability line consists of one or more tokens, which MUST be
separated by one or more space or TAB characters.  A token is a
string 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).  Unless stated otherwise,
tokens are \%case-insensitive.  Each capability line consists of three
parts:
.in 7
.ti 3
1.  Zero or more modifier tokens; each such token begins with a
character other than a letter or digit.  See Section 3.6.3 for
more information about capability modifiers.
.ti 3
2.  The capability label, which is a keyword indicating the
capability.  A capability label may be defined by this
specification or a successor, or may be defined by an extension. 
.bp
.ti 3
3.  Zero or more tokens which are arguments of the capability.  The
form and meaning of these tokens is specific to each capability. 
.in 3

.in 7
.ti 0
3.6.2  Standard capabilities
.in 3

The following capabilities are defined by this specification.
.in 6
.ti 3
VERSION
.br
This capability MUST be advertised by all servers; it indicates
the version(s) of NNTP that the server supports.  There must be at
least one argument; each argument is a decimal number and MUST NOT
have a leading zero.  Version numbers are assigned only in RFCs
which update or replace this specification; servers MUST NOT
create their own version numbers.
.sp 1
.ti 6
The version number of this specification is 2.
.sp 1
.ti 3
TRANSIT
.br
This capability MUST be advertised by a \%transit-only or
\%general-use server; it MUST NOT be advertised by a \%reader-only
server.
.sp 1
.ti 3
READER
.br
This capability MUST be advertised by a \%reader-only or \%general-use
server; it MUST NOT be advertised by a \%transit-only server.  If
and only if posting is permitted using the POST command, there
MUST be a single argument POST.
.sp 1
.ti 3
LIST
.br
This capability MUST be advertised by all servers.  There MUST be
one argument for each variant of the LIST command supported by the
server, giving the keyword for that variant.
.sp 1
.ti 3
IMPLEMENTATION
.br
This capability MAY be provided by a server.  If so, the arguments
SHOULD be used to provide information such as the server software
name and version number.  The client MUST NOT use this line to
determine capabilities of the server.  (While servers often
provide this information in the initial greeting, clients need to
guess whether this is the case; this capability makes it clear
what the information is.)
.sp 1
.in 3

OUTSTANDING ISSUE
.in 6
.ti 6
[2511] The current wording for LIST includes the mandatory
versions and/or the versions in extensions.  We may want to change
this.
.in 3
.bp
.in 7
.ti 0
3.6.3  Capability modifiers
.in 3

A capability modifier is a flag that a server can apply to a
capability line to indicate some generic property (for example, that
that capability requires authentication or payment of a fee before
use).  It differs from an argument in the capability line in that
modifiers have the same meaning for all capabilities while arguments
are particular to a specific capability.

A capability modifier beginning with an open parenthesis ("(") is a
comment and does not affect the meaning of the capability line. 
(This facility is provided to allow the server to add information
useful to humans reading the capabilities list, such as debugging
information.)

Servers MUST NOT use a modifier unless it is defined in the IANA
registry of capabilities (see Section 3.6.5).  Clients MUST ignore
any capability line that uses a modifier they do not understand and
MUST NOT treat it as an error.  A client is not required to
understand any modifier other than the comment modifier, and
therefore MAY ignore any capability line beginning with a character
other than a letter or open parenthesis.

OUTSTANDING ISSUE
.in 6
.ti 6
[2505] The following paragraph forms a separate proposal.
.in 3

A capability modifier beginning with a dash \%("-") indicates that the
capability is not available in the current state.  A server MAY use
these to provide information about capabilities that are not
currently available, but is not required to do so.  The following
such modifiers are defined by this specification:
.in 6
.ti 3
\%--            the capability cannot be \%re-enabled in this session
.ti 3
\%-480          the capability requires authentication
.ti 3
\%-483          the capability requires appropriate privacy protection
.ti 3
\%-label        the capability can be enabled by use of the extension
with this capability label
.ti 3
\%-MODE_READER  the server is a \%mode-switching server and the
capability can be enabled by use of the MODE READER
command
.in 3

OUTSTANDING ISSUE
.in 6
.ti 6
[2505 continued] Thus a \%mode-switching server can advertise
itself with \%"-MODE_READER READER".
.ti 6

.br
.ti 6
If this proposal isn\'t included and \%mode-switching servers
remain in the specification, we will need some other way to
indicate them.  \%"- READER" might still be a reasonable way to do
so.
.bp
.in 3
.in 7
.ti 0
3.6.4  Extensions
.in 3

Although NNTP is widely and robustly deployed, some parts of the
Internet community might wish to extend the NNTP service.  It must be
emphasized that any extension to NNTP should not be considered
lightly.  NNTP\'s strength comes primarily from its simplicity. 
Experience with many protocols has shown that:
.in 6
.ti 6
Protocols with few options tend towards ubiquity, whilst
protocols with many options tend towards obscurity.
.in 3
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.

An extension is a package of associated facilities, often but not
always including one or new commands.  Each extension MUST define at
least one new capability label (this will often, but need not, be the
name of one of these new commands).  While any additional capability
information can normally be specified using arguments to that label,
an extension MAY define more than one capability label.  However,
this SHOULD be limited to exceptional circumstances.

An extension is either a private extension or else its capabilities
are included in the IANA registry of capabilities (see Section 3.6.5)
and it is defined in an RFC (in which case it is a "standard
extension" or "registered extension").  Such RFCs either must be on
the standards track or must define an \%IESG-approved experimental
protocol.

The definition of an extension must include:
.in 6
.ti 3
o  a descriptive name for the extension;
.ti 3
o  the capability label or labels defined by the extension; the
capability label of a registered extension MUST NOT begin with
"X";
.ti 3
o  the syntax, values, and meanings of any arguments for each
capability label defined by the extension;
.ti 3
o  any new NNTP commands associated with the extension \%- the names of
commands associated with registered extensions MUST NOT begin with
"X";
.ti 3
o  the syntax and possible values of arguments associated with the
new NNTP commands;
.ti 3
o  the response codes and possible values of arguments for the
responses of the new NNTP commands;
.ti 3
o  any new arguments the extension associates with any other
\%pre-existing NNTP commands;
.ti 3
o  how support for the extension affects the behaviour of a server
and NNTP client;
.bp
.ti 3
o  any increase in the maximum length of commands and initial
response lines over the value specified in this document;
.ti 3
o  a specific statement about the effect on pipelining this extension
may have (if any);
.ti 3
o  a specific statement about the circumstances when use of this
extension can alter the contents of the capabilities list (other
than the new capability labels it defines);
.ti 3
o  the circumstances under which the extension can cause any
\%pre-existing command to produce a 401, 480, or 483 response;
.ti 3
o  for each command added by the extension, whether it is a transit,
reader, or general command;
.ti 3
o  if the extension provides any other features, whether they are
available on \%reader-only servers or \%transit-only servers (all
facilities will be available in \%general-use servers; for
\%mode-switching servers it will depend on the current server mode);
.ti 3
o  how the use of MODE READER on a \%mode-switching server interacts
with the extension.
.in 3

A private extension MAY or MAY NOT be included in the capabilities
list.  If it is, the capability label MUST begin with "X".  A server
MAY provide additional keywords \%- for new commands and also for new
variants of existing commands \%- as part of a private extension.  To
avoid the risk of a clash with a future registered extension, these
keywords SHOULD begin with "X".

If the server provides a registered extension as specified, it MUST
implement all of the commands in the specification of the extension
except for those marked as optional and it MUST include the extension
in the capabilities list returned by the CAPABILITIES command
(Section 5.2).  If it does not implement the extension as specified,
it MUST NOT list the extension in the capabilities list under its
registered name; in this case it MAY, but SHOULD NOT, provide a
private extension (not listed, or listed with a different name) that
implements part of the extension or implements the commands of the
extension with a different meaning.

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.

.in 7
.ti 0
3.6.5  Initial IANA register
.in 3

IANA is requested to maintain a registry of NNTP capability labels
and capability modifiers.  All capability labels in the registry MUST
be keywords and MUST NOT begin with X.  All capability modifiers in
the registry MUST NOT begin with a letter, digit, or open parenthesis
("(").
.bp
The initial contents of the registry consists of these entries:
.in 0
.nf

   \%+--------------------+-------------------------+--------------------+
   | Label or modifier  | Meaning                 | Definition         |
   \%+--------------------+-------------------------+--------------------+
   | AUTHINFO           | Authentication          | \%[NNTP-AUTH]        |
   |                    |                         |                    |
   | HDR                | Batched header          | Section 8.4        |
   |                    | retrieval               |                    |
   |                    |                         |                    |
   | IMPLEMENTATION     | Server                  | Section 3.6.2      |
   |                    | \%implementation-specific |                    |
   |                    | information             |                    |
   |                    |                         |                    |
   | LIST               | LIST command variants   | Section 3.6.2      |
   |                    |                         |                    |
   | LISTGROUP          | Specific article        | Section 8.1        |
   |                    | numbers                 |                    |
   |                    |                         |                    |
   | OVER               | Overview support        | Section 8.3        |
   |                    |                         |                    |
   | READER             | Reader commands         | Section 3.6.2      |
   |                    | available               |                    |
   |                    |                         |                    |
   | SASL               | SASL capabilities       | \%[NNTP-AUTH]        |
   |                    |                         |                    |
   | STARTTLS           | Transport layer         | \%[NNTP-TLS]         |
   |                    | security                |                    |
   |                    |                         |                    |
   | STREAMING          | Streaming feeds         | \%[NNTP-STREAM]      |
   |                    |                         |                    |
   | TRANSIT            | Transit commands        | Section 3.6.2      |
   |                    | available               |                    |
   |                    |                         |                    |
   | VERSION            | Supported NNTP versions | Section 3.6.2      |
   |                    |                         |                    |
   | \%--                 | No longer available     | Section 3.6.3      |
   |                    |                         |                    |
   | \%-480               | Requires authentication | Section 3.6.3      |
   |                    |                         |                    |
   | \%-483               | Requires appropriate    | Section 3.6.3      |
   |                    | privacy                 |                    |
   |                    |                         |                    |
   | \%-MODE_READER       | Requires a switch of    | Section 3.6.3      |
   |                    | server mode             |                    |
   |                    |                         |                    |
   | \%-label             | Requires use of         | Section 3.6.3      |
   |                    | indicated capability    |                    |
.bp
   \%+--------------------+-------------------------+--------------------+

.in 3
.bp
.fi
.in 4
.ti 0
4.   The WILDMAT format
.in 3

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.

.in 5
.ti 0
4.1  Wildmat syntax
.in 3

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

.in 9
.ti 6
wildmat = \%wildmat-pattern *("," ["!"] \%wildmat-pattern)
.ti 6
\%wildmat-pattern = \%1*wildmat-item
.ti 6
\%wildmat-item = \%wildmat-exact / \%wildmat-wild
.ti 6
\%wildmat-exact = \%%x21-29 / %x2B / \%%x2D-3E / \%%x40-5A / \%%x5E-7E /
\%UTF8-non-ascii ; exclude * , ? [ \\ ]
.ti 6
\%wildmat-wild = "*" / "?"
.in 6
.in 3

\%UTF8-non-ascii is defined in Section 10.

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.

.in 5
.ti 0
4.2  Wildmat semantics
.in 3

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.

.bp
For example, consider the wildmat "a*,!*b,*c*":
.in 6
.ti 6
the string "aaa" matches because the rightmost match is with
"a*"
.ti 6
the string "abb" does not match because the rightmost match is
with "*b"
.ti 6
the string "ccb" matches because the rightmost match is with
"*c*"
.ti 6
the string "xxx" does not match because no \%wildmat-pattern
matches
.in 3

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.

.in 5
.ti 0
4.3  Extensions
.in 3

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.
.bp
.in 5
.ti 0
4.4  Examples
.in 3

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.
.nf

  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

.bp
.fi
.in 4
.ti 0
5.  Session administration commands
.in 3

.in 5
.ti 0
5.1  Initial Connection
.in 3

.in 7
.ti 0
5.1.1  Usage
.in 3

.in 6
.ti 3
Responses
.br
200   Service available, posting allowed [1]
.br
201   Service available, posting prohibited [1]
.br
400   Service temporarily unavailable [1][2]
.br
502   Service permanently unavailable [1][2]
.ti 3
[1] These are the only valid response codes for the initial greeting;
the server MUST not return any other generic response code.
.ti 3
[2] Following a 400 or 502 response the server MUST immediately close
the connection.
.in 3

.in 7
.ti 0
5.1.2  Description
.in 3

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.  400 SHOULD be used if the issue is
only temporary (for example, because of load) and the client can
expect to be able to connect successfully at some point in the future
without making any changes.  502 MUST be used if the client is not
permitted under any circumstances to interact with the server, and
MAY be used if the server has insufficient information to determine
whether the issue is temporary or permanent.

Note: the distinction between the 200 and 201 response codes has
turned out in practice to be insufficient; for example, some servers
do not allow posting until the client has authenticated, while other
clients assume that a 201 response means that posting will never be
possible even after authentication.  Therefore clients SHOULD use the
CAPABILITIES command (Section 5.2) rather than rely on this response.
.bp
.in 7
.ti 0
5.1.3  Examples
.in 3

Example of a normal connection from an authorized client which then
terminates the session (see Section 5.4):
.in 6
.ti 6
[Initial TCP connection \%set-up completed.]
.br
[S] 200 NNTP Service Ready, posting permitted
.br
[C] QUIT
.br
[S] 205 NNTP Service exits normally
.br
[Server closes connection.]
.in 3

Example of a normal connection from an authorized client that is not
permitted to post; it also immediately terminates the session:
.in 6
.ti 6
[Initial TCP connection \%set-up completed.]
.br
[S] 201 NNTP Service Ready, posting prohibited
.br
[C] QUIT
.br
[S] 205 NNTP Service exits normally
.br
[Server closes connection.]
.in 3

Example of a normal connection from an unauthorized client:
.in 6
.ti 6
[Initial TCP connection \%set-up completed.]
.br
[S] 502 NNTP Service permanently unavailable
.br
[Server closes connection.]
.in 3

Example of a connection from a client where the server is unable to
provide service:
.in 6
.ti 6
[Initial TCP connection \%set-up completed.]
.br
[S] 400 NNTP Service temporarily unavailable
.br
[Server closes connection.]
.in 3

.in 5
.ti 0
5.2  CAPABILITIES
.in 3

.in 7
.ti 0
5.2.1  Usage
.in 3

.in 6
.ti 3
General command
.ti 3
Syntax
.br
CAPABILITIES [keyword]
.ti 3
Responses
.br
101   Capability list follows (multiline)
.ti 3
Parameters
.br
keyword = additional feature, see description
.in 3

.in 7
.ti 0
5.2.2  Description
.in 3

The CAPABILITIES command allows a client to determine the
capabilities of the server at any given time.

This command MAY be issued at any time; the server MUST NOT require
it to be issued in order to make use of any capability.  The response
.bp
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 capabilities at any
point during a session by issuing a CAPABILITIES command at that
point of that session and processing the response.

The capability list is returned as a \%multi-line response following
the 101 response code.  Each capability is described by a separate
capability line.  The server MUST NOT list the same capability twice
in the response.  Except that the VERSION capability MUST be the
first line, the order in which the capability lines appears is not
significant; the server need not even consistently return the same
order.

The server MUST ensure that the capability list accurately reflects
the capabilities (including extensions) currently available.  If a
capability is only available with the server in a certain state (for
example, only after authentication), the list MUST only include the
capability label when in that state.  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, according to the
state of the server, this MUST be indicated by different arguments in
the capability line.

While some capabilities are likely to be always available or never
available, others \%- notably extensions \%- 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 12.6 for further discussion
of this topic.

OUTSTANDING ISSUE
.in 6
.ti 6
[2513] Should more of this material move to Section 3.6.1? If
so, which?
.in 3

The keyword argument is not used by this specification.  It is
provided so that extensions or revisions to this specification can
include extra features for this command without requiring the
CAPABILITIES command to be used twice (once to determine if the extra
features are available and a second time to make use of them).  If
the server does not recognise the argument (and it is a keyword), it
.bp
MUST respond with the 101 response code as if the argument had been
omitted.  If an argument is provided that the server does recognise,
it MAY use the 101 response code or MAY use some other response code
(which will be defined in the specification of that feature).  If the
argument is not a keyword, the 501 generic response code MUST be
returned.  The server MUST NOT generate any other response code to
the CAPABILITIES command.

.in 7
.ti 0
5.2.3  Examples
.in 3

Example of a minimal response (a \%read-only server):
.in 6
.ti 6
[C] CAPABILITIES
.br
[S] 101 Capability list:
.br
[S] VERSION 2
.br
[S] READER
.br
[S] LIST ACTIVE NEWSGROUPS
.br
[S] .
.in 3

Example of a response from a \%general-use server that allows posting,
describes itself, and supports some extensions:
.in 6
.ti 6
[C] CAPABILITIES
.br
[S] 101 Capability list:
.br
[S] VERSION 2
.br
[S] READER
.br
[S] TRANSIT
.br
[S] LIST ACTIVE NEWSGROUPS ACTIVE.TIMES OVERVIEW.FMT HEADERS
.br
[S] IMPLEMENTATION INN 4.2 \%2004-12-25
.br
[S] OVER MSGID
.br
[S] HDR
.br
[S] LISTGROUP
.br
[S] .
.in 3
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 of a server that supports more than one version of NNTP:
.in 6
.ti 6
[C] CAPABILITIES
.br
[S] 101 Capability list:
.br
[S] VERSION 2 3
.br
[S] READER
.br
[S] LIST ACTIVE NEWSGROUPS
.br
[S] .
.in 3

Example of a server including a comment on a capability:
.in 6
.ti 6
[C] CAPABILITIES
.br
[S] 101 Capability list:
.br
[S] VERSION 2
.br
[S] READER
.bp
.br
[S] LIST ACTIVE NEWSGROUPS
.br
[S] \%(test-version-2.1) STREAMING
.br
[S] .
.in 3

Example of a server using a modifier to show that posting is
available after authentication:
.in 6
.ti 6
[C] CAPABILITIES
.br
[S] 101 Capability list:
.br
[S] VERSION 2
.br
[S] READER
.br
[S] \%-480 READER POST
.br
[S] LIST ACTIVE NEWSGROUPS
.br
[S] AUTHINFO SASL
.br
[S] SASL GSSAPI
.br
[S] .
.in 3

Example of a client attempting to use a feature of the CAPABILITIES
command that the server does not support:
.in 6
.ti 6
[C] CAPABILITIES AUTOUPDATE
.br
[S] 101 Capability list:
.br
[S] VERSION 2
.br
[S] READER
.br
[S] TRANSIT
.br
[S] LIST ACTIVE NEWSGROUPS OVERVIEW.FMT HEADERS
.br
[S] OVER MSGID
.br
[S] HDR
.br
[S] LISTGROUP
.br
[S] .
.in 3

.in 5
.ti 0
5.3  MODE READER
.in 3

.in 7
.ti 0
5.3.1  Usage
.in 3

.in 6
.ti 3
General command
.ti 3
This command MUST NOT be pipelined.
.ti 3
Syntax
.br
MODE READER
.ti 3
Responses
.br
200   Posting allowed
.br
201   Posting prohibited
.br
502   Reading service permanently unavailable [1]
.ti 3
[1] Following a 502 response the server MUST immediately close the
connection.
.in 3

.in 7
.ti 0
5.3.2  Description
.in 3

If the server is a \%transit-only server, it MUST return a 502 response
and then immediately close the connection.
.bp
Otherwise the server MUST return a 200 or 201 response with the same
meaning as for the initial greeting (as described in Section 5.1.1);
note that the response need not be the same as the one presented
during the initial greeting.

If the server is a \%mode-switching server that was in \%transit-only
mode, it MUST switch modes to \%reader-only or \%general-use and then MAY
make other changes to its internal state (for example, the available
extensions may differ, or the currently selected newsgroup may be
forgotten).  With this exception, the MODE READER command has no
effect on the state of the server.

Because a server might be \%mode-switching, clients SHOULD send this
command when appropriate.

.in 7
.ti 0
5.3.3  Examples
.in 3

Example of use of the MODE READER command on a \%transit-only server:
.in 6
.ti 6
[C] IHAVE   <i.am.an.article.you.have@example.com>
.br
[S] 435 Duplicate
.br
[C] GROUP   misc.test
.br
[S] 502 Not available in \%transit-only mode
.br
[C] MODE READER
.br
[S] 502 NNTP Service permanently unavailable
.br
[Server closes connection.]
.in 3

Example of use of the MODE READER command on a \%reader-only server:
.in 6
.ti 6
[C] IHAVE   <i.am.an.article.you.have@example.com>
.br
[S] 502 Permission denied
.br
[C] GROUP   misc.test
.br
[S] 211 1234 3000234 3002322 misc.test
.br
[C] MODE READER
.br
[S] 200 Reader mode, posting permitted
.br
[C] IHAVE   <i.am.an.article.you.have@example.com>
.br
[S] 502 Permission denied
.br
[C] GROUP   misc.test
.br
[S] 211 1234 3000234 3002322 misc.test
.in 3

Example of use of the MODE READER command on a \%general-use server:
.in 6
.ti 6
[C] IHAVE   <i.am.an.article.you.have@example.com>
.br
[S] 435 Duplicate
.br
[C] GROUP   misc.test
.br
[S] 211 1234 3000234 3002322 misc.test
.br
[C] MODE READER
.br
[S] 200 Reader mode, posting permitted
.br
[C] IHAVE   <i.am.an.article.you.have@example.com>
.br
[S] 435 Duplicate
.br
[C] GROUP   misc.test
.bp
.br
[S] 211 1234 3000234 3002322 misc.test
.in 3

Example of use of the MODE READER command on a \%mode-switching server:
.in 6
.ti 6
[C] IHAVE   <i.am.an.article.you.have@example.com>
.br
[S] 435 Duplicate
.br
[C] GROUP   misc.test
.br
[S] 502 Not available in \%transit-only mode
.br
[C] MODE READER
.br
[S] 200 Reader mode, posting permitted
.br
[C] IHAVE   <i.am.an.article.you.have@example.com>
.br
[S] 502 Not available in \%reader-only mode
.br
[C] GROUP   misc.test
.br
[S] 211 1234 3000234 3002322 misc.test
.in 3

Example of use of the MODE READER command where the client is not
permitted to post:
.in 6
.ti 6
[C] MODE READER
.br
[S] 201 NNTP Service Ready, posting prohibited
.in 3

Example where the server is temporarily unable to provide \%reader-only
or \%general-use mode:
.in 6
.ti 6
[C] MODE READER
.br
[S] 400 NNTP Service temporarily unavailable
.br
[Server closes connection.]
.in 3

.in 5
.ti 0
5.4  QUIT
.in 3

.in 7
.ti 0
5.4.1  Usage
.in 3

.in 6
.ti 3
General command
.ti 3
Syntax
.br
QUIT
.ti 3
Responses
.br
205   Connection closing
.in 3

.in 7
.ti 0
5.4.2  Description
.in 3

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.

The server MUST NOT generate any response code to the QUIT command
.bp
other than 205 or, if any arguments are provided, 501.

.in 7
.ti 0
5.4.3  Examples
.in 3

.in 6
.ti 6
[C] QUIT
.br
[S] 205 closing connection
.br
[Server closes connection.]
.in 3
.bp
.in 4
.ti 0
6.  Article posting and retrieval
.in 3

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 MAY use leading zeroes in specifying article
numbers, but MUST NOT use more than 16 digits.  In some situations,
the value zero replaces an article number to show some special
situation.

.in 5
.ti 0
6.1  Group and article selection
.in 3

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".

.in 7
.ti 0
6.1.1  GROUP
.in 3

.in 9
.ti 0
6.1.1.1  Usage
.in 3

.in 6
.ti 3
Reader command
.ti 3
Syntax
.br
GROUP group
.ti 3
Responses
.br
211 number low high group   Group successfully selected
.br
411                         No such newsgroup
.ti 3
Parameters
.br
group  = name of newsgroup
.br
number = estimated number of articles in the group
.br
low    = reported low water mark
.br
high   = reported high water mark
.in 3
.bp
.in 9
.ti 0
6.1.1.2  Description
.in 3

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.3).

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.
.in 6
.ti 3
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.
.ti 3
o  All three numbers will be zero.
.ti 3
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.
.in 3

The set of articles in a group may change after the GROUP command is
carried out.  That is:
.in 6
.ti 3
o  articles may be removed from the group
.ti 3
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)
.ti 3
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 and the high water mark adjusted
accordingly, the next new article will not have the number one
greater than the reported high water mark)
.in 3

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
.bp
response for that newsgroup in any session, and SHOULD be no less
than that in any previous response for that newsgroup ever sent to
any client.  Any failure to meet the latter condition SHOULD be
transient only.  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.

.in 9
.ti 0
6.1.1.3  Examples
.in 3

Example for a group known to the server:
.in 6
.ti 6
[C] GROUP   misc.test
.br
[S] 211 1234 3000234 3002322 misc.test
.in 3

Example for a group unknown to the server:
.in 6
.ti 6
[C] GROUP   example.is.sob.bradner.or.barber
.br
[S] 411 example.is.sob.bradner.or.barber is unknown
.in 3

Example of an empty group using the preferred response:
.in 6
.ti 6
[C] GROUP   example.currently.empty.newsgroup
.br
[S] 211 0 4000 3999 example.currently.empty.newsgroup
.in 3

Example of an empty group using an alternative response:
.in 6
.ti 6
[C] GROUP   example.currently.empty.newsgroup
.br
[S] 211 0 0 0 example.currently.empty.newsgroup
.in 3

Example of an empty group using a different alternative response:
.in 6
.ti 6
[C] GROUP   example.currently.empty.newsgroup
.br
[S] 211 0 4000 4321 example.currently.empty.newsgroup
.in 3
.bp
.in 7
.ti 0
6.1.2  LAST
.in 3

.in 9
.ti 0
6.1.2.1  Usage
.in 3

.in 6
.ti 3
Reader command
.ti 3
Syntax
.br
LAST
.ti 3
Responses
.br
223 n \%message-id   Article found
.br
412                No newsgroup selected
.br
420                Current article number is invalid
.br
422                No previous article in this group
.ti 3
Parameters
.br
n          = article number
.br
\%message-id = article \%message-id
.in 3

.in 9
.ti 0
6.1.2.2  Description
.in 3

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.

.in 9
.ti 0
6.1.2.3  Examples
.in 3

Example of a successful article retrieval using LAST:
.in 6
.ti 6
[C] GROUP   misc.test
.br
[S] 211 1234 3000234 3002322 misc.test
.br
[C] NEXT
.br
[S] 223 3000237 <668929@example.org> retrieved
.bp
.br
[C] LAST
.br
[S] 223 3000234 <45223423@example.com> retrieved
.in 3

Example of an attempt to retrieve an article without having selected
a group (via the GROUP command) first:
.in 6
.ti 6
[Assumes current selected newsgroup is invalid.]
.br
[C] LAST
.br
[S] 412 no newsgroup selected
.in 3

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:
.in 6
.ti 6
[C] GROUP   misc.test
.br
[S] 211 1234 3000234 3002322 misc.test
.br
[C] LAST
.br
[S] 422 No previous article to retrieve
.in 3

Example of an attempt to retrieve an article using the LAST command
when the current selected newsgroup is empty:
.in 6
.ti 6
[C] GROUP   example.empty.newsgroup
.br
[S] 211 0 0 0 example.empty.newsgroup
.br
[C] LAST
.br
[S] 420 No current article selected
.in 3

.in 7
.ti 0
6.1.3  NEXT
.in 3

.in 9
.ti 0
6.1.3.1  Usage
.in 3

.in 6
.ti 3
Reader command
.ti 3
Syntax
.br
NEXT
.ti 3
Responses
.br
223 n \%message-id   Article found
.br
412                No newsgroup selected
.br
420                Current article number is invalid
.br
421                No next article in this group
.ti 3
Parameters
.br
n          = article number
.br
\%message-id = article \%message-id
.in 3

.in 9
.ti 0
6.1.3.2  Description
.in 3

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.
.bp
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).

.in 9
.ti 0
6.1.3.3  Examples
.in 3

Example of a successful article retrieval using NEXT:
.in 6
.ti 6
[C] GROUP   misc.test
.br
[S] 211 1234 3000234 3002322 misc.test
.br
[C] NEXT
.br
[S] 223 3000237 <668929@example.org> retrieved
.in 3

Example of an attempt to retrieve an article without having selected
a group (via the GROUP command) first:
.in 6
.ti 6
[Assumes current selected newsgroup is invalid.]
.br
[C] NEXT
.br
[S] 412 no newsgroup selected
.in 3

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:
.in 6
.ti 6
[C] GROUP   misc.test
.br
[S] 211 1234 3000234 3002322 misc.test
.br
[C] STAT   3002322
.br
[S] 223 3002322 <411@example.net> retrieved
.br
[C] NEXT
.br
[S] 421 No next article to retrieve
.in 3

Example of an attempt to retrieve an article using the NEXT command
when the current selected newsgroup is empty:
.in 6
.ti 6
[C] GROUP   example.empty.newsgroup
.br
[S] 211 0 0 0 example.empty.newsgroup
.br
[C] NEXT
.br
[S] 420 No current article selected
.in 3

.in 5
.ti 0
6.2  Retrieval of articles and article sections
.in 3

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.5, 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.
.bp
.in 7
.ti 0
6.2.1  ARTICLE
.in 3

.in 9
.ti 0
6.2.1.1  Usage
.in 3

.in 6
.ti 3
Reader command
.ti 3
Syntax
.br
ARTICLE \%message-id
.br
ARTICLE number
.br
ARTICLE
.ti 3
Responses
.in 9
.ti 6
First form \%(message-id specified)
.br
220 0|n \%message-id   Article follows (multiline)
.br
430                  No article with that \%message-id
.ti 6
Second form (article number specified)
.br
220 n \%message-id     Article follows (multiline)
.br
412                  No newsgroup selected
.br
423                  No article with that number
.ti 6
Third form (current article number used)
.br
220 n \%message-id     Article follows (multiline)
.br
412                  No newsgroup selected
.br
420                  Current article number is invalid
.in 6
.ti 3
Parameters
.br
number     = Requested article number
.br
n          = Returned article number
.br
\%message-id = Article \%message-id
.in 3

.in 9
.ti 0
6.2.1.2  Description
.in 3

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 \%cross-posted to more than
one newsgroup.

In the response, the article number MUST be replaced with zero,
except that if there is a current selected group and the article is
present in that group, the server MAY use that article number.  (The
server is not required to determine whether the article is in the
current selected newsgroup or, if so, what article number it has; the
client MUST always be prepared for zero to be specified.) The server
MUST NOT provide an article number unless use of that number in a
.bp
second ARTICLE command immediately following this one would return
the same article.  Even if the server chooses to return article
numbers in these circumstances, it need not do so consistently; it
MAY return zero to any such command (also see the STAT examples
(Section 6.2.4.3)).

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.

.in 9
.ti 0
6.2.1.3  Examples
.in 3

Example of a successful retrieval of an article (using no article
number):
.in 6
.ti 6
[C] GROUP   misc.test
.br
[S] 211 1234 3000234 3002322 misc.test
.br
[C] ARTICLE
.br
[S] 220 3000234 <45223423@example.com>
.bp
.br
[S] Path: \%pathost!demo!whitehouse!not-for-mail
.br
[S] From: "Demo User" <nobody@example.net>
.br
[S] Newsgroups: misc.test
.br
[S] Subject: I am just a test article
.br
[S] Date: 6 Oct 1998 04:38:40 \%-0500
.br
[S] Organization: An Example Net, Uncertain, Texas
.br
[S] \%Message-ID: <411@example.net>
.br
[S]
.br
[S] This is just a test article.
.br
[S] .
.in 3

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

Example of an unsuccessful retrieval of an article by \%message-id:
.in 6
.ti 6
[C] ARTICLE   <i.am.not.there@example.com>
.br
[S] 430 No Such Article Found
.in 3

Example of an unsuccessful retrieval of an article by number:
.in 6
.ti 6
[C] GROUP   misc.test
.br
[S] 211 1234 3000234 3002322 news.groups
.br
[C] ARTICLE   300256
.br
[S] 423 No article with that number
.in 3

Example of an unsuccessful retrieval of an article by number because
no newsgroup was selected first:
.in 6
.ti 6
[Assumes current selected newsgroup is invalid.]
.br
[C] ARTICLE   300256
.br
[S] 412 No newsgroup selected
.in 3

Example of an attempt to retrieve an article when the current
selected newsgroup is empty:
.in 6
.ti 6
[C] GROUP   example.empty.newsgroup
.br
[S] 211 0 0 0 example.empty.newsgroup
.br
[C] ARTICLE
.br
[S] 420 No current article selected
.in 3
.bp
.in 7
.ti 0
6.2.2  HEAD
.in 3

.in 9
.ti 0
6.2.2.1  Usage
.in 3

.in 6
.ti 3
General command
.ti 3
Syntax
.br
HEAD \%message-id
.br
HEAD number
.br
HEAD
.ti 3
Responses
.in 9
.ti 6
First form \%(message-id specified)
.br
221 0|n \%message-id   Headers follow (multiline)
.br
430                  No article with that \%message-id
.ti 6
Second form (article number specified)
.br
221 n \%message-id     Headers follow (multiline)
.br
412                  No newsgroup selected
.br
423                  No article with that number
.ti 6
Third form (current article number used)
.br
221 n \%message-id     Headers follow (multiline)
.br
412                  No newsgroup selected
.br
420                  Current article number is invalid
.in 6
.ti 3
Parameters
.br
number     = Requested article number
.br
n          = Returned article number
.br
\%message-id = Article \%message-id
.in 3

.in 9
.ti 0
6.2.2.2  Description
.in 3

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).

.in 9
.ti 0
6.2.2.3  Examples
.in 3

Example of a successful retrieval of the headers of an article (using
no article number):
.in 6
.ti 6
[C] GROUP   misc.test
.br
[S] 211 1234 3000234 3002322 misc.test
.br
[C] HEAD
.br
[S] 221 3000234 <45223423@example.com>
.br
[S] Path: \%pathost!demo!whitehouse!not-for-mail
.br
[S] From: "Demo User" <nobody@example.net>
.br
[S] Newsgroups: misc.test
.br
[S] Subject: I am just a test article
.br
[S] Date: 6 Oct 1998 04:38:40 \%-0500
.br
[S] Organization: An Example Net, Uncertain, Texas
.br
[S] \%Message-ID: <411@example.net>
.bp
.br
[S] .
.in 3

Example of a successful retrieval of the headers of an article by
\%message-id:
.in 6
.ti 6
[C] HEAD   <45223423@example.com>
.br
[S] 221 0 <45223423@example.com>
.br
[S] Path: \%pathost!demo!whitehouse!not-for-mail
.br
[S] From: "Demo User" <nobody@example.net>
.br
[S] Newsgroups: misc.test
.br
[S] Subject: I am just a test article
.br
[S] Date: 6 Oct 1998 04:38:40 \%-0500
.br
[S] Organization: An Example Net, Uncertain, Texas
.br
[S] \%Message-ID: <411@example.net>
.br
[S] .
.in 3

Example of an unsuccessful retrieval of the headers of an article by
\%message-id:
.in 6
.ti 6
[C] HEAD   <i.am.not.there@example.com>
.br
[S] 430 No Such Article Found
.in 3

Example of an unsuccessful retrieval of the headers of an article by
number:
.in 6
.ti 6
[C] GROUP   misc.test
.br
[S] 211 1234 3000234 3002322 misc.test
.br
[C] HEAD   300256
.br
[S] 423 No article with that number
.in 3

Example of an unsuccessful retrieval of the headers of an article by
number because no newsgroup was selected first:
.in 6
.ti 6
[Assumes current selected newsgroup is invalid.]
.br
[C] HEAD   300256
.br
[S] 412 No newsgroup selected
.in 3

Example of an attempt to retrieve the headers of an article when the
current selected newsgroup is empty:
.in 6
.ti 6
[C] GROUP   example.empty.newsgroup
.br
[S] 211 0 0 0 example.empty.newsgroup
.br
[C] HEAD
.br
[S] 420 No current article selected
.in 3

.in 7
.ti 0
6.2.3  BODY
.in 3

.in 9
.ti 0
6.2.3.1  Usage
.in 3

.in 6
.ti 3
Reader command
.bp
.ti 3
Syntax
.br
BODY \%message-id
.br
BODY number
.br
BODY
.ti 3
Responses
.in 9
.ti 6
First form \%(message-id specified)
.br
222 0|n \%message-id   Body follows (multiline)
.br
430                  No article with that \%message-id
.ti 6
Second form (article number specified)
.br
222 n \%message-id     Body follows (multiline)
.br
412                  No newsgroup selected
.br
423                  No article with that number
.ti 6
Third form (current article number used)
.br
222 n \%message-id     Body follows (multiline)
.br
412                  No newsgroup selected
.br
420                  Current article number is invalid
.in 6
.ti 3
Parameters
.br
number     = Requested article number
.br
n          = Returned article number
.br
\%message-id = Article \%message-id
.in 3

.in 9
.ti 0
6.2.3.2  Description
.in 3

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).

.in 9
.ti 0
6.2.3.3  Examples
.in 3

Example of a successful retrieval of the body of an article (using no
article number):
.in 6
.ti 6
[C] GROUP   misc.test
.br
[S] 211 1234 3000234 3002322 misc.test
.br
[C] BODY
.br
[S] 222 3000234 <45223423@example.com>
.br
[S] This is just a test article.
.br
[S] .
.in 3

Example of a successful retrieval of the body of an article by
\%message-id:
.in 6
.ti 6
[C] BODY   <45223423@example.com>
.br
[S] 222 0 <45223423@example.com>
.br
[S] This is just a test article.
.br
[S] .
.in 3

Example of an unsuccessful retrieval of the body of an article by
\%message-id:
.bp
.in 6
.ti 6
[C] BODY   <i.am.not.there@example.com>
.br
[S] 430 No Such Article Found
.in 3

Example of an unsuccessful retrieval of the body of an article by
number:
.in 6
.ti 6
[C] GROUP   misc.test
.br
[S] 211 1234 3000234 3002322 misc.test
.br
[C] BODY   300256
.br
[S] 423 No article with that number
.in 3

Example of an unsuccessful retrieval of the body of an article by
number because no newsgroup was selected first:
.in 6
.ti 6
[Assumes current selected newsgroup is invalid.]
.br
[C] BODY   300256
.br
[S] 412 No newsgroup selected
.in 3

Example of an attempt to retrieve the body of an article when the
current selected newsgroup is empty:
.in 6
.ti 6
[C] GROUP   example.empty.newsgroup
.br
[S] 211 0 0 0 example.empty.newsgroup
.br
[C] BODY
.br
[S] 420 No current article selected
.in 3

.in 7
.ti 0
6.2.4  STAT
.in 3

.in 9
.ti 0
6.2.4.1  Usage
.in 3

.in 6
.ti 3
General command
.ti 3
Syntax
.br
STAT \%message-id
.br
STAT number
.br
STAT
.ti 3
Responses
.in 9
.ti 6
First form \%(message-id specified)
.br
223 0|n \%message-id   Article exists
.br
430                  No article with that \%message-id
.ti 6
Second form (article number specified)
.br
223 n \%message-id     Article exists
.br
412                  No newsgroup selected
.br
423                  No article with that number
.ti 6
Third form (current article number used)
.br
223 n \%message-id     Article exists
.br
412                  No newsgroup selected
.br
420                  Current article number is invalid
.in 6
.ti 3
Parameters
.br
number     = Requested article number
.br
n          = Returned article number
.br
\%message-id = Article \%message-id
.bp
.in 3
.in 9
.ti 0
6.2.4.2  Description
.in 3

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.

.in 9
.ti 0
6.2.4.3  Examples
.in 3

Example of STAT on an existing article (using no article number):
.in 6
.ti 6
[C] GROUP   misc.test
.br
[S] 211 1234 3000234 3002322 misc.test
.br
[C] STAT
.br
[S] 223 3000234 <45223423@example.com>
.in 3

Example of STAT on an existing article by \%message-id:
.in 6
.ti 6
[C] STAT   <45223423@example.com>
.br
[S] 223 0 <45223423@example.com>
.in 3

Example of STAT on an article not on the server by \%message-id:
.in 6
.ti 6
[C] STAT   <i.am.not.there@example.com>
.br
[S] 430 No Such Article Found
.in 3

Example of STAT on an article not in the server by number:
.in 6
.ti 6
[C] GROUP   misc.test
.br
[S] 211 1234 3000234 3002322 misc.test
.br
[C] STAT   300256
.br
[S] 423 No article with that number
.in 3

Example of STAT on an article by number when no newsgroup was
selected first:
.in 6
.ti 6
[Assumes current selected newsgroup is invalid.]
.br
[C] STAT   300256
.br
[S] 412 No newsgroup selected
.in 3

Example of STAT on an article when the current selected newsgroup is
empty:
.in 6
.ti 6
[C] GROUP   example.empty.newsgroup
.br
[S] 211 0 0 0 example.empty.newsgroup
.br
[C] STAT
.br
[S] 420 No current article selected
.in 3

Example of STAT by \%message-id on a server which sometimes reports the
actual article number:
.bp
.in 6
.ti 6
[C] GROUP   misc.test
.br
[S] 211 1234 3000234 3002322 misc.test
.br
[C] STAT
.br
[S] 223 3000234 <45223423@example.com>
.br
[C] STAT   <45223423@example.com>
.br
[S] 223 0 <45223423@example.com>
.br
[C] STAT   <45223423@example.com>
.br
[S] 223 3000234 <45223423@example.com>
.br
[C] GROUP   example.empty.newsgroup
.br
[S] 211 0 0 0 example.empty.newsgroup
.br
[C] STAT   <45223423@example.com>
.br
[S] 223 0 <45223423@example.com>
.br
[C] GROUP   alt.crossposts
.br
[S] 211 9999 111111 222222 alt.crossposts
.br
[C] STAT   <45223423@example.com>
.br
[S] 223 123456 <45223423@example.com>
.br
[C] STAT
.br
[S] 223 111111 <23894720@example.com>
.in 3
The first STAT command establishes the identity of an article in the
group.  The second and third show that the server may, but need not,
give the article number when the \%message-id is specified.  The fourth
STAT command shows that zero must be specified if the article isn\'t
in the current selected group, the fifth shows that the number, if
provided, must be that relating to the current selected group, and
the last one shows that the current selected article is still not
changed by the use of STAT with a \%message-id even if it returns an
article number.

.in 5
.ti 0
6.3  Article posting
.in 3

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

.in 7
.ti 0
6.3.1  POST
.in 3

.in 9
.ti 0
6.3.1.1  Usage
.in 3

.in 6
.ti 3
Reader command
.ti 3
This command MUST NOT be pipelined.
.ti 3
Syntax
.br
POST
.ti 3
Responses
.in 9
.ti 6
Initial responses
.br
340   Send article to be posted
.br
440   Posting not permitted
.bp
.ti 6
Subsequent responses
.br
240   Article received OK
.br
441   Posting failed
.in 6
.in 3

.in 9
.ti 0
6.3.1.2  Description
.in 3

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.5 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 unforeseen 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 A.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).

.in 9
.ti 0
6.3.1.3  Examples
.in 3

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

Example of an unsuccessful posting:
.in 6
.ti 6
[C] POST
.br
[S] 340 Input article; end with \%<CR-LF>.<CR-LF>
.br
[C] From: "Demo User" <nobody@example.net>
.br
[C] Newsgroups: misc.test
.br
[C] Subject: I am just a test article
.br
[C] Organization: An Example Net
.br
[C]
.br
[C] This is just a test article.
.br
[C] .
.br
[S] 441 Posting failed
.in 3

Example of an attempt to post when posting is not allowed:
.in 6
.ti 6
[Initial TCP connection \%set-up completed.]
.br
[S] 201 NNTP Service Ready, posting prohibited
.br
[C] POST
.br
[S] 440 Posting not permitted
.in 3

.in 7
.ti 0
6.3.2  IHAVE
.in 3

.in 9
.ti 0
6.3.2.1  Usage
.in 3

.in 6
.ti 3
Transit command
.ti 3
This command MUST NOT be pipelined.
.ti 3
Syntax
.br
IHAVE \%message-id
.ti 3
Responses
.in 9
.ti 6
Initial responses
.br
335   Send article to be transferred
.br
435   Article not wanted
.br
436   Transfer not possible; try again later
.ti 6
Subsequent responses
.br
235   Article transferred OK
.br
436   Transfer failed; try again later
.br
437   Transfer rejected; do not retry
.in 6
.bp
.ti 3
Parameters
.br
\%message-id = Article \%message-id
.in 3

.in 9
.ti 0
6.3.2.2  Description
.in 3

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
.bp
forwarding, an NNTP server MAY acknowledge the successful transfer of
the article (with a 235 response) but later silently discard it.

.in 9
.ti 0
6.3.2.3  Examples
.in 3

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

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

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

Example of sending an article to a site that already has it:
.in 6
.ti 6
[C] IHAVE   <i.am.an.article.you.have@example.com>
.br
[S] 435 Duplicate
.in 3

Example of sending an article to a site that requests the article be
tried again later:
.in 6
.ti 6
[C] IHAVE   <i.am.an.article.you.defer@example.com>
.br
[S] 436 Retry later
.in 3
.bp
.in 4
.ti 0
7.  Information commands
.in 3

This section lists other commands that may be used at any time
between the beginning of a session and its termination.  Using these
commands does not alter any state information, but the response
generated from their use may provide useful information to clients.

.in 5
.ti 0
7.1  DATE
.in 3

.in 7
.ti 0
7.1.1  Usage
.in 3

.in 6
.ti 3
Reader command
.ti 3
Syntax
.br
DATE
.ti 3
Responses
.br
111 yyyymmddhhmmss   server date and time
.ti 3
Parameters
.br
yyyymmddHHmmss = Current UTC date and time on server
.in 3

.in 7
.ti 0
7.1.2  Description
.in 3

This command exists to help clients find out the current Coordinated
Universal Time \%[TF.686-1] from the server\'s perspective.  This
command SHOULD NOT be used as a substitute for NTP [RFC1305] but to
provide information that might be useful when using the NEWNEWS
command (see Section 7.4).  A system providing NNTP service SHOULD
keep the system clock as accurate as possible, either with NTP or by
some other method.

The server MUST return a 111 response specifying the date and time on
the server in the form yyyymmddhhmmss.  This date and time is in
Coordinated Universal Time.

.in 7
.ti 0
7.1.3  Examples
.in 3

.in 6
.ti 6
[C] DATE
.br
[S] 111 19990623135624
.in 3

.in 5
.ti 0
7.2  HELP
.in 3

.in 7
.ti 0
7.2.1  Usage
.in 3

.in 6
.ti 3
General command
.ti 3
Syntax
.br
HELP
.bp
.ti 3
Responses
.br
100   Help text follows (multiline)
.in 3

.in 7
.ti 0
7.2.2  Description
.in 3

This command provides a short summary of commands that are understood
by this implementation of the server.  The help text will be
presented as a multiline response following the 100 response code.

This text is not guaranteed to be in any particular format and MUST
NOT be used by clients as a replacement for the CAPABILITIES command
described in Section 5.2

.in 7
.ti 0
7.2.3  Examples
.in 3

.in 6
.ti 6
[C] HELP
.br
[S] 100 Help text follows
.br
[S] This is some help text.  There is no specific
.br
[S] formatting requirement for this test, though
.br
[S] it is customary for it to list the valid commands
.br
[S] and give a brief definition of what they do
.br
[S] .
.in 3

.in 5
.ti 0
7.3  NEWGROUPS
.in 3

.in 7
.ti 0
7.3.1  Usage
.in 3

.in 6
.ti 3
Reader command
.ti 3
Syntax
.br
NEWGROUPS date time [GMT]
.ti 3
Responses
.br
231   List of new newsgroups follows (multiline)
.ti 3
Parameters
.br
date = Date in yymmdd or yyyymmdd format
.br
time = Time in hhmmss format
.in 3

.in 7
.ti 0
7.3.2  Description
.in 3

This command returns a list of newsgroups created on the server since
the specified date and time.  The results are in the same format as
the LIST ACTIVE command (see Section 7.6.3).  However, they MAY
include groups not available on the server (and so not returned by
LIST ACTIVE) and MAY omit groups for which the creation date is not
available.

The date is specified as 6 or 8 digits in the format [xx]yymmdd,
where xx is the first two digits of the year \%(19-99), yy is the last
two digits of the year \%(00-99), mm is the month \%(01-12), and dd is
.bp
the day of the month \%(01-31).  Clients SHOULD specify all four digits
of the year.  If the first two digits of the year are not specified
(this is supported only for backwards compatibility), the year is to
be taken from the current century if yy is smaller than or equal to
the current year, otherwise the year is from the previous century.

The time is specified as 6 digits in the format hhmmss, where hh is
the hours in the \%24-hour clock \%(00-23), mm is the minutes \%(00-59),
and ss is the seconds \%(00-60, to allow for leap seconds).  The token
"GMT" specifies that the date and time are given in Coordinated
Universal Time \%[TF.686-1]; if it is omitted then the date and time
are specified in the server\'s local timezone.  Note that there is no
way using the protocol specified in this document to establish the
server\'s local timezone.

Note that an empty list is a possible valid response and indicates
that there are no new newsgroups since that \%date-time.

Clients SHOULD make all queries using Coordinated Universal Time
(i.e.  by including the "GMT" argument) when possible.

.in 7
.ti 0
7.3.3  Examples
.in 3

Example where there are new groups:
.in 6
.ti 6
[C] NEWGROUPS   19990624 000000 GMT
.br
[S] 231 list of new newsgroups follows
.br
[S] \%alt.rfc-writers.recovery 4 1 y
.br
[S] tx.natives.recovery 89 56 y
.br
[S] .
.in 3

Example where there are no new groups:
.in 6
.ti 6
[C] NEWGROUPS   19990624 000000 GMT
.br
[S] 231 list of new newsgroups follows
.br
[S] .
.in 3

.in 5
.ti 0
7.4  NEWNEWS
.in 3

.in 7
.ti 0
7.4.1  Usage
.in 3

.in 6
.ti 3
Reader command
.ti 3
Syntax
.br
NEWNEWS wildmat date time [GMT]
.ti 3
Responses
.br
230   List of new articles follows (multiline)
.ti 3
Parameters
.br
wildmat = Newsgroups of interest
.br
date    = Date in yymmdd or yyyymmdd format
.br
time    = Time in hhmmss format
.bp
.in 3
.in 7
.ti 0
7.4.2  Description
.in 3

This command returns a list of \%message-ids of articles posted or
received on the server, in the newsgroups whose names match the
wildmat, since the specified date and time.  One \%message-id is sent
on each line; the order of the response has no specific significance
and may vary from response to response in the same session.  A
\%message-id MAY appear more than once; if it does so, it has the same
meaning as if it appeared only once.

Date and time are in the same format as the NEWGROUPS command (see
Section 7.3).

Note that an empty list is a possible valid response and indicates
that there is currently no new news in the relevant groups.

Clients SHOULD make all queries in Coordinated Universal Time (i.e. 
by using the "GMT" argument) when possible.

.in 7
.ti 0
7.4.3  Examples
.in 3

Example where there are new articles:
.in 6
.ti 6
[C] NEWNEWS   news.*,sci.* 19990624 000000 GMT
.br
[S] 230 list of new articles by \%message-id follows
.br
[S] <i.am.a.new.article@example.com>
.br
[S] <i.am.another.new.article@example.com>
.br
[S] .
.in 3

Example where there are no new articles:
.in 6
.ti 6
[C] NEWNEWS   alt.* 19990624 000000 GMT
.br
[S] 230 list of new articles by \%message-id follows
.br
[S] .
.in 3

.in 5
.ti 0
7.5  Time
.in 3

As described in Section 6, each article has an arrival timestamp. 
Each newsgroup also has a creation timestamp.  These timestamps are
used by the NEWNEWS and NEWGROUP commands to construct their
responses.

The DATE command MUST return a timestamp from the same clock as is
used for determining article arrival and group creation times.  This
clock SHOULD be monotonic, and adjustments SHOULD be made by running
it fast or slow compared to "real" time rather than by making sudden
jumps.

Clients can ensure that they do not have gaps in lists of articles or
groups by using the DATE command in the following manner:
.bp
.in 6
.ti 3
First session:
.br
Issue DATE command and record result
.br
Issue NEWNEWS command using a previously chosen timestamp
.ti 3
Subsequent sessions:
.br
Issue DATE command and hold result in temporary storage
.br
Issue NEWNEWS command using timestamp saved from previous session
.br
Overwrite saved timestamp with that currently in temporary storage
.in 3
In order to allow for minor errors, clients MAY want to adjust the
timestamp back by two or three minutes before using it in NEWNEWS.

.in 7
.ti 0
7.5.1  Examples
.in 3

First session:
.in 6
.ti 6
[C] DATE
.br
[S] 111 20010203112233
.br
[C] NEWNEWS   local.chat 20001231 235959 GMT
.br
[S] 230 list follows
.br
[S] <article.1@local.service>
.br
[S] <article.2@local.service>
.br
[S] <article.3@local.service>
.br
[S] .
.in 3
Second session (the client has subtracted 3 minutes from the
timestamp returned previously):
.in 6
.ti 6
[C] DATE
.br
[S] 111 20010204003344
.br
[C] NEWNEWS   local.chat 20010203 111933 GMT
.br
[S] 230 list follows
.br
[S] <article.3@local.service>
.br
[S] <article.4@local.service>
.br
[S] <article.5@local.service>
.br
[S] .
.in 3
Note how <article.3@local.service> arrived in the 3 minute gap and so
is listed in both responses.

.in 5
.ti 0
7.6  The LIST commands
.in 3

The LIST family of commands all return information that is \%multi-line
and, in general, can be expected not to change during the session. 
Often the information is related to newsgroups, in which case the
response has one line per newsgroup and a wildmat MAY be provided to
restrict the groups for which information is returned.

The set of available keywords (including those provided in
extensions) is given in the capability list with capability label
LIST.
.bp
.in 7
.ti 0
7.6.1  LIST
.in 3

.in 9
.ti 0
7.6.1.1  Usage
.in 3

.in 6
.ti 3
General command
.ti 3
Syntax
.br
LIST [keyword [wildmat|argument]]
.ti 3
Responses
.br
215   Information follows (multiline)
.ti 3
Parameters
.br
keyword  = information requested [1]
.br
argument = specific to keyword
.br
wildmat  = groups of interest
.ti 3
[1] If no keyword is provided, it defaults to ACTIVE.
.in 3

.in 9
.ti 0
7.6.1.2  Description
.in 3

The LIST command allows the server to provide blocks of information
to the client.  This information may be global or may be related to
newsgroups; in the latter case, the information may be returned
either for all groups or only for those matching a wildmat.  Each
block of information is represented by a different keyword.  The
command returns the specific information identified by the keyword.

If the information is available, it is returned as a \%multi-line
response following the 215 response code.  The format of the
information depends on the keyword.  The information MAY be affected
by the additional argument, but the format MUST NOT be.

If the information is based on newsgroups and the optional wildmat
argument is specified, the response is limited to only the groups (if
any) whose names match the wildmat and for which the information is
available.

Note that an empty list is a possible valid response; for a
\%newsgroup-based keyword, it indicates that there are no groups
meeting the above criteria.

If the keyword is not recognised, or if an argument is specified and
the keyword does not expect one, a 501 response code MUST BE
returned.  If the keyword is recognised but the server does not
maintain the information, a 503 response code MUST BE returned.

The LIST command MUST NOT change the visible state of the server in
any way; that is, the behaviour of subsequent commands MUST NOT be
affected by whether the LIST command was issued or not.  For example,
it MUST NOT make groups available that otherwise would not have been.
.bp
.in 9
.ti 0
7.6.1.3  Examples
.in 3

Example of LIST with the ACTIVE keyword:
.in 6
.ti 6
[C] LIST ACTIVE
.br
[S] 215 list of newsgroups follows
.br
[S] misc.test 3002322 3000234 y
.br
[S] comp.risks 442001 441099 m
.br
[S] \%alt.rfc-writers.recovery 4 1 y
.br
[S] tx.natives.recovery 89 56 y
.br
[S] tx.natives.recovery.d 11 9 n
.br
[S] .
.in 3

Example of LIST with no keyword:
.in 6
.ti 6
[C] LIST
.br
[S] 215 list of newsgroups follows
.br
[S] misc.test 3002322 3000234 y
.br
[S] comp.risks 442001 441099 m
.br
[S] \%alt.rfc-writers.recovery 4 1 y
.br
[S] tx.natives.recovery 89 56 y
.br
[S] tx.natives.recovery.d 11 9 n
.br
[S] .
.in 3
The output is identical to that of the previous example.

Example of LIST on a \%newsgroup-based keyword with and without
wildmat:
.in 6
.ti 6
[C] LIST ACTIVE.TIMES
.br
[S] 215 information follows
.br
[S] misc.test 930445408 <creatme@isc.org>
.br
[S] \%alt.rfc-writers.recovery 930562309 <m@example.com>
.br
[S] tx.natives.recovery 930678923 <sob@academ.com>
.br
[S] .
.br
[C] LIST ACTIVE.TIMES   tx.*
.br
[S] 215 information follows
.br
[S] tx.natives.recovery 930678923 <sob@academ.com>
.br
[S] .
.in 3

Example of LIST returning an error where the keyword is recognized
but the software does not maintain this information:
.in 6
.ti 6
[C] CAPABILITIES
.br
[S] 101 Capability list:
.br
[S] VERSION 2
.br
[S] READER
.br
[S] LIST ACTIVE NEWSGROUPS ACTIVE.TIMES XTRA.DATA
.br
[S] .
.br
[C] LIST XTRA.DATA
.br
[S] 503 Data item not stored
.in 3

Example of LIST where the keyword is not recognised:
.bp
.in 6
.ti 6
[C] CAPABILITIES
.br
[S] 101 Capability list:
.br
[S] VERSION 2
.br
[S] READER
.br
[S] LIST ACTIVE NEWSGROUPS ACTIVE.TIMES XTRA.DATA
.br
[S] .
.br
[C] LIST DISTRIB.PATS
.br
[S] 501 Syntax Error
.in 3

.in 7
.ti 0
7.6.2  Standard LIST keywords
.in 3

This specification defines the following LIST keywords:
.in 0
.nf

   \%+----------------------+----------------------+---------------------+
   | Keyword              | Definition           | Status              |
   \%+----------------------+----------------------+---------------------+
   | ACTIVE               | Section 7.6.3        | Mandatory           |
   |                      |                      |                     |
   | ACTIVE.TIMES         | Section 7.6.4        | Optional            |
   |                      |                      |                     |
   | DISTRIB.PATS         | Section 7.6.5        | Optional            |
   |                      |                      |                     |
   | HEADERS              | Section 8.4.2        | Extension           |
   |                      |                      |                     |
   | NEWSGROUPS           | Section 7.6.6        | Mandatory except    |
   |                      |                      | for \%transit-only    |
   |                      |                      | servers             |
   |                      |                      |                     |
   | OVERVIEW.FMT         | Section 8.3.2        | Extension           |
   \%+----------------------+----------------------+---------------------+

.in 3
.fi
Where one of these LIST keywords is supported by a server, it MUST
have the meaning given in the following \%sub-sections.

.in 7
.ti 0
7.6.3  LIST ACTIVE
.in 3

This keyword MUST be supported by all servers.

LIST ACTIVE returns a list of valid newsgroups and associated
information.  If no wildmat is specified, the server MUST include
every group that the client is permitted to select with the GROUP
(Section 6.1.1) command.  Each line of this list consists of four
fields separated from each other by one or more spaces:
.in 6
.ti 3
o  the name of the newsgroup;
.ti 3
o  the reported high water mark for the group;
.ti 3
o  the reported low water mark for the group;
.ti 3
o  the current status of the group on this server.
.in 3

.bp
The reported high and low water marks are as described in the GROUP
command (see Section 6.1.1).

The status field is typically one of:
.in 6
.ti 3
"y" posting is permitted
.ti 3
"n" posting is not permitted
.ti 3
"m" postings will be forwarded to the newsgroup moderator
.in 3
The server SHOULD use these values when these meanings are required
and MUST NOT use them with any other meaning.  Other values for the
status may exist; the definition of these other values and the
circumstances under which they are returned may be specified in an
extension or may be private to the server.  A client SHOULD treat an
unrecognized status as giving no information.

The status of a newsgroup only indicates how posts to that newsgroup
are normally processed and is not necessarily customised to the
specific client.  For example, if the current client is forbidden
from posting, then this will apply equally to groups with status "y".
Conversely, a client with special privileges (not defined by this
specification) might be able to post to a group with status "n".

For example:

.in 6
.ti 6
[C] LIST ACTIVE
.br
[S] 215 list of newsgroups follows
.br
[S] misc.test 3002322 3000234 y
.br
[S] comp.risks 442001 441099 m
.br
[S] \%alt.rfc-writers.recovery 4 1 y
.br
[S] tx.natives.recovery 89 56 y
.br
[S] tx.natives.recovery.d 11 9 n
.br
[S] .
.in 3

or, on an implementation that includes leading zeroes:

.in 6
.ti 6
[C] LIST ACTIVE
.br
[S] 215 list of newsgroups follows
.br
[S] misc.test 0003002322 0003000234 y
.br
[S] comp.risks 0000442001 0000441099 m
.br
[S] \%alt.rfc-writers.recovery 0000000004 0000000001 y
.br
[S] tx.natives.recovery 0000000089 0000000056 y
.br
[S] tx.natives.recovery.d 0000000011 0000000009 n
.br
[S] .
.in 3

The information is \%newsgroup-based and a wildmat MAY be specified, in
which case the response is limited to only the groups (if any) whose
names match the wildmat.  For example:

.bp
.in 6
.ti 6
[C] LIST ACTIVE   *.recovery
.br
[S] 215 list of newsgroups follows
.br
[S] \%alt.rfc-writers.recovery 4 1 y
.br
[S] tx.natives.recovery 89 56 y
.br
[S] .
.in 3

.in 7
.ti 0
7.6.4  LIST ACTIVE.TIMES
.in 3

This keyword is optional.

The active.times list is maintained by some NNTP servers to contain
information about who created a particular newsgroup and when.  Each
line of this list consists of three fields separated from each other
by one or more spaces.  The first field is the name of the newsgroup.
The second is the time when this group was created on this news
server, measured in seconds since the start of January 1, 1970.  The
third is plain text intended to describe the entity that created the
newsgroup; it is often a mailbox as defined in RFC 2822 [RFC2822]. 
For example:

.in 6
.ti 6
[C] LIST ACTIVE.TIMES
.br
[S] 215 information follows
.br
[S] misc.test 930445408 <creatme@isc.org>
.br
[S] \%alt.rfc-writers.recovery 930562309 <m@example.com>
.br
[S] tx.natives.recovery 930678923 <sob@academ.com>
.br
[S] .
.in 3

The list MAY omit newsgroups for which the information is unavailable
and MAY include groups not available on the server; in particular, it
MAY omit all groups created before the date and time of the oldest
entry.  The client MUST NOT assume that the list is complete or that
it matches the list returned by the LIST ACTIVE (Section 7.6.3)
command.  The NEWGROUPS command (Section 7.3) may provide a better
way to access this information, and the results of the two commands
SHOULD be consistent except that, if the latter is invoked with a
date and time earlier than the oldest entry in active.times list, its
result may include extra groups.

The information is \%newsgroup-based and a wildmat MAY be specified, in
which case the response is limited to only the groups (if any) whose
names match the wildmat.

.in 7
.ti 0
7.6.5  LIST DISTRIB.PATS
.in 3

This keyword is optional.

The distrib.pats list is maintained by some NNTP servers to assist
clients to choose a value for the content of the Distribution header
.bp
of a news article being posted.  Each line of this list consists of
three fields separated from each other by a colon (":").  The first
field is a weight, the second field is a wildmat (which may be a
simple group name), and the third field is a value for the
Distribution header content.  For example:

.in 6
.ti 6
[C] LIST DISTRIB.PATS
.br
[S] 215 information follows
.br
[S] 10:local.*:local
.br
[S] 5:*:world
.br
[S] 20:local.here.*:thissite
.br
[S] .
.in 3

The client MAY use this information to construct an appropriate
Distribution header given the name of a newsgroup.  To do so, it
should determine the lines whose second field matches the newsgroup
name, select from among them the line with the highest weight (with 0
being the lowest), and use the value of the third field to construct
the Distribution header.

The information is not \%newsgroup-based and an argument MUST NOT be
specified.

.in 7
.ti 0
7.6.6  LIST NEWSGROUPS
.in 3

This keyword MUST be supported by \%reader-only and \%general-use servers
and MAY be supported by \%transit-only servers.

The newsgroups list is maintained by NNTP servers to contain the name
of each newsgroup that is available on the server and a short
description about the purpose of the group.  Each line of this list
consists of two fields separated from each other by one or more space
or TAB characters (the usual practice is a single TAB).  The first
field is the name of the newsgroup and the second is a short
description of the group.  For example:

.in 6
.ti 6
[C] LIST NEWSGROUPS
.br
[S] 215 information follows
.br
[S] misc.test General Usenet testing
.br
[S] \%alt.rfc-writers.recovery RFC Writers Recovery
.br
[S] tx.natives.recovery Texas Natives Recovery
.br
[S] .
.in 3

The list MAY omit newsgroups for which the information is unavailable
and MAY include groups not available on the server.  The client MUST
NOT assume that the list is complete or that it matches the list
returned by LIST ACTIVE.

.bp
The information is \%newsgroup-based and a wildmat MAY be specified, in
which case the response is limited to only the groups (if any) whose
names match the wildmat.
.bp
.in 4
.ti 0
8.  Standard extensions
.in 3

N.B.  while these extensions are standard extensions, the term
includes all extensions whose capability labels are in the IANA
registry, not just these three.

Each of the following sections describes an extension that a server
MAY provide.  If the server provides the extension, it MUST include
the appropriate label in the capabilities list.  If it does not
provide it, it MUST NOT include the appropriate 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
C.

.in 5
.ti 0
8.1  The LISTGROUP extension
.in 3

This extension provides one command and has the capability label
LISTGROUP.  This label has no arguments.

.in 7
.ti 0
8.1.1  LISTGROUP
.in 3

.in 9
.ti 0
8.1.1.1  Usage
.in 3

.in 6
.ti 3
Reader command
.ti 3
Syntax
.br
LISTGROUP [group]
.ti 3
Responses
.br
211 number low high group   Article numbers follow (multiline)
.br
411                         No such newsgroup
.br
412                         No newsgroup selected [1]
.ti 3
Parameters
.br
group  = name of newsgroup
.br
number = estimated number of articles in the group
.br
low    = reported low water mark
.br
high   = reported high water mark
.ti 3
[1] The 412 response can only occur if no group has been specified.
.in 3

.in 9
.ti 0
8.1.1.2  Description
.in 3

The LISTGROUP command is used to get a listing of all the article
numbers in a particular newsgroup.  As a side effect, it also selects
the group in the same way as the GROUP command (see Section 6.1.1).

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

On success, 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.  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.

.in 9
.ti 0
8.1.1.3  Examples
.in 3

Example of LISTGROUP on an empty group:
.in 6
.ti 6
[C] LISTGROUP   example.empty.newsgroup
.br
[S] 211 0 0 0 example.empty.newsgroup list follows
.br
[S] .
.in 3

Example of LISTGROUP on a valid current selected newsgroup:
.in 6
.ti 6
[C] GROUP   misc.test
.br
[S] 211 2000 3000234 3002322 misc.test
.br
[C] LISTGROUP
.br
[S] 211 2000 3000234 3002322 misc.test list follows
.br
[S] 3000234
.br
[S] 3000237
.br
[S] 3000238
.br
[S] 3000239
.br
[S] 3002322
.br
[S] .
.in 3

Example of LISTGROUP failing because no group has been selected:
.in 6
.ti 6
[Assumes current selected newsgroup is invalid.]
.br
[C] LISTGROUP
.br
[S] 412 no current group
.br
[C] GROUP   example.is.sob.bradner.or.barber
.bp
.br
[S] 411 no such group
.br
[C] LISTGROUP
.br
[S] 412 no current group
.in 3

.in 5
.ti 0
8.2  Article metadata
.in 3

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).  As with header names, metadata item names are not
\%case-sensitive.

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.) If the server has access to several \%non-identical copies of
an article, the value returned MUST be correct for any copy of that
article retrieved during the same session.

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-".

.in 7
.ti 0
8.2.1  The :bytes metadata item
.in 3

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 excluding both the "." CRLF terminating the response and 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:
.in 6
.ti 3
o  counting a CRLF pair as one octet;
.ti 3
o  including the "." character used for \%byte-stuffing in the number;
.ti 3
o  including the terminating "." CRLF in the number;
.ti 3
o  using one copy of an article for counting the octets but then
returning another one that differs in some (permitted) manner.
.in 3
Implementations should be prepared for such variation and MUST NOT
rely on the value being accurate.
.bp
.in 7
.ti 0
8.2.2  The :lines metadata item
.in 3

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).

.in 5
.ti 0
8.3  The OVER extension
.in 3

This extension provides two commands, OVER and LIST OVERVIEW.FMT. 
The capability 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.

Support for the \%message-id form of the OVER command is optional.  If
.bp
an implementation supports this form, it MUST specify the argument
"MSGID" to the OVER capability label; if not, it MUST NOT specify any
argument.

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

.in 7
.ti 0
8.3.1  OVER
.in 3

.in 9
.ti 0
8.3.1.1  Usage
.in 3

.in 6
.ti 3
Reader command
.ti 3
Syntax
.br
OVER \%message-id
.br
OVER range
.br
OVER
.ti 3
Responses
.in 9
.ti 6
First form \%(message-id specified)
.br
224   Overview information follows (multiline)
.br
430   No article with that \%message-id
.ti 6
Second form (range specified)
.br
224   Overview information follows (multiline)
.br
412   No newsgroup selected
.br
423   No articles in that range
.ti 6
Third form (current article number used)
.br
224   Overview information follows (multiline)
.br
412   No newsgroup selected
.br
420   Current article number is invalid
.in 6
.ti 3
Parameters
.br
range      = number(s) of articles
.br
\%message-id = \%message-id of article
.in 3

.in 9
.ti 0
8.3.1.2  Description
.in 3

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:
.in 6
.ti 3
o  an article number
.ti 3
o  an article number followed by a dash to indicate all following
.ti 3
o  an article number followed by a dash followed by another article
number
.in 3
If neither is specified, the current article number is used.  Support
for the first \%(message-id) form is optional.  If it is not supported,
the generic response code 503 MUST be returned.
.bp
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:
.in 6
.ti 6
"0" or article number (see below)
.br
Subject header content
.br
From header content
.br
Date header content
.br
\%Message-ID header content
.br
References header content
.br
:bytes metadata item
.br
:lines metadata item
.in 3
If the article is specified by \%message-id (the first form of the
command), the article number MUST be replaced with zero, except that
if there is a current selected group and the article is present in
that group, the server MAY use that article number (see the ARTICLE
command (Section 6.2.1) and STAT examples (Section 6.2.4.3) for more
details).  In the other two forms of the command, the article number
MUST be returned.

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.

.bp
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 could 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.

.in 9
.ti 0
8.3.1.3  Examples
.in 3

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

Example of a successful retrieval of overview information for an
article by \%message-id:
.in 6
.ti 6
[C] CAPABILITIES
.br
[S] 101 Capability list:
.br
[S] VERSION 2
.br
[S] READER
.br
[S] OVER MSGID
.br
[S] LIST ACTIVE NEWSGROUPS OVERVIEW.FMT
.br
[S] .
.br
[C] OVER   <45223423@example.com>
.br
[S] 224 Overview information follows
.bp
.br
[S] 0|I am just a test article|"Demo User"
.br
<nobody@example.com>|6 Oct 1998 04:38:40 \%-0500|
.br
<45223423@example.com>|<45454@example.net>|1234|
.br
17|Xref: news.example.com misc.test:3000363
.br
[S] .
.in 3
Note that the article number has been replaced by "0".

Example of the same commands on a system that does not implement
retrieval by \%message-id:
.in 6
.ti 6
[C] CAPABILITIES
.br
[S] 101 Capability list:
.br
[S] VERSION 2
.br
[S] READER
.br
[S] OVER
.br
[S] LIST ACTIVE NEWSGROUPS OVERVIEW.FMT
.br
[S] .
.br
[C] OVER   <45223423@example.com>
.br
[S] 503 Overview by \%message-id unsupported
.in 3

Example of a successful retrieval of overview information for a range
of articles:
.in 6
.ti 6
[C] GROUP   misc.test
.br
[S] 211 1234 3000234 3002322 misc.test
.br
[C] OVER   \%3000234-3000240
.br
[S] 224 Overview information follows
.br
[S] 300234|I am just a test article|"Demo User"
.br
<nobody@example.com>|6 Oct 1998 04:38:40 \%-0500|
.br
<45223423@example.com>|<45454@example.net>|1234|
.br
17|Xref: news.example.com misc.test:3000363
.br
[S] 3000235|Another test article|nobody@nowhere.to
.br
(Demo User)|6 Oct 1998 04:38:45 \%-0500|<45223425@to.to>||
.br
4818|37||Distribution: fi
.br
[S] 3000238|Re: I am just a test article|somebody@elsewhere.to|
.br
7 Oct 1998 11:38:40 +1200|<kfwer3v@elsewhere.to>|
.br
<45223423@to.to>|9234|51
.br
[S] .
.in 3
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:
.in 6
.ti 6
[C] GROUP   misc.test
.br
[S] 211 1234 3000234 3002322 misc.test
.br
[C] OVER   300256
.br
[S] 423 No such article in this group
.in 3

Example of an unsuccessful retrieval of overview information by
.bp
number because no newsgroup was selected first:
.in 6
.ti 6
[Assumes current selected newsgroup is invalid.]
.br
[C] OVER
.br
[S] 412 No newsgroup selected
.in 3

Example of an attempt to retrieve information when the current
selected newsgroup is empty:
.in 6
.ti 6
[C] GROUP   example.empty.newsgroup
.br
[S] 211 0 0 0 example.empty.newsgroup
.br
[C] OVER
.br
[S] 420 No current article selected
.in 3

.in 7
.ti 0
8.3.2  LIST OVERVIEW.FMT
.in 3

.in 9
.ti 0
8.3.2.1  Usage
.in 3

.in 6
.ti 3
Reader command
.ti 3
Syntax
.br
LIST OVERVIEW.FMT
.ti 3
Responses
.br
215   Information follows (multiline)
.in 3

.in 9
.ti 0
8.3.2.2  Description
.in 3

See Section 7.6.1 for general requirements of the LIST command.

The LIST OVERVIEW.FMT command returns a description of the fields in
the database for which it is consistent (as described above).  The
information 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
(except for the case of letters) be exactly:
.nf

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

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

.in 3
    Bytes:
    Lines:

.fi
even though they refer to metadata, not headers.
.bp
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 (which may use either uppercase,
lowercase, or a mix) 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.

.in 9
.ti 0
8.3.2.3  Examples
.in 3

Example of LIST OVERVIEW.FMT output corresponding to the example OVER
output above, using the preferred format:
.in 6
.ti 6
[C] LIST OVERVIEW.FMT
.br
[S] 215 Order of fields in overview database.
.br
[S] Subject:
.br
[S] From:
.br
[S] Date:
.br
[S] \%Message-ID:
.br
[S] References:
.br
[S] :bytes
.br
[S] :lines
.br
[S] Xref:full
.br
[S] Distribution:full
.br
[S] .
.in 3

Example of LIST OVERVIEW.FMT output corresponding to the example OVER
output above, using the alternative format:
.in 6
.ti 6
[C] LIST OVERVIEW.FMT
.br
[S] 215 Order of fields in overview database.
.br
[S] Subject:
.br
[S] From:
.br
[S] Date:
.br
[S] \%Message-ID:
.br
[S] References:
.br
[S] Bytes:
.br
[S] Lines:
.br
[S] Xref:FULL
.br
[S] Distribution:FULL
.br
[S] .
.in 3

.in 5
.ti 0
8.4  The HDR extension
.in 3

This extension provides two new commands: HDR and LIST HEADERS.  The
.bp
capability label for this extension is HDR and has no arguments.

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; it may behave differently when the HDR command is
used with a \%message-id argument and when it is used with a range or
no 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.3) and
the LIST HEADERS command SHOULD take the same approach as the LIST
OVERVIEW.FMT command in resolving them.

.in 7
.ti 0
8.4.1  HDR
.in 3

.in 9
.ti 0
8.4.1.1  Usage
.in 3

.in 6
.ti 3
Reader command
.ti 3
Syntax
.br
HDR header \%message-id
.br
HDR header range
.br
HDR header
.ti 3
Responses
.in 9
.ti 6
First form \%(message-id specified)
.br
225   Headers follow (multiline)
.br
430   No article with that \%message-id
.ti 6
Second form (range specified)
.br
225   Headers follow (multiline)
.br
412   No newsgroup selected
.br
423   No articles in that range
.ti 6
Third form (current article number used)
.br
225   Headers follow (multiline)
.br
412   No newsgroup selected
.br
420   Current article number is invalid
.in 6
.ti 3
Parameters
.br
header     = name of header, without the colon
.br
range      = number(s) of articles
.br
\%message-id = \%message-id of article
.in 3

.in 9
.ti 0
8.4.1.2  Description
.in 3

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.
.bp
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:
.in 6
.ti 3
o  an article number
.ti 3
o  an article number followed by a dash to indicate all following
.ti 3
o  an article number followed by a dash followed by another article
number
.in 3
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 in the range that 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 or
metadata item.  In the case of a header, the header name, colon, and
the first space after the colon are all omitted.

If the article is specified by \%message-id (the first form of the
command), the article number MUST be replaced with zero, except that
if there is a current selected group and the article is present in
that group, the server MAY use that article number (see the ARTICLE
command (Section 6.2.1) and STAT examples (Section 6.2.4.3) for more
details).  In the other two forms of the command, the article number
MUST be returned.

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.3.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
.bp
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; it may behave differently in this respect for the
first \%(message-id) form than for the other forms.  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.

.in 9
.ti 0
8.4.1.3  Examples
.in 3

Example of a successful retrieval of subject lines from a range of
articles (3000235 has no Subject header, and 3000236 is missing):
.in 6
.ti 6
[C] GROUP   misc.test
.br
[S] 211 1234 3000234 3002322 misc.test
.br
[C] HDR   Subject \%3000234-300238
.br
[S] 225 Headers follow
.br
[S] 3000234 I am just a test article
.br
[S] 3000235
.br
[S] 3000237 Re: I am just a test article
.br
[S] 3000238 Ditto
.br
[S] .
.in 3

Example of a successful retrieval of line counts from a range of
articles:
.in 6
.ti 6
[C] GROUP   misc.test
.br
[S] 211 1234 3000234 3002322 misc.test
.br
[C] HDR   :lines \%3000234-300238
.br
[S] 225 Headers follow
.br
[S] 3000234 42
.br
[S] 3000235 5
.br
[S] 3000237 11
.bp
.br
[S] 3000238 2378
.br
[S] .
.in 3

Example of a successful retrieval of the subject line from an article
by \%message-id:
.in 6
.ti 6
[C] GROUP   misc.test
.br
[S] 211 1234 3000234 3002322 misc.test
.br
[C] HDR   subject <i.am.a.test.article@example.com>
.br
[S] 225 Header information follows
.br
[S] 0 I am just a test article
.br
[S] .
.in 3

Example of a successful retrieval of the subject line from the
current article:
.in 6
.ti 6
[C] GROUP   misc.test
.br
[S] 211 1234 3000234 3002322 misc.test
.br
[C] HDR   subject
.br
[S] 225 Header information follows
.br
[S] 3000234 I am just a test article
.br
[S] .
.in 3

Example of an unsuccessful retrieval of a header from an article by
\%message-id:
.in 6
.ti 6
[C] HDR   subject <i.am.not.there@example.com>
.br
[S] 430 No Such Article Found
.in 3

Example of an unsuccessful retrieval of headers from articles by
number because no newsgroup was selected first:
.in 6
.ti 6
[Assumes current selected newsgroup is invalid.]
.br
[C] HDR   subject \%300256-
.br
[S] 412 No newsgroup selected
.in 3

Example of an unsuccessful retrieval of headers because the current
selected newsgroup is empty:
.in 6
.ti 6
[C] GROUP   example.empty.newsgroup
.br
[S] 211 0 0 0 example.empty.newsgroup
.br
[C] HDR   subject \%1-
.br
[S] 423 No articles in that range
.in 3

Example of an unsuccessful retrieval of headers because the server
does not allow HDR commands for that header:
.in 6
.ti 6
[C] GROUP   misc.test
.br
[S] 211 1234 3000234 3002322 misc.test
.br
[C] HDR   \%Content-Type \%3000234-300238
.br
[S] 503 HDR not permitted on \%Content-Type
.in 3
.bp
.in 7
.ti 0
8.4.2  LIST HEADERS
.in 3

.in 9
.ti 0
8.4.2.1  Usage
.in 3

.in 6
.ti 3
Reader command
.ti 3
Syntax
.br
LIST HEADERS [MSGID|RANGE]
.ti 3
Responses
.br
215   Header and metadata list follows (multiline)
.ti 3
Parameters
.br
MSGID = requests list for access by \%message-id
.br
RANGE = requests list for access by range
.in 3

.in 9
.ti 0
8.4.2.2  Description
.in 3

See Section 7.6.1 for general requirements of the LIST command.

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, 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.

If the server treats the first form of the HDR command \%(message-id
specified) differently to the other two forms (range specified or
current article number used) in respect of which headers or metadata
items are available, then:
.in 6
.ti 3
o  if the MSGID argument is specified, the results MUST be those
available for the first form of the HDR command;
.ti 3
o  if the RANGE argument is specified, the results MUST be those
available for the second and third forms of the HDR command;
.ti 3
o  if no argument is specified, the results MUST be those available
in all forms of the HDR command (that is, it MUST only list those
items listed in both the previous cases).
.in 3

If the server does not treat the various forms differently, then it
.bp
MUST always produce the same results and ignore any argument.

.in 9
.ti 0
8.4.2.3  Examples
.in 3

Example of an implementation providing access to only a few headers:
.in 6
.ti 6
[C] LIST HEADERS
.br
[S] 215 headers supported:
.br
[S] Subject
.br
[S] \%Message-ID
.br
[S] Xref
.br
[S] .
.in 3

Example of an implementation providing access to the same fields as
the first example in Section 8.3.2.3:
.in 6
.ti 6
[C] CAPABILITIES
.br
[S] 101 Capability list:
.br
[S] VERSION 2
.br
[S] READER
.br
[S] OVER
.br
[S] HDR
.br
[S] LIST ACTIVE NEWSGROUPS HEADERS OVERVIEW.FMT
.br
[S] .
.br
[C] LIST HEADERS
.br
[S] 215 headers and metadata items supported:
.br
[S] Date
.br
[S] Distribution
.br
[S] From
.br
[S] \%Message-ID
.br
[S] References
.br
[S] Subject
.br
[S] Xref
.br
[S] :bytes
.br
[S] :lines
.br
[S] .
.in 3

Example of an implementation providing access to all headers:
.in 6
.ti 6
[C] LIST HEADERS
.br
[S] 215 metadata items supported:
.br
[S] :
.br
[S] :lines
.br
[S] :bytes
.br
[S] \%:x-article-number
.br
[S] .
.in 3

Example of an implementation distinguishing the first form of the HDR
command from the other two forms:
.in 6
.ti 6
[C] LIST HEADERS RANGE
.br
[S] 215 metadata items supported:
.bp
.br
[S] :
.br
[S] :lines
.br
[S] :bytes
.br
[S] .
.br
[C] LIST HEADERS MSGID
.br
[S] 215 headers and metadata items supported:
.br
[S] Date
.br
[S] Distribution
.br
[S] From
.br
[S] \%Message-ID
.br
[S] References
.br
[S] Subject
.br
[S] :lines
.br
[S] :bytes
.br
[S] \%:x-article-number
.br
[S] .
.br
[C] LIST HEADERS
.br
[S] 215 headers and metadata items supported:
.br
[S] Date
.br
[S] Distribution
.br
[S] From
.br
[S] \%Message-ID
.br
[S] References
.br
[S] Subject
.br
[S] :lines
.br
[S] :bytes
.br
[S] .
.in 3
Note how \%:x-article-number does not appear in the last set of output.
.bp
.in 4
.ti 0
9.  Deprecated commands
.in 3

These commands are deprecated, either because they have been replaced
by new commands with enhanced functionality, or because their
functionality is no longer appropriate.  Servers MUST implement them
but clients SHOULD NOT use them with a server conforming to this
specification.

These commands MAY be removed from a future version of this
specification.

OUTSTANDING ISSUE
.in 6
.ti 6
[2512] There are currently no deprecated commands.  This
section is retained in case we want to deprecate MODE READER.
.in 3
.bp
.in 5
.ti 0
10.  Augmented BNF Syntax for NNTP
.in 3

OUTSTANDING ISSUE
.in 6
.ti 6
Need to update this for new capabilities description.
.in 3

Each of the following sections describes the syntax of a major
element of NNTP.  This syntax extends and refines the descriptions
elsewhere in this specification, and should be given precedence when
resolving apparent conflicts.  Note that ABNF [RFC2234] strings are
\%case-insensitive.  \%Non-terminals used in several places are defined
in a separate section at the end.

The \%non-terminals \%"command-line", \%"command-continuation", and
"response" between them specify the text that flows between client
and server.  For each command, the sequence is:
.in 6
.ti 3
o  the client sends an instance of \%"command-line";
.ti 3
o  the server sends an instance of "response";
.ti 3
o  while the latest response is one that indicates more data is
required (in general, a 3xx response):
.in 9
.ti 6
*  the client sends an instance of \%"command-continuation";
.ti 6
*  the server sends an instance of "response".
.in 6
.in 3

.in 6
.ti 0
10.1  Commands
.in 3

This syntax defines the \%non-terminal \%"command-line", which represents
what is sent from the client to the server.
.nf

  command-line = command EOL
  command = article-command /
        body-command /
        capabilities-command /
        date-command /
        group-command /
        hdr-command /
        head-command /
        help-command /
        ihave-command /
        last-command /
        list-command /
        listgroup-command /
        mode-reader-command /
        newgroups-command /
        newnews-command /
        next-command /
        over-command /
        post-command /
        quit-command /
        stat-command /
.bp
        x-command
\0
  article-command = "ARTICLE" [article-ref]
  body-command = "BODY" [article-ref]
  capabilities-command = "CAPABILITIES" [WS keyword]
  date-command = "DATE"
  group-command = "GROUP" WS newsgroup-name
  hdr-command = "HDR" WS header-meta-name [range-ref]
  head-command = "HEAD" [article-ref]
  help-command = "HELP"
  ihave-command = "IHAVE" WS message-id
  last-command = "LAST"
  list-command = "LIST" [WS list-arguments]
  listgroup-command = "LISTGROUP" [WS newsgroup-name]
  mode-reader-command = "MODE" WS "READER"
  newgroups-command = "NEWGROUPS" WS date-time
  newnews-command = "NEWNEWS" WS wildmat WS date-time
  next-command = "NEXT"
  over-command = "OVER" [WS range-ref]
  post-command = "POST"
  quit-command = "QUIT"
  stat-command = "STAT" [article-ref]
  x-command = x-command-name *(WS x-argument)
      ; This is the generic syntax for an extension command.
      ; Each extension command is specified fully elsewhere
\0
  article-ref = WS (article-number / message-id)
  date = date2y / date4y
  date4y = 4DIGIT 2DIGIT 2DIGIT
  date2y = 2DIGIT 2DIGIT 2DIGIT
  date-time = date WS time [WS "GMT"]
  header-meta-name = header-name / metadata-name
  list-arguments = keyword [WS token]
  metadata-name = ":" 1*A-NOTCOLON
  range = article-number ["-" [article-number]]
  range-ref = WS (range / message-id)
  time = 2DIGIT 2DIGIT 2DIGIT
  x-command-name = keyword
  x-argument = token

.bp
.fi
.in 6
.ti 0
10.2  Command continuation
.in 3

This syntax defines the further material sent by the client in the
case of \%multi-stage commands.
.nf

  command-continuation = ihave-continuation /
        post-continuation
\0
  ihave-continuation = encoded-article
  post-continuation = encoded-article
\0
  encoded-article = content-lines termination
    ; after undoing the "byte-stuffing", this MUST match "article"


.fi
.in 6
.ti 0
10.3  Responses
.in 3

.in 8
.ti 0
10.3.1  Generic responses
.in 3

This syntax defines the \%non-terminal "response", which represents the
generic form of responses \%- that is, what is sent from the server to
the client in response to a command or a \%command-continuation.
.nf

  response = simple-response / multiline-response
  multiline-response = simple-response content-lines termination
\0
  simple-response =
        simple-response-content [SP trailing-comment] CRLF
  simple-response-content = 3DIGIT arguments
  trailing-comment = *U-CHAR
  arguments = *(SP argument) ; How many depends on the response
  argument = 1*A-CHAR

.bp
.fi
.in 8
.ti 0
10.3.2  Initial response line contents
.in 3

This syntax defines the specific initial response lines for the
various commands and extensions in this specification.  Only those
response codes with arguments are listed.
.nf

  simple-response-content =/ response-111-content
        response-211-content
        response-22x-content
        response-401-content
\0
  response-111-content = "111" SP date4y time
  response-211-content = "211" 3(SP article-number) SP newsgroup-name
  response-22x-content = ("220" / "221" / "222" / "223")
        SP article-number SP message-id
  response-401-content = "401" SP capability-label

.bp
.fi
.in 8
.ti 0
10.3.3  \%Multi-line response contents
.in 3

This syntax defines the content of the various \%multi-line responses
(more precisely, the part of the response in \%"content-lines"), in
each case after any \%"byte-stuffing" has been undone.
.nf

  multiline-response-content = article-response /
        body-response /
        capabilities-response /
        hdr-response /
        head-response /
        help-response /
        list-response /
        listgroup-response /
        newgroups-response /
        newnews-response /
        over-response
\0
  article-response = article
  body-response = body
  capabilities-response = 1*(capability-line CRLF)
  hdr-response = *(article-number SP hdr-content CRLF)
  head-response = 1*header
  help-response = *(*B-CHAR CRLF)
  list-response = body
  listgroup-response = *(article-number CRLF)
  newgroups-response = *(newsgroup-name SPA article-number
        SPA article-number SPA newsgroup-status CRLF)
  newnews-response = *(message-id CRLF)
  over-response = *(article-number over-content CRLF)
\0
  hdr-content = *S-NONTAB
  hdr-n-content = [(header-name ":" / metadata-name) SP hdr-content]
  newsgroup-status = %x79 / %x6E / %x6D / private-status
  over-content = 1*6(TAB hdr-content) /
        7(TAB hdr-content) *(TAB hdr-n-content)
  private-status = token ; except the values in newsgroup-status

.bp
.fi
.in 6
.ti 0
10.4  Capability lines
.in 3

This syntax defines the generic form of a capability line in the
capabilities list (see Section 3.6.1).
.nf

  capability-line = *(capability-modifier WS) capability-entry
  capability-entry = capability-label *(WS capability-argument)
  capability-modifier = P-NOTALNUM *P-CHAR
  capability-label = keyword
  capability-argument = token

.fi
This syntax defines the specific capability entries for the
capabilities in this specification.
.nf

.in 3
  capability-entry =/
        hdr-capability /
        implementation-capability /
        list-capability /
        listgroup-capability /
        over-capability /
        reader-capability /
        transit-capability /
        version-capability
\0
  hdr-capability = "HDR"
  implementation-capability = "IMPLEMENTATION" *(WS token)
  list-capability = "LIST" 1*(WS keyword)
  listgroup-capability = "LISTGROUP"
  over-capability = "OVER" [WS "MSGID"]
  reader-capability = "READER" [WS "POST"]
  transit-capability = "TRANSIT"
  version-capability = "VERSION" 1*(WS version-number)
  version-number = nzDIGIT *5DIGIT

.fi
This syntax defines the specific capability modifiers described in
this specification.
.nf

.in 3
  capability-modifier =/ capability-comment /
        capa-mod-unavailable
\0
  capability-comment = "(" [token]
  capa-mod-unavailable = "--" / "-480" / "-483" / "-MODE_READER" /
        "-" keyword


.fi
.in 6
.ti 0
10.5  LIST variants
.in 3

This section defines more specifically the keywords for the LIST
.bp
command and the syntax of the corresponding responses.
.nf

  ; active
  list-arguments =/ "ACTIVE" [WS wildmat]
  list-response =/ list-active-response
  list-active-response = newgroups-response
\0
  ; active.times
  list-arguments =/ "ACTIVE.TIMES" [WS wildmat]
  list-response =/ list-active-times-response
  list-active-times-response =
        *(newsgroup-name SPA 1*DIGIT SPA newsgroup-creator CRLF)
  newsgroup-creator = U-TEXT
\0
  ; distrib.pats
  list-arguments =/ "DISTRIB.PATS"
  list-response =/ list-distrib-pats-response
  list-distrib-pats-response =
        *(1*DIGIT ":" wildmat ":" distribution CRLF)
  distribution = token
\0
  ; headers
  list-arguments =/ "HEADERS" [WS ("MSGID" / "RANGE")]
  list-response =/ list-headers-response
  list-headers-response = *(header-meta-name CRLF) /
        *((metadata-name / ":") CRLF)
\0
  ; newsgroups
  list-arguments =/ "NEWSGROUPS" [WS wildmat]
  list-response =/ list-newsgroups-response
  list-newsgroups-response =
        *(newsgroup-name WS newsgroup-description CRLF)
  newsgroup-description = S-TEXT
\0
  ; overview.fmt
  list-arguments =/ "OVERVIEW.FMT"
  list-response =/ list-overview-fmt-response
  list-overview-fmt-response = "Subject:" CRLF
        "From:" CRLF
        "Date:" CRLF
        "Message-ID:" CRLF
        "References:" CRLF
        ( ":bytes" CRLF ":lines" / "Bytes:" CRLF "Lines:") CRLF
        *((header-name ":full" / metadata-name) CRLF)

.bp
.fi
.in 6
.ti 0
10.6  Articles
.in 3

This syntax defines the \%non-terminal "article", which represents the
format of an article as described in Section 3.5.
.nf

  article = 1*header CRLF body
  header = header-name ":" [CRLF] SP header-content CRLF
  header-content = *(S-CHAR / [CRLF] WS)
  body = *(*B-CHAR CRLF)


.fi
.in 6
.ti 0
10.7  General \%non-terminals
.in 3

These \%non-terminals are used at various places in the syntax and are
collected here for convenience.  A few of these \%non-terminals are not
used in this specification but are provided for the consistency and
convenience of extension authors.
.nf

  article-number = 1*16DIGIT
  content-lines = *([content-text] CRLF)
  content-text = (".." / B-NONDOT) *B-CHAR
  header-name = 1*A-NOTCOLON
  keyword = ALPHA 2*11(ALPHA / DIGIT / "." / "-")
  message-id = "<" 1*248A-NOTGT ">"
  newsgroup-name = 1*wildmat-exact
  termination = "." CRLF
  token = 1*P-CHAR
\0
  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 = "*" / "?"
\0
  base64 = *(4base64-char) [base64-terminal]
  base64-char = UPPER / LOWER / DIGIT / "+" / "/"
  base64-terminal = 2base64-char "==" / 3base64-char "="
\0
  ; Assorted special character sets
  ;   A- means based on US-ASCII, excluding controls and SP
  ;   P- means based on UTF-8, excluding controls and SP
  ;   U- means based on UTF-8, excluding NUL CR and LF
  ;   B- means based on bytes, excluding NUL CR and LF
  A-CHAR     = %x21-7E
  A-NOTCOLON = %x21-39 / %x3B-7E  ; exclude ":"
  A-NOTGT    = %x21-3D / %x3F-7E  ; exclude ">"
  P-CHAR     = A-CHAR / UTF8-non-ascii
.bp
  P-NOTALNUM = PUNCT / UTF8-non-ascii
  U-CHAR     = CTRL / TAB / SP / A-CHAR / UTF8-non-ascii
  U-NONTAB   = CTRL /       SP / A-CHAR / UTF8-non-ascii
  U-TEXT     = P-CHAR *U-CHAR
  B-CHAR     = CTRL / TAB / SP / %x21-FF
  B-NONDOT   = CTRL / TAB / SP / %x21-2D / %x2F-FF  ; exclude "."
\0
  ALPHA = UPPER / LOWER   ; use only when case-insensitive
  CR = %x0D
  CRLF = CR LF
  CTRL = %x01-08 / %x0B-0C / %x0E-1F
  DIGIT = %x30-39
  nzDIGIT = %x31-39
  EOL = *(SP / TAB) CRLF
  LF = %x0A
  LOWER = %x61-7A
  PUNCT = %x21-2F / %x3A-40 / %x5B-60 / %x7B-7E
  SP = %x20
  SPA = 1*SP
  TAB = %x09
  UPPER = %x41-5A
  UTF8-non-ascii = UTF8-2 / UTF8-3 / UTF8-4
  UTF8-2    = %xC2-DF UTF8-tail
  UTF8-3    = %xE0 %xA0-BF UTF8-tail / %xE1-EC 2UTF8-tail /
              %xED %x80-9F UTF8-tail / %xEE-EF 2UTF8-tail
  UTF8-4    = %xF0 %x90-BF 2UTF8-tail / %xF1-F3 3UTF8-tail /
              %xF4 %x80-8F 2UTF8-tail
  UTF8-tail = %x80-BF
  WS = 1*(SP / TAB)

.fi
The following \%non-terminals require special consideration.  They
represent situations where material SHOULD be restricted to \%UTF-8,
but implementations MUST be able to cope with other character
encodings.  Therefore there are two sets of definitions for them.

Implementations MUST accept any content that meets this syntax:
.nf

.in 3
  S-CHAR   = %x21-FF
  S-NONTAB = CTRL / SP / S-CHAR
  S-TEXT   = (CTRL / S-CHAR) *B-CHAR

.fi
Implementations SHOULD only generate content that meets this syntax:
.nf

.in 3
  S-CHAR   = P-CHAR
  S-NONTAB = U-NONTAB
  S-TEXT   = U-TEXT

.bp
.fi
.in 5
.ti 0
11.  IANA Considerations
.in 3

This specification requires IANA to keep a registry of capability
labels and capability modifiers.  The initial contents of this
registry are specified in Section 3.6.5.  As described in Section
3.6.4, labels beginning with X and modifiers beginning with open
parenthesis ("(") are reserved for private use while all other names
are expected to be associated with a specification in an RFC on the
\%standards-track or defining an \%IESG-approved experimental protocol.

Different entries in the registry MUST use different capability
labels or capability modifiers.

Different entries in the registry MUST NOT use the same command name.
For this purpose, variants distinguished by a second or subsequent
keyword (e.g.  "LIST HEADERS" and "LIST OVERVIEW.FMT") count as
different commands.  If there is a need for two extensions to use the
same command, a single harmonised specification MUST be registered.
.bp
.in 5
.ti 0
12.  Security Considerations
.in 3

This section is meant to inform application developers, information
providers, and users of the security limitations in NNTP as described
by this document.  The discussion does not include definitive
solutions to the problems revealed, though it does make some
suggestions for reducing security risks.

.in 6
.ti 0
12.1  Personal and Proprietary Information
.in 3

NNTP, because it was created to distribute network news articles,
will forward whatever information is stored in those articles. 
Specification of that information is outside this scope of this
document, but it is likely that some personal and/or proprietary
information is available in some of those articles.  It is very
important that designers and implementers provide informative
warnings to users so personal and/or proprietary information in
material that is added automatically to articles (e.g.  in headers)
is not disclosed inadvertently.  Additionally, effective and easily
understood mechanisms to manage the distribution of news articles
SHOULD be provided to NNTP Server administrators, so that they are
able to report with confidence the likely spread of any particular
set of news articles.

.in 6
.ti 0
12.2  Abuse of Server Log Information
.in 3

A server is in the position to save session data about a user\'s
requests that might identify their reading patterns or subjects of
interest.  This information is clearly confidential in nature and its
handling can be constrained by law in certain countries.  People
using the NNTP protocol to provide data are responsible for ensuring
that such material is not distributed without the permission of any
individuals that are identifiable by the published results.

.in 6
.ti 0
12.3  Weak Authentication and Access Control
.in 3

There is no \%user-based or \%token-based authentication in the basic
NNTP specification.  Access is normally controlled by server
configuration files.  Those files specify access by using domain
names or IP addresses.  However, this specification does permit the
creation of extensions to the NNTP protocol itself for such purposes;
one such extension is \%[NNTP-AUTH].  While including such mechanisms
is optional, doing so is strongly encouraged.

Other mechanisms are also available.  For example, a proxy server
could be put in place that requires authentication before connecting
via the proxy to the NNTP server.
.bp
.in 6
.ti 0
12.4  DNS Spoofing
.in 3

Many existing NNTP implementations authorize incoming connections by
checking the IP address of that connection against the IP addresses
obtained via DNS lookups of lists of domain names given in local
configuration files.  Servers that use this type of authentication,
and clients that find a server by doing a DNS lookup of the server
name, rely very heavily on the Domain Name Service, and are thus
generally prone to security attacks based on the deliberate
misassociation of IP addresses and DNS names.  Clients and servers
need to be cautious in assuming the continuing validity of an IP
number/DNS name association.

In particular, NNTP clients and servers SHOULD rely on their name
resolver for confirmation of an IP number/DNS name association,
rather than caching the result of previous host name lookups.  Many
platforms already can cache host name lookups locally when
appropriate, and they SHOULD be configured to do so.  It is proper
for these lookups to be cached, however, only when the TTL (Time To
Live) information reported by the name server makes it likely that
the cached information will remain useful.

If NNTP clients or servers cache the results of host name lookups in
order to achieve a performance improvement, they MUST observe the TTL
information reported by DNS.  If NNTP clients or servers do not
observe this rule, they could be spoofed when a previously accessed
server\'s IP address changes.  As network renumbering is expected to
become increasingly common, the possibility of this form of attack
will grow.  Observing this requirement thus reduces this potential
security vulnerability.

This requirement also improves the \%load-balancing behaviour of
clients for replicated servers using the same DNS name and reduces
the likelihood of a user\'s experiencing failure in accessing sites
that use that strategy.

.in 6
.ti 0
12.5  \%UTF-8 issues
.in 3

\%UTF-8 [RFC3629] permits only certain sequences of octets and
designates others as either malformed or "illegal".  The Unicode
standard identifies a number of security issues related to illegal
sequences and forbids their generation by conforming implementations.

Implementations of this specification MUST NOT generate malformed or
illegal sequences and SHOULD detect them and take some appropriate
action.  This could include:
.in 6
.ti 3
o  generating a 501 response code.
.bp
.ti 3
o  replacing such sequences by the sequence %xEF.BF.BD, which encodes
the "replacement character" U+FFFD;
.ti 3
o  closing the connection;
.ti 3
o  replacing such sequences by a "guessed" valid sequence (based on
properties of the \%UTF-8 encoding);
.in 3
In the last case, the implementation MUST ensure that any replacement
cannot be used to bypass validity or security checks.  For example,
the illegal sequence %xC0.A0 is an \%over-long encoding for space
(%x20).  If it is replaced by the latter in a command line, this
needs to happen before the command line is parsed into individual
arguments.  If the replacement came after parsing, it would be
possible to generate an argument with an embedded space, which is
forbidden.  Use of the "replacement character" does not have this
problem, since it is permitted wherever \%non-US-ASCII characters are. 
Implementations SHOULD use one of the first two solutions where the
general structure of the NNTP stream remains intact, and close the
connection if it is no longer possible to parse it sensibly.

.in 6
.ti 0
12.6  Caching of capability lists
.in 3

The CAPABILITIES command provides a capability list, which is
information about the current capabilities of the server.  Whenever
there is a relevant change to the server state, the results of this
command are required to change accordingly.

In most situations the capabilities list in a given server state will
not change from session to session; for example, a given extension
will be installed permanently on a server.  Some clients may
therefore wish to remember which extensions a server supports to
avoid the delay of an additional command and response, particularly
if they open multiple connections in the same session.

However, information about extensions related to security and privacy
MUST NOT be cached, since this could allow a variety of attacks.

For example, consider a server which permits the use of cleartext
passwords on links that are encrypted but not otherwise:
.in 6
.ti 6
[Initial TCP connection \%set-up completed.]
.br
[S] 200 NNTP Service Ready, posting permitted
.br
[C] CAPABILITIES
.br
[S] 101 Capability list:
.br
[S] VERSION 2
.br
[S] READER POST
.br
[S] XENCRYPT
.br
[S] LIST ACTIVE NEWSGROUPS
.br
[S] .
.br
[C] XENCRYPT
.br
[Client and server negotiate encryption on the link]
.bp
.br
[S] 283 Encrypted link established
.br
[C] CAPABILITIES
.br
[S] 101 Capability list:
.br
[S] VERSION 2
.br
[S] READER POST
.br
[S] XSECRET
.br
[S] LIST ACTIVE NEWSGROUPS
.br
[S] .
.br
[C] XSECRET   fred flintstone
.br
[S] 290 Password for fred accepted
.in 3

If the client caches the last capabilities list, then on the next
session it will attempt to use XSECRET on an unencrypted link:
.in 6
.ti 6
[Initial TCP connection \%set-up completed.]
.br
[S] 200 NNTP Service Ready, posting permitted
.br
[C] XSECRET   fred flintstone
.br
[S] 483 Only permitted on secure links
.in 3
exposing the password to any eavesdropper.  While the primary cause
of this is passing a secret without first checking the security of
the link, caching of capability lists can increase the risk.

Any security extension should include requirements to check the
security state of the link in a manner appropriate to that extension.

Caching should normally only be considered for anonymous clients that
do not use any security or privacy extensions and for which the time
required for an additional command and response is a noticeable
issue.
.bp
.in 5
.ti 0
13.  Acknowledgements
.in 3

This document is the result of much effort by the present and past
members of the NNTP Working Group, chaired by Russ Allbery and Ned
Freed.  It could not have been produced without them.

The author acknowledges the original authors of NNTP as documented in
RFC 977 [RFC977]: Brian Kantor and Phil Lapsey.

The author gratefully acknowledges:
.in 6
.ti 3
o  The work of the NNTP committee chaired by Eliot Lear.  The
organization of this document was influenced by the last available
draft from this working group.  A special thanks to Eliot for
generously providing the original \%machine-readable sources for
that document.
.ti 3
o  The work of the DRUMS working group, specifically RFC 1869
[RFC1869], which is the basis of the NNTP extensions mechanism
detailed in this document.
.ti 3
o  The authors of RFC 2616 [RFC2616] for providing specific and
relevant examples of security issues that should be considered for
HTTP.  Since many of the same considerations exist for NNTP, those
examples that are relevant have been included here with some minor
rewrites.
.ti 3
o  The comments and additional information provided by the following
individuals in preparing one or more of the progenitors of this
document:
.in 9
.ti 9
Russ Allbery <rra@stanford.edu>
.br
Wayne Davison <davison@armory.com>
.br
Chris Lewis <clewis@bnr.ca>
.br
Tom Limoncelli <tal@mars.superlink.net>
.br
Eric Schnoebelen <eric@egsner.cirr.com>
.br
Rich Salz <rsalz@osf.org>
.in 6
.in 3

This work was motivated by the work of various news reader authors
and news server authors, which includes those listed below:
.in 6
.ti 3
Rick Adams
.br
Original author of the NNTP extensions to the RN news reader and
last maintainer of Bnews
.ti 3
Stan Barber
.br
Original author of the NNTP extensions to the news readers that
are part of Bnews
.ti 3
Geoff Collyer
.br
Original author of the OVERVIEW database proposal and one of the
original authors of CNEWS
.ti 3
Dan Curry
.br
Original author of the xvnews news reader
.bp
.ti 3
Wayne Davison
.br
Author of the first threading extensions to the RN news reader
(commonly called TRN)
.ti 3
Geoff Huston
.br
Original author of ANU NEWS
.ti 3
Phil Lapsey
.br
Original author of the UNIX reference implementation for NNTP
.ti 3
Iain Lea
.br
Original maintainer of the TIN news reader
.ti 3
Chris Lewis
.br
First known implementer of the AUTHINFO GENERIC extension
.ti 3
Rich Salz
.br
Original author of INN
.ti 3
Henry Spencer
.br
One of the original authors of CNEWS
.ti 3
Kim Storm
.br
Original author of the NN news reader
.in 3

Other people who contributed to this document include:
.in 6
.ti 6

.ti 6
Matthias Andree
.ti 6
Greg Andruk
.ti 6
Maurizio Codogno
.ti 6
Mark Crispin
.ti 6
Andrew Gierth
.ti 6
Juergen Helbing
.ti 6
Scott Hollenbeck
.ti 6
Charles Lindsey
.ti 6
Ade Lovett
.ti 6
Ken Murchison
.ti 6
Francois Petillon
.ti 6
Peter Robinson
.ti 6
Rob Siemborski
.ti 6
Howard Swinehart
.ti 6
Ruud van Tol
.ti 6
Jeffrey Vinocur
.ti 6

.in 3
The author thanks them all and apologises to anyone omitted.

Finally, the present author gratefully acknowledges the vast amount
of work put into previous drafts by the previous author:
.in 6
.ti 6
Stan Barber <sob@academ.com>
.in 3
.bp
.in 5
.ti 0
14.  References
.in 3

.in 6
.ti 0
14.1  Normative References
.in 3

.in 14
.ti 3
[ANSI1986]
.br
American National Standards Institute, "Coded Character
Set \%- \%7-bit American Standard Code for Information
Interchange", ANSI X3.4, 1986.

.ti 3
[RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997.

.ti 3
[RFC2234]  Crocker, D. and P. Overell, "Augmented BNF for Syntax
Specifications: ABNF", RFC 2234, November 1997.

.ti 3
[RFC3548]  Josefsson, S., "The Base16, Base32, and Base64 Data
Encodings", RFC 3548, July 2003.

.ti 3
[RFC3629]  Yergeau, F., \%"UTF-8, a transformation format of ISO
10646", STD 63, RFC 3629, November 2003.

.ti 3
[RFC977]   Kantor, B. and P. Lapsley, "Network News Transfer
Protocol", RFC 977, February 1986.

.in 14
.ti 3
\%[TF.686-1]
.br
International Telecommunications Union \%- Radio, "Glossary,
\%ITU-R Recommendation \%TF.686-1", \%ITU-R Recommendation
\%TF.686-1, October 1997.

.in 6
.ti 0
14.2  Informative References
.in 3

.in 14
.ti 3
\%[NNTP-AUTH]
.br
Vinocur, J., Murchinson, K. and C. Newman, "NNTP
Authentication", \%draft-ietf-nntpext-authinfo-06 (work in
progress), December 2004.

.in 14
.ti 3
\%[NNTP-STREAM]
.br
Vinocur, J. and K. Murchinson, "NNTP Authentication",
\%draft-ietf-nntpext-streaming-03 (work in progress),
December 2004.

.in 14
.ti 3
\%[NNTP-TLS]
.br
Vinocur, J., Murchison, K. and C. Newman, "Using TLS with
NNTP", \%draft-ietf-nntpext-tls-nntp-04 (work in progress),
December 2004.

.ti 3
[RFC1036]  Horton, M. and R. Adams, "Standard for interchange of
USENET messages", RFC 1036, December 1987.
.bp
.ti 3
[RFC1305]  Mills, D., "Network Time Protocol (Version 3)
Specification, Implementation", RFC 1305, March 1992.

.ti 3
[RFC1869]  Klensin, J., Freed, N., Rose, M., Stefferud, E. and D.
Crocker, "SMTP Service Extensions", STD 10, RFC 1869,
November 1995.

.ti 3
[RFC2616]  Fielding, R., Gettys, J., Mogul, J., Nielsen, H.,
Masinter, L., Leach, P. and T. \%Berners-Lee, "Hypertext
Transfer Protocol \%-- HTTP/1.1", RFC 2616, June 1999.

.ti 3
[RFC2629]  Rose, M., "Writing \%I-Ds and RFCs using XML", RFC 2629,
June 1999.

.ti 3
[RFC2822]  Resnick, P., "Internet Message Format", RFC 2822, April
2001.

.ti 3
[RFC2980]  Barber, S., "Common NNTP Extensions", RFC 2980, October
2000.

.in 14
.ti 3
[ROBE1995]
.br
Robertson, R., "FAQ: Overview database / NOV General
Information", January 1995.

There is no definitive copy of this document known to the
author.  It was previously posted as the Usenet article
\%<news:nov-faq-1-930909720@agate.Berkeley.EDU>

.in 14
.ti 3
[SALZ1992]
.br
Salz, R., "Manual Page for wildmat(3) from the INN 1.4
distribution, Revision 1.10", April 1992.

There is no definitive copy of this document known to the
author.


.in 3
.nf
.ti 0
Author\'s Address

Clive D.W. Feather
Thus plc
322 Regents Park Road
London  N3 2QQ
GB

Phone: +44 20 8495 6138
Fax:   +44 870 051 9937
EMail: clive@demon.net
URI:   http://www.davros.org/
.bp
.fi
.in 13
.ti 0
Appendix A.  Interaction with other specifications
.in 3

NNTP is most often used for transferring articles that conform to RFC
1036 [RFC1036] (such articles are called "Netnews articles" here). 
It is also sometimes used for transferring email messages that
conform to RFC 2822 [RFC2822] (such articles are called "email
articles" here).  In this situation, articles must conform both to
this specification and to that other one; this appendix describes
some relevant issues.

.in 5
.ti 0
A.1  Header folding
.in 3

NNTP allows a header line to be folded (by inserting a CRLF pair)
before any space or TAB character.

Both email and Netnews articles are required to have at least one
octet other than space or TAB on each header line.  Thus folding can
only happen at one point in each sequence of consecutive spaces or
TABs.  Netnews articles are further required to have the header name,
colon, and following space all on the first line; folding may only
happen beyond that space.  Finally, some \%non-conforming software will
remove trailing spaces and TABs from a line.  Therefore it might be
inadvisable to fold a header after a space or TAB.

For maximum safety, header lines SHOULD conform to the following
syntax rather than that in Section 10.6.
.nf

  header = header-name ":" SP [header-content] CRLF
  header-content = [WS] token *( [CRLF] WS token )


.fi
.in 5
.ti 0
A.2  \%Message-IDs
.in 3

Every article handled by an NNTP server MUST have a unique
\%message-id.  For the purposes of this specification, a \%message-id is
an arbitrary opaque string that merely needs to meet certain
syntactic requirements and is just a way to refer to the article.

Because there is a significant risk of old articles being reinjected
into the global Usenet system, RFC 1036 [RFC1036] requires that
\%message-ids are globally unique for all time.

This specification states that \%message-ids are the same if and only
if they consist of the same sequence of octets.  Other specifications
may define two different sequences as being equal because they are
putting an interpretation on particular characters.  RFC 2822
[RFC2822] has a concept of "quoted" and "escaped" characters.  It
therefore considers the three \%message-ids:
.bp
.in 6
.ti 6
<abcd@example.com>
.br
<"abcd"@example.com>
.br
<"ab\\cd"@example.com>
.in 3
as being identical.  Therefore an NNTP implementation handing email
articles must ensure that only one of these three appears in the
protocol and the other two are converted to it as and when necessary,
such as when a client checks the results of a NEWNEWS command against
an internal database of \%message-ids.  Note that RFC 1036 [RFC1036]
never treats two different strings as being identical.  Its draft
successor restricts the syntax of \%message-ids so that, whenever RFC
2822 would treat two strings as equivalent, only one of them is valid
(in the above example only the first string is valid).

This specification does not describe how the \%message-id of an article
is determined; it may be deduced from the contents of the article or
derived from some external source.  If the server is also conforming
to another specification that contains a definition of \%message-id
compatible with this one, the server SHOULD use those \%message-ids.  A
common approach, and one that SHOULD be used for email and Netnews
articles, is to extract the \%message-id from the contents of a header
with name \%"Message-ID".  This may not be as simple as copying the
entire header contents; it may be necessary to strip off comments and
undo quoting, or to reduce "equivalent" \%message-ids to a canonical
form.

If an article is obtained through the IHAVE command, there will be a
\%message-id provided with the command.  The server MAY either use it
or determine one from the article contents.  However, whichever it
does it SHOULD ensure that, if the IHAVE command is repeated with the
same argument and article, it will be recognized as a duplicate.

If an article does not contain a \%message-id that the server can
identify, it MUST synthesize one.  This could, for example, be a
simple sequence number or based on the date and time that the article
arrived.  When handling email or Netnews articles, a \%Message-ID
header SHOULD be added to ensure global consistency and uniqueness.

.in 5
.ti 0
A.3  Article posting
.in 3

As far as NNTP is concerned, the POST and IHAVE commands provide the
same basic facilities in a slightly different way.  However they have
rather different intentions.

The IHAVE command is intended for transmitting conforming articles
between a system of NNTP servers, with all articles perhaps also
conforming to another specification (e.g.  all articles are Netnews
articles).  It is expected that the client will have already done any
necessary validation (or has in turn obtained the article from a
.bp
third party which has done so); therefore the contents SHOULD be left
unchanged.

In contrast, the POST command is intended for use when an \%end-user is
injecting a \%newly-created article into a such a system.  The article
being transferred might not be a conforming email or Netnews article,
and the server is expected to validate it and, if necessary, convert
it to the right form for onward distribution.  This is often done by
a separate piece of software on the server installation; if so, the
NNTP server SHOULD pass the incoming article to that software
unaltered, making no attempt to filter characters, fold or limit
lines, or otherwise process the incoming text.

The POST command can fail in various ways and clients should be
prepared to \%re-send an article.  When doing so, however, it is often
important to ensure \%- as far as possible \%- that the same \%message-id
is allocated to both attempts so that the server, or other servers,
can recognize the two articles as being duplicates.  In the case of
email or Netnews articles, therefore, the posted article SHOULD
contain a header with name \%"Message-ID" and the contents of this
header SHOULD be identical on each attempt.  The server SHOULD ensure
that two POSTed articles with the same contents for this header are
recognized as identical and the same \%message-id allocated, whether or
not those contents are suitable for use as the \%message-id.
.bp
.in 13
.ti 0
Appendix B.  Summary of Response Codes
.in 3

This section contains a list of every response code defined in this
document, whether it is \%multi-line, which commands can generate it,
what arguments it has, and what its meaning is.

.in 6
.ti 3
Response code 100 \%(multi-line)
.br
Generated by: HELP
.br
Meaning: help text follows.
.ti 3
Response code 101 \%(multi-line)
.br
Generated by: CAPABILITIES
.br
Meaning: capabilities list follows.
.ti 3
Response code 111
.br
Generated by: DATE
.br
1 argument: yyyymmddhhmmss
.br
Meaning: server date and time.
.ti 3
Response code 200
.br
Generated by: initial connection, MODE\0READER
.br
Meaning: service available, posting allowed.
.ti 3
Response code 201
.br
Generated by: initial connection, MODE\0READER
.br
Meaning: service available, posting prohibited.
.ti 3
Response code 205
.br
Generated by: QUIT
.br
Meaning: connection closing (the server immediately closes the
connection).
.ti 3
Response code 211
.br
The 211 response code has two completely different forms depending
on which command generated it:
.in 9
.ti 9
Generated by: GROUP
.br
4 arguments: number low high group
.br
Meaning: group selected.
.sp 1
.ti 9
\%(multi-line)
.br
Generated by: LISTGROUP
.br
4 arguments: number low high group
.br
Meaning: article numbers follow.
.in 6
.ti 3
Response code 215 \%(multi-line)
.br
Generated by: LIST
.br
Meaning: information follows.
.ti 3
Response code 220 \%(multi-line)
.br
Generated by: ARTICLE
.br
2 arguments: n \%message-id
.br
Meaning: article follows.
.ti 3
Response code 221 \%(multi-line)
.br
Generated by: HEAD
.br
2 arguments: n \%message-id
.br
Meaning: article headers follow.
.bp
.ti 3
Response code 222 \%(multi-line)
.br
Generated by: BODY
.br
2 arguments: n \%message-id
.br
Meaning: article body follows.
.ti 3
Response code 223
.br
Generated by: LAST, NEXT, STAT
.br
2 arguments: n \%message-id
.br
Meaning: article exists and selected.
.ti 3
Response code 224 \%(multi-line)
.br
Generated by: OVER
.br
Meaning: overview information follows.
.ti 3
Response code 225 \%(multi-line)
.br
Generated by: HDR
.br
Meaning: headers follow.
.ti 3
Response code 230 \%(multi-line)
.br
Generated by: NEWNEWS
.br
Meaning: list of new articles follows.
.ti 3
Response code 231 \%(multi-line)
.br
Generated by: NEWGROUPS
.br
Meaning: list of new newsgroups follows.
.ti 3
Response code 235
.br
Generated by: IHAVE (second stage)
.br
Meaning: article transferred OK.
.ti 3
Response code 240
.br
Generated by: POST (second stage)
.br
Meaning: article received OK.
.ti 3
Response code 335
.br
Generated by: IHAVE (first stage)
.br
Meaning: send article to be transferred.
.ti 3
Response code 340
.br
Generated by: POST (first stage)
.br
Meaning: send article to be posted.
.ti 3
Response code 400
.br
Generic response and generated by initial connection
.br
Meaning: service not available or no longer available (the server
immediately closes the connection).
.ti 3
Response code 401
.br
Generic response
.br
1 argument: \%capability-label
.br
Meaning: the server is in the wrong mode; the indicated capability
should be used to change the mode.
.ti 3
Response code 403
.br
Generic response
.br
Meaning: internal fault or problem preventing action being taken. 
.ti 3
Response code 411
.br
Generated by: GROUP, LISTGROUP
.br
Meaning: no such newsgroup.
.bp
.ti 3
Response code 412
.br
Generated by: ARTICLE, BODY, HDR, HEAD, LAST, LISTGROUP, NEXT,
OVER, STAT
.br
Meaning: no newsgroup selected.
.ti 3
Response code 420
.br
Generated by: ARTICLE, BODY, HDR, HEAD, LAST, NEXT, OVER, STAT
.br
Meaning: current article number is invalid.
.ti 3
Response code 421
.br
Generated by: NEXT
.br
Meaning: no next article in this group.
.ti 3
Response code 422
.br
Generated by: LAST
.br
Meaning: no previous article in this group.
.ti 3
Response code 423
.br
Generated by: ARTICLE, BODY, HDR, HEAD, OVER, STAT
.br
Meaning: no article with that number or in that range.
.ti 3
Response code 430
.br
Generated by: ARTICLE, BODY, HDR, HEAD, OVER, STAT
.br
Meaning: no article with that \%message-id.
.ti 3
Response code 435
.br
Generated by: IHAVE (first stage)
.br
Meaning: article not wanted.
.ti 3
Response code 436
.br
Generated by: IHAVE (either stage)
.br
Meaning: transfer not possible (first stage) or failed (second
stage); try again later.
.ti 3
Response code 437
.br
Generated by: IHAVE (second stage)
.br
Meaning: transfer rejected; do not retry.
.ti 3
Response code 440
.br
Generated by: POST (first stage)
.br
Meaning: posting not permitted.
.ti 3
Response code 441
.br
Generated by: POST (second stage)
.br
Meaning: posting failed.
.ti 3
Response code 480
.br
Generic response
.br
Meaning: command unavailable until the client has authenticated
itself.
.ti 3
Response code 483
.br
Generic response
.br
Meaning: command unavailable until suitable privacy has been
arranged.
.ti 3
Response code 500
.br
Generic response
.br
Meaning: unknown command.
.bp
.ti 3
Response code 501
.br
Generic response
.br
Meaning: syntax error in command.
.ti 3
Response code 502
.br
Generic response and generated by initial connection
.br
Meaning for the initial connection and the MODE READER command:
service permanently unavailable (the server immediately closes the
connection).
.br
Meaning for all other commands: command not permitted (and there
is no way for the client to change this).
.ti 3
Response code 503
.br
Generic response
.br
Meaning: feature not supported.
.ti 3
Response code 504
.br
Generic response
.br
Meaning: error in \%base64-encoding [RFC3548] of an argument
.in 3
.bp
.in 13
.ti 0
Appendix C.  Formal specification of the standard
extensions
.in 3

This section gives a formal definition of each of the extensions in
Section 8 as required by Section 3.6.4 for the IANA registry.

.in 5
.ti 0
C.1  The LISTGROUP extension
.in 3

.in 6
.ti 3
o  This extension provides information about specific article
numbers.
.ti 3
o  The capability label is "LISTGROUP".
.ti 3
o  The capability label has no arguments.
.ti 3
o  The extension defines one new command: LISTGROUP, whose behaviour,
arguments, and responses are defined in Section 8.1.
.ti 3
o  The extension does not associate any new responses with
\%pre-existing NNTP commands.
.ti 3
o  The extension does not affect the behaviour of a server or client
other than via the new command.
.ti 3
o  The extension does not affect the maximum length of commands and
initial response lines.
.ti 3
o  The extension does not alter pipelining, and the LISTGROUP command
can be pipelined.
.ti 3
o  Use of this extension does not alter the capabilities list.
.ti 3
o  The extension does not cause any \%pre-existing command to produce a
401, 480, or 483 response.
.ti 3
o  The LISTGROUP command is a reader command.
.in 3

.in 5
.ti 0
C.2  The OVER extension
.in 3

.in 6
.ti 3
o  This extension provides support for an overview of newsgroups.
.ti 3
o  The capability label is "OVER".
.ti 3
o  The capability label has the optional argument "MSGID", indicating
that the \%message-id variant of the OVER command is supported.
.ti 3
o  The extension defines two new commands: OVER and LIST
OVERVIEW.FMT, whose behaviour, arguments, and responses are
defined in Section 8.3.
.ti 3
o  The extension does not associate any new responses with
\%pre-existing NNTP commands.
.ti 3
o  The extension requires the server to maintain an overview database
and article metadata, as described in Section 8.2.
.ti 3
o  The extension does not affect the maximum length of commands and
initial response lines.
.ti 3
o  The extension does not alter pipelining, and the OVER and LIST
OVERVIEW.FMT commands can be pipelined.
.ti 3
o  Use of this extension does not alter the capabilities list.
.ti 3
o  The extension does not cause any \%pre-existing command to produce a
401, 480, or 483 response.
.bp
.ti 3
o  The OVER and LIST OVERVIEW.FMT commands are reader commands.
.in 3

.in 5
.ti 0
C.3  The HDR extension
.in 3

.in 6
.ti 3
o  This extension provides batched header retrieval.
.ti 3
o  The capability label is "HDR".
.ti 3
o  The capability label has no arguments.
.ti 3
o  The extension defines two new commands: HDR and LIST HEADERS,
whose behaviour, arguments, and responses are defined in Section
8.4.
.ti 3
o  The extension does not associate any new responses with
\%pre-existing NNTP commands.
.ti 3
o  The extension requires the server to maintain article metadata, as
described in Section 8.2.
.ti 3
o  The extension does not affect the maximum length of commands and
initial response lines.
.ti 3
o  The extension does not alter pipelining, and the HDR and LIST
HEADERS commands can be pipelined.
.ti 3
o  Use of this extension does not alter the capabilities list.
.ti 3
o  The extension does not cause any \%pre-existing command to produce a
401, 480, or 483 response.
.ti 3
o  The HDR and LIST HEADERS commands are reader commands.
.in 3
.bp
.ti 0
Intellectual Property Statement

The IETF takes no position regarding the validity or scope of any
Intellectual Property Rights or other rights that might be claimed to
pertain to the implementation or use of the technology described in
this document or the extent to which any license under such rights
might or might not be available; nor does it represent that it has
made any independent effort to identify any such rights.  Information
on the procedures with respect to rights in RFC documents can be
found in BCP 78 and BCP 79.

Copies of IPR disclosures made to the IETF Secretariat and any
assurances of licenses to be made available, or the result of an
attempt made to obtain a general license or permission for the use of
such proprietary rights by implementers or users of this
specification can be obtained from the IETF \%on-line IPR repository at
http://www.ietf.org/ipr.

The IETF invites any interested party to bring to its attention any
copyrights, patents or patent applications, or other proprietary
rights that may cover technology that may be required to implement
this standard.  Please address the information to the IETF at
\%ietf-ipr@ietf.org.


.ti 0
Disclaimer of Validity

This document and the information contained herein are provided on an
"AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
ENGINEERING TASK FORCE DISCLAIM 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.


.ti 0
Copyright Statement

Copyright (C) The Internet Society (2004).  This document is subject
to the rights, licenses and restrictions contained in BCP 78, and
except as set forth therein, the authors retain all their rights.


.ti 0
Acknowledgment

Funding for the RFC Editor function is currently provided by the
Internet Society.
