🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #66887

New NNTP draft -- Section 5

#66887
From: Russ Allbery
Date: Mon, 20 Oct 2003 16:39
358 lines
15177 bytes
[ See <http://www.davros.org/nntp-texts/draft20.txt> for the complete
  document, including credits and references.  This is the third in a
  series of postings of the sections of the new NNTP draft, which is
  currently in Last Call. ]


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


5. Session administration commands

5.1 Initial Connection

5.1.1 Usage

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

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

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

5.1.2 Description

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

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

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

5.1.3 Examples

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

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

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

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

   Example of a normal connection from an unauthorized client:

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

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

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


5.2 MODE READER

5.2.1 Usage

   This command MUST NOT be pipelined.

   Syntax
      MODE READER

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

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

5.2.2 Description

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

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

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

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

5.2.3 Examples

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

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

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

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

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

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

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

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

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

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

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

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

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

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


5.3 LIST EXTENSIONS

5.3.1 Usage

   This command is optional.

   Syntax
      LIST EXTENSIONS

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

5.3.2 Description

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

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

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

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

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

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

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

5.3.3 Examples

   Example of a successful response:

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

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

   Example where no extensions are available:

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

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

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


5.4 QUIT

5.4.1 Usage

   Syntax
      QUIT

   Responses
      205   Connection closing

5.4.2 Description

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

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

5.4.3 Examples

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


Full Copyright Statement

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

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

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

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

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

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Technical Details
Message-ID: <874qy3hnhl.fsf_-_@windlord.stanford.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20140818.mbox.gz!text1.nnrp.aus1!firehose2!nntp4!intern1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!in.100proofnews.com!in.100proofnews.com!news.maxwell.syr.edu!newsfeed.stanford.edu!shelby.stanford.edu!not-for-mail
References: <87fzhryxdc.fsf@windlord.stanford.edu> <871xta1bbb.fsf@windlord.stanford.edu>

Show Full Headers
Complete Article Headers
Message-ID: <874qy3hnhl.fsf_-_@windlord.stanford.edu>
Subject: New NNTP draft -- Section 5
Date: Mon, 20 Oct 2003 09:39:50 -0700
From: Russ Allbery <rra@stanford.edu>
References: <87fzhryxdc.fsf@windlord.stanford.edu> <871xta1bbb.fsf@windlord.stanford.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20140818.mbox.gz!text1.nnrp.aus1!firehose2!nntp4!intern1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!in.100proofnews.com!in.100proofnews.com!news.maxwell.syr.edu!newsfeed.stanford.edu!shelby.stanford.edu!not-for-mail
Newsgroups: news.software.nntp
Organization: The Eyrie
Lines: 358
NNTP-Posting-Host: windlord.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Trace: news.Stanford.EDU 1066667992 18842 171.64.19.147 (20 Oct 2003
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.1002 (Gnus v5.10.2) XEmacs/21.4 (Common Lisp, linux)
Cancel-Lock: sha1:0Wz70yYmvKV+0Fw324SrOlNhXO4=