<!-- THINGS TO DO

Solve all of the unresolved issues.
Which references should be normative?
Audit all response codes and make a summary table.
Audit all example responses to ensure the codes are valid.
Check ABNF using tool from www.apps.ietf.org.
Can I do an XML consistency check?

 -->
<?xml version='1.0'?>
<!DOCTYPE rfc SYSTEM 'rfc2629.dtd'>

<?rfc strict='yes'?>
<?rfc compact='no'?>
<?rfc editing='no'?> <!-- editing marks -->
<?rfc symrefs='yes'?>
<?rfc sortrefs='yes'?>
<?rfc emoticonic='yes'?>
<?rfc toc='yes'?>
<?rfc tocdepth='4'?>

<rfc ipr="full2026" docName="draft-ietf-nntpext-base-18">
<front>
  <title>Network News Transport Protocol</title>

  <author initials="C.D.W." surname="Feather" fullname="Clive D.W. Feather">
    <organization>Thus plc</organization>
    <address>
      <postal>
        <street>322 Regents Park Road</street>
        <city>London</city>
        <code>N3 2QQ</code>
        <country>GB</country>
      </postal>
      <phone>     +44 20 8495 6138 </phone>
      <facsimile> +44 870 051 9937 </facsimile>
      <email>clive@demon.net</email>
      <email>clive@davros.org</email>
      <uri>http://www.davros.org/</uri>
    </address>
  </author>
  <date year="2003" month="April" day="25" />
  <area>Applications</area>
  <workgroup>NNTP</workgroup>
  <keyword>NNTP</keyword>
  <keyword>News</keyword>
  <keyword>Usenet</keyword>
  <keyword>RFC 977</keyword>
  <abstract>
    <t>
The Network News Transport 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.
    </t>
  </abstract>
  <note title="Administration">
    <t>
This document is a product of the NNTP Working Group, chaired by
Russ Allbery and Ned Freed.
    </t>
  </note>
  <note title="Outstanding issues">
    <N.issue>
    <t>
Outstanding substantive (as opposed to editorial) issues in the text are
shown thus.
    </t>
    </N.issue>
  </note>
  <note title="Author's Note">
    <t>
This draft is written in XML using an NNTP-specific DTD.
Custom software is used to convert this to
<xref target="RFC2629">RFC 2629</xref>
format, and then the public "xml2rfc" package to further reduce this to
text, nroff source, and HTML.
    </t>
    <t>
No perl was used in producing this draft.
    </t>
  </note>
  <note title="Rights">
    <t>
UNIX is a registered trademark of the X/Open Company Ltd.
    </t>
  </note>
</front>

<!-- The actual RFC -->

<middle>

<section title="Introduction">

<t>
This document specifies the Network News Transport Protocol
(NNTP), which is used for the distribution, inquiry,
retrieval, and posting of Netnews articles using a reliable
stream-based mechanism.
For news reading clients, NNTP
enables retrieval of news articles that are stored in a
central database, giving subscribers the ability to select
only those articles they wish to read.
</t>
<t>
The Netnews model provides for indexing, cross-referencing,
and expiration of aged messages.
For server-to-server interaction, NNTP is designed for efficient
transmission of Netnews articles over a reliable full duplex
communication channel.
</t>
<t>
Every attempt is made to ensure that the protocol
specification in this document is compatible with the version
specified in <xref target="RFC977">RFC 977</xref>.
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
<xref target="RFC2279">UTF-8</xref>
instead of
<xref target="ANSI1986">US-ASCII</xref>.
It now requires all articles to have a message-id,
eliminating the "&lt;0&gt;" placeholder used in RFC 977.
It also extends the newsgroup name matching
capabilities already documented in RFC 977.
</t>
<t>
Generally, new functionality is made available using new commands.
Part of that 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.
</t>
<t>
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
<xref target="RFC2119">RFC 2119</xref>.
</t>
<t>
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".
</t>
<t>
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.
</t>

</section>

<section anchor="notation" title="Notation">

<t>
The following notational conventions are used in this document.
</t>
<figure>
  <artwork>
  UPPERCASE     indicates literal text to be included in the
                command;
  lowercase     indicates a token described elsewhere;
  [brackets]    indicate that the parameter is optional;
  ellipsis...   indicates that the parameter may be repeated any
                number of times (it must occur at least once);
  vertical|bar  indicates a choice of two mutually exclusive
                parameters (exactly one must be provided).
  </artwork>
</figure>
<t>
The name "message-id" for a command or response parameter indicates that
it is the message-id of an article as described in
<xref target="article.concepts" />,
including the angle brackets.
</t>
<t>
The name "wildmat" for a parameter indicates that it is a
wildmat as defined in <xref target="wildmat" />.
If the parameter does not meet the requirements of that section
(for example, if it does not fit the grammar of
<xref target="wildmat.syntax" />)
the NNTP server MAY place some interpretation on it (not specified by
this document) or otherwise MUST treat it as a syntax error.
</t>
<t>
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.
</t>
<t>
The terms "NUL", "TAB", "LF", "CR, and "space" refer to the octets
with those codes in
<xref target="ANSI1986">US-ASCII</xref>
(that is, %x00, %x09, %x0A, %x0D, and %x20 respectively),
as do quoted characters
(so "." and "&lt;" refer to %x2E and %x3C).
The term "CRLF" or "CRLF pair" means the sequence CR immediately
followed by LF (that is, %x0D.0A).
A "printable US-ASCII character" is an octet in the range %x21-7E.
</t>
<t>
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 <xref target="group">GROUP command</xref>)
is invalid;
when so, this is indicated at the start of the example.
</t>

</section>


<section title="Basic Concepts">
  <section title="Commands and Responses" anchor='basics'>
<t>
NNTP operates over any reliable data stream 8-bit-wide channel.
Initially, the server host starts the NNTP service by listening on a
TCP port;
when running over TCP/IP, the official port for the NNTP service is 119.
When a client host wishes to make use of the service, it MUST establish
a TCP connection with the server host by connecting to that host on
the same port on which the server is listening.
When the connection is established, the
NNTP server host MUST send a greeting.
The client host and server host then exchange
commands and responses (respectively) until the connection is
closed or aborted.
</t>
<t>
The character set for all NNTP commands is
<xref target="RFC2279">UTF-8</xref>.
Commands in NNTP MUST consist of a keyword,
which MAY be followed by one or more arguments.
A CRLF pair MUST terminate all commands.
Multiple commands MUST NOT be on the same line.
Keywords MUST consist of printable US-ASCII characters.
Unless otherwise noted elsewhere in this document,
arguments SHOULD consist of printable US-ASCII characters.
Keywords and arguments MUST be each
separated by one or more space or TAB characters.
Keywords MUST be at least three
characters and MUST NOT exceed 12 characters.
Command lines MUST NOT exceed 512 octets, which includes the
terminating CRLF pair.
The arguments MUST NOT exceed 497 octets.
</t>
<t>
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.
</t>
<t>
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.
</t>
<t>
Keywords are case-insensitive;
the case of keywords for commands MUST be ignored by the server.
Command and response parameters are case or language specific only when
stated,
either in this document or in other relevant specifications.
</t>
<t>
An NNTP server MUST implement all the commands in this specification except
for those marked as optional and those in extensions.
</t>
<t>
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.
</t>
<N.issue>
<t>
Should the initial response line be limited to 512 octets as well?
<!-- Russ happy, Charles no -->
Possible text:
</t>
<t>
The first or only line of the response MUST NOT exceed 512 octets, which
includes the response code and the terminating CRLF pair.
</t>
<t>
The text further down about "does not place any limit on the length" would
need equivalent edits.
</t>
</N.issue>
<t>
All multi-line responses MUST adhere to the following format:
</t>
<list style="numbers">
<t>
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.
</t>
<t>
The first such line contains the response code as with a
single line response.
</t>
<t>
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.
</t>
<t>
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).
</t>
<t>
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.
</t>
<t>
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).
</t>
</list>
<t>
Note that texts using an encoding (such as UTF-16 or UTF-32) that
may contain the octets NUL, LF, or CR other than a CRLF pair
cannot be reliably conveyed in the above format.
However, except when stated otherwise, this specification does not
require the content to be UTF-8 and it is possible for
octets above and below 128 to be mixed arbitrarily.
</t>
<t>
This document does not place any limit on the length of a line.
However, the standards that define the format of articles may do so.
</t>
<t>
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.
</t>
  </section>
  <section title="Response Codes">
<t>
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.
</t>
<t>
The first digit of the response broadly indicates the
success, failure, or progress of the previous command.
</t>
<list>
<t>
          1xx - Informative message.
<vspace />2xx - Command completed OK.
<vspace />3xx - Command OK so far; send the rest of it.
<vspace />4xx - Command was correct, but couldn't be performed
for some reason.
<vspace />5xx - Command unimplemented, or incorrect,
or a serious program error occurred.
</t>
</list>
<N.issue>
<t>
I proposed that we assign 6xx for extensions and future commands to use for
multiline responses, thus at least limiting (if not eliminating) the
problem clients have of working out whether one is coming up.
Nobody was violently against the idea, but nobody was particularly in
favour either.
</t>
</N.issue>
<t>
The next digit in the code indicates the function response category.
</t>
<list>
<t>
          x0x - Connection, setup, and miscellaneous messages
<vspace />x1x - Newsgroup selection
<vspace />x2x - Article selection
<vspace />x3x - Distribution functions
<vspace />x4x - Posting
<vspace />x8x - Reserved for authentication and authorization extensions
<vspace />x9x - Reserved for private use (non-standard extensions)
</t>
</list>
<t>
Certain responses contain parameters 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 parameters is fixed for each response code, as is whether
or not the code introduces a multi-line response.
Any extension MUST follow this principle as well, but note that,
for historical reasons, the 211 response code is an exception to this.
In all other cases, the client MUST only use the status indicator itself
to determine the nature of the response.
The exact response codes that can be returned by any given command are
detailed in the description of that command.
</t>
<t>
Parameters MUST be separated from the numeric status
indicator and from each other by a single space.
All numeric parameters MUST be in base 10 (decimal) format,
and MAY have leading zeros.
String parameters 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 parameter 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
parameter by at least one space.
</t>
<t>
The server MUST respond to any command with the appropriate
generic response
(given in <xref target="generic.response.codes" />)
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.)
</t>
<t>
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.
</t>
<t>
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.
</t>
<t>
Neither this document nor any extension registered with IANA
(see <xref target="extensions" />)
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.)
</t>

    <section anchor="generic.response.codes" title="Generic Response Codes">
<t>
The server MUST respond to any command with the appropriate
one of the following generic responses if it represents the situation.
</t>
<t>
If the command is not recognized, or it is an optional
command or extension that is not implemented by the server,
the response code 500 MUST be returned.
</t>
<t>
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,
the response code 501 MUST be returned.
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 requested variant is not implemented but the base command is.
</t>
<t>
If the server experiences an internal fault or problem that means it is
unable to carry out the command (for example, a necessary file is missing
or a necessary service could not be contacted), the response code 403 MUST
be returned.
If the server recognises the command but does not provide an optional
feature
(for example because it does not store the required information),
or only handles a subset of legitimate cases
(see the <xref target="hdr">HDR command</xref> for an example),
the response code 503 MUST be returned.
Note that where a command is optional (e.g. LIST ACTIVE.TIMES) and is not
provided by a server, this MAY be treated as an unimplemented command
(response code 500 or 501) or as a working command where the information
is not available (response code 503).
</t>
<N.issue>
<t>
Do we need to add text like:
<list>
<t>
For backwards compatibility a server MAY return the response code 503
where this specification requires the response code 403,
and a client SHOULD be prepared for this.
This waiver may be removed in a future revision of this specification.
</t>
</list>
<!-- Russ agnostic, Clive slightly against -->
</t>
</N.issue>
<t>
If the client is not authorized to use the specified facility when
the server is in its current state,
then either the response code 480 or the response code 502 MUST be returned.
The response code 480 SHOULD be used if a different command
(for example, an extension used to present credentials)
might change the server state so that the command is permitted.
The response code 502 SHOULD be used if the server wishes to indicate
that it is necessary to terminate the connection and start a new one with 
the appropriate authority before the command can be used.
Since it is not always possible to clearly distinguish these two cases,
a server MAY issue either of these response codes for either case.
(Note that the server MUST NOT close the TCP connection
immediately after a 502 response except at the
<xref target="initial.connection">initial connection</xref>
and with the
<xref target="mode.reader">MODE READER</xref>
command.)
</t>
<N.issue>
<t>
This isn't a complete solution to the 480 issue;
what about the TLS extension, which uses 483 to mean "you need encryption".
Should 480 be used for other than "you need authentication"?
What code should be used to mean "can't do AUTH until after MODE READER"?
</t>
<t>
Do we need a more generic mechanism for
"you must invoke extension X to do Y"?
</t>
<t>
The best proposal made so far is that all 48x codes, if returned from an
existing command, mean "unavailable unless some authentication or privacy
extension is invoked".
Does this tie in with the issue of permitting existing commands not listed
in an extension?
</t>
</N.issue>
<t>
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.
It MAY give a
401 response code to any command to indicate that termination
is imminent (following a 401 response, it MUST NOT close the
TCP connection immediately).
</t>
<N.issue>
<t>
It's not clear that we need 401;
it appears to have been an invention.
If we do keep it, then text is needed to indicate what happens with
commands that change the status
(for example, if GROUP returns 401 what happens to the current selected
newsgroup),
and how to make those commands work.
</t>
</N.issue>
<t>
With the exception of mandatory commands and the 500 response,
the client MUST be prepared to receive any of these responses for
any command.
</t>

<N.examples>

<N.example>
Example of an unknown command:
  <N.c text="MAIL" />
  <N.s code="500" text="Unknown command" />
</N.example>

<N.example>
Example of an unsupported extension:
  <N.c text="LIST EXTENSIONS" />
  <N.s code="202" text="Extensions supported:">
    <N.sm text="LISTGROUP" />
  </N.s>
  <N.c text="OVER" />
  <N.s code="500" text="Unknown command" />
</N.example>

<N.example>
Example of an unsupported variant:
  <N.c text="MODE POSTER" />
  <N.s code="501" text="Unknown MODE option" />
</N.example>

<N.example>
Example of a syntax error:
  <N.c text="ARTICLE a.message.id@no.angle.brackets" />
  <N.s code="501" text="Syntax error" />
</N.example>

<N.example>
Example of an overlong command line:
  <N.c text="HEAD 53 54 55" />
  <N.s code="501" text="Too many arguments" />
</N.example>

<N.example>
Example of a bad wildmat:
  <N.c text="LIST ACTIVE u[ks].*" />
  <N.s code="501" text="Syntax error" />
</N.example>

<N.example>
Example of an attempt to access a restricted facility:
  <N.c text="GROUP secret.group" />
  <N.s code="480" text="Permission denied" />
followed by a successful attempt following authentication:
  <N.c text="XSECRET fred flintstone" />
  <N.s code="290" text="Password for fred accepted." />
  <N.c text="GROUP secret.group" />
  <N.s code="211" text="5 1 20 secret.group selected" />
</N.example>

<N.example>
Example of an attempt to access a facility not available to this
connection:
  <N.c text="MODE READER" />
  <N.s code="200" text="Reader mode, posting permitted" />
  <N.c text="IHAVE &lt;i.am.an.article.you.will.want@example.com&gt;" />
  <N.s code="502" text="Permission denied" />
</N.example>

<N.example>
Example of a temporary failure:
  <N.c text="GROUP archive.local" />
  <N.s code="403" text="Archive server temporarily offline" />
</N.example>

<N.example>
Example of the server needing to close down immediately:
  <N.c text="ARTICLE 123" />
  <N.s code="400" text="Power supply failed, running on UPS" />
  <N.p text='Server closes connection.' />
</N.example>

<N.example>
Example of imminent termination of the server:
  <N.c text="STAT 123" />
  <N.s code="401" text="Pre-payment expired, you have 10 seconds" />
  <N.c text="STAT 123" />
  <N.s code="423" text="No such article number in this group" />
  <N.c text="NEXT" />
  <N.s code="400" text="Time expired" />
  <N.p text='Server closes connection.' />
</N.example>

</N.examples>

    </section>
  </section>
  <section title="Pipelining">
<t>
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.
</t>
<t>
Except where stated otherwise, a client MAY use pipelining.
That is, it may send a command before receiving the response
for the previous command.
The server MUST allow pipelining and
MUST NOT throw away any text received after a command.
Irrespective of whether or not pipelining is used,
the server MUST process commands in the order they are sent.
</t>
<t>
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.
</t>
<t>
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.
</t>
<t>
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.
</t>

<N.examples>

<N.example>
Example of correct use of pipelining:
  <N.c text="GROUP misc.test" />
  <N.c text="STAT" />
  <N.c text="NEXT" />
  <N.s code="211" text="1234 3000234 3002322 misc.test" />
  <N.s code="223" text="3000234 &lt;45223423@example.com&gt; retrieved" />
  <N.s code="223" text="3000237 &lt;668929@example.org&gt; retrieved" />
</N.example>

<N.example>
Example of incorrect use of pipelining (the MODE READER command may not
be pipelined):
  <N.c text="GROUP misc.test" />
  <N.c text="MODE READER" />
  <N.c text="DATE" />
  <N.c text="NEXT" />
  <N.s code="211" text="1234 3000234 3002322 misc.test" />
  <N.s code="200" text="Server ready, posting allowed" />
  <N.s code="223" text="3000237 &lt;668929@example.org&gt; retrieved" />
The DATE command has been thrown away by the server and so there is no
111 response to match it.
</N.example>

</N.examples>

  </section>
  <section title="Articles" anchor="article.concepts">
<N.issue>
<t>
This section is new.
If anyone has better wording, I won't complain.
</t>
</N.issue>
<t>
NNTP is intended to transfer articles between clients and servers.
For the purposes of this specification, articles are required to conform to
the rules in this section and clients and servers MUST correctly process
any article received from the other that does so.
Note that this requirement applies only to the contents of communications
over NNTP;
it does not prevent the client or server from subsequently rejecting an
article for reasons of local policy.
In particular, where NNTP is used to transport articles that conform to
other specifications such as
<xref target="RFC1036">RFC 1036</xref> or
<xref target="RFC2822">RFC 2822</xref>,
articles must meet both this specification and that other.
</t>
<N.issue>
<t>
Need to add an appendix that spells out how this document interacts with
RFC 1036.
That would allow us to remove some of the convoluted wording about "other
specifications".
</t>
</N.issue>
<t>
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.
</t>
<t>
The headers of an article consist of one or more header lines.
Each header line consists of a header name, a colon, a space,
the header content, and a CRLF in that order.
The name consists of one or more printable US-ASCII characters other than
colon and, for the purposes of this specification, is not case sensitive.
There MAY be more than one header line with the same name.
The content MUST NOT contain CRLF but is otherwise unrestricted;
in particular, it MAY be empty.
A header may be "folded";
that is, a CRLF pair may be placed before any TAB or space
in the line (including the space after the colon after the header name),
except that there MUST be at least one octet other than %x09 or %x20
between any two CRLF pairs in a header line.
(Note that folding means that the header line occupies more than one
line when displayed or transmitted;
nevertheless it is still referred to as "a" header line.)
The presence or absence of folding does not affect the meaning of the
header line;
that is, the CRLF pairs introduced by folding are not considered
part of the header value.
</t>
<t>
Each article MUST have a unique message-id;
two articles offered by an NNTP server MUST NOT have the same message-id.
Note that
<xref target="RFC1036">RFC 1036</xref>
further requires that message-ids are globally unique for all time.
</t>
<t>
For the purposes of this specification, message-ids are opaque strings that
MUST meet the following requirements:
<list style="symbols">
<t>A message-id MUST begin with "&lt;" and end with "&gt;",
and MUST NOT contain the latter except at the end.</t>
<t>A message-id MUST be between 3 and 250 octets in length.</t>
<t>A message-id MUST NOT contain octets other than printable US-ASCII
characters.</t>
</list>
Two 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;
an NNTP server that also conforms to such a specification must consistently
use only one or the other.
As an example, the message-ids:
<list>
<t>       &lt;abcd@example.com&gt;
<vspace />&lt;"abcd"@example.com&gt;
<vspace />&lt;"ab\cd"@example.com&gt;
</t>
</list>
are considered distinct by this specification even though they would be
considered semantically identical according to the specification in
<xref target="RFC2822">RFC 2822</xref>.
</t>
<t>
This specification does not describe how the message-id of an article is
determined
(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).
Many servers will extract the message-id from the contents of a header
with name "Message-ID", but this is not required by this document.
If the server does not have any way to determine a message-id from the
article itself, it MUST synthesise one
(it need not modify the article to add such a header unless required
to by another specification).
</t>
  </section>
</section>

<section anchor="wildmat" title="The WILDMAT format">

<t>
The WILDMAT format described here is based on the version
first developed by Rich Salz <xref target="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.
</t>

  <section anchor="wildmat.syntax" title="Wildmat syntax">

<t>
A wildmat is described by the following
<xref target="RFC2234">ABNF</xref>
syntax
(note that this syntax contains ambiguities and
special cases described at the end):
</t>
<list>
  <list style="hanging">
    <t hangText="wildmat =">
      wildmat-pattern *("," ["!"] wildmat-pattern) </t>
    <t hangText="wildmat-pattern =">
      1*wildmat-item </t>
    <t hangText="wildmat-item =">
      wildmat-exact / wildmat-wild </t>
    <t hangText="wildmat-exact =">
      %x21-29 / %x2B / %x2D-3E / %x40-5A / %x5E-7E / UTF8-non-ascii
       ; exclude * , ? [ \ ] </t>
    <t hangText="wildmat-wild =">
      "*" / "?" </t>
  </list>
</list>
<t>
UTF8-non-ascii is defined in <xref target="full.syntax" />.
</t>
<t>
This syntax must be interpreted subject to the following rule:
</t>
<t>
Where a wildmat-pattern is not immediately preceded by "!",
it shall not begin with a "!".
</t>
<t>
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.
</t>

  </section>

  <section anchor="wildmat.semantics" title="Wildmat semantics">

<t>
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.
</t>
<t>
For example, consider the wildmat "a*,!*b,*c*":
</t>
<list>
  <t>the string "aaa" matches because the rightmost match is with "a*"</t>
  <t>the string "abb" does not match because the rightmost match is
with "*b"</t>
  <t>the string "ccb" matches because the rightmost match is with "*c*"</t>
  <t>the string "xxx" does not match because no wildmat-pattern matches</t>
</list>
<t>
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).
</t>
<t>
A wildmat-exact matches the same character (which may be more
than one octet in UTF-8).
</t>
<t>
"?" matches exactly one character (which may be more than one octet).
</t>
<t>
"*" 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.
</t>

  </section>

  <section title="Extensions">

<t>
An NNTP server or extension MAY extend the syntax or
semantics of wildmats provided that all wildmats that meet
the requirements of <xref target="wildmat.syntax" />
have the meaning ascribed to
them by <xref target="wildmat.semantics" />.
Future editions of this document may also extend wildmats.
</t>

  </section>

  <section title="Examples">

<figure>
  <preamble>
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.
  </preamble>
  <artwork>
  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
  </artwork>
</figure>

  </section>

</section>

<section title="Session administration commands">

<N.command name="Initial Connection" initial="yes">

  <N.variant>
    <N.response code="200" text="Service available, posting allowed" />
    <N.response code="201" text="Service available, posting prohibited" />
    <N.response code="400" text="Service temporarily unavailable [1]" />
    <N.response code="502" text="Service permanently unavailable [1]" />
  </N.variant>

  <N.usage.notes>
    <N.usage.note tag="">
These are the only valid response codes for the initial greeting;
the server MUST not return any other generic response code.
    </N.usage.note>
    <N.usage.note tag="[1]">
Following a 400 or 502 response the server MUST immediately
close the connection.
    </N.usage.note>
  </N.usage.notes>

<N.description>
<t>
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.
</t>
<t>
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.
</t>
<t>
Otherwise the server MUST present a 400 or 502 greeting code
and then immediately close the connection.
502 MUST be used
if the client is not permitted under any circumstances to
interact with the server and 400 otherwise.
</t>
</N.description>

<N.examples>
<N.example>
Example of a normal connection from an authorized client
which then terminates the session
(see <xref target="quit" />):
    <N.p text="Initial TCP connection setup completed." />
    <N.s code="200" text="NNTP Service Ready, posting permitted" />
    <N.c text='QUIT' />
    <N.s code='205' text='NNTP Service exits normally' />
    <N.p text='Server closes connection.' />
</N.example>

<N.example>
Example of a normal connection from an authorized client that
is not permitted to post;
it also immediately terminates the session:
    <N.p text="Initial TCP connection setup completed." />
    <N.s code="201" text="NNTP Service Ready, posting prohibited" />
    <N.c text='QUIT' />
    <N.s code='205' text='NNTP Service exits normally' />
    <N.p text='Server closes connection.' />
</N.example>

<N.example>
  Example of a normal connection from an unauthorized client:
    <N.p text="Initial TCP connection setup completed." />
    <N.s code="502" text="NNTP Service permanently unavailable" />
    <N.p text="Server closes connection." />
</N.example>

<N.example>
  Example of a connection from a client where the server is
  unable to provide service:
    <N.p text="Initial TCP connection setup completed." />
    <N.s code="400" text="NNTP Service temporarily unavailable" />
    <N.p text='Server closes connection.' />
</N.example>
</N.examples>
</N.command>

<N.command name="MODE READER" pipeline="no">

  <N.variant>
    <N.response code="200" text="Posting allowed" />
    <N.response code="201" text="Posting prohibited" />
    <N.response code="400" text="Service temporarily unavailable [1]" />
    <N.response code="502" text="Service permanently unavailable [1]" />
  </N.variant>

  <N.usage.notes>
    <N.usage.note tag="[1]">
Following a 400 or 502 response the server MUST immediately
close the connection.
    </N.usage.note>
  </N.usage.notes>

<N.description>
<t>
MODE READER SHOULD be sent by any client that intends to use
any command other than IHAVE, HEAD, STAT, LIST ACTIVE,
LIST EXTENSIONS, or a command advertised by the server as available
via LIST EXTENSIONS.
</t>
<t>
Servers MAY require that this command be issued before any
commands other than the above are sent and MAY reject such commands
until after a MODE READER command has been sent.
Where an extension is only available after a MODE READER command,
or where the effects of the extension will change,
the LIST EXTENSIONS command MUST produce different results that indicate
the change.
</t>
<t>
The server MUST return a response using the same codes as the
initial greeting
(as described in <xref target="initial.connection.usage" />)
to indicate its ability to provide reading service to the client.
Note that the response need not be the same as the one
presented during the initial greeting.
</t>
<t>
Once MODE READER is sent, IHAVE (and any extensions intended
for peer-to-peer article transfer) MAY no longer be
permitted, even if it were permitted before the MODE READER command.
The results of LIST EXTENSIONS MAY be different
following a MODE READER command than prior to the issuing of
that command.
</t>
<t>
Servers are encouraged to not require this command even
though clients SHOULD send it when appropriate.
It is present
to support some news architectures that switch between modes
based on whether a given connection is a peer-to-peer
connection with another server or a news reading client.
</t>
</N.description>

<N.examples>

<N.example>
Example of use of the MODE READER command by an authorized client
which then terminates the session
(see <xref target="quit" />):
    <N.c text="MODE READER" />
    <N.s code="200" text="NNTP Service Ready, posting permitted" />
    <N.c text='QUIT' />
    <N.s code='205' text='NNTP Service exits normally' />
    <N.p text='Server closes connection.' />
</N.example>

<N.example>
Example of use of the MODE READER command by an authorized client that
is not permitted to post;
it also immediately terminates the session:
    <N.c text='MODE READER' />
    <N.s code='201' text='NNTP Service Ready, posting prohibited' />
    <N.c text='QUIT' />
    <N.s code='205' text='NNTP Service exits normally' />
    <N.p text='Server closes connection.' />
</N.example>

<N.example>
  Example of use of MODE READER by a client not authorized to
  receive service from the server as a news reader:
    <N.c text='MODE READER' />
    <N.s code="502" text="NNTP Service permanently unavailable" />
    <N.p text='Server closes connection.' />
</N.example>

<N.example>
  Example of a connection from any client where the server is
  temporarily unable to provide news reader service:
    <N.c text='MODE READER' />
    <N.s code='400' text='NNTP Service temporarily unavailable' />
    <N.p text='Server closes connection.' />
</N.example>
</N.examples>
</N.command>

<N.command name="LIST EXTENSIONS" pipeline="no" optional="yes">

<N.variant>
    <N.response code="202" text="Extension list follows" multi="yes" />
    <N.response code="402" text="Server has no extensions" />
</N.variant>

<N.description>
<t>
The LIST EXTENSIONS command allows a client to determine
which extensions are supported by the server at any given time.
See <xref target="extensions" /> for further discussion of extensions.
</t>
<t>
This command MUST be implemented by any server that implements any
extensions defined in this document or any other extension in the
IANA registry, and is optional otherwise.
</t>
<t>
This command MAY be issued at anytime during a session.
It is not required that the client issues this command before
attempting to make use of any extension.
The response
generated by this command MAY change during a session because
of other state information
(which in turn may be changed by the effects of other commands).
An NNTP client MUST NOT
cache (for use in another session) any information returned
if the LIST EXTENSIONS command succeeds.
That is, an NNTP
client is only able to get the current and correct
information concerning available extensions at any point during a session
by issuing a LIST EXTENSIONS command at that point of that session and
processing the response.
</t>
<t>
The list of extensions is returned as a multi-line
response following the 202 response code.
Each extension is listed on a separate line;
the line MUST begin
with an extension-label and optionally one or more parameters
(separated by single spaces).
The extension-label and the
meaning of the parameters are specified as part of the
definition of the extension.
The extension-label is a string of 1 to 12 US-ASCII letters and
MUST be in uppercase.
Parameters are strings of 1 or more printable UTF-8 characters
(that is, either printable US-ASCII characters or any UTF-8 sequence
outside the US-ASCII range, but not space or TAB).
</t>
<t>
The server MUST NOT list the same extension twice in the
response, and MUST list all supported extensions.
The order in which the extensions are listed is not significant.
The server need not even consistently return the same order.
If the server does not support any extensions,
it MUST return an empty list.
The 402 response code is documented for historic reasons only;
clients SHOULD handle it gracefully, but servers MUST NOT generate it.
</t>
<t>
Following a generic failure response, such as 403, an extension might still
be available, and the client MAY attempt to use it.
</t>
</N.description>

<N.examples>

<N.example>
Example of a successful response:
  <N.c text="LIST EXTENSIONS" />
  <N.s code="202" text="Extensions supported:">
    <N.sm text="OVER" />
    <N.sm text="HDR" />
    <N.sm text="LISTGROUP" />
  </N.s>
The particular extensions shown here are simply examples of
what might be defined in other places, and no particular
meaning should be attributed to them.
</N.example>

<N.example>
Example where no extensions are available:
  <N.c text="LIST EXTENSIONS" />
  <N.s code="202" text="Extensions supported:">
    <N.s.empty />
  </N.s>
</N.example>

<N.example>
Example from a non-conforming server which indicates "no extensions
available" using the 402 response code:
  <N.c text="LIST EXTENSIONS" />
  <N.s code="402" text="Server has no extensions" />
</N.example>
</N.examples>
</N.command>

<N.command name="QUIT">

<N.variant>
  <N.response code="205" text="Connection closing" />
</N.variant>

<N.description>
<t>
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.
</t>
<t>
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.
</t>
</N.description>

<N.examples>
<N.example>
<N.c text="QUIT" />
<N.s code="205" text="closing connection" />
<N.p text="Server closes connection." />
</N.example>
</N.examples>
</N.command>

</section>


<section title="Article posting and retrieval" anchor="article.handling">

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

  <section title="Group and article selection">

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

<N.command name="GROUP">

<N.variant args="group">
  <N.response code="211" args="number low high group"
              text="Group successfully selected" />
  <N.response code="411" text="No such newsgroup" />
</N.variant>

<N.parameter name="group"  text="name of newsgroup" />
<N.parameter name="number" text="estimated number of articles in the group" />
<N.parameter name="low"    text="reported low water mark" />
<N.parameter name="high"   text="reported high water mark" />

<N.description>
<t>
The required parameter 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 <xref target="list.active" />).
</t>
<t>
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 on file in the group.
</t>
<t>
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 on file.
Others will just
subtract the low water mark from the high water mark and add
one to get an estimate.)
</t>
<t>
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.
<list style="symbols">
<t>
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.
</t>
<t>
All three numbers will be zero.
</t>
<t>
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.
</t>
</list>
</t>
<t>
The set of articles in a group may change after the GROUP
command is carried out.
That is:
<list style="symbols">
<t>articles may be removed from the group</t>
<t>
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)
</t>
<t>
new articles may be added with article numbers greater
than the reported high water mark (if an article that was
the one with the highest number has been removed, the next
new article will not have the number one greater than the
reported high water mark)
</t>
</list>
</t>
<t>
Except when the group is empty and all three numbers are
zero, whenever a subsequent GROUP command for the same
newsgroup is issued, either by the same client or a different
client, the reported low water mark in the response MUST be
no less than that in any previous response for that newsgroup
sent to any client.
The client may make use of the low water
mark to remove all remembered information about articles with
lower numbers, as these will never recur.
This includes the
situation when the high water mark is one less than the low water mark.
No similar assumption can be made about the high water mark,
as this can decrease if an article is removed, and then
increase again if it is reinstated or if new articles arrive.
</t>
<t>
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.
</t>
<t>
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.
</t>
<t>
If the group specified is not available on the server,
a 411 response MUST be returned.
</t>

</N.description>

<N.examples>

<N.example>
Example for a group known to the server:
<N.c text="GROUP misc.test" />
<N.s code="211" text="1234 3000234 3002322 misc.test" />
</N.example>

<N.example>
Example for a group unknown to the server:
<N.c text="GROUP example.is.sob.bradner.or.barber" />
<N.s code="411" text="example.is.sob.bradner.or.barber is unknown" />
</N.example>

<N.example>
Example of an empty group using the preferred response:
<N.c text="GROUP example.currently.empty.newsgroup" />
<N.s code="211" text="0 4000 3999 example.currently.empty.newsgroup" />
</N.example>
<N.example>
Example of an empty group using an alternative response:
<N.c text="GROUP example.currently.empty.newsgroup" />
<N.s code="211" text="0 0 0 example.currently.empty.newsgroup" />
</N.example>
<N.example>
Example of an empty group using a different alternative response:
<N.c text="GROUP example.currently.empty.newsgroup" />
<N.s code="211" text="0 4000 4321 example.currently.empty.newsgroup" />
</N.example>

</N.examples>

</N.command>

<N.command name="LAST">
<N.variant>
  <N.response code="223" args="n message-id" text="Article found" />
  <N.response code="412" text="No newsgroup selected" />
  <N.response code="420" text="Current article number is invalid" />
  <N.response code="422" text="No previous article in this group" />
</N.variant>

<N.parameter name="n" text="article number" />
<N.parameter name="message-id" text="article message-id" />

<N.description>
<t>
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.
</t>
<t>
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.
</t>
<t>
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.
</t>
<t>
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.
</t>
</N.description>

<N.examples>
<N.example>
Example of a successful article retrieval using LAST:
<N.c text="GROUP misc.test" />
<N.s code="211" text="1234 3000234 3002322 misc.test" />
<N.c text="NEXT" />
<N.s code="223" text="3000237 &lt;668929@example.org&gt; retrieved" />
<N.c text="LAST" />
<N.s code="223" text="3000234 &lt;45223423@example.com&gt; retrieved" />
</N.example>
<N.example>
Example of an attempt to retrieve an article without having
selected a group (via the GROUP command) first:
<N.p text="Assumes current selected newsgroup is invalid." />
<N.c text="LAST" />
<N.s code="412" text="no newsgroup selected" />
</N.example>
<N.example>
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:
<N.c text="GROUP misc.test" />
<N.s code="211" text="1234 3000234 3002322 misc.test" />
<N.c text="LAST" />
<N.s code="422" text="No previous article to retrieve" />
</N.example>
<N.example>
Example of an attempt to retrieve an article using the LAST
command when the current selected newsgroup is empty:
<N.c text="GROUP example.empty.newsgroup" />
<N.s code="211" text="0 0 0 example.empty.newsgroup" />
<N.c text="LAST" />
<N.s code="420" text="No current article selected" />
</N.example>
</N.examples>
</N.command>

<N.command name="NEXT">
<N.variant>
  <N.response code="223" args="n message-id" text="Article found" />
  <N.response code="412" text="No newsgroup selected" />
  <N.response code="420" text="Current article number is invalid" />
  <N.response code="421" text="No next article in this group" />
</N.variant>

<N.parameter name="n" text="article number" />
<N.parameter name="message-id" text="article message-id" />

<N.description>
<t>
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.
</t>
<t>
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
<xref target="last">LAST command</xref>.
</t>
</N.description>

<N.examples>
<N.example>
Example of a successful article retrieval using NEXT:
<N.c text="GROUP misc.test" />
<N.s code="211" text="1234 3000234 3002322 misc.test" />
<N.c text="NEXT" />
<N.s code="223" text="3000237 &lt;668929@example.org&gt; retrieved" />
</N.example>
<N.example>
Example of an attempt to retrieve an article without having
selected a group (via the GROUP command) first:
<N.p text="Assumes current selected newsgroup is invalid." />
<N.c text="NEXT" />
<N.s code="412" text="no newsgroup selected" />
</N.example>
<N.example>
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:
<N.c text="GROUP misc.test" />
<N.s code="211" text="1234 3000234 3002322 misc.test" />
<N.c text="STAT 3002322" />
<N.s code="223" text="3002322 &lt;411@example.net&gt; retrieved" />
<N.c text="NEXT" />
<N.s code="421" text="No next article to retrieve" />
</N.example>
<N.example>
Example of an attempt to retrieve an article using the NEXT
command when the current selected newsgroup is empty:
<N.c text="GROUP example.empty.newsgroup" />
<N.s code="211" text="0 0 0 example.empty.newsgroup" />
<N.c text="NEXT" />
<N.s code="420" text="No current article selected" />
</N.example>
</N.examples>
</N.command>

  </section>

  <section title="Retrieval of articles and article sections">

<t>
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
<xref target="article.concepts" />,
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.
</t>

<N.command name="ARTICLE">
<N.variant args="message-id" comment="message-id specified">
  <N.response code="220" multi="yes" args="0 message-id"
              text="Article follows" />
  <N.response code="430" text="No article found with that message-id" />
</N.variant>

<N.variant args="[number]" comment="optional article number specified">
  <N.response code="220" multi="yes" args="n message-id"
              text="Article follows" />
  <N.response code="412" text="No newsgroup selected" />
  <N.response code="420" text="Current article number is invalid [1]" />
  <N.response code="423" text="No such article in this newsgroup" />
</N.variant>

<N.parameter name="number" text="Requested article number" />
<N.parameter name="n" text="Returned article number" />
<N.parameter name="message-id" text="Article message-id" />

<N.usage.notes>
  <N.usage.note tag="[1]">
The 420 response can only occur if no article number has been specified.
  </N.usage.note>
</N.usage.notes>

<N.description>
<t>
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 two forms.
</t>
<t>
In the first form, a message-id is specified (including the
angle brackets), and the server presents the article with
that message-id.
In this case, the server MUST NOT alter the
current selected newsgroup or current article number.
This is both to facilitate the presentation of articles that may be
referenced within another article being read, and because of
the semantic difficulties of determining the proper sequence
and membership of an article that may have been crossposted
to more than one newsgroup.
</t>
<t>
In the response, the article number is replaced with zero (that is, the
server is not required to determine whether the article is in the current
group or what article number(s) it has).
</t>
<t>
In the second form, an article number may be specified.
If so, and if there is an article with that number in the
currently selected newsgroup, the server MUST set the
current article number to that number.
</t>
<t>
Then, whether or not a number was specified, the article
indicated by the current article number is presented to the client.
</t>
<t>
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.
</t>
<t>
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.
</t>
<t>
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.
</t>
<t>
The article is returned as a multi-line
response following the 220 response code.
</t>
<t>
If the current article number is invalid, a 420 response MUST be returned.
If there is no article with the specified number,
a 423 response MUST be returned.
If the current selected newsgroup is invalid, a 412 response MUST be
returned.
</t>
</N.description>

<N.examples>
<N.example>
Example of a successful retrieval of an article (using no
article number):
<N.c text="GROUP misc.test" />
<N.s code="211" text="1234 3000234 3002322 misc.test" />
<N.c text="ARTICLE" />
<N.s code="220" text="3000234 &lt;45223423@example.com&gt;">
 <N.sm text="Path: pathost!demo!whitehouse!not-for-mail" />
 <N.sm text='From: "Demo User" &lt;nobody@example.net&gt;' />
 <N.sm text="Newsgroups: misc.test" />
 <N.sm text="Subject: I am just a test article" />
 <N.sm text="Date: 6 Oct 1998 04:38:40 -0500" />
 <N.sm text="Organization: An Example Net, Uncertain, Texas" />
 <N.sm text="Message-ID: &lt;411@example.net&gt;" />
 <N.sm text=""/>
 <N.sm text="This is just a test article." />
</N.s>
</N.example>
<N.example>
Example of a successful retrieval of an article by message-id:
<N.c text="ARTICLE &lt;45223423@example.com&gt;" />
<N.s code="220" text="0 &lt;45223423@example.com&gt;">
 <N.sm text="Path: pathost!demo!whitehouse!not-for-mail" />
 <N.sm text='From: "Demo User" &lt;nobody@example.net&gt;' />
 <N.sm text="Newsgroups: misc.test" />
 <N.sm text="Subject: I am just a test article" />
 <N.sm text="Date: 6 Oct 1998 04:38:40 -0500" />
 <N.sm text="Organization: An Example Net, Uncertain, Texas" />
 <N.sm text="Message-ID: &lt;411@example.net&gt;" />
 <N.sm text=""/>
 <N.sm text="This is just a test article." />
</N.s>
</N.example>
<N.example>
Example of an unsuccessful retrieval of an article by message-id:
<N.c text="ARTICLE &lt;i.am.not.there@example.com&gt;" />
<N.s code="430" text="No Such Article Found" />
</N.example>
<N.example>
Example of an unsuccessful retrieval of an article by number:
<N.c text="GROUP misc.test" />
<N.s code="211" text="1234 3000234 3002322 news.groups" />
<N.c text="ARTICLE 300256" />
<N.s code="423" text="No such article number in this group" />
</N.example>
<N.example>
Example of an unsuccessful retrieval of an article by number
because no newsgroup was selected first:
<N.p text="Assumes current selected newsgroup is invalid." />
<N.c text="ARTICLE 300256" />
<N.s code="412" text="No newsgroup selected" />
</N.example>
<N.example>
Example of an attempt to retrieve an article when the
current selected newsgroup is empty:
<N.c text="GROUP example.empty.newsgroup" />
<N.s code="211" text="0 0 0 example.empty.newsgroup" />
<N.c text="ARTICLE" />
<N.s code="420" text="No current article selected" />
</N.example>
</N.examples>
</N.command>

<N.command name="HEAD">
<N.variant args="message-id" comment="message-id specified">
  <N.response code="221" multi="yes" args="0 message-id"
              text="Headers follow" />
  <N.response code="430" text="No article found with that message-id" />
</N.variant>

<N.variant args="[number]" comment="optional article number specified">
  <N.response code="221" multi="yes" args="n message-id"
              text="Headers follow" />
  <N.response code="412" text="No newsgroup selected" />
  <N.response code="420" text="Current article number is invalid [1]" />
  <N.response code="423" text="No such article in this newsgroup" />
</N.variant>

<N.parameter name="number" text="Requested article number" />
<N.parameter name="n" text="Returned article number" />
<N.parameter name="message-id" text="Article message-id" />

<N.usage.notes>
  <N.usage.note tag="[1]">
The 420 response can only occur if no article number has been specified.
  </N.usage.note>
</N.usage.notes>

<N.description>
<t>
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).
</t>
</N.description>

<N.examples>
<N.example>
Example of a successful retrieval of the headers of an
article (using no article number):
<N.c text="GROUP misc.test" />
<N.s code="211" text="1234 3000234 3002322 misc.test" />
<N.c text="HEAD" />
<N.s code="221" text="3000234 &lt;45223423@example.com&gt;">
 <N.sm text="Path: pathost!demo!whitehouse!not-for-mail" />
 <N.sm text='From: "Demo User" &lt;nobody@example.net&gt;' />
 <N.sm text="Newsgroups: misc.test" />
 <N.sm text="Subject: I am just a test article" />
 <N.sm text="Date: 6 Oct 1998 04:38:40 -0500" />
 <N.sm text="Organization: An Example Net, Uncertain, Texas" />
 <N.sm text="Message-ID: &lt;411@example.net&gt;" />
</N.s>
</N.example>
<N.example>
Example of a successful retrieval of the headers of an
article by message-id:
<N.c text="HEAD &lt;45223423@example.com&gt;" />
<N.s code="221" text="0 &lt;45223423@example.com&gt;">
 <N.sm text="Path: pathost!demo!whitehouse!not-for-mail" />
 <N.sm text='From: "Demo User" &lt;nobody@example.net&gt;' />
 <N.sm text="Newsgroups: misc.test" />
 <N.sm text="Subject: I am just a test article" />
 <N.sm text="Date: 6 Oct 1998 04:38:40 -0500" />
 <N.sm text="Organization: An Example Net, Uncertain, Texas" />
 <N.sm text="Message-ID: &lt;411@example.net&gt;" />
</N.s>
</N.example>
<N.example>
Example of an unsuccessful retrieval of the headers of an
article by message-id:
<N.c text="HEAD &lt;i.am.not.there@example.com&gt;" />
<N.s code="430" text="No Such Article Found" />
</N.example>
<N.example>
Example of an unsuccessful retrieval of the headers of an
article by number:
<N.c text="GROUP misc.test" />
<N.s code="211" text="1234 3000234 3002322 misc.test" />
<N.c text="HEAD 300256" />
<N.s code="423" text="No such article number in this group" />
</N.example>
<N.example>
Example of an unsuccessful retrieval the headers of an article
by number because no newsgroup was selected first:
<N.p text="Assumes current selected newsgroup is invalid." />
<N.c text="HEAD 300256" />
<N.s code="412" text="No newsgroup selected" />
</N.example>
<N.example>
Example of an attempt to retrieve the headers of an article
when the current selected newsgroup is empty:
<N.c text="GROUP example.empty.newsgroup" />
<N.s code="211" text="0 0 0 example.empty.newsgroup" />
<N.c text="HEAD" />
<N.s code="420" text="No current article selected" />
</N.example>
</N.examples>
</N.command>

<N.command name="BODY">
<N.variant args="message-id" comment="message-id specified">
  <N.response code="222" multi="yes" args="0 message-id"
              text="Body follows" />
  <N.response code="430" text="No article found with that message-id" />
</N.variant>

<N.variant args="[number]" comment="optional article number specified">
  <N.response code="222" multi="yes" args="n message-id"
              text="Body follows" />
  <N.response code="412" text="No newsgroup selected" />
  <N.response code="420" text="Current article number is invalid [1]" />
  <N.response code="423" text="No such article in this newsgroup" />
</N.variant>

<N.parameter name="number" text="Requested article number" />
<N.parameter name="n" text="Returned article number" />
<N.parameter name="message-id" text="Article message-id" />

<N.usage.notes>
  <N.usage.note tag="[1]">
The 420 response can only occur if no article number has been specified.
  </N.usage.note>
</N.usage.notes>

<N.description>
<t>
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).
</t>
</N.description>

<N.examples>
<N.example>
Example of a successful retrieval of the body of an article
(using no article number):
<N.c text="GROUP misc.test" />
<N.s code="211" text="1234 3000234 3002322 misc.test" />
<N.c text="BODY" />
<N.s code="222" text="3000234 &lt;45223423@example.com&gt;">
 <N.sm text="This is just a test article." />
</N.s>
</N.example>
<N.example>
Example of a successful retrieval of the body of an article
by message-id:
<N.c text="BODY &lt;45223423@example.com&gt;" />
<N.s code="222" text="0 &lt;45223423@example.com&gt;">
 <N.sm text="This is just a test article." />
</N.s>
</N.example>
<N.example>
Example of an unsuccessful retrieval of the body of an
article by message-id:
<N.c text="BODY &lt;i.am.not.there@example.com&gt;" />
<N.s code="430" text="No Such Article Found" />
</N.example>
<N.example>
Example of an unsuccessful retrieval of the body of an
article by number:
<N.c text="GROUP misc.test" />
<N.s code="211" text="1234 3000234 3002322 misc.test" />
<N.c text="BODY 300256" />
<N.s code="423" text="No such article number in this group" />
</N.example>
<N.example>
Example of an unsuccessful retrieval of the body of an
article by number because no newsgroup was selected first:
<N.p text="Assumes current selected newsgroup is invalid." />
<N.c text="BODY 300256" />
<N.s code="412" text="No newsgroup selected" />


</N.example>
<N.example>
Example of an attempt to retrieve the body of an article when
the current selected newsgroup is empty:
<N.c text="GROUP example.empty.newsgroup" />
<N.s code="211" text="0 0 0 example.empty.newsgroup" />
<N.c text="BODY" />
<N.s code="420" text="No current article selected" />
</N.example>
</N.examples>
</N.command>

<N.command name="STAT">
<N.variant args="message-id" comment="message-id specified">
  <N.response code="223" args="0 message-id" text="Article exists" />
  <N.response code="430" text="No article found with that message-id" />
</N.variant>

<N.variant args="[number]" comment="optional article number specified">
  <N.response code="223" args="n message-id" text="Article exists" />
  <N.response code="412" text="No newsgroup selected" />
  <N.response code="420" text="Current article number is invalid [1]" />
  <N.response code="423" text="No such article in this newsgroup" />
</N.variant>

<N.parameter name="number" text="Requested article number" />
<N.parameter name="n" text="Returned article number" />
<N.parameter name="message-id" text="Article message-id" />

<N.usage.notes>
  <N.usage.note tag="[1]">
The 420 response can only occur if no article number has been specified.
  </N.usage.note>
</N.usage.notes>

<N.description>
<t>
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.
</t>
<t>
This command allows the client to determine whether an
article exists, and in the second form what its message-id
is, without having to process an arbitrary amount of text.
</t>
</N.description>

<N.examples>
<N.example>
Example of STAT on an existing article (using no article number):
<N.c text="GROUP misc.test" />
<N.s code="211" text="1234 3000234 3002322 misc.test" />
<N.c text="STAT" />
<N.s code="223" text="3000234 &lt;45223423@example.com&gt;" />
</N.example>
<N.example>
Example of a STAT of an existing article by message-id:
<N.c text="STAT &lt;45223423@example.com&gt;" />
<N.s code="223" text="0 &lt;45223423@example.com&gt;" />
</N.example>
<N.example>
Example of an STAT of an article not on the server by message-id:
<N.c text="STAT &lt;i.am.not.there@example.com&gt;" />
<N.s code="430" text="No Such Article Found" />
</N.example>
<N.example>
Example of STAT of an article not in the server by number:
<N.c text="GROUP misc.test" />
<N.s code="211" text="1234 3000234 3002322 misc.test" />
<N.c text="STAT 300256" />
<N.s code="423" text="No such article number in this group" />
</N.example>
<N.example>
Example of STAT of an article by number when no newsgroup was
selected first:
<N.p text="Assumes current selected newsgroup is invalid." />
<N.c text="STAT 300256" />
<N.s code="412" text="No newsgroup selected" />
</N.example>
<N.example>
Example of STAT of an article when the current selected newsgroup is empty:
<N.c text="GROUP example.empty.newsgroup" />
<N.s code="211" text="0 0 0 example.empty.newsgroup" />
<N.c text="STAT" />
<N.s code="420" text="No current article selected" />
</N.example>
</N.examples>
</N.command>

  </section>

  <section title="Article posting">

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

<N.command name="POST" pipeline="no">

<N.variant>
  <N.response code="340" text="Send article to be posted" />
  <N.response code="440" text="Posting not permitted" />
  <N.stage2 />
  <N.response code="240" text="Article received OK" />
  <N.response code="441" text="Posting failed" />
</N.variant>

<N.description>
<t>
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.
</t>
<t>
If posting is permitted, the article MUST be in the format specified in
<xref target="article.concepts" />
and MUST be sent by the client to the server in the manner specified in
(<xref target="basics" />) 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.
</t>
<t>
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.
</t>
<t>
A response of 240 SHOULD indicate that, barring unforseen server errors,
the posted article will be made available on the server and/or
transferred to other servers as appropriate.
In other words, articles not wanted by the server SHOULD be rejected
with a 441 response and not accepted and silently discarded.
</t>
<t>
No attempt shall be made by the server to filter characters,
fold or limit lines, or otherwise process incoming text.
The intent is that the server just passes the incoming message to
be posted to the server installation's news posting software,
which is not defined by this document.
</t>
<t>
The client SHOULD NOT assume that the article has been
successfully transferred unless it receives an affirmative
response from the server.
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, if the client supplied a message-id in the original article,
ensure it supplies the same message-id -
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 particular,
if the article contained a header with name "Message-ID",
the client SHOULD ensure
that the contents of this header are identical when resending it and
the server SHOULD ensure that the re-sent article is
recognised as a duplicate and not assigned a different message-id to the
original.
</t>
</N.description>

<N.examples>
<N.example>
Example of a successful posting:
<N.c text="POST" />
<N.s code="340" text="Input article; end with &lt;CR-LF&gt;.&lt;CR-LF&gt;" />
<N.c.continued>
 <N.cm text='From: "Demo User" &lt;nobody@example.net&gt;' />
 <N.cm text='Newsgroups: misc.test' />
 <N.cm text='Subject: I am just a test article' />
 <N.cm text='Organization: An Example Net' />
 <N.cm text='' />
 <N.cm text='This is just a test article.' />
</N.c.continued>
<N.s code="240" text="Article received OK" />
</N.example>
<N.example>
Example of an unsuccessful posting:
<N.c text="POST" />
<N.s code="340" text="Input article; end with &lt;CR-LF&gt;.&lt;CR-LF&gt;" />
<N.c.continued>
 <N.cm text='From: "Demo User" &lt;nobody@example.net&gt;' />
 <N.cm text='Newsgroups: misc.test' />
 <N.cm text='Subject: I am just a test article' />
 <N.cm text='Organization: An Example Net' />
 <N.cm text='' />
 <N.cm text='This is just a test article.' />
</N.c.continued>
<N.s code="441" text="Posting failed" />
</N.example>
<N.example>
Example of an attempt to post when posting is not allowed:
    <N.c text='MODE READER' />
    <N.s code='201' text='NNTP Service Ready, posting prohibited' />
<N.c text="POST" />
<N.s code="440" text="Posting not permitted" />
</N.example>
</N.examples>

</N.command>

<N.command name="IHAVE" pipeline="no">

<N.variant args="message-id">
  <N.response code="335" text="Send article to be transferred" />
  <N.response code="435" text="Article not wanted" />
  <N.response code="436" text="Transfer not possible; try again later" />
  <N.stage2 />
  <N.response code="235" text="Article transferred OK" />
  <N.response code="436" text="Transfer failed; try again later" />
  <N.response code="437" text="Transfer rejected; do not retry" />
</N.variant>

<N.parameter name="message-id" text="Article message-id" />

<N.description>
<t>
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.
</t>
<t>
If transmission of the article is requested, the client MUST
send the entire article, including headers and body, in the
format defined above (<xref target="basics" />) 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.
</t>
<t>
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.
</t>
<t>
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.
</t>
<t>
Because some news server software may not be able immediately
to determine whether or not an article is suitable for
posting or forwarding, an NNTP server MAY acknowledge the
successful transfer of the article (with a 235 response) but
later silently discard it.
</t>
</N.description>

<N.examples>
<N.example>
Example of successfully sending an article to another site:
<N.c text="IHAVE &lt;i.am.an.article.you.will.want@example.com&gt;" />
<N.s code="335" text="Send it; end with &lt;CR-LF&gt;.&lt;CR-LF&gt;" />
<N.c.continued>
 <N.cm text='Path: pathost!demo!somewhere!not-for-mail' />
 <N.cm text='From: "Demo User" &lt;nobody@example.com>' />
 <N.cm text='Newsgroups: misc.test' />
 <N.cm text='Subject: I am just a test article' />
 <N.cm text='Date: 6 Oct 1998 04:38:40 -0500' />
 <N.cm text='Organization: An Example Com, San Jose, CA' />
 <N.cm text='Message-ID: &lt;i.am.a.test.article@example.com&gt;' />
 <N.cm text='' />
 <N.cm text='This is just a test article.' />
</N.c.continued>
<N.s code="235" text="Article transferred OK" />
</N.example>
<N.example>
Example of sending an article to another site that rejects it:
<N.c text="IHAVE &lt;i.am.an.article.you.will.want@example.com&gt;" />
<N.s code="335" text="Send it; end with &lt;CR-LF&gt;.&lt;CR-LF&gt;" />
<N.c.continued>
 <N.cm text='Path: pathost!demo!somewhere!not-for-mail' />
 <N.cm text='From: "Demo User" &lt;nobody@example.com>' />
 <N.cm text='Newsgroups: misc.test' />
 <N.cm text='Subject: I am just a test article' />
 <N.cm text='Date: 6 Oct 1998 04:38:40 -0500' />
 <N.cm text='Organization: An Example Com, San Jose, CA' />
 <N.cm text='Message-ID: &lt;i.am.a.test.article@example.com&gt;' />
 <N.cm text='' />
 <N.cm text='This is just a test article.' />
</N.c.continued>
<N.s code="437" text="Article rejected; don't send again" />
</N.example>
<N.example>
Example of sending an article to another site where the
transfer fails:
<N.c text="IHAVE &lt;i.am.an.article.you.will.want@example.com&gt;" />
<N.s code="335" text="Send it; end with &lt;CR-LF&gt;.&lt;CR-LF&gt;" />
<N.c.continued>
 <N.cm text='Path: pathost!demo!somewhere!not-for-mail' />
 <N.cm text='From: "Demo User" &lt;nobody@example.com>' />
 <N.cm text='Newsgroups: misc.test' />
 <N.cm text='Subject: I am just a test article' />
 <N.cm text='Date: 6 Oct 1998 04:38:40 -0500' />
 <N.cm text='Organization: An Example Com, San Jose, CA' />
 <N.cm text='Message-ID: &lt;i.am.a.test.article@example.com&gt;' />
 <N.cm text='' />
 <N.cm text='This is just a test article.' />
</N.c.continued>
<N.s code="436" text="Transfer failed" />
</N.example>
<N.example>
Example of sending an article to a site that already has it:
<N.c text="IHAVE &lt;i.am.an.article.you.have@example.com&gt;" />
<N.s code="435" text="Duplicate" />
</N.example>
<N.example>
Example of sending an article to a site that requests the
article be tried again later:
<N.c text="IHAVE &lt;i.am.an.article.you.defer@example.com&gt;" />
<N.s code="436" text="Retry later" />
</N.example>
</N.examples>
</N.command>

  </section>
</section>

<section title="Information commands">

<t>
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.
</t>

<N.command name="DATE">

<N.variant>
  <N.response code="111" args="yyyymmddhhmmss"
              text="server date and time" />
</N.variant>

<N.parameter name="yyyymmddHHmmss"
             text="Current UTC date and time on server" />

<N.description>
<t>
This command exists to help clients find out the current
<xref target="TF.686-1">Coordinated Universal Time</xref>
from the server's perspective.
This command SHOULD NOT be used as a substitute for
<xref target="RFC1305">NTP</xref>
but to provide information that might be useful when using
the NEWNEWS command (see <xref target="newnews" />).
A system providing NNTP service SHOULD keep the system clock as accurate as
possible, either with NTP or by some other method.
</t>
<t>
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.
</t>
</N.description>

<N.examples>
<N.example>
<N.c text="DATE" />
<N.s code="111" text="19990623135624" />
</N.example>
</N.examples>
</N.command>

<N.command name="HELP">

<N.variant>
  <N.response code="100" text="Help text follows" multi="yes" />
</N.variant>

<N.description>
<t>
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.
</t>
<t>
This text is not guaranteed to be in any particular format
and MUST NOT be used by clients as a replacement for the
LIST EXTENSIONS command described in <xref target="list.extensions" />
</t>
</N.description>

<N.examples>
<N.example>
<N.c text="HELP" />
<N.s code="100" text="Help text follows">
 <N.sm text="This is some help text. There is no specific" />
 <N.sm text="formatting requirement for this test, though" />
 <N.sm text="it is customary for it to list the valid commands" />
 <N.sm text="and give a brief definition of what they do" />
</N.s>
</N.example>
</N.examples>
</N.command>

<N.command name="NEWGROUPS">

<N.variant args="date time [GMT]">
  <N.response code='231' text="List of new newsgroups follows" multi="yes" />
</N.variant>

<N.parameter name="date" text="Date in yymmdd or yyyymmdd format" />
<N.parameter name="time" text="Time in hhmmss format" />

<N.description>
<t>
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 <xref target="list.active" />).
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 results SHOULD be consistent with those of the
<xref target="list.active.times">LIST ACTIVE.TIMES command</xref>,
except that if the specified date and time is earlier than the oldest
entry in the latter then the results of this command may include
extra groups.
</t>
<t>
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 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.
</t>
<t>
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
<xref target="TF.686-1">Coordinated Universal Time</xref>;
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.
</t>
<t>
Note that an empty list is a
possible valid response and indicates that there are
no new newsgroups since that date-time.
</t>
<t>
Clients SHOULD make all queries using Coordinated Universal Time
(i.e. by including the &quot;GMT&quot; parameter) when possible.
</t>
</N.description>

<N.examples>
<N.example>
Example where there are new groups:
<N.c text="NEWGROUPS 19990624 000000 GMT" />
<N.s code="231" text="list of new newsgroups follows">
 <N.sm text="alt.fc-writers.recovery 4 1 y" />
 <N.sm text="tx.natives.recovery 89 56 y" />
</N.s>
</N.example>
<N.example>
Example where there are no new groups:
<N.c text="NEWGROUPS 19990624 000000 GMT" />
<N.s code="231" text="list of new newsgroups follows">
 <N.s.empty />
</N.s>
</N.example>
</N.examples>
</N.command>

<N.command name="NEWNEWS">

<N.variant args="wildmat date time [GMT]">
  <N.response code='230' text="List of new articles follows" multi="yes" />
</N.variant>

<N.parameter name="wildmat" text="Newsgroups of interest" />
<N.parameter name="date" text="Date in yymmdd or yyyymmdd format" />
<N.parameter name="time" text="Time in hhmmss format" />

<N.description>
<t>
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.
</t>
<t>
Date and time are in the same format as the NEWGROUPS command
(see <xref target="newgroups" />).
</t>
<t>
Note that an empty list is a possible valid response and indicates that
there is currently no new news in the relevant groups.
</t>
<t>
Clients SHOULD make all queries in Coordinated Universal Time
(i.e. by using the &quot;GMT&quot; parameter) when possible.
</t>
</N.description>

<N.examples>
<N.example>
Example where there are new articles:
<N.c text="NEWNEWS news.*,sci.* 19990624 000000 GMT" />
<N.s code="230" text="list of new articles by message-id follows">
 <N.sm text="&lt;i.am.a.new.article@example.com&gt;" />
 <N.sm text="&lt;i.am.another.new.article@example.com&gt;" />
</N.s>
</N.example>
<N.example>
Example where there are no new articles:
<N.c text="NEWNEWS alt.* 19990624 000000 GMT" />
<N.s code="230" text="list of new articles by message-id follows">
 <N.s.empty />
</N.s>
</N.example>
</N.examples>
</N.command>

  <section title="Time">

<t>
As described in <xref target="article.handling" />,
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 reponses.
</t>
<t>
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.
</t>
<t>
Clients can ensure that they do not have gaps in lists of articles
or groups by using the DATE command in the following manner:
<list style="hanging">
<t hangText="First session:">
<vspace />Issue DATE command and record result
<vspace />Issue NEWNEWS command using a previously chosen timestamp
</t>
<t hangText="Subsequent sessions:">
<vspace />Issue DATE command and hold result in temporary storage
<vspace />Issue NEWNEWS command using timestamp saved from previous session
<vspace />Overwrite saved timestamp with that currently in temporary storage
</t>
</list>
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.
</t>

<N.examples>
<N.example>
First session:
  <N.c text="DATE" />
  <N.s code="111" text="20010203112233" />
  <N.c text="NEWNEWS local.chat 20001231 235959 GMT" />
  <N.s code="230" text="list follows">
    <N.sm text="&lt;article.1@local.service&gt;" />
    <N.sm text="&lt;article.2@local.service&gt;" />
    <N.sm text="&lt;article.3@local.service&gt;" />
  </N.s>
Second session (the client has subtracted 3 minutes from
the timestamp returned previously):
  <N.c text="DATE" />
  <N.s code="111" text="20010204003344" />
  <N.c text="NEWNEWS local.chat 20010203 111933 GMT" />
  <N.s code="230" text="list follows">
    <N.sm text="&lt;article.3@local.service&gt;" />
    <N.sm text="&lt;article.4@local.service&gt;" />
    <N.sm text="&lt;article.5@local.service&gt;" />
  </N.s>
Note how &lt;article.3@local.service&gt; arrived in the 3 minute gap and so
is listed in both responses.
</N.example>
</N.examples>

  </section>

  <section title="The LIST commands" anchor="list.commands">

<N.command name="LIST ACTIVE">

<N.variant args="[wildmat]">
  <N.response code="215" text="Information follows" multi="yes" />
</N.variant>

<N.parameter name="wildmat" text="groups of interest" />

<N.description>
<t>
The LIST ACTIVE command with no parameters returns a
list of valid newsgroups and associated information.
The server MUST include every group that the client is permitted to
select with the <xref target="group">GROUP</xref> command.
Each newsgroup is sent as a line of text in the following format:
<list style="hanging">
<t hangText="group high low status" />
</list>
where:
<list style="hanging">
<t hangText='"group"'>is the name of the newsgroup;</t>
<t hangText='"high"'>is the reported high water mark for the group;</t>
<t hangText='"low"'>is the reported low water mark for the group;</t>
<t hangText='"status"'>is the current status of the group on this server.</t>
</list>
Each field in the line is separated from its neighboring fields by
one or more spaces.
Note that an empty list is a possible valid response,
and indicates that there are currently no valid newsgroups.
</t>
<t>
The reported high and low water marks are as
described in the GROUP command (see <xref target="group" />).
</t>
<t>
The status field is typically one of:
  <list style="hanging">
  <t hangText='"y"'>posting is permitted</t>
  <t hangText='"n"'>posting is not permitted</t>
  <t hangText='"m"'>postings will be forwarded to the newsgroup moderator</t>
  </list>
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 unrecognised status as giving no information.
</t>
<t>
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".
</t>
<t>
If the optional wildmat parameter is specified, the list is
limited to only the groups whose names match the wildmat.
If no wildmat is specified, the keyword ACTIVE MAY be omitted
without altering the effect of the command.
</t>
</N.description>

<N.examples>
<N.example>
Example of LIST ACTIVE returning a list of newsgroups:
<N.c text="LIST ACTIVE" />
<N.s code="215" text="list of newsgroups follows">
 <N.sm text="misc.test 3002322 3000234 y" />
 <N.sm text="comp.risks 442001 441099 m" />
 <N.sm text="alt.fc-writers.recovery 4 1 y" />
 <N.sm text="tx.natives.recovery 89 56 y" />
 <N.sm text="tx.natives.recovery.d 11 9 n" />
</N.s>
</N.example>
<N.example>
Example of LIST ACTIVE omitting the second keyword and returning no
newsgroups:
<N.c text="LIST" />
<N.s code="215" text="list of newsgroups follows">
<N.s.empty />
</N.s>
</N.example>
<N.example>
Example of LIST ACTIVE with a wildmat:
<N.c text="LIST ACTIVE *.recovery" />
<N.s code="215" text="list of newsgroups follows">
 <N.sm text="alt.fc-writers.recovery 4 1 y" />
 <N.sm text="tx.natives.recovery 89 56 y" />
</N.s>
</N.example>
</N.examples>
</N.command>

<N.command name="LIST ACTIVE.TIMES" optional="yes">

<N.variant args="[wildmat]">
  <N.response code="215" text="Information follows" multi="yes" />
</N.variant>

<N.parameter name="wildmat" text="groups of interest" />

<N.description>
<t>
The active.times file is maintained by some news transport
systems to contain information about who created a particular
newsgroup and when.
Each line of this file 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 the email address of the entity that created the newsgroup,
and must be a mailbox as defined in
<xref target="RFC2822">RFC 2822</xref>.
</t>
<N.issue>
<t>
Should the third field simply be free-form, or should it be recommended
usage rather than mandatory?
The problem with "mailbox" is that mailbox requires that it be fully
qualified, and unqualified addresses are apparently
very common for groups created directly by the administrator.
</t>
</N.issue>
<t>
The file MAY omit newsgroups for which the information is unavailable
and MAY include groups not available on the server;
in particular, the file 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 LIST ACTIVE.
The <xref target="newgroups">NEWGROUPS command</xref> may provide a better
way to access this information and the results of the two commands SHOULD
be consistent (subject to the caveats in the description of that command).
</t>
<t>
If the information is available, it is returned as a multi-line response
following the 215 response code.
</t>
<t>
If the optional wildmat parameter is specified, the list is limited to
only the groups in the file whose names match the wildmat.
Note that an empty list is a possible valid response,
and indicates that there are no groups in the file,
or that match the wildmat.
</t>
</N.description>

<N.examples>
<N.example>
Example of LIST ACTIVE.TIMES returning a list of newsgroups:
<N.c text="LIST ACTIVE.TIMES" />
<N.s code="215" text="information follows">
 <N.sm text="misc.test 930445408 &lt;creatme@isc.org&gt;" />
 <N.sm text="alt.rfc-writers.recovery 930562309 &lt;m@example.com&gt;" />
 <N.sm text="tx.natives.recovery 930678923 &lt;sob@academ.com&gt;" />
</N.s>
</N.example>
<N.example>
Example of LIST ACTIVE.TIMES returning an error where the command is
recognised but the software does not maintain this information:
<N.c text="LIST ACTIVE.TIMES" />
<N.s code="503" text="program error, function not performed" />
</N.example>
<N.example>
Example of LIST ACTIVE.TIMES sent to a server that does not
recognize this command:
<N.c text="LIST ACTIVE.TIMES" />
<N.s code="501" text="Syntax Error" />
</N.example>
</N.examples>
</N.command>

<N.command name="LIST DISTRIBUTIONS" optional="yes">

<N.variant>
  <N.response code="215" text="Information follows" multi="yes" />
</N.variant>

<N.description>
<t>
The distributions file is maintained by some news transport
systems to contain information about valid values for the content of the
Distribution header in a news article and about what
the various values mean.
Each line of this file consists of two fields separated from each
other by one or more spaces.
The first field is a value and the second is a short explanation of the
meaning of that value.
</t>
<t>
If the information is available, it is returned as a multi-line response
following the 215 response code.
</t>
</N.description>

<N.examples>
<N.example>
Example of LIST DISTRIBUTIONS returning a list of distributions:
<N.c text="LIST DISTRIBUTIONS" />
<N.s code="215" text="information follows">
 <N.sm text="usa United States of America" />
 <N.sm text="na North America" />
 <N.sm text="world All over the World" />
</N.s>
</N.example>
<N.example>
Example of LIST DISTRIBUTIONS returning an error where the command is
recognised but the software does not maintain this information:
<N.c text="LIST DISTRIBUTIONS" />
<N.s code="503" text="program error, function not performed" />
</N.example>
<N.example>
Example of LIST DISTRIBUTIONS sent to a server that does not
recognize this command:
<N.c text="LIST DISTRIBUTIONS" />
<N.s code="501" text="Syntax Error" />
</N.example>
</N.examples>
</N.command>

<N.command name="LIST DISTRIB.PATS" optional="yes">

<N.variant>
  <N.response code="215" text="Information follows" multi="yes" />
</N.variant>

<N.description>
<t>
The distrib.pats file is maintained by some news transport
systems to choose a value for the content of the
Distribution header of a news article being posted.
Each line of this file 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.
</t>
<t>
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.
</t>
<t>
If the information is available, it is returned as a multi-line response
following the 215 response code.
</t>
</N.description>

<N.examples>
<N.example>
Example of LIST DISTRIB.PATS returning a list of newsgroups:
<N.c text="LIST DISTRIB.PATS" />
<N.s code="215" text="information follows">
 <N.sm text="10:local.*:local" />
 <N.sm text="5:*:world" />
 <N.sm text="20:local.here.*:thissite" />
</N.s>
</N.example>
<N.example>
Example of LIST DISTRIB.PATS returning an error where the command is
recognised but the software does not maintain this information:
<N.c text="LIST DISTRIB.PATS" />
<N.s code="503" text="program error, function not performed" />
</N.example>
<N.example>
Example of LIST DISTRIB.PATS sent to a server that does not
recognize this command:
<N.c text="LIST DISTRIB.PATS" />
<N.s code="501" text="Syntax Error" />
</N.example>
</N.examples>

</N.command>

<N.command name="LIST NEWSGROUPS" optional="yes">

<N.variant args="[wildmat]">
  <N.response code="215" text="Information follows" multi="yes" />
</N.variant>

<N.parameter name="wildmat" text="groups of interest" />

<N.description>
<t>
The newsgroups file is maintained by some news transport
systems 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 file consists of two fields separated from each
other by one or more space or TAB characters
(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.
Note that an empty list is a possible valid response,
and indicates that there are currently no valid newsgroups.
</t>
<t>
The file 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.
</t>
<t>
If the information is available, it is returned as a multi-line response
following the 215 response code.
</t>
<t>
If the optional wildmat parameter is specified, the list is limited to
only the groups in the file whose names match the wildmat.
Note that an empty list is a possible valid response,
and indicates that there are no groups in the file,
or that match the wildmat.
</t>
</N.description>

<N.examples>
<N.example>
Example of LIST NEWSGROUPS returning a list of newsgroups:
<N.c text="LIST NEWSGROUPS" />
<N.s code="215" text="information follows">
 <N.sm text="misc.test General Usenet testing" />
 <N.sm text="alt.rfc-writers.recovery RFC Writers Recovery" />
 <N.sm text="tx.natives.recovery Texas Natives Recovery" />
</N.s>
</N.example>
<N.example>
Example of LIST NEWSGROUPS returning an error where the command is
recognised but the software does not maintain this information:
<N.c text="LIST NEWSGROUPS" />
<N.s code="503" text="program error, function not performed" />
</N.example>
<N.example>
Example of LIST NEWSGROUPS sent to a server that does not
recognize this command:
<N.c text="LIST NEWSGROUPS" />
<N.s code="501" text="Syntax error" />
</N.example>
</N.examples>
</N.command>

  </section>
</section>

<section title="Framework for NNTP extensions" anchor="extensions">

<t>
Although NNTP is widely and robustly deployed, some parts of
the Internet community might wish to extend the NNTP service.
This document defines a means whereby an extended NNTP client can
query the server to determine the service extensions that it supports.
</t>
<t>
It must be emphasized that any extension to the NNTP service
should not be considered lightly.
NNTP's strength comes
primarily from its simplicity.
Experience with many
protocols has shown that:
<list>
<t>
Protocols with few options tend towards ubiquity, whilst
protocols with many options tend towards obscurity.
</t>
</list>
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.
</t>
<t>
Given this environment, the framework for extensions
described in this document consists of:
<list style="symbols">
<t>a mechanism for clients to determine a server's available extensions</t>
<t>a registry of NNTP service extensions</t>
</list>
</t>
<t>
The LIST EXTENSIONS command is described in this document
(see <xref target="list.extensions" />)
and is the mechanism for clients to use to
determine what extensions are available.
</t>
<t>
The IANA shall maintain a registry of NNTP service extensions.
</t>
<t>
An extension is identified by a unique extension-label, which
is a string of 1 to 12 uppercase US-ASCII letters.
The extension-label
will often be the name of a new command that the extension adds.
However this is not a requirement: an extension might
not add any new commands or keywords.
</t>
<t>
An extension is either a private extension or else it is
included in the IANA registry and is defined in an RFC.
Such RFCs either must be on the standards-track or must define an
IESG-approved experimental protocol.
</t>
<t>
The definition of an extension must include:
<list style="symbols">
<t>a descriptive name for the extension</t>
<t>the extension-label (which is returned by LIST EXTENSIONS
to indicate to the client that the server supports this
particular extension)</t>
<t>the syntax, values, and meanings of any parameters
following the extension-label in the output of LIST EXTENSIONS</t>
<t>any new NNTP commands associated with the extension</t>
<t>the syntax and possible values of parameters associated
with the new NNTP commands</t>
<t>the response codes and possible values of parameters for the
responses of the new NNTP commands</t>
<t>any new parameters the extension associates with any other
pre-existing NNTP commands</t>
<t>how support for the extension affects the behavior of a
server and NNTP client</t>
<t>any increase in the maximum length of commands over the
value specified in this document</t>
<t>a specific statement about the effect on pipelining this
extension may have (if any)</t>
</list>
</t>
<t>
The extension-label of private extensions MUST begin with "X".
The extension-label of registered extensions MUST NOT begin with "X".
</t>
<t>
A server MUST NOT provide any extension, whether or not listed in
the output from LIST EXTENSIONS, unless it is either a registered
extension or a private extension.
</t>
<N.issue>
<t>
As worded, this forbids commands like MODE SLAVE that servers already
provide but that aren't part of an existing extension.
We can't simply make these illegal.
</t>
<t>
The wording about starting keywords with an X could be reduced to a SHOULD,
except for backwards compatibility (with a pointer to RFC 2980).
But is that the right answer?
</t>
</N.issue>
<t>
Except where stated otherwise, the commands in this document are understood
(even if not supported) by all servers and are not described in the
list of features returned by the LIST EXTENSIONS command.
</t>
<t>
A server MAY provide additional keywords -
either for new commands or new variants of existing commands -
as part of a private extension.
These new keywords MUST begin with "X".
</t>
<t>
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.
</t>

  <section title="Initial IANA registry" anchor="iana.initial">

<figure>
  <preamble>
The IANA's initial registry of NNTP service extensions
consists of these entries:
  </preamble>
  <artwork>
  Extension                   Label        Added behavior

  Specific article numbers    LISTGROUP    Defined in this document
  Overview support            OVER         Defined in this document
  Header pattern matching     HDR          Defined in this document
  </artwork>
</figure>

  </section>

  <section title="Standard extensions">

<t>
Each of the following sections describes an extension that a
server MAY provide.
If the server provides the extension, it
MUST include the appropriate extension label in the response
to LIST EXTENSIONS.
If it does not provide it, it MUST NOT
include the appropriate extension label.
The descriptions of
facilities in each section are written as if the extension is provided.
If it is not provided, the entire section should be ignored.
</t>
<t>
If the server provides an extension, it MUST implement all of the commands
in the specification of the extension except for those marked as optional.
If it does not provide an extension, it MUST NOT implement any of the
commands in the specification of that extension.
</t>

  </section>

  <section title="The LISTGROUP extension">

<t>
This extension provides one command and has the extension label LISTGROUP.
</t>

<N.command name="LISTGROUP">

<N.variant args="[group]">
  <N.response code="211" multi="yes" text="Article numbers follow"
                         args="number low high group" />
  <N.response code="411" text="No such newsgroup" />
  <N.response code="412" text="No newsgroup selected [1]" />
</N.variant>

<N.parameter name="group"  text="name of newsgroup" />
<N.parameter name="number" text="estimated number of articles in the group" />
<N.parameter name="low"    text="reported low water mark" />
<N.parameter name="high"   text="reported high water mark" />

<N.usage.notes>
  <N.usage.note tag="[1]">
The 412 response can only occur if no group has been specified.
  </N.usage.note>
</N.usage.notes>

<N.description>
<t>
The LISTGROUP command is used to get a listing of all the
article numbers in a particular newsgroup.
</t>
<t>
The optional parameter is the name of the newsgroup to be selected
(e.g. "news.software.misc").
A list of valid newsgroups may be obtained from the LIST ACTIVE command.
If no group is specified, the current selected newsgroup is used.
</t>
<t>
The list of article numbers is returned
as a multi-line response following the 211 response code
(the parameters on the initial response line are the same as
for the GROUP command (see <xref target="group" />).
The list contains one number per line, is in numerical order,
and lists precisely those articles that exist in the group.
</t>
<t>
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.
</t>
<t>
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.
</t>
<t>
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.
</t>
</N.description>

<N.examples>
<N.example>
Example of LISTGROUP on an empty group:
<N.c text="LISTGROUP example.empty.newsgroup" />
<N.s code="211" text="0 0 0 example.empty.newsgroup list follows">
  <N.s.empty />
</N.s>
</N.example>
<N.example>
Example of LISTGROUP on a valid current selected newsgroup:
<N.c text="GROUP misc.test" />
<N.s code="211" text="2000 3000234 3002322 misc.test" />
<N.c text="LISTGROUP" />
<N.s code="211" text="2000 3000234 3002322 misc.test list follows">
<N.sm text="3000234" />
<N.sm text="3000237" />
<N.sm text="3000238" />
<N.sm text="3000239" />
<N.sm text="3002322" />
</N.s>
</N.example>
<N.example>
Example of LISTGROUP failing because no group has been selected:
<N.p text="Assumes current selected newsgroup is invalid." />
<N.c text="LISTGROUP" />
<N.s code="412" text="no current group" />
<N.c text="GROUP example.is.sob.bradner.or.barber" />
<N.s code="411" text="no such group" />
<N.c text="LISTGROUP" />
<N.s code="412" text="no current group" />
</N.example>
</N.examples>
</N.command>

  </section>

  <section title="Article metadata">

<t>
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).
</t>
<t>
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.)
</t>
<t>
This specification defines two metadata items: ":bytes" and ":lines".
Implementations and other extensions may define other metadata items.
</t>
<N.issue>
<t>
Do we need a separate private namespace?
For example, we could reserve :name for extensions and ::name for
implementation use.
</t>
</N.issue>

<section title="The :bytes metadata item">

<t>
The :bytes metadata item for an article is a decimal integer.
It MUST equal the number of octets in the entire article -
headers, body, and separating empty line -
except that each CRLF pair MAY (but SHOULD NOT)
be counted as a single octet.
</t>
<N.issue>
<t>
Should this be called ":octets" instead?
<!-- Russ: name probably okay as is. Charles: no. -->
</t>
</N.issue>

</section>

<section title="The :lines metadata item">

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

</section>

  </section>

  <section title="The OVER extension">

<t>
This extension provides two commands, OVER and LIST OVERVIEW.FMT.
The label for this extension is OVER.
</t>
<t>
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.
The LIST OVERVIEW.FMT command describes the information that would be
stored for an article arriving at the same time as the command was executed.
</t>
<t>
This extension is based on the
<xref target="ROBE1995">Overview/NOV database</xref>
developed by Geoff Collyer.
</t>

<N.command name="OVER">

<N.variant args="[range]">
  <N.response code="224" text="Overview information follows" multi="yes" />
  <N.response code="412" text="No newsgroup selected" />
  <N.response code="420" text="Current article number is invalid" />
  <N.response code="423" text="No articles in that range" />
</N.variant>

<N.parameter name="range" text="Article(s) to return information for" />

<N.description>
<t>
The OVER command returns the contents of the headers and metadata in the
database for the article(s) specified from the current selected newsgroup.
</t>
<t>
The optional range argument may be any of the following:
<list style="symbols">
<t>an article number</t>
<t>an article number followed by a dash to indicate all following</t>
<t>an article number followed by a dash followed by another article number</t>
</list>
If no argument is specified, then the current article number is used.
</t>
<t>
If the information is available, it is returned as a multi-line response
following the 224 response code.
If the current selected newsgroup is invalid,
a 412 response MUST be returned.
If there are no articles in the range specified,
a 423 response MUST be returned.
If OVER is sent without any arguments and the current article number
is invalid, a 420 response MUST be returned.
</t>
<t>
For a successful response, the output consists of one line per article,
sorted in numerical order of article number.
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.
</t>
<t>
The first 8 fields MUST be the following, in order:
<list>
       <t>article number
<vspace />Subject header content
<vspace />From header content
<vspace />Date header content
<vspace />Message-ID header content
<vspace />References header content
<vspace />:bytes metadata item
<vspace />:lines metadata item
</t>
</list>
</t>
<t>
Any subsequent fields are the contents of the other headers and metadata
held in the database.
</t>
<t>
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.
</t>
<t>
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.
</t>
<t>
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.
</t>
<t>
Note that, after unfolding, the characters NUL, LF, and CR cannot occur
in the header of an article offered by a conformant server.
Nevertheless, servers SHOULD check for these characters and replace
each one by a single space
(so that, for example, CR LF LF TAB will become two spaces,
since the CR and first LF will be removed by the unfolding process).
This will encourage robustness in the face of non-conforming data;
it is also possible that future versions of this specification may permit
these characters to appear in articles.
</t>
<t>
The server SHOULD NOT produce output for articles that no longer exist.
</t>
</N.description>

<N.examples>
<t>
In the first two examples, TAB has been replaced by vertical bar
and some lines have been folded for readability.
</t>
<N.example>
Example of a successful retrieval of overview information for
an article (using no article number):
<N.c text="GROUP misc.test" />
<N.s code="211" text="1234 3000234 3002322 misc.test" />
<N.c text="OVER" />
<N.s code="224" text="Overview information follows">
 <N.sm text='300234|I am just a test article|&quot;Demo User&quot;' />
 <N.sw text="&lt;nobody@example.com&gt;|6 Oct 1998 04:38:40 -0500|" />
 <N.sw text="&lt;45223423@example.com&gt;|&lt;45454@example.net&gt;|1234|" />
 <N.sw text="17|Xref: news.example.com misc.test:3000363" />
</N.s>
</N.example>
<N.example>
Example of a successful retrieval of overview information for
a range of articles:
<N.c text="GROUP misc.test" />
<N.s code="211" text="1234 3000234 3002322 misc.test" />
<N.c text="OVER 3000234-3000240" />
<N.s code="224" text="Overview information follows">
 <N.sm text='300234|I am just a test article|&quot;Demo User&quot;' />
 <N.sw text="&lt;nobody@example.com&gt;|6 Oct 1998 04:38:40 -0500|" />
 <N.sw text="&lt;45223423@example.com&gt;|&lt;45454@example.net&gt;|1234|" />
 <N.sw text="17|Xref: news.example.com misc.test:3000363" />
 <N.sm text="3000235|Another test article|nobody@nowhere.to" />
 <N.sw text="(Demo User)|6 Oct 1998 04:38:45 -0500|&lt;45223425@to.to&gt;||" />
 <N.sw text="4818|37||Distribution: fi" />
 <N.sm text="3000238|Re: I am just a test article|somebody@elsewhere.to|" />
 <N.sw text="7 Oct 1998 11:38:40 +1200|&lt;kfwer3v@elsewhere.to&gt;|" />
 <N.sw text="&lt;45223423@to.to&gt;|9234|51" />
</N.s>
Note the missing "References" and Xref headers in the second line, the
missing trailing field(s) in the first and last lines,
and that there are only results for those articles that still exist.
</N.example>
<N.example>
Example of an unsuccessful retrieval of overview information
on an article by number:
<N.c text="GROUP misc.test" />
<N.s code="211" text="1234 3000234 3002322 misc.test" />
<N.c text="OVER 300256" />
<N.s code="420" text="No such article in this group" />
</N.example>
<N.example>
Example of an unsuccessful retrieval of overview information
by number because no newsgroup was selected first:
<N.p text="Assumes current selected newsgroup is invalid." />
<N.c text="OVER" />
<N.s code="412" text="No newsgroup selected" />
</N.example>
<N.example>
Example of an attempt to retrieve information when the current
selected newsgroup is empty:
<N.c text="GROUP example.empty.newsgroup" />
<N.s code="211" text="0 0 0 example.empty.newsgroup" />
<N.c text="OVER" />
<N.s code="420" text="No current article selected" />
</N.example>
</N.examples>
</N.command>

<N.command name="LIST OVERVIEW.FMT">

<N.variant>
  <N.response code="215" text="Information follows" multi="yes" />
</N.variant>

<N.description>
<N.issue>
<t>
Should this be optional even when the OVER extension is provided?
Or even just removed entirely?
What do we want to require about the OVER contents being consistent
with the output of this command?
</t>
</N.issue>
<t>
The LIST OVERVIEW.FMT command returns a description of the fields in
the database.
The fields MUST be listed in the order that they will be returned by
the OVER command for a newly-received article
(the information stored for articles may change over time).
</t>
<t>
If the information is available, it is returned as a multi-line response
following the 215 response code.
The information contains one line per field in the order they are returned
by the OVER command;
the first 7 lines MUST be exactly:
<figure>
<artwork>
    Subject:
    From:
    Date:
    Message-ID:
    References:
    :bytes
    :lines
</artwork>
</figure>
except that, for compatibility with existing implementations, the last
two lines MAY instead be:
<figure>
<artwork>
    Bytes:
    Lines:
</artwork>
</figure>
even though they refer to metadata, not headers.
</t>
<t>
All subsequent lines MUST consist of either a header name followed by
":full", or the name of a piece of metadata.
</t>
<t>
There are no leading or trailing spaces in the output.
</t>
<t>
Note that the 7 fixed lines describe the 2nd to 8th fields of the OVER output.
The "full" suffix is a reminder that the corresponding fields include
the header name.
</t>
<t>
This command MAY generate different results if used more than once in
a session.
</t>

</N.description>

<N.examples>
<N.example>
Example of LIST OVERVIEW.FMT output corresponding to the example
OVER output above, using the preferred format:
  <N.c text="LIST OVERVIEW.FMT" />
  <N.s code="215" text="Order of fields in overview database.">
   <N.sm text="Subject:" />
   <N.sm text="From:" />
   <N.sm text="Date:" />
   <N.sm text="Message-ID:" />
   <N.sm text="References:" />
   <N.sm text=":bytes" />
   <N.sm text=":lines" />
   <N.sm text="Xref:full" />
   <N.sm text="Distribution:full" />
  </N.s>
</N.example>
<N.example>
Example of LIST OVERVIEW.FMT output corresponding to the example
OVER output above, using the alternative format:
  <N.c text="LIST OVERVIEW.FMT" />
  <N.s code="215" text="Order of fields in overview database.">
   <N.sm text="Subject:" />
   <N.sm text="From:" />
   <N.sm text="Date:" />
   <N.sm text="Message-ID:" />
   <N.sm text="References:" />
   <N.sm text="Bytes:" />
   <N.sm text="Lines:" />
   <N.sm text="Xref:full" />
   <N.sm text="Distribution:full" />
  </N.s>
</N.example>
<N.example>
Example of LIST OVERVIEW.FMT returning an error:
<N.c text="LIST OVERVIEW.FMT" />
<N.s code="503" text="overview.fmt not available" />
</N.example>
</N.examples>
</N.command>

  </section>

  <section title="The HDR extension">

<t>
This extension provides one new command: HDR.
The label for this extension is HDR.
</t>
<N.issue>
<t>
There is ongoing discussion about whether this extension should have a
parameter and, if so, what it means.
</t>
</N.issue>

<N.command name="HDR">

<N.variant args="header range" comment="range specified">

  <N.response code="225" text="Headers follow" multi="yes" />
  <N.response code="412" text="No newsgroup selected" />
  <N.response code="423" text="No articles in that range" />

</N.variant>

<N.variant args="header message-id" comment="message-id specified">

  <N.response code="225" text="Headers follow" multi="yes" />
  <N.response code="430" text="No article with that message-id" />

</N.variant>

<N.variant args="header" comment="current article number used">

  <N.response code="225" text="Headers follow" multi="yes" />
  <N.response code="412" text="No newsgroup selected" />
  <N.response code="420" text="Current article number is invalid" />

</N.variant>

<N.parameter name="header" text="name of header, without the colon" />
<N.parameter name="range" text="number(s) of articles" />
<N.parameter name="message-id" text="message-id of article" />

<N.description>
<t>
The HDR command retrieves specific headers from an article or specified
range of articles in the current selected newsgroup, or from an article
specified by message-id.
It can also return certain metadata about the article or articles.
</t>
<t>
The required header parameter 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.
</t>
<t>
The range parameter may be any of the following:
<list style="symbols">
<t>an article number</t>
<t>an article number followed by a dash to indicate all following</t>
<t>an article number followed by a dash followed by another article number</t>
</list>
</t>
<t>
The message-id argument indicates a specific article.
As shown by the syntax, the range and message-id arguments are
mutually exclusive;
if neither is specified, the current article number is used.
</t>
<t>
If the information is available, it is returned as a multi-line response
following the 225 response code and contains one line for
each article where the relevant header line exists.
The line consists of the article number, a space, and then
the contents of the header (without the header name or the colon and
space that follow it) or metadata item.
If the article is specified by message-id rather than by article range,
the article number is given as "0".
</t>
<t>
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
<xref target="over.descr">OVER extension</xref>,
and the same comment concerning NUL, CR, and LF applies).
</t>
<t>
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.
</t>
<t>
If the requested header is not present in the article or if it is present
but empty, a line for that article is included in the output but the
header content portion of the line is empty
(the space after the article number MAY be retained or omitted).
If any article number in the provided range does not exist in the group,
no line for that article number is included in the output.
</t>
<t>
If the optional argument is a message-id
and no such article exists,
a 430 response MUST be returned.
If the optional argument is not a message-id and the current selected
newsgroup is invalid,
a 412 response MUST be returned.
If the optional argument is an article number or number range and
no article with that number or in that number range exists in the
current selected newsgroup,
a 423 response MUST be returned.
If HDR is sent without any arguments and the current article number
is invalid, a 420 response MUST be returned.
</t>
<t>
A server MAY only allow HDR commands for a limited set of headers and
metadata items (such as those present in the overview database).
If so, it MUST respond with a 503 response to attempts to
request other headers, rather than returning erroneous results such as a
successful empty response.
</t>
</N.description>

<N.examples>
<N.example>
Example of a successful retrieval of subject lines from a range of
articles (3000235 has no Subject header, and 3000236 is missing):
<N.c text="GROUP misc.test" />
<N.s code="211" text="1234 3000234 3002322 misc.test" />
<N.c text="HDR Subject 3000234-300238" />
<N.s code="225" text="Headers follow">
<N.sm text="3000234 I am just a test article" />
<N.sm text="3000235" />
<N.sm text="3000237 Re: I am just a test article" />
<N.sm text="3000238 Ditto" />
</N.s>
</N.example>
<N.example>
Example of a successful retrieval of line counts from a range of articles:
<N.c text="GROUP misc.test" />
<N.s code="211" text="1234 3000234 3002322 misc.test" />
<N.c text="HDR :lines 3000234-300238" />
<N.s code="225" text="Headers follow">
<N.sm text="3000234 42" />
<N.sm text="3000235 5" />
<N.sm text="3000237 11" />
<N.sm text="3000238 2378" />
</N.s>
</N.example>
<N.example>
Example of a successful retrieval of the subject line from an article by
message-id:
<N.c text="GROUP misc.test" />
<N.s code="211" text="1234 3000234 3002322 misc.test" />
<N.c text="HDR subject &lt;i.am.a.test.article@example.com&gt;" />
<N.s code="225" text="Header information follows">
<N.sm text="0 I am just a test article" />
</N.s>
</N.example>
<N.example>
Example of a successful retrieval of the subject line from the current
article:
<N.c text="GROUP misc.test" />
<N.s code="211" text="1234 3000234 3002322 misc.test" />
<N.c text="HDR subject" />
<N.s code="225" text="Header information follows">
<N.sm text="3000234 I am just a test article" />
</N.s>
</N.example>
<N.example>
Example of an unsuccessful retrieval of a header from an
article by message-id:
<N.c text="HDR subject &lt;i.am.not.there@example.com&gt;" />
<N.s code="430" text="No Such Article Found" />
</N.example>
<N.example>
Example of an unsuccessful retrieval of headers from articles
by number because no newsgroup was selected first:
<N.p text="Assumes current selected newsgroup is invalid." />
<N.c text="HDR subject 300256-" />
<N.s code="412" text="No newsgroup selected" />
</N.example>
<N.example>
Example of an unsuccessful retrieval of headers because the current
selected newsgroup is empty:
<N.c text="GROUP example.empty.newsgroup" />
<N.s code="211" text="0 0 0 example.empty.newsgroup" />
<N.c text="HDR subject 1-" />
<N.s code="423" text="No articles in that range" />
</N.example>
<N.example>
Example of an unsuccessful retrieval of headers because the server does
not allow HDR commands for that header:
<N.c text="GROUP misc.test" />
<N.s code="211" text="1234 3000234 3002322 misc.test" />
<N.c text="HDR Content-Type 3000234-300238" />
<N.s code="503" text="HDR not permitted on Content-Type" />
</N.example>
</N.examples>
</N.command>

  </section>

</section>

<section title="Augmented BNF Syntax for NNTP" anchor="full.syntax">

<t>
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
<xref target="RFC2234">ABNF</xref>
strings are case insensitive.
Non-terminals used in several places
are defined in a separate section at the end.
</t>

  <section title="Commands">
<figure>
  <preamble>
This syntax defines the non-terminal "command-line", which represents
what is sent from the client to the server.
  </preamble>
  <artwork>

  command-line = command EOL
  command = article-command /
        body-command /
        date-command /
        group-command /
        hdr-command /
        head-command /
        help-command /
        ihave-command /
        last-command /
        list-active-command /
        list-active-times-command /
        list-distrib-pats-command /
        list-distributions-command /
        list-extensions-command /
        list-newsgroups-command /
        list-overview-fmt-command /
        listgroup-command /
        mode-reader-command /
        newgroups-command /
        newnews-command /
        next-command /
        over-command /
        post-command /
        quit-command /
        stat-command /
        x-command
&nbsp;
  article-command = "ARTICLE" [article-ref]
  body-command = "BODY" [article-ref]
  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-active-command = "LIST" [WS "ACTIVE" [WS wildmat]]
  list-active-times-command = "LIST" WS "ACTIVE.TIMES" [WS wildmat]
  list-distrib-pats-command = "LIST" WS "DISTRIB.PATS"
  list-distributions-command = "LIST" WS "DISTRIBUTIONS"
  list-extensions-command = "LIST" WS "EXTENSIONS"
  list-newsgroups-command = "LIST" WS "NEWSGROUPS" [WS wildmat]
  list-overview-fmt-command = "LIST" WS "OVERVIEW.FMT"
  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]
  post-command = "POST"
  quit-command = "QUIT"
  stat-command = "STAT" [article-ref]
  x-command = x-command-name *(WS x-argument)
      ; Each extension command is specified fully elsewhere
&nbsp;
  article-ref = WS (article-number / message-id)
  article-number = 1*16DIGIT
  date = [2DIGIT] 6DIGIT
  date-time = date WS time [WS "GMT"]
  header-meta-name = header-name / metadata-name
  metadata-name = ":" 1*A-NOTCOLON
  newsgroup-name = 1*wildmat-exact
  range = article-number ["-" [article-number]]
  range-ref = WS (range / message-id)
  time = 6DIGIT
  x-command-name = 3*12A-CHAR
  x-argument = 1*P-CHAR
&nbsp;
  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 = "*" / "?"
  </artwork>
</figure>
  </section>

  <section title="Responses">
<figure>
  <preamble>
This syntax defines the non-terminal "response", which represents
what is sent from the server to the client in response to a command.
  </preamble>
  <artwork>

  response = simple-response / multiline-response
  multiline-response = simple-response *content-line termination
  termination = "." CRLF
  content-line = [content-text] CRLF
  content-text = (".." / B-NONDOT) B-CHAR
&nbsp;
  simple-response = 3DIGIT parameters [ SP trailing-comment ] CRLF
  trailing-comment = *U-CHAR
  parameters = *( SP parameter ) ; How many depends on the response
  parameter = 1*A-CHAR

  </artwork>
</figure>
  </section>

  <section title="Articles">
<figure>
  <preamble>
This syntax defines the non-terminal "article", which represents the format
of an article as described in <xref target="article.concepts" />.
  </preamble>
  <artwork>

  article = 1*header CRLF body
  body = *(*B-CHAR CRLF)
  header = header-name ":" header-tail CRLF
  header-tail = SP header-content-u / CRLF SP header-content-f
  header-content-u = *( header-gap header-text) *WS
  header-content-f = *WS header-text header-content-u
  header-gap = *WS [CRLF] 1*WS
  header-text = 1*P-CHAR

  </artwork>
</figure>

  </section>

  <section title="General non-terminals">
<figure>
  <preamble>
  </preamble>
  <artwork>

  header-name = 1*A-NOTCOLON
  message-id = "&lt;" 1*248A-NOTGT "&gt;"
&nbsp;
  ; Assorted special character sets
  ;   A- means based on 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 "&gt;"
  P-CHAR     = A-CHAR / UTF8-non-ascii
  U-CHAR     = %x01-09 / %x0B-0C / %x0E-7F / UTF8-non-ascii
  B-CHAR     = %x01-09 / %x0B-0C / %x0E-FF
  B-NONDOT   = %x01-09 / %x0B-0C / %x0E-2D / %x2F-FF  ; exclude "."
&nbsp;
  CR = %x0D
  CRLF = CR LF
  DIGIT = %x30-39
  EOL = *(SP / HT) CRLF
  HT = %x09
  LF = %x0A
  SP = %x20
  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 / HT)

  </artwork>
</figure>
<N.issue>
<t>
When draft-yergeau-rfc2279bis-04.txt replaces 2279,
need to update references.
</t>
</N.issue>
  </section>

</section>

<section title="IANA Considerations">

<t>
This specification requires IANA to keep a registry of extension-labels.
The initial contents of this registry are specified in
<xref target="iana.initial" />.
As described in
<xref target="extensions" />,
names beginning with X are reserved for private use while
all other names are to be associated with a specification in an RFC
on the standards-track or defining an IESG-approved experimental protocol.
</t>

</section>

<section title="Security Considerations">
<t>
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.
</t>
  <section title="Personal and Proprietary Information">
<t>
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.
</t>
  </section>

  <section title="Abuse of Server Log Information">
<t>
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.
</t>
  </section>

  <section title="Weak Authentication and Access Control">
<t>
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.
While including such mechanisms is optional, doing so is strongly encouraged.
</t>
<t>
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.
</t>
  </section>

  <section title="DNS Spoofing">
<t>
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.
</t>
<t>
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.
</t>
<t>
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.
</t>
<t>
This requirement also improves the load-balancing behavior 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.
</t>
  </section>

  <section title="UTF-8 issues">
<t>
<xref target="RFC2279">UTF-8</xref>
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.
</t>
<t>
Implementations of this specification MUST NOT generate malformed or
illegal sequences and SHOULD detect them and take some appropriate
action.
This could include:
<list style="symbols">
<t> replacing such sequences by a "guessed" valid sequence (based on
properties of the UTF-8 encoding);</t>
<t> replacing such sequences by the sequence %xEF.BF.BD,
which encodes the "replacement character" U+FFFD;</t>
<t> closing the connection;</t>
<t> generating a 501 response code.</t>
</list>
In the first 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.
</t>
<N.issue>
<t>
Yergeau says that you MUST detect illegal sequences.
He also rejects the first bullet point and consequent text;
I'm discussing it with him now.
</t>
</N.issue>
  </section>
</section>

<section title="Acknowledgments">

<t>
The author acknowledges the original authors of NNTP as
documented in <xref target="RFC977">RFC 977</xref>:
Brian Kantor and Phil Lapsey.
</t>
<t>
The author gratefully acknowledges 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.
</t>
<t>
The author gratefully acknowledges the work of Marshall Rose &amp;
John G. Meyers in
<xref target="RFC1939">RFC 1939</xref>
and the work of the DRUMS working group,
specifically
<xref target="RFC1869">RFC 1869</xref>,
which is the basis of the NNTP extensions
mechanism detailed in this document.
</t>
<N.issue>
<t>
Why RFC 1939?
</t>
</N.issue>
<t>
The author gratefully acknowledges the authors of
<xref target="RFC2616">RFC 2616</xref>
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.
</t>
<t>
The author gratefully acknowledges the comments and
additional information provided by the following individuals
in preparing one or more of the progenitors of this document:
<list>
<t>        Russ Allbery &lt;rra@stanford.edu&gt;
<vspace /> Wayne Davison &lt;davison@armory.com&gt;
<vspace /> Chris Lewis &lt;clewis@bnr.ca&gt;
<vspace /> Tom Limoncelli &lt;tal@mars.superlink.net&gt;
<vspace /> Eric Schnoebelen &lt;eric@egsner.cirr.com&gt;
<vspace /> Rich Salz &lt;rsalz@osf.org&gt;
</t>
</list>
</t>
<t>
This work was motivated by the work of various news reader
authors and news server authors, which includes those listed below:
<list style="hanging">
<t hangText="Rick Adams"><vspace />
Original author of the NNTP extensions to the RN news reader and last
maintainer of Bnews</t>
<t hangText="Stan Barber"><vspace />
Original author of the NNTP extensions to the news readers that are
part of Bnews</t>
<t hangText="Geoff Collyer"><vspace />
Original author of the OVERVIEW database proposal and one of the
original authors of CNEWS</t>
<t hangText="Dan Curry"><vspace />
Original author of the xvnews news reader</t>
<t hangText="Wayne Davison"><vspace />
Author of the first threading extensions to the RN news reader
(commonly called TRN)</t>
<t hangText="Geoff Huston"><vspace />
Original author of ANU NEWS</t>
<t hangText="Phil Lapsey"><vspace />
Original author of the UNIX reference implementation for NNTP</t>
<t hangText="Iain Lea"><vspace />
Original maintainer of the TIN news reader</t>
<t hangText="Chris Lewis"><vspace />
First known implementer of the AUTHINFO GENERIC extension</t>
<t hangText="Rich Salz"><vspace />
Original author of INN</t>
<t hangText="Henry Spencer"><vspace />
One of the original authors of CNEWS</t>
<t hangText="Kim Storm"><vspace />
Original author of the NN news reader</t>
</list>
</t>
<t>
Finally, the present author gratefully acknowledges the vast amount of
work put into previous drafts by the previous author:
<list>
<t>Stan Barber &lt;sob@academ.com&gt;</t>
</list>
</t>

</section>

</middle>

<!-- References and other similar stuff -->

<back>

  <!--
You can fetch definitive references for RFCs and similar by carrying
out one of the following commands:

lynx -source http://xml.resource.org/public/rfc/bibxml/reference.RFC.0977.xml
lynx -source http://xml.resource.org/public/rfc/bibxml4/reference.W3C.code.xml
lynx -source http://xml.resource.org/public/rfc/bibxml2/reference.ANSI.code.xml
(other stuff is in the same place as ANSI)

  -->

  <references title="Normative References">

    <reference anchor="RFC977">

<front>
<title abbrev='Network News Transfer Protocol'>Network News Transfer Protocol</title>
<author initials='B.' surname='Kantor' fullname='Brian Kantor'>
<organization>University of California, San Diego (UCSD)</organization></author>
<author initials='P.' surname='Lapsley' fullname='Phil Lapsley'>
<organization>University of California, Berkeley (UCB)</organization></author>
<date month='February' day='1' year='1986' /></front>

<seriesInfo name='RFC' value='977' />
<format type='TXT' octets='55062' target='ftp://ftp.isi.edu/in-notes/rfc977.txt' />
</reference>

    <reference anchor="RFC2279">
<front>
<title abbrev='UTF-8'>UTF-8, a transformation format of ISO 10646</title>
<author initials='F.' surname='Yergeau' fullname='Francois Yergeau'>
<organization>Alis Technologies</organization>
<address>
<postal>
<street>100, boul. Alexis-Nihon</street>
<street>Suite 600</street>
<city>Montreal</city>
<region>Quebec</region>
<code>H4M 2P2</code>
<country>CA</country></postal>
<phone>+1 514 747 2547</phone>
<facsimile>+1 514 747 2561</facsimile>
<email>fyergeau@alis.com</email></address></author>
<date month='January' year='1998' />
<abstract>
<t>ISO/IEC 10646-1 defines a multi-octet character set called the Universal Character Set (UCS) which encompasses most of the world's writing systems. Multi-octet characters, however, are not compatible with many current applications and protocols, and this has led to the development of a few so-called UCS transformation formats (UTF), each with different characteristics.  UTF-8, the object of this memo, has the characteristic of preserving the full US-ASCII range, providing compatibility with file systems, parsers and other software that rely on US-ASCII values but are transparent to other values. This memo updates and replaces RFC 2044, in particular addressing the question of versions of the relevant standards.</t></abstract></front>

<seriesInfo name='RFC' value='2279' />
<format type='TXT' octets='21634' target='ftp://ftp.isi.edu/in-notes/rfc2279.txt' />
</reference>

    <reference anchor="ANSI1986">
<!-- http://xml.resource.org/public/rfc/bibxml2/reference.ANSI.X3-4.1986.xml -->
<front>
<title>Coded Character Set - 7-bit American Standard Code for Information Interchange</title>
<author>
<organization>American National Standards Institute</organization>
</author>
<date month="" year="1986" />
</front>
<seriesInfo name="ANSI" value="X3.4" />
</reference>

    <reference anchor="RFC2119">
<front>
<title abbrev='RFC Key Words'>Key words for use in RFCs to Indicate Requirement Levels</title>
<author initials='S.' surname='Bradner' fullname='Scott Bradner'>
<organization>Harvard University</organization>
<address>
<postal>
<street>1350 Mass. Ave.</street>
<street>Cambridge</street>
<street>MA 02138</street></postal>
<phone>- +1 617 495 3864</phone>
<email>-</email></address></author>
<date month='March' year='1997' />
<area>General</area>
<keyword>keyword</keyword>
<abstract>
<t>
   In many standards track documents several words are used to signify
   the requirements in the specification.  These words are often
   capitalized.  This document defines these words as they should be
   interpreted in IETF documents.  Authors who follow these guidelines
   should incorporate this phrase near the beginning of their document:

<list>
<t>
      The key words &quot;MUST&quot;, &quot;MUST NOT&quot;, &quot;REQUIRED&quot;, &quot;SHALL&quot;, &quot;SHALL
      NOT&quot;, &quot;SHOULD&quot;, &quot;SHOULD NOT&quot;, &quot;RECOMMENDED&quot;,  &quot;MAY&quot;, and
      &quot;OPTIONAL&quot; in this document are to be interpreted as described in
      RFC 2119.
</t></list></t>
<t>
   Note that the force of these words is modified by the requirement
   level of the document in which they are used.
</t></abstract></front>

<seriesInfo name='BCP' value='14' />
<seriesInfo name='RFC' value='2119' />
<format type='TXT' octets='4723' target='ftp://ftp.isi.edu/in-notes/rfc2119.txt' />
<format type='HTML' octets='15902' target='http://xml.resource.org/public/rfc/html/rfc2119.html' />
<format type='XML' octets='5647' target='http://xml.resource.org/public/rfc/xml/rfc2119.xml' />
</reference>

    <reference anchor="RFC2234">
<front>
<title abbrev='ABNF for Syntax Specifications'>Augmented BNF for Syntax Specifications: ABNF</title>
<author initials='D.H.' surname='Crocker' fullname='David H. Crocker'>
<organization>Internet Mail Consortium</organization>
<address>
<postal>
<street>675 Spruce Dr.</street>
<city>Sunnyvale</city>
<region>CA</region>
<code>94086</code>
<country>US</country></postal>
<phone>+1 408 246 8253</phone>
<facsimile>+1 408 249 6205</facsimile>
<email>dcrocker@imc.org</email></address></author>
<author initials='P.' surname='Overell' fullname='Paul Overell'>
<organization>Demon Internet Ltd</organization>
<address>
<postal>
<street>Dorking Business Park</street>
<street>Dorking</street>
<city>Surrey</city>
<region>England</region>
<code>RH4 1HN</code>
<country>UK</country></postal>
<email>paulo@turnpike.com</email></address></author>
<date month='November' year='1997' /></front>

<seriesInfo name='RFC' value='2234' />
<format type='TXT' octets='24265' target='ftp://ftp.isi.edu/in-notes/rfc2234.txt' />
</reference>

    <reference anchor="RFC2822">
<front>
<title>Internet Message Format</title>
<author initials='P.' surname='Resnick' fullname='P. Resnick'>
<organization /></author>
<date month='April' year='2001' /></front>

<seriesInfo name='RFC' value='2822' />
<format type='TXT' octets='110695' target='ftp://ftp.isi.edu/in-notes/rfc2822.txt' />
</reference>

    <reference anchor="ROBE1995">
      <front>
        <title abbrev="Overview database">
FAQ: Overview database / NOV General Information
        </title>
        <author initials="R." surname="Robertson" fullname="Rob Robertson" />
        <format type='TXT'
                target="ftp://ftp.uu.net/networking/news/nntp/inn/faq-nov.Z"
        />
        <format type='TXT'
                target="http://www.ibiblio.org/pub/historic-linux/distributions/slackware/2.1/usr/lib/news/tools.linux/faq-nov"
        />
        <format type='TXT'
                target="news:nov-faq-1-752238124@agate.Berkeley.EDU"
        />
        <date year="1995" month="January" />
      </front>
    </reference>

    <reference anchor="TF.686-1">
      <front>
        <title>Glossary, ITU-R Recommendation TF.686-1</title>
        <author>
          <organization abbrev="ITU-R">
International Telecommunications Union - Radio
          </organization>
        </author>
        <date year="1997" month="October" />
      </front>
      <seriesInfo name="ITU-R" value="Recommendation TF.686-1" />
    </reference>

    <reference anchor="RFC1305">
<front>
<title>Network Time Protocol (Version 3) Specification, Implementation</title>
<author initials='D.' surname='Mills' fullname='David L. Mills'>
<organization>University of Delaware, Electrical Engineering Department</organization>
<address>
<postal>
<street />
<city>Newark</city>
<region>DE</region>
<code>19716</code>
<country>US</country></postal>
<phone>+1 302 451 8247</phone>
<email>mills@udel.edu</email></address></author>
<date month='March' year='1992' />
<abstract>
<t>This document describes the Network Time Protocol (NTP), specifies its normal structure and summarizes information useful for its implementation. NTP provides the mechanisms to synchronize time and coordinate time distribution in a large, diverse internet operating at rates from mundane to lightwave. It uses a returnable-time design in which a distributed subnet of time servers operating in a self-organizing, hierarchical-master-slave configuration synchronizes local clocks within the subnet and to national time standards via wire or radio. The servers can also redistribute reference time via local routing algorithms and time daemons.</t></abstract></front>

<seriesInfo name='RFC' value='1305' />
<format type='TXT' octets='307085' target='ftp://ftp.isi.edu/in-notes/rfc1305.txt' />
<format type='PDF' octets='442493' target='ftp://ftp.isi.edu/in-notes/rfc1305.pdf' />
</reference>

  </references>

  <references title="Informative References">

    <reference anchor="SALZ1992">
      <front>
        <title abbrev="Wildmat(3) manual page">
Manual Page for wildmat(3)
from the INN 1.4 distribution, Revision 1.10
        </title>
        <author initials="R." surname="Salz" fullnam="Rich Salz">
          <organization>UUNET Technologies</organization>
        </author>
        <date year="1992" month="April" />
      </front>
    </reference>

    <reference anchor="RFC2629">

<front>
<title>Writing I-Ds and RFCs using XML</title>
<author initials='M.T.' surname='Rose' fullname='Marshall T. Rose'>
<organization>Invisible Worlds, Inc.</organization>
<address>
<postal>
<street>660 York Street</street>
<city>San Francisco</city>
<region>CA</region>
<code>94110</code>
<country>US</country></postal>
<phone>+1 415 695 3975</phone>
<email>mrose@not.invisible.net</email>
<uri>http://invisible.net/</uri></address></author>
<date month='June' year='1999' />
<area>General</area>
<keyword>RFC</keyword>
<keyword>Request for Comments</keyword>
<keyword>I-D</keyword>
<keyword>Internet-Draft</keyword>
<keyword>XML</keyword>
<keyword>Extensible Markup Language</keyword>
<abstract>
<t>This memo presents a technique for using XML
(Extensible Markup Language)
as a source format for documents in the Internet-Drafts (I-Ds) and
Request for Comments (RFC) series.</t></abstract></front>

<seriesInfo name='RFC' value='2629' />
<format type='TXT' octets='48677' target='ftp://ftp.isi.edu/in-notes/rfc2629.txt' />
<format type='HTML' octets='59504' target='http://xml.resource.org/public/rfc/html/rfc2629.html' />
<format type='XML' octets='46132' target='http://xml.resource.org/public/rfc/xml/rfc2629.xml' />

    </reference>

    <reference anchor="RFC1036">
<front>
<title abbrev='Standard for USENET Messages'>Standard for interchange of USENET messages</title>
<author initials='M.' surname='Horton' fullname='M. Horton'>
<organization>AT&amp;T Bell Laboratories</organization></author>
<author initials='R.' surname='Adams' fullname='R. Adams'>
<organization>Center for Seismic Studies</organization></author>
<date month='December' day='1' year='1987' /></front>

<seriesInfo name='RFC' value='1036' />
<format type='TXT' octets='46891' target='ftp://ftp.isi.edu/in-notes/rfc1036.txt' />
</reference>

    <reference anchor="RFC1939">
<front>
<title abbrev='POP3'>Post Office Protocol - Version 3</title>
<author initials='J.G.' surname='Myers' fullname='John G. Myers'>
<organization>Carnegie-Mellon University</organization>
<address>
<postal>
<street>5000 Forbes Ave</street>
<city>Pittsburgh</city>
<region>PA</region>
<code>15213</code>
<country>US</country></postal>
<email>jgm+@cmu.edu</email></address></author>
<author initials='M.T.' surname='Rose' fullname='Marshall T. Rose'>
<organization>Dover Beach Consulting, Inc.</organization>
<address>
<postal>
<street>420 Whisman Court</street>
<city>Mountain View</city>
<region>CA</region>
<code>94043-2186</code>
<country>US</country></postal>
<email>mrose@dbc.mtview.ca.us</email></address></author>
<date month='May' year='1996' /></front>

<seriesInfo name='STD' value='53' />
<seriesInfo name='RFC' value='1939' />
<format type='TXT' octets='47018' target='ftp://ftp.isi.edu/in-notes/rfc1939.txt' />
    </reference>

    <reference anchor="RFC1869">
<front>
<title>SMTP Service Extensions</title>
<author initials='J.' surname='Klensin' fullname='John Klensin'>
<organization>MCI</organization>
<address>
<postal>
<street>2100 Reston Parkway</street>
<city>Reston</city>
<region>VA</region>
<code>22091</code>
<country>US</country></postal>
<phone>+1 703 715 7361</phone>
<facsimile>+1 703 715 7436</facsimile>
<email>klensin@mci.net</email></address></author>
<author initials='N.' surname='Freed' fullname='Ned Freed'>
<organization>Innosoft International, Inc.</organization>
<address>
<postal>
<street>1050 East Garvey Avenue South</street>
<city>West Covina</city>
<region>CA</region>
<code>91790</code>
<country>US</country></postal>
<phone>+1 818 919 3600</phone>
<facsimile>+1 818 919 3614</facsimile>
<email>ned@innosoft.com</email></address></author>
<author initials='M.' surname='Rose' fullname='Marshall T. Rose'>
<organization>Dover Beach Consulting, Inc.</organization>
<address>
<postal>
<street>420 Whisman Court</street>
<city>Mountain View</city>
<region>CA</region>
<code>94043-2186</code>
<country>US</country></postal>
<phone>+1 415 968 1052</phone>
<facsimile>+1 415 968 2510</facsimile>
<email>mrose@dbc.mtview.ca.us</email></address></author>
<author initials='E.' surname='Stefferud' fullname='Einar A. Stefferud'>
<organization>Network Management Associates, Inc.</organization>
<address>
<postal>
<street>17301 Drey Lane</street>
<city>Huntington Beach</city>
<region>CA</region>
<code>92647-5615</code>
<country>US</country></postal>
<phone>+1 714 842 3711</phone>
<facsimile>+1 714 848 2091</facsimile>
<email>stef@nma.com</email></address></author>
<author initials='D.' surname='Crocker' fullname='Dave Crocker'>
<organization>Brandenburg Consulting</organization>
<address>
<postal>
<street>675 Spruce Dr.</street>
<city>Sunnyvale</city>
<region>CA</region>
<code>94086</code>
<country>US</country></postal>
<phone>+1 408 246 8253</phone>
<facsimile>+1 408 249 6205</facsimile>
<email>dcrocker@mordor.stanford.edu</email></address></author>
<date month='November' year='1995' />
<abstract>
<t>This memo defines a framework for extending the SMTP service by defining a means whereby a server SMTP can inform a client SMTP as to the service extensions it supports.  Extensions to the SMTP service are registered with the IANA. This framework does not require modification of existing SMTP clients or servers unless the features of the service extensions are to be requested or provided.</t></abstract></front>

<seriesInfo name='STD' value='10' />
<seriesInfo name='RFC' value='1869' />
<format type='TXT' octets='23299' target='ftp://ftp.isi.edu/in-notes/rfc1869.txt' />
    </reference>

    <reference anchor="RFC2616">
<front>
<title abbrev='HTTP/1.1'>Hypertext Transfer Protocol -- HTTP/1.1</title>
<author initials='R.T.' surname='Fielding' fullname='Roy T. Fielding'>
<organization>University of California, Irvine, Information and Computer Science</organization>
<address>
<postal>
<street />
<city>Irvine</city>
<region>CA</region>
<code>92697-3425</code>
<country>US</country></postal>
<phone>+1 949 824 1715</phone>
<email>fielding@ics.uci.edu</email></address></author>
<author initials='J.' surname='Gettys' fullname='James Gettys'>
<organization>World Wide Web Consortium, MIT Laboratory for Computer Science</organization>
<address>
<postal>
<street>545 Technology Square</street>
<city>Cambridge</city>
<region>MA</region>
<code>02139</code>
<country>US</country></postal>
<facsimile>+1 617 258 8682</facsimile>
<email>jg@w3.org</email></address></author>
<author initials='J.C.' surname='Mogul' fullname='Jeffrey C. Mogul'>
<organization>Compaq Computer Corporation, Western Research Laboratory</organization>
<address>
<postal>
<street>250 University Avenue</street>
<city>Palo Alto</city>
<region>CA</region>
<code>94301</code>
<country>US</country></postal>
<email>mogul@wrl.dec.com</email></address></author>
<author initials='H.F.' surname='Nielsen' fullname='Henrik Frystyk Nielsen'>
<organization>World Wide Web Consortium, MIT Laboratory for Computer Science</organization>
<address>
<postal>
<street>545 Technology Square</street>
<city>Cambridge</city>
<region>MA</region>
<code>02139</code>
<country>US</country></postal>
<facsimile>+1 617 258 8682</facsimile>
<email>frystyk@w3.org</email></address></author>
<author initials='L.' surname='Masinter' fullname='Larry Masinter'>
<organization>Xerox Corporation</organization>
<address>
<postal>
<street>3333 Coyote Hill Road</street>
<city>Palo Alto</city>
<region>CA</region>
<code>94034</code>
<country>US</country></postal>
<email>masinter@parc.xerox.com</email></address></author>
<author initials='P.J.' surname='Leach' fullname='Paul J. Leach'>
<organization>Microsoft Corporation</organization>
<address>
<postal>
<street>1 Microsoft Way</street>
<city>Redmond</city>
<region>WA</region>
<code>98052</code>
<country>US</country></postal>
<email>paulle@microsoft.com</email></address></author>
<author initials='T.' surname='Berners-Lee' fullname='Tim Berners-Lee'>
<organization>World Wide Web Consortium, MIT Laboratory for Computer Science</organization>
<address>
<postal>
<street>545 Technology Square</street>
<city>Cambridge</city>
<region>MA</region>
<code>02139</code>
<country>US</country></postal>
<phone>+1 617 258 8682</phone>
<email>timbl@w3.org</email></address></author>
<date month='June' year='1999' />
<abstract>
<t>The Hypertext Transfer Protocol (HTTP) is an application-level protocol for distributed, collaborative, hypermedia information systems. It is a generic, stateless, protocol which can be used for many tasks beyond its use for hypertext, such as name servers and distributed object management systems, through extension of its request methods, error codes and headers. A feature of HTTP is the typing and negotiation of data representation, allowing systems to be built independently of the data being transferred.</t>
<t>HTTP has been in use by the World-Wide Web global information initiative since 1990. This specification defines the protocol referred to as "HTTP/1.1", and is an update to RFC 2068.</t></abstract></front>

<seriesInfo name='RFC' value='2616' />
<format type='TXT' octets='422317' target='ftp://ftp.isi.edu/in-notes/rfc2616.txt' />
<format type='PS' octets='5529857' target='ftp://ftp.isi.edu/in-notes/rfc2616.ps' />
<format type='PDF' octets='550558' target='ftp://ftp.isi.edu/in-notes/rfc2616.pdf' />
    </reference>

  </references>

<!-- If I want an appendix, add a [section] bit here -->

</back>

</rfc>
