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