3 Network Working Group Brian Kantor (U.C. San Diego)
\r
4 Request for Comments: 977 Phil Lapsley (U.C. Berkeley)
\r
7 Network News Transfer Protocol
\r
9 A Proposed Standard for the Stream-Based
\r
10 Transmission of News
\r
14 NNTP specifies a protocol for the distribution, inquiry, retrieval,
\r
15 and posting of news articles using a reliable stream-based
\r
16 transmission of news among the ARPA-Internet community. NNTP is
\r
17 designed so that news articles are stored in a central database
\r
18 allowing a subscriber to select only those items he wishes to read.
\r
19 Indexing, cross-referencing, and expiration of aged messages are also
\r
20 provided. This RFC suggests a proposed protocol for the ARPA-Internet
\r
21 community, and requests discussion and suggestions for improvements.
\r
22 Distribution of this memo is unlimited.
\r
26 For many years, the ARPA-Internet community has supported the
\r
27 distribution of bulletins, information, and data in a timely fashion
\r
28 to thousands of participants. We collectively refer to such items of
\r
29 information as "news". Such news provides for the rapid
\r
30 dissemination of items of interest such as software bug fixes, new
\r
31 product reviews, technical tips, and programming pointers, as well as
\r
32 rapid-fire discussions of matters of concern to the working computer
\r
33 professional. News is very popular among its readers.
\r
35 There are popularly two methods of distributing such news: the
\r
36 Internet method of direct mailing, and the USENET news system.
\r
38 1.1. Internet Mailing Lists
\r
40 The Internet community distributes news by the use of mailing lists.
\r
41 These are lists of subscriber's mailbox addresses and remailing
\r
42 sublists of all intended recipients. These mailing lists operate by
\r
43 remailing a copy of the information to be distributed to each
\r
44 subscriber on the mailing list. Such remailing is inefficient when a
\r
45 mailing list grows beyond a dozen or so people, since sending a
\r
46 separate copy to each of the subscribers occupies large quantities of
\r
47 network bandwidth, CPU resources, and significant amounts of disk
\r
48 storage at the destination host. There is also a significant problem
\r
49 in maintenance of the list itself: as subscribers move from one job
\r
50 to another; as new subscribers join and old ones leave; and as hosts
\r
51 come in and out of service.
\r
56 Kantor & Lapsley [Page 1]
\r
60 RFC 977 February 1986
\r
61 Network News Transfer Protocol
\r
64 1.2. The USENET News System
\r
66 Clearly, a worthwhile reduction of the amount of these resources used
\r
67 can be achieved if articles are stored in a central database on the
\r
68 receiving host instead of in each subscriber's mailbox. The USENET
\r
69 news system provides a method of doing just this. There is a central
\r
70 repository of the news articles in one place (customarily a spool
\r
71 directory of some sort), and a set of programs that allow a
\r
72 subscriber to select those items he wishes to read. Indexing,
\r
73 cross-referencing, and expiration of aged messages are also provided.
\r
75 1.3. Central Storage of News
\r
77 For clusters of hosts connected together by fast local area networks
\r
78 (such as Ethernet), it makes even more sense to consolidate news
\r
79 distribution onto one (or a very few) hosts, and to allow access to
\r
80 these news articles using a server and client model. Subscribers may
\r
81 then request only the articles they wish to see, without having to
\r
82 wastefully duplicate the storage of a copy of each item on each host.
\r
84 1.4. A Central News Server
\r
86 A way to achieve these economies is to have a central computer system
\r
87 that can provide news service to the other systems on the local area
\r
88 network. Such a server would manage the collection of news articles
\r
89 and index files, with each person who desires to read news bulletins
\r
90 doing so over the LAN. For a large cluster of computer systems, the
\r
91 savings in total disk space is clearly worthwhile. Also, this allows
\r
92 workstations with limited disk storage space to participate in the
\r
93 news without incoming items consuming oppressive amounts of the
\r
94 workstation's disk storage.
\r
96 We have heard rumors of somewhat successful attempts to provide
\r
97 centralized news service using IBIS and other shared or distributed
\r
98 file systems. While it is possible that such a distributed file
\r
99 system implementation might work well with a group of similar
\r
100 computers running nearly identical operating systems, such a scheme
\r
101 is not general enough to offer service to a wide range of client
\r
102 systems, especially when many diverse operating systems may be in use
\r
103 among a group of clients. There are few (if any) shared or networked
\r
104 file systems that can offer the generality of service that stream
\r
105 connections using Internet TCP provide, particularly when a wide
\r
106 range of host hardware and operating systems are considered.
\r
108 NNTP specifies a protocol for the distribution, inquiry, retrieval,
\r
109 and posting of news articles using a reliable stream (such as TCP)
\r
110 server-client model. NNTP is designed so that news articles need only
\r
113 Kantor & Lapsley [Page 2]
\r
117 RFC 977 February 1986
\r
118 Network News Transfer Protocol
\r
121 be stored on one (presumably central) host, and subscribers on other
\r
122 hosts attached to the LAN may read news articles using stream
\r
123 connections to the news host.
\r
125 NNTP is modelled upon the news article specifications in RFC 850,
\r
126 which describes the USENET news system. However, NNTP makes few
\r
127 demands upon the structure, content, or storage of news articles, and
\r
128 thus we believe it easily can be adapted to other non-USENET news
\r
131 Typically, the NNTP server runs as a background process on one host,
\r
132 and would accept connections from other hosts on the LAN. This works
\r
133 well when there are a number of small computer systems (such as
\r
134 workstations, with only one or at most a few users each), and a large
\r
137 1.5. Intermediate News Servers
\r
139 For clusters of machines with many users (as might be the case in a
\r
140 university or large industrial environment), an intermediate server
\r
141 might be used. This intermediate or "slave" server runs on each
\r
142 computer system, and is responsible for mediating news reading
\r
143 requests and performing local caching of recently-retrieved news
\r
146 Typically, a client attempting to obtain news service would first
\r
147 attempt to connect to the news service port on the local machine. If
\r
148 this attempt were unsuccessful, indicating a failed server, an
\r
149 installation might choose to either deny news access, or to permit
\r
150 connection to the central "master" news server.
\r
152 For workstations or other small systems, direct connection to the
\r
153 master server would probably be the normal manner of operation.
\r
155 This specification does not cover the operation of slave NNTP
\r
156 servers. We merely suggest that slave servers are a logical addition
\r
157 to NNTP server usage which would enhance operation on large local
\r
160 1.6. News Distribution
\r
162 NNTP has commands which provide a straightforward method of
\r
163 exchanging articles between cooperating hosts. Hosts which are well
\r
164 connected on a local area or other fast network and who wish to
\r
165 actually obtain copies of news articles for local storage might well
\r
166 find NNTP to be a more efficient way to distribute news than more
\r
167 traditional transfer methods (such as UUCP).
\r
170 Kantor & Lapsley [Page 3]
\r
174 RFC 977 February 1986
\r
175 Network News Transfer Protocol
\r
178 In the traditional method of distributing news articles, news is
\r
179 propagated from host to host by flooding - that is, each host will
\r
180 send all its new news articles on to each host that it feeds. These
\r
181 hosts will then in turn send these new articles on to other hosts
\r
182 that they feed. Clearly, sending articles that a host already has
\r
183 obtained a copy of from another feed (many hosts that receive news
\r
184 are redundantly fed) again is a waste of time and communications
\r
185 resources, but for transport mechanisms that are single-transaction
\r
186 based rather than interactive (such as UUCP in the UNIX-world <1>),
\r
187 distribution time is diminished by sending all articles and having
\r
188 the receiving host simply discard the duplicates. This is an
\r
189 especially true when communications sessions are limited to once a
\r
192 Using NNTP, hosts exchanging news articles have an interactive
\r
193 mechanism for deciding which articles are to be transmitted. A host
\r
194 desiring new news, or which has new news to send, will typically
\r
195 contact one or more of its neighbors using NNTP. First it will
\r
196 inquire if any new news groups have been created on the serving host
\r
197 by means of the NEWGROUPS command. If so, and those are appropriate
\r
198 or desired (as established by local site-dependent rules), those new
\r
199 newsgroups can be created.
\r
201 The client host will then inquire as to which new articles have
\r
202 arrived in all or some of the newsgroups that it desires to receive,
\r
203 using the NEWNEWS command. It will receive a list of new articles
\r
204 from the server, and can request transmission of those articles that
\r
205 it desires and does not already have.
\r
207 Finally, the client can advise the server of those new articles which
\r
208 the client has recently received. The server will indicate those
\r
209 articles that it has already obtained copies of, and which articles
\r
210 should be sent to add to its collection.
\r
212 In this manner, only those articles which are not duplicates and
\r
213 which are desired are transferred.
\r
227 Kantor & Lapsley [Page 4]
\r
231 RFC 977 February 1986
\r
232 Network News Transfer Protocol
\r
235 2. The NNTP Specification
\r
239 The news server specified by this document uses a stream connection
\r
240 (such as TCP) and SMTP-like commands and responses. It is designed
\r
241 to accept connections from hosts, and to provide a simple interface
\r
242 to the news database.
\r
244 This server is only an interface between programs and the news
\r
245 databases. It does not perform any user interaction or presentation-
\r
246 level functions. These "user-friendly" functions are better left to
\r
247 the client programs, which have a better understanding of the
\r
248 environment in which they are operating.
\r
250 When used via Internet TCP, the contact port assigned for this
\r
253 2.2. Character Codes
\r
255 Commands and replies are composed of characters from the ASCII
\r
256 character set. When the transport service provides an 8-bit byte
\r
257 (octet) transmission channel, each 7-bit character is transmitted
\r
258 right justified in an octet with the high order bit cleared to zero.
\r
262 Commands consist of a command word, which in some cases may be
\r
263 followed by a parameter. Commands with parameters must separate the
\r
264 parameters from each other and from the command by one or more space
\r
265 or tab characters. Command lines must be complete with all required
\r
266 parameters, and may not contain more than one command.
\r
268 Commands and command parameters are not case sensitive. That is, a
\r
269 command or parameter word may be upper case, lower case, or any
\r
270 mixture of upper and lower case.
\r
272 Each command line must be terminated by a CR-LF (Carriage Return -
\r
275 Command lines shall not exceed 512 characters in length, counting all
\r
276 characters including spaces, separators, punctuation, and the
\r
277 trailing CR-LF (thus there are 510 characters maximum allowed for the
\r
278 command and its parameters). There is no provision for continuation
\r
284 Kantor & Lapsley [Page 5]
\r
288 RFC 977 February 1986
\r
289 Network News Transfer Protocol
\r
294 Responses are of two kinds, textual and status.
\r
296 2.4.1. Text Responses
\r
298 Text is sent only after a numeric status response line has been sent
\r
299 that indicates that text will follow. Text is sent as a series of
\r
300 successive lines of textual matter, each terminated with CR-LF pair.
\r
301 A single line containing only a period (.) is sent to indicate the
\r
302 end of the text (i.e., the server will send a CR-LF pair at the end
\r
303 of the last line of text, a period, and another CR-LF pair).
\r
305 If the text contained a period as the first character of the text
\r
306 line in the original, that first period is doubled. Therefore, the
\r
307 client must examine the first character of each line received, and
\r
308 for those beginning with a period, determine either that this is the
\r
309 end of the text or whether to collapse the doubled period to a single
\r
312 The intention is that text messages will usually be displayed on the
\r
313 user's terminal whereas command/status responses will be interpreted
\r
314 by the client program before any possible display is done.
\r
316 2.4.2. Status Responses
\r
318 These are status reports from the server and indicate the response to
\r
319 the last command received from the client.
\r
321 Status response lines begin with a 3 digit numeric code which is
\r
322 sufficient to distinguish all responses. Some of these may herald
\r
323 the subsequent transmission of text.
\r
325 The first digit of the response broadly indicates the success,
\r
326 failure, or progress of the previous command.
\r
328 1xx - Informative message
\r
330 3xx - Command ok so far, send the rest of it.
\r
331 4xx - Command was correct, but couldn't be performed for
\r
333 5xx - Command unimplemented, or incorrect, or a serious
\r
334 program error occurred.
\r
341 Kantor & Lapsley [Page 6]
\r
345 RFC 977 February 1986
\r
346 Network News Transfer Protocol
\r
349 The next digit in the code indicates the function response category.
\r
351 x0x - Connection, setup, and miscellaneous messages
\r
352 x1x - Newsgroup selection
\r
353 x2x - Article selection
\r
354 x3x - Distribution functions
\r
356 x8x - Nonstandard (private implementation) extensions
\r
357 x9x - Debugging output
\r
359 The exact response codes that should be expected from each command
\r
360 are detailed in the description of that command. In addition, below
\r
361 is listed a general set of response codes that may be received at any
\r
364 Certain status responses contain parameters such as numbers and
\r
365 names. The number and type of such parameters is fixed for each
\r
366 response code to simplify interpretation of the response.
\r
368 Parameters are separated from the numeric response code and from each
\r
369 other by a single space. All numeric parameters are decimal, and may
\r
370 have leading zeros. All string parameters begin after the separating
\r
371 space, and end before the following separating space or the CR-LF
\r
372 pair at the end of the line. (String parameters may not, therefore,
\r
373 contain spaces.) All text, if any, in the response which is not a
\r
374 parameter of the response must follow and be separated from the last
\r
375 parameter by a space. Also, note that the text following a response
\r
376 number may vary in different implementations of the server. The
\r
377 3-digit numeric code should be used to determine what response was
\r
380 Response codes not specified in this standard may be used for any
\r
381 installation-specific additional commands also not specified. These
\r
382 should be chosen to fit the pattern of x8x specified above. (Note
\r
383 that debugging is provided for explicitly in the x9x response codes.)
\r
384 The use of unspecified response codes for standard commands is
\r
387 We have provided a response pattern x9x for debugging. Since much
\r
388 debugging output may be classed as "informative messages", we would
\r
389 expect, therefore, that responses 190 through 199 would be used for
\r
390 various debugging outputs. There is no requirement in this
\r
391 specification for debugging output, but if such is provided over the
\r
392 connected stream, it must use these response codes. If appropriate
\r
393 to a specific implementation, other x9x codes may be used for
\r
394 debugging. (An example might be to use e.g., 290 to acknowledge a
\r
395 remote debugging request.)
\r
398 Kantor & Lapsley [Page 7]
\r
402 RFC 977 February 1986
\r
403 Network News Transfer Protocol
\r
406 2.4.3. General Responses
\r
408 The following is a list of general response codes that may be sent by
\r
409 the NNTP server. These are not specific to any one command, but may
\r
410 be returned as the result of a connection, a failure, or some unusual
\r
413 In general, 1xx codes may be ignored or displayed as desired; code
\r
414 200 or 201 is sent upon initial connection to the NNTP server
\r
415 depending upon posting permission; code 400 will be sent when the
\r
416 NNTP server discontinues service (by operator request, for example);
\r
417 and 5xx codes indicate that the command could not be performed for
\r
418 some unusual reason.
\r
425 200 server ready - posting allowed
\r
426 201 server ready - no posting allowed
\r
428 400 service discontinued
\r
430 500 command not recognized
\r
431 501 command syntax error
\r
432 502 access restriction or permission denied
\r
433 503 program fault - command not performed
\r
435 3. Command and Response Details
\r
437 On the following pages are descriptions of each command recognized by
\r
438 the NNTP server and the responses which will be returned by those
\r
441 Each command is shown in upper case for clarity, although case is
\r
442 ignored in the interpretation of commands by the NNTP server. Any
\r
443 parameters are shown in lower case. A parameter shown in [square
\r
444 brackets] is optional. For example, [GMT] indicates that the
\r
445 triglyph GMT may present or omitted.
\r
447 Every command described in this section must be implemented by all
\r
455 Kantor & Lapsley [Page 8]
\r
459 RFC 977 February 1986
\r
460 Network News Transfer Protocol
\r
463 There is no prohibition against additional commands being added;
\r
464 however, it is recommended that any such unspecified command begin
\r
465 with the letter "X" to avoid conflict with later revisions of this
\r
468 Implementors are reminded that such additional commands may not
\r
469 redefine specified status response codes. Using additional
\r
470 unspecified responses for standard commands is also prohibited.
\r
472 3.1. The ARTICLE, BODY, HEAD, and STAT commands
\r
474 There are two forms to the ARTICLE command (and the related BODY,
\r
475 HEAD, and STAT commands), each using a different method of specifying
\r
476 which article is to be retrieved. When the ARTICLE command is
\r
477 followed by a message-id in angle brackets ("<" and ">"), the first
\r
478 form of the command is used; when a numeric parameter or no parameter
\r
479 is supplied, the second form is invoked.
\r
481 The text of the article is returned as a textual response, as
\r
482 described earlier in this document.
\r
484 The HEAD and BODY commands are identical to the ARTICLE command
\r
485 except that they respectively return only the header lines or text
\r
486 body of the article.
\r
488 The STAT command is similar to the ARTICLE command except that no
\r
489 text is returned. When selecting by message number within a group,
\r
490 the STAT command serves to set the current article pointer without
\r
491 sending text. The returned acknowledgement response will contain the
\r
492 message-id, which may be of some value. Using the STAT command to
\r
493 select by message-id is valid but of questionable value, since a
\r
494 selection by message-id does NOT alter the "current article pointer".
\r
496 3.1.1. ARTICLE (selection by message-id)
\r
498 ARTICLE <message-id>
\r
500 Display the header, a blank line, then the body (text) of the
\r
501 specified article. Message-id is the message id of an article as
\r
502 shown in that article's header. It is anticipated that the client
\r
503 will obtain the message-id from a list provided by the NEWNEWS
\r
504 command, from references contained within another article, or from
\r
505 the message-id provided in the response to some other commands.
\r
507 Please note that the internally-maintained "current article pointer"
\r
508 is NOT ALTERED by this command. This is both to facilitate the
\r
509 presentation of articles that may be referenced within an article
\r
512 Kantor & Lapsley [Page 9]
\r
516 RFC 977 February 1986
\r
517 Network News Transfer Protocol
\r
520 being read, and because of the semantic difficulties of determining
\r
521 the proper sequence and membership of an article which may have been
\r
522 posted to more than one newsgroup.
\r
524 3.1.2. ARTICLE (selection by number)
\r
528 Displays the header, a blank line, then the body (text) of the
\r
529 current or specified article. The optional parameter nnn is the
\r
531 numeric id of an article in the current newsgroup and must be chosen
\r
532 from the range of articles provided when the newsgroup was selected.
\r
533 If it is omitted, the current article is assumed.
\r
535 The internally-maintained "current article pointer" is set by this
\r
536 command if a valid article number is specified.
\r
538 [the following applies to both forms of the article command.] A
\r
539 response indicating the current article number, a message-id string,
\r
540 and that text is to follow will be returned.
\r
542 The message-id string returned is an identification string contained
\r
543 within angle brackets ("<" and ">"), which is derived from the header
\r
544 of the article itself. The Message-ID header line (required by
\r
545 RFC850) from the article must be used to supply this information. If
\r
546 the message-id header line is missing from the article, a single
\r
547 digit "0" (zero) should be supplied within the angle brackets.
\r
549 Since the message-id field is unique with each article, it may be
\r
550 used by a news reading program to skip duplicate displays of articles
\r
551 that have been posted more than once, or to more than one newsgroup.
\r
555 220 n <a> article retrieved - head and body follow
\r
556 (n = article number, <a> = message-id)
\r
557 221 n <a> article retrieved - head follows
\r
558 222 n <a> article retrieved - body follows
\r
559 223 n <a> article retrieved - request text separately
\r
560 412 no newsgroup has been selected
\r
561 420 no current article has been selected
\r
562 423 no such article number in this group
\r
563 430 no such article found
\r
569 Kantor & Lapsley [Page 10]
\r
573 RFC 977 February 1986
\r
574 Network News Transfer Protocol
\r
577 3.2. The GROUP command
\r
583 The required parameter ggg is the name of the newsgroup to be
\r
584 selected (e.g. "net.news"). A list of valid newsgroups may be
\r
585 obtained from the LIST command.
\r
587 The successful selection response will return the article numbers of
\r
588 the first and last articles in the group, and an estimate of the
\r
589 number of articles on file in the group. It is not necessary that
\r
590 the estimate be correct, although that is helpful; it must only be
\r
591 equal to or larger than the actual number of articles on file. (Some
\r
592 implementations will actually count the number of articles on file.
\r
593 Others will just subtract first article number from last to get an
\r
596 When a valid group is selected by means of this command, the
\r
597 internally maintained "current article pointer" is set to the first
\r
598 article in the group. If an invalid group is specified, the
\r
599 previously selected group and article remain selected. If an empty
\r
600 newsgroup is selected, the "current article pointer" is in an
\r
601 indeterminate state and should not be used.
\r
603 Note that the name of the newsgroup is not case-dependent. It must
\r
604 otherwise match a newsgroup obtained from the LIST command or an
\r
609 211 n f l s group selected
\r
610 (n = estimated number of articles in group,
\r
611 f = first article number in the group,
\r
612 l = last article number in the group,
\r
613 s = name of the group.)
\r
614 411 no such news group
\r
626 Kantor & Lapsley [Page 11]
\r
630 RFC 977 February 1986
\r
631 Network News Transfer Protocol
\r
634 3.3. The HELP command
\r
640 Provides a short summary of commands that are understood by this
\r
641 implementation of the server. The help text will be presented as a
\r
642 textual response, terminated by a single period on a line by itself.
\r
646 100 help text follows
\r
648 3.4. The IHAVE command
\r
654 The IHAVE command informs the server that the client has an article
\r
655 whose id is <messageid>. If the server desires a copy of that
\r
656 article, it will return a response instructing the client to send the
\r
657 entire article. If the server does not want the article (if, for
\r
658 example, the server already has a copy of it), a response indicating
\r
659 that the article is not wanted will be returned.
\r
661 If transmission of the article is requested, the client should send
\r
662 the entire article, including header and body, in the manner
\r
663 specified for text transmission from the server. A response code
\r
664 indicating success or failure of the transferral of the article will
\r
667 This function differs from the POST command in that it is intended
\r
668 for use in transferring already-posted articles between hosts.
\r
669 Normally it will not be used when the client is a personal
\r
670 newsreading program. In particular, this function will invoke the
\r
671 server's news posting program with the appropriate settings (flags,
\r
672 options, etc) to indicate that the forthcoming article is being
\r
673 forwarded from another host.
\r
675 The server may, however, elect not to post or forward the article if
\r
676 after further examination of the article it deems it inappropriate to
\r
677 do so. The 436 or 437 error codes may be returned as appropriate to
\r
680 Reasons for such subsequent rejection of an article may include such
\r
683 Kantor & Lapsley [Page 12]
\r
687 RFC 977 February 1986
\r
688 Network News Transfer Protocol
\r
691 problems as inappropriate newsgroups or distributions, disk space
\r
692 limitations, article lengths, garbled headers, and the like. These
\r
693 are typically restrictions enforced by the server host's news
\r
694 software and not necessarily the NNTP server itself.
\r
698 235 article transferred ok
\r
699 335 send article to be transferred. End with <CR-LF>.<CR-LF>
\r
700 435 article not wanted - do not send it
\r
701 436 transfer failed - try again later
\r
702 437 article rejected - do not try again
\r
704 An implementation note:
\r
706 Because some host news posting software may not be able to decide
\r
707 immediately that an article is inappropriate for posting or
\r
708 forwarding, it is acceptable to acknowledge the successful transfer
\r
709 of the article and to later silently discard it. Thus it is
\r
710 permitted to return the 235 acknowledgement code and later discard
\r
711 the received article. This is not a fully satisfactory solution to
\r
712 the problem. Perhaps some implementations will wish to send mail to
\r
713 the author of the article in certain of these cases.
\r
715 3.5. The LAST command
\r
721 The internally maintained "current article pointer" is set to the
\r
722 previous article in the current newsgroup. If already positioned at
\r
723 the first article of the newsgroup, an error message is returned and
\r
724 the current article remains selected.
\r
726 The internally-maintained "current article pointer" is set by this
\r
729 A response indicating the current article number, and a message-id
\r
730 string will be returned. No text is sent in response to this
\r
735 223 n a article retrieved - request text separately
\r
736 (n = article number, a = unique article id)
\r
740 Kantor & Lapsley [Page 13]
\r
744 RFC 977 February 1986
\r
745 Network News Transfer Protocol
\r
748 412 no newsgroup selected
\r
749 420 no current article has been selected
\r
750 422 no previous article in this group
\r
752 3.6. The LIST command
\r
758 Returns a list of valid newsgroups and associated information. Each
\r
759 newsgroup is sent as a line of text in the following format:
\r
763 where <group> is the name of the newsgroup, <last> is the number of
\r
764 the last known article currently in that newsgroup, <first> is the
\r
765 number of the first article currently in the newsgroup, and <p> is
\r
766 either 'y' or 'n' indicating whether posting to this newsgroup is
\r
767 allowed ('y') or prohibited ('n').
\r
769 The <first> and <last> fields will always be numeric. They may have
\r
770 leading zeros. If the <last> field evaluates to less than the
\r
771 <first> field, there are no articles currently on file in the
\r
774 Note that posting may still be prohibited to a client even though the
\r
775 LIST command indicates that posting is permitted to a particular
\r
776 newsgroup. See the POST command for an explanation of client
\r
777 prohibitions. The posting flag exists for each newsgroup because
\r
778 some newsgroups are moderated or are digests, and therefore cannot be
\r
779 posted to; that is, articles posted to them must be mailed to a
\r
780 moderator who will post them for the submitter. This is independent
\r
781 of the posting permission granted to a client by the NNTP server.
\r
783 Please note that an empty list (i.e., the text body returned by this
\r
784 command consists only of the terminating period) is a possible valid
\r
785 response, and indicates that there are currently no valid newsgroups.
\r
789 215 list of newsgroups follows
\r
797 Kantor & Lapsley [Page 14]
\r
801 RFC 977 February 1986
\r
802 Network News Transfer Protocol
\r
805 3.7. The NEWGROUPS command
\r
809 NEWGROUPS date time [GMT] [<distributions>]
\r
811 A list of newsgroups created since <date and time> will be listed in
\r
812 the same format as the LIST command.
\r
814 The date is sent as 6 digits in the format YYMMDD, where YY is the
\r
815 last two digits of the year, MM is the two digits of the month (with
\r
816 leading zero, if appropriate), and DD is the day of the month (with
\r
817 leading zero, if appropriate). The closest century is assumed as
\r
818 part of the year (i.e., 86 specifies 1986, 30 specifies 2030, 99 is
\r
821 Time must also be specified. It must be as 6 digits HHMMSS with HH
\r
822 being hours on the 24-hour clock, MM minutes 00-59, and SS seconds
\r
823 00-59. The time is assumed to be in the server's timezone unless the
\r
824 token "GMT" appears, in which case both time and date are evaluated
\r
827 The optional parameter "distributions" is a list of distribution
\r
828 groups, enclosed in angle brackets. If specified, the distribution
\r
829 portion of a new newsgroup (e.g, 'net' in 'net.wombat') will be
\r
830 examined for a match with the distribution categories listed, and
\r
831 only those new newsgroups which match will be listed. If more than
\r
832 one distribution group is to be listed, they must be separated by
\r
833 commas within the angle brackets.
\r
835 Please note that an empty list (i.e., the text body returned by this
\r
836 command consists only of the terminating period) is a possible valid
\r
837 response, and indicates that there are currently no new newsgroups.
\r
841 231 list of new newsgroups follows
\r
854 Kantor & Lapsley [Page 15]
\r
858 RFC 977 February 1986
\r
859 Network News Transfer Protocol
\r
862 3.8. The NEWNEWS command
\r
866 NEWNEWS newsgroups date time [GMT] [<distribution>]
\r
868 A list of message-ids of articles posted or received to the specified
\r
869 newsgroup since "date" will be listed. The format of the listing will
\r
870 be one message-id per line, as though text were being sent. A single
\r
871 line consisting solely of one period followed by CR-LF will terminate
\r
874 Date and time are in the same format as the NEWGROUPS command.
\r
876 A newsgroup name containing a "*" (an asterisk) may be specified to
\r
877 broaden the article search to some or all newsgroups. The asterisk
\r
878 will be extended to match any part of a newsgroup name (e.g.,
\r
879 net.micro* will match net.micro.wombat, net.micro.apple, etc). Thus
\r
880 if only an asterisk is given as the newsgroup name, all newsgroups
\r
881 will be searched for new news.
\r
883 (Please note that the asterisk "*" expansion is a general
\r
884 replacement; in particular, the specification of e.g., net.*.unix
\r
885 should be correctly expanded to embrace names such as net.wombat.unix
\r
886 and net.whocares.unix.)
\r
888 Conversely, if no asterisk appears in a given newsgroup name, only
\r
889 the specified newsgroup will be searched for new articles. Newsgroup
\r
890 names must be chosen from those returned in the listing of available
\r
891 groups. Multiple newsgroup names (including a "*") may be specified
\r
892 in this command, separated by a comma. No comma shall appear after
\r
893 the last newsgroup in the list. [Implementors are cautioned to keep
\r
894 the 512 character command length limit in mind.]
\r
896 The exclamation point ("!") may be used to negate a match. This can
\r
897 be used to selectively omit certain newsgroups from an otherwise
\r
898 larger list. For example, a newsgroups specification of
\r
899 "net.*,mod.*,!mod.map.*" would specify that all net.<anything> and
\r
900 all mod.<anything> EXCEPT mod.map.<anything> newsgroup names would be
\r
901 matched. If used, the exclamation point must appear as the first
\r
902 character of the given newsgroup name or pattern.
\r
904 The optional parameter "distributions" is a list of distribution
\r
905 groups, enclosed in angle brackets. If specified, the distribution
\r
906 portion of an article's newsgroup (e.g, 'net' in 'net.wombat') will
\r
907 be examined for a match with the distribution categories listed, and
\r
908 only those articles which have at least one newsgroup belonging to
\r
911 Kantor & Lapsley [Page 16]
\r
915 RFC 977 February 1986
\r
916 Network News Transfer Protocol
\r
919 the list of distributions will be listed. If more than one
\r
920 distribution group is to be supplied, they must be separated by
\r
921 commas within the angle brackets.
\r
923 The use of the IHAVE, NEWNEWS, and NEWGROUPS commands to distribute
\r
924 news is discussed in an earlier part of this document.
\r
926 Please note that an empty list (i.e., the text body returned by this
\r
927 command consists only of the terminating period) is a possible valid
\r
928 response, and indicates that there is currently no new news.
\r
932 230 list of new articles by message-id follows
\r
934 3.9. The NEXT command
\r
940 The internally maintained "current article pointer" is advanced to
\r
941 the next article in the current newsgroup. If no more articles
\r
942 remain in the current group, an error message is returned and the
\r
943 current article remains selected.
\r
945 The internally-maintained "current article pointer" is set by this
\r
948 A response indicating the current article number, and the message-id
\r
949 string will be returned. No text is sent in response to this
\r
954 223 n a article retrieved - request text separately
\r
955 (n = article number, a = unique article id)
\r
956 412 no newsgroup selected
\r
957 420 no current article has been selected
\r
958 421 no next article in this group
\r
968 Kantor & Lapsley [Page 17]
\r
972 RFC 977 February 1986
\r
973 Network News Transfer Protocol
\r
976 3.10. The POST command
\r
982 If posting is allowed, response code 340 is returned to indicate that
\r
983 the article to be posted should be sent. Response code 440 indicates
\r
984 that posting is prohibited for some installation-dependent reason.
\r
986 If posting is permitted, the article should be presented in the
\r
987 format specified by RFC850, and should include all required header
\r
988 lines. After the article's header and body have been completely sent
\r
989 by the client to the server, a further response code will be returned
\r
990 to indicate success or failure of the posting attempt.
\r
992 The text forming the header and body of the message to be posted
\r
993 should be sent by the client using the conventions for text received
\r
994 from the news server: A single period (".") on a line indicates the
\r
995 end of the text, with lines starting with a period in the original
\r
996 text having that period doubled during transmission.
\r
998 No attempt shall be made by the server to filter characters, fold or
\r
999 limit lines, or otherwise process incoming text. It is our intent
\r
1000 that the server just pass the incoming message to be posted to the
\r
1001 server installation's news posting software, which is separate from
\r
1002 this specification. See RFC850 for more details.
\r
1004 Since most installations will want the client news program to allow
\r
1005 the user to prepare his message using some sort of text editor, and
\r
1006 transmit it to the server for posting only after it is composed, the
\r
1007 client program should take note of the herald message that greeted it
\r
1008 when the connection was first established. This message indicates
\r
1009 whether postings from that client are permitted or not, and can be
\r
1010 used to caution the user that his access is read-only if that is the
\r
1011 case. This will prevent the user from wasting a good deal of time
\r
1012 composing a message only to find posting of the message was denied.
\r
1013 The method and determination of which clients and hosts may post is
\r
1014 installation dependent and is not covered by this specification.
\r
1018 240 article posted ok
\r
1019 340 send article to be posted. End with <CR-LF>.<CR-LF>
\r
1020 440 posting not allowed
\r
1021 441 posting failed
\r
1025 Kantor & Lapsley [Page 18]
\r
1029 RFC 977 February 1986
\r
1030 Network News Transfer Protocol
\r
1033 (for reference, one of the following codes will be sent upon initial
\r
1034 connection; the client program should determine whether posting is
\r
1035 generally permitted from these:) 200 server ready - posting allowed
\r
1036 201 server ready - no posting allowed
\r
1038 3.11. The QUIT command
\r
1044 The server process acknowledges the QUIT command and then closes the
\r
1045 connection to the client. This is the preferred method for a client
\r
1046 to indicate that it has finished all its transactions with the NNTP
\r
1049 If a client simply disconnects (or the connection times out, or some
\r
1050 other fault occurs), the server should gracefully cease its attempts
\r
1051 to service the client.
\r
1055 205 closing connection - goodbye!
\r
1057 3.12. The SLAVE command
\r
1063 Indicates to the server that this client connection is to a slave
\r
1064 server, rather than a user.
\r
1066 This command is intended for use in separating connections to single
\r
1067 users from those to subsidiary ("slave") servers. It may be used to
\r
1068 indicate that priority should therefore be given to requests from
\r
1069 this client, as it is presumably serving more than one person. It
\r
1070 might also be used to determine which connections to close when
\r
1071 system load levels are exceeded, perhaps giving preference to slave
\r
1072 servers. The actual use this command is put to is entirely
\r
1073 implementation dependent, and may vary from one host to another. In
\r
1074 NNTP servers which do not give priority to slave servers, this
\r
1075 command must nonetheless be recognized and acknowledged.
\r
1079 202 slave status noted
\r
1082 Kantor & Lapsley [Page 19]
\r
1086 RFC 977 February 1986
\r
1087 Network News Transfer Protocol
\r
1090 4. Sample Conversations
\r
1092 These are samples of the conversations that might be expected with
\r
1093 the news server in hypothetical sessions. The notation C: indicates
\r
1094 commands sent to the news server from the client program; S: indicate
\r
1095 responses received from the server by the client.
\r
1097 4.1. Example 1 - relative access with NEXT
\r
1099 S: (listens at TCP port 119)
\r
1101 C: (requests connection on TCP port 119)
\r
1102 S: 200 wombatvax news server ready - posting ok
\r
1104 (client asks for a current newsgroup list)
\r
1106 S: 215 list of newsgroups follows
\r
1107 S: net.wombats 00543 00501 y
\r
1108 S: net.unix-wizards 10125 10011 y
\r
1109 (more information here)
\r
1110 S: net.idiots 00100 00001 n
\r
1113 (client selects a newsgroup)
\r
1114 C: GROUP net.unix-wizards
\r
1115 S: 211 104 10011 10125 net.unix-wizards group selected
\r
1116 (there are 104 articles on file, from 10011 to 10125)
\r
1118 (client selects an article to read)
\r
1120 S: 223 10110 <23445@sdcsvax.ARPA> article retrieved - statistics
\r
1121 only (article 10110 selected, its message-id is
\r
1122 <23445@sdcsvax.ARPA>)
\r
1124 (client examines the header)
\r
1126 S: 221 10110 <23445@sdcsvax.ARPA> article retrieved - head
\r
1127 follows (text of the header appears here)
\r
1130 (client wants to see the text body of the article)
\r
1132 S: 222 10110 <23445@sdcsvax.ARPA> article retrieved - body
\r
1133 follows (body text here)
\r
1136 (client selects next article in group)
\r
1139 Kantor & Lapsley [Page 20]
\r
1143 RFC 977 February 1986
\r
1144 Network News Transfer Protocol
\r
1148 S: 223 10113 <21495@nudebch.uucp> article retrieved - statistics
\r
1149 only (article 10113 was next in group)
\r
1151 (client finishes session)
\r
1155 4.2. Example 2 - absolute article access with ARTICLE
\r
1157 S: (listens at TCP port 119)
\r
1159 C: (requests connection on TCP port 119)
\r
1160 S: 201 UCB-VAX netnews server ready -- no posting allowed
\r
1163 S: 211 103 402 504 msgs Your new group is msgs
\r
1164 (there are 103 articles, from 402 to 504)
\r
1167 S: 423 No such article in this newsgroup
\r
1170 S: 220 402 <4105@ucbvax.ARPA> Article retrieved, text follows
\r
1171 S: (article header and body follow)
\r
1175 S: 221 403 <3108@mcvax.UUCP> Article retrieved, header follows
\r
1176 S: (article header follows)
\r
1180 S: 205 UCB-VAX news server closing connection. Goodbye.
\r
1182 4.3. Example 3 - NEWGROUPS command
\r
1184 S: (listens at TCP port 119)
\r
1186 C: (requests connection on TCP port 119)
\r
1187 S: 200 Imaginary Institute News Server ready (posting ok)
\r
1189 (client asks for new newsgroups since April 3, 1985)
\r
1190 C: NEWGROUPS 850403 020000
\r
1192 S: 231 New newsgroups since 03/04/85 02:00:00 follow
\r
1196 Kantor & Lapsley [Page 21]
\r
1200 RFC 977 February 1986
\r
1201 Network News Transfer Protocol
\r
1204 S: net.music.gdead
\r
1205 S: net.games.sources
\r
1208 C: GROUP net.music.gdead
\r
1209 S: 211 0 1 1 net.music.gdead Newsgroup selected
\r
1210 (there are no articles in that newsgroup, and
\r
1211 the first and last article numbers should be ignored)
\r
1214 S: 205 Imaginary Institute news server ceasing service. Bye!
\r
1216 4.4. Example 4 - posting a news article
\r
1218 S: (listens at TCP port 119)
\r
1220 C: (requests connection on TCP port 119)
\r
1221 S: 200 BANZAIVAX news server ready, posting allowed.
\r
1224 S: 340 Continue posting; Period on a line by itself to end
\r
1225 C: (transmits news article in RFC850 format)
\r
1227 S: 240 Article posted successfully.
\r
1230 S: 205 BANZAIVAX closing connection. Goodbye.
\r
1232 4.5. Example 5 - interruption due to operator request
\r
1234 S: (listens at TCP port 119)
\r
1236 C: (requests connection on TCP port 119)
\r
1237 S: 201 genericvax news server ready, no posting allowed.
\r
1239 (assume normal conversation for some time, and
\r
1240 that a newsgroup has been selected)
\r
1243 S: 223 1013 <5734@mcvax.UUCP> Article retrieved; text separate.
\r
1246 C: 221 1013 <5734@mcvax.UUCP> Article retrieved; head follows.
\r
1248 S: (sends head of article, but halfway through is
\r
1249 interrupted by an operator request. The following
\r
1250 then occurs, without client intervention.)
\r
1253 Kantor & Lapsley [Page 22]
\r
1257 RFC 977 February 1986
\r
1258 Network News Transfer Protocol
\r
1261 S: (ends current line with a CR-LF pair)
\r
1263 S: 400 Connection closed by operator. Goodbye.
\r
1264 S: (closes connection)
\r
1266 4.6. Example 6 - Using the news server to distribute news between
\r
1269 S: (listens at TCP port 119)
\r
1271 C: (requests connection on TCP port 119)
\r
1272 S: 201 Foobar NNTP server ready (no posting)
\r
1274 (client asks for new newsgroups since 2 am, May 15, 1985)
\r
1275 C: NEWGROUPS 850515 020000
\r
1276 S: 235 New newsgroups since 850515 follow
\r
1281 (client asks for new news articles since 2 am, May 15, 1985)
\r
1282 C: NEWNEWS * 850515 020000
\r
1283 S: 230 New news since 850515 020000 follows
\r
1284 S: <1772@foo.UUCP>
\r
1285 S: <87623@baz.UUCP>
\r
1286 S: <17872@GOLD.CSNET>
\r
1289 (client asks for article <1772@foo.UUCP>)
\r
1290 C: ARTICLE <1772@foo.UUCP>
\r
1291 S: 220 <1772@foo.UUCP> All of article follows
\r
1292 S: (sends entire message)
\r
1295 (client asks for article <87623@baz.UUCP>
\r
1296 C: ARTICLE <87623@baz.UUCP>
\r
1297 S: 220 <87623@baz.UUCP> All of article follows
\r
1298 S: (sends entire message)
\r
1301 (client asks for article <17872@GOLD.CSNET>
\r
1302 C: ARTICLE <17872@GOLD.CSNET>
\r
1303 S: 220 <17872@GOLD.CSNET> All of article follows
\r
1304 S: (sends entire message)
\r
1310 Kantor & Lapsley [Page 23]
\r
1314 RFC 977 February 1986
\r
1315 Network News Transfer Protocol
\r
1318 (client offers an article it has received recently)
\r
1319 C: IHAVE <4105@ucbvax.ARPA>
\r
1320 S: 435 Already seen that one, where you been?
\r
1322 (client offers another article)
\r
1323 C: IHAVE <4106@ucbvax.ARPA>
\r
1324 S: 335 News to me! <CRLF.CRLF> to end.
\r
1325 C: (sends article)
\r
1327 S: 235 Article transferred successfully. Thanks.
\r
1331 S: 436 Transfer failed.
\r
1333 (client is all through with the session)
\r
1335 S: 205 Foobar NNTP server bids you farewell.
\r
1337 4.7. Summary of commands and responses.
\r
1339 The following are the commands recognized and responses returned by
\r
1362 100 help text follows
\r
1367 Kantor & Lapsley [Page 24]
\r
1371 RFC 977 February 1986
\r
1372 Network News Transfer Protocol
\r
1375 200 server ready - posting allowed
\r
1376 201 server ready - no posting allowed
\r
1377 202 slave status noted
\r
1378 205 closing connection - goodbye!
\r
1379 211 n f l s group selected
\r
1380 215 list of newsgroups follows
\r
1381 220 n <a> article retrieved - head and body follow 221 n <a> article
\r
1382 retrieved - head follows
\r
1383 222 n <a> article retrieved - body follows
\r
1384 223 n <a> article retrieved - request text separately 230 list of new
\r
1385 articles by message-id follows
\r
1386 231 list of new newsgroups follows
\r
1387 235 article transferred ok
\r
1388 240 article posted ok
\r
1390 335 send article to be transferred. End with <CR-LF>.<CR-LF>
\r
1391 340 send article to be posted. End with <CR-LF>.<CR-LF>
\r
1393 400 service discontinued
\r
1394 411 no such news group
\r
1395 412 no newsgroup has been selected
\r
1396 420 no current article has been selected
\r
1397 421 no next article in this group
\r
1398 422 no previous article in this group
\r
1399 423 no such article number in this group
\r
1400 430 no such article found
\r
1401 435 article not wanted - do not send it
\r
1402 436 transfer failed - try again later
\r
1403 437 article rejected - do not try again.
\r
1404 440 posting not allowed
\r
1405 441 posting failed
\r
1407 500 command not recognized
\r
1408 501 command syntax error
\r
1409 502 access restriction or permission denied
\r
1410 503 program fault - command not performed
\r
1412 4.8. A Brief Word about the USENET News System
\r
1414 In the UNIX world, which traditionally has been linked by 1200 baud
\r
1415 dial-up telephone lines, the USENET News system has evolved to handle
\r
1416 central storage, indexing, retrieval, and distribution of news. With
\r
1417 the exception of its underlying transport mechanism (UUCP), USENET
\r
1418 News is an efficient means of providing news and bulletin service to
\r
1419 subscribers on UNIX and other hosts worldwide. The USENET News
\r
1424 Kantor & Lapsley [Page 25]
\r
1428 RFC 977 February 1986
\r
1429 Network News Transfer Protocol
\r
1432 system is discussed in detail in RFC 850. It runs on most versions
\r
1433 of UNIX and on many other operating systems, and is customarily
\r
1434 distributed without charge.
\r
1436 USENET uses a spooling area on the UNIX host to store news articles,
\r
1437 one per file. Each article consists of a series of heading text,
\r
1438 which contain the sender's identification and organizational
\r
1439 affiliation, timestamps, electronic mail reply paths, subject,
\r
1440 newsgroup (subject category), and the like. A complete news article
\r
1441 is reproduced in its entirety below. Please consult RFC 850 for more
\r
1444 Relay-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site
\r
1446 Posting-Version: version B 2.10.1 6/24/83 SMI; site unitek.uucp
\r
1447 Path:sdcsvax!sdcrdcf!hplabs!qantel!ihnp4!alberta!ubc-vision!unitek
\r
1449 From: honman@unitek.uucp (Man Wong)
\r
1450 Newsgroups: net.unix-wizards
\r
1451 Subject: foreground -> background ?
\r
1452 Message-ID: <167@unitek.uucp>
\r
1453 Date: 25 Sep 85 23:51:52 GMT
\r
1454 Date-Received: 29 Sep 85 09:54:48 GMT
\r
1455 Reply-To: honman@unitek.UUCP (Hon-Man Wong)
\r
1456 Distribution: net.all
\r
1457 Organization: Unitek Technologies Corporation
\r
1460 I have a process (C program) which generates a child and waits for
\r
1461 it to return. What I would like to do is to be able to run the
\r
1462 child process interactively for a while before kicking itself into
\r
1463 the background so I can return to the parent process (while the
\r
1464 child process is RUNNING in the background). Can it be done? And
\r
1467 Please reply by E-mail. Thanks in advance.
\r
1481 Kantor & Lapsley [Page 26]
\r
1485 RFC 977 February 1986
\r
1486 Network News Transfer Protocol
\r
1491 [1] Crocker, D., "Standard for the Format of ARPA Internet Text
\r
1492 Messages", RFC-822, Department of Electrical Engineering,
\r
1493 University of Delaware, August, 1982.
\r
1495 [2] Horton, M., "Standard for Interchange of USENET Messages",
\r
1496 RFC-850, USENET Project, June, 1983.
\r
1498 [3] Postel, J., "Transmission Control Protocol- DARPA Internet
\r
1499 Program Protocol Specification", RFC-793, USC/Information
\r
1500 Sciences Institute, September, 1981.
\r
1502 [4] Postel, J., "Simple Mail Transfer Protocol", RFC-821,
\r
1503 USC/Information Sciences Institute, August, 1982.
\r
1505 6. Acknowledgements
\r
1507 The authors wish to express their heartfelt thanks to those many
\r
1508 people who contributed to this specification, and especially to Erik
\r
1509 Fair and Chuq von Rospach, without whose inspiration this whole thing
\r
1510 would not have been necessary.
\r
1514 <1> UNIX is a trademark of Bell Laboratories.
\r
1538 Kantor & Lapsley [Page 27]
\r