rfc977.txt

来自「RFC 的详细文档!」· 文本 代码 · 共 1,540 行 · 第 1/4 页

TXT
1,540
字号

   We have provided a response pattern x9x for debugging.  Since much
   debugging output may be classed as "informative messages", we would
   expect, therefore, that responses 190 through 199 would be used for
   various debugging outputs.  There is no requirement in this
   specification for debugging output, but if such is provided over the
   connected stream, it must use these response codes.  If appropriate
   to a specific implementation, other x9x codes may be used for
   debugging.  (An example might be to use e.g., 290 to acknowledge a
   remote debugging request.)


Kantor & Lapsley                                                [Page 7]



RFC 977                                                    February 1986
Network News Transfer Protocol


2.4.3.  General Responses

   The following is a list of general response codes that may be sent by
   the NNTP server.  These are not specific to any one command, but may
   be returned as the result of a connection, a failure, or some unusual
   condition.

   In general, 1xx codes may be ignored or displayed as desired;  code
   200 or 201 is sent upon initial connection to the NNTP server
   depending upon posting permission; code 400 will be sent when the
   NNTP server discontinues service (by operator request, for example);
   and 5xx codes indicate that the command could not be performed for
   some unusual reason.

      100 help text
      190
        through
      199 debug output

      200 server ready - posting allowed
      201 server ready - no posting allowed

      400 service discontinued

      500 command not recognized
      501 command syntax error
      502 access restriction or permission denied
      503 program fault - command not performed

3.  Command and Response Details

   On the following pages are descriptions of each command recognized by
   the NNTP server and the responses which will be returned by those
   commands.

   Each command is shown in upper case for clarity, although case is
   ignored in the interpretation of commands by the NNTP server.  Any
   parameters are shown in lower case.  A parameter shown in [square
   brackets] is optional.  For example, [GMT] indicates that the
   triglyph GMT may present or omitted.

   Every command described in this section must be implemented by all
   NNTP servers.






Kantor & Lapsley                                                [Page 8]



RFC 977                                                    February 1986
Network News Transfer Protocol


   There is no prohibition against additional commands being added;
   however, it is recommended that any such unspecified command begin
   with the letter "X" to avoid conflict with later revisions of this
   specification.

   Implementors are reminded that such additional commands may not
   redefine specified status response codes.  Using additional
   unspecified responses for standard commands is also prohibited.

3.1.  The ARTICLE, BODY, HEAD, and STAT commands

   There are two forms to the ARTICLE command (and the related BODY,
   HEAD, and STAT commands), each using a different method of specifying
   which article is to be retrieved.  When the ARTICLE command is
   followed by a message-id in angle brackets ("<" and ">"), the first
   form of the command is used; when a numeric parameter or no parameter
   is supplied, the second form is invoked.

   The text of the article is returned as a textual response, as
   described earlier in this document.

   The HEAD and BODY commands are identical to the ARTICLE command
   except that they respectively return only the header lines or text
   body of the article.

   The STAT command is similar to the ARTICLE command except that no
   text is returned.  When selecting by message number within a group,
   the STAT command serves to set the current article pointer without
   sending text. The returned acknowledgement response will contain the
   message-id, which may be of some value.  Using the STAT command to
   select by message-id is valid but of questionable value, since a
   selection by message-id does NOT alter the "current article pointer".

3.1.1.  ARTICLE (selection by message-id)

   ARTICLE <message-id>

   Display the header, a blank line, then the body (text) of the
   specified article.  Message-id is the message id of an article as
   shown in that article's header.  It is anticipated that the client
   will obtain the message-id from a list provided by the NEWNEWS
   command, from references contained within another article, or from
   the message-id provided in the response to some other commands.

   Please note that the internally-maintained "current article pointer"
   is NOT ALTERED by this command. This is both to facilitate the
   presentation of articles that may be referenced within an article


Kantor & Lapsley                                                [Page 9]



RFC 977                                                    February 1986
Network News Transfer Protocol


   being read, and because of the semantic difficulties of determining
   the proper sequence and membership of an article which may have been
   posted to more than one newsgroup.

3.1.2.  ARTICLE (selection by number)

   ARTICLE [nnn]

   Displays the header, a blank line, then the body (text) of the
   current or specified article.  The optional parameter nnn is the

   numeric id of an article in the current newsgroup and must be chosen
   from the range of articles provided when the newsgroup was selected.
   If it is omitted, the current article is assumed.

   The internally-maintained "current article pointer" is set by this
   command if a valid article number is specified.

   [the following applies to both forms of the article command.] A
   response indicating the current article number, a message-id string,
   and that text is to follow will be returned.

   The message-id string returned is an identification string contained
   within angle brackets ("<" and ">"), which is derived from the header
   of the article itself.  The Message-ID header line (required by
   RFC850) from the article must be used to supply this information. If
   the message-id header line is missing from the article, a single
   digit "0" (zero) should be supplied within the angle brackets.

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

3.1.3.  Responses

   220 n <a> article retrieved - head and body follow
           (n = article number, <a> = message-id)
   221 n <a> article retrieved - head follows
   222 n <a> article retrieved - body follows
   223 n <a> article retrieved - request text separately
   412 no newsgroup has been selected
   420 no current article has been selected
   423 no such article number in this group
   430 no such article found





Kantor & Lapsley                                               [Page 10]



RFC 977                                                    February 1986
Network News Transfer Protocol


3.2.  The GROUP command

3.2.1.  GROUP

   GROUP ggg

   The required parameter ggg is the name of the newsgroup to be
   selected (e.g. "net.news").  A list of valid newsgroups may be
   obtained from the LIST command.

   The successful selection response will return the article numbers of
   the first and last articles in the group, and an estimate of the
   number of articles on file in the group.  It is not necessary that
   the estimate be correct, although that is helpful; it must only be
   equal to or larger than the actual number of articles on file.  (Some
   implementations will actually count the number of articles on file.
   Others will just subtract first article number from last to get an
   estimate.)

   When a valid group is selected by means of this command, the
   internally maintained "current article pointer" is set to the first
   article in the group.  If an invalid group is specified, the
   previously selected group and article remain selected.  If an empty
   newsgroup is selected, the "current article pointer" is in an
   indeterminate state and should not be used.

   Note that the name of the newsgroup is not case-dependent.  It must
   otherwise match a newsgroup obtained from the LIST command or an
   error will result.

3.2.2.  Responses

   211 n f l s group selected
           (n = estimated number of articles in group,
           f = first article number in the group,
           l = last article number in the group,
           s = name of the group.)
   411 no such news group











Kantor & Lapsley                                               [Page 11]



RFC 977                                                    February 1986
Network News Transfer Protocol


3.3.  The HELP command

3.3.1.  HELP

   HELP

   Provides a short summary of commands that are understood by this
   implementation of the server. The help text will be presented as a
   textual response, terminated by a single period on a line by itself.

   3.3.2.  Responses

   100 help text follows

3.4.  The IHAVE command

3.4.1.  IHAVE

   IHAVE <messageid>

   The IHAVE command informs the server that the client has an article
   whose id is <messageid>.  If the server desires a copy of that
   article, it will return a response 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 response indicating
   that the article is not wanted will be returned.

   If transmission of the article is requested, the client should send
   the entire article, including header and body, in the manner
   specified for text transmission from the server. A response code
   indicating success or failure of the transferral of the article will
   be returned.

   This function differs from the POST command in that it is intended
   for use in transferring already-posted articles between hosts.
   Normally it will not be used when the client is a personal
   newsreading program.  In particular, this function will invoke the
   server's news posting program with the appropriate settings (flags,
   options, etc) to indicate that the forthcoming article is being
   forwarded from another host.

   The server may, however, elect not to post or forward the article if
   after further examination of the article it deems it inappropriate to
   do so.  The 436 or 437 error codes may be returned as appropriate to
   the situation.

   Reasons for such subsequent rejection of an article may include such


Kantor & Lapsley                                               [Page 12]



RFC 977                                                    February 1986
Network News Transfer Protocol


   problems as inappropriate newsgroups or distributions, disk 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.

3.4.2.  Responses

   235 article transferred ok
   335 send article to be transferred.  End with <CR-LF>.<CR-LF>
   435 article not wanted - do not send it
   436 transfer failed - try again later
   437 article rejected - do not try again

   An implementation note:

   Because some host news posting software may not be able to decide
   immediately that an article is inappropriate for posting or
   forwarding, it is acceptable to acknowledge the successful transfer
   of the article and to later silently discard it.  Thus it is
   permitted to return the 235 acknowledgement code and later discard
   the received article.  This is not a fully satisfactory solution to
   the problem.  Perhaps some implementations will wish to send mail to
   the author of the article in certain of these cases.

3.5.  The LAST command

3.5.1.  LAST

   LAST

   The internally maintained "current article pointer" is set to the
   previous article in the current newsgroup.  If already positioned at
   the first article of the newsgroup, an error message is returned and
   the current article remains selected.

   The internally-maintained "current article pointer" is set by this
   command.

   A response indicating the current article number, and a message-id
   string will be returned.  No text is sent in response to this
   command.

3.5.2.  Responses

   223 n a article retrieved - request text separately
           (n = article number, a = unique article id)



Kantor & Lapsley                                               [Page 13]



RFC 977                                                    February 1986
Network News Transfer Protocol


   412 no newsgroup selected
   420 no current article has been selected
   422 no previous article in this group

3.6.  The LIST command

3.6.1.  LIST

   LIST

   Returns a list of valid newsgroups and associated information.  Each
   newsgroup is sent as a line of text in the following format:

      group last first p

   where <group> is the name of the newsgroup, <last> is the number of
   the last known article currently in that newsgroup, <first> is the
   number of the first article currently in the newsgroup, and <p> is
   either 'y' or 'n' indicating whether posting to this newsgroup is
   allowed ('y') or prohibited ('n').

   The <first> and <last> fields will always be numeric.  They may have
   leading zeros.  If the <last> field evaluates to less than the

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?