home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume36 / unpost / part01 < prev    next >
Encoding:
Text File  |  1993-04-18  |  59.0 KB  |  1,722 lines

  1. Newsgroups: comp.sources.misc,alt.binaries.pictures.utilities
  2. From: jstevens@teal.csn.org (John W.M. Stevens)
  3. Subject: v36i114:  unpost - Smart multi-part uudecoder v2.1.2, Part01/07
  4. Message-ID: <1993Apr19.052020.28445@sparky.imd.sterling.com>
  5. X-Md4-Signature: 09522defa9d278258ff56491e1dcd228
  6. Date: Mon, 19 Apr 1993 05:20:20 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: jstevens@teal.csn.org (John W.M. Stevens)
  10. Posting-number: Volume 36, Issue 114
  11. Archive-name: unpost/part01
  12. Environment: UNIX, MS-DOS, OS/2, Windows, MacIntosh, Amiga, Vax/VMS
  13.  
  14. #! /bin/sh
  15. # This is a shell archive.  Remove anything before this line, then feed it
  16. # into a shell via "sh file" or similar.  To overwrite existing files,
  17. # type "sh file -c".
  18. # Contents:  cfg makefils nntp nntp/rfc977 utils utils/mofs.c
  19. # Wrapped by kent@sparky on Sun Apr 18 23:10:29 1993
  20. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  21. echo If this archive is complete, you will see the following message:
  22. echo '          "shar: End of archive 1 (of 7)."'
  23. if test ! -d 'cfg' ; then
  24.     echo shar: Creating directory \"'cfg'\"
  25.     mkdir 'cfg'
  26. fi
  27. if test ! -d 'makefils' ; then
  28.     echo shar: Creating directory \"'makefils'\"
  29.     mkdir 'makefils'
  30. fi
  31. if test ! -d 'nntp' ; then
  32.     echo shar: Creating directory \"'nntp'\"
  33.     mkdir 'nntp'
  34. fi
  35. if test -f 'nntp/rfc977' -a "${1}" != "-c" ; then 
  36.   echo shar: Will not clobber existing file \"'nntp/rfc977'\"
  37. else
  38.   echo shar: Extracting \"'nntp/rfc977'\" \(53460 characters\)
  39.   sed "s/^X//" >'nntp/rfc977' <<'END_OF_FILE'
  40. X
  41. X
  42. XNetwork Working Group                      Brian Kantor (U.C. San Diego)
  43. XRequest for Comments: 977                   Phil Lapsley (U.C. Berkeley)
  44. X                                                           February 1986
  45. X
  46. X                     Network News Transfer Protocol
  47. X
  48. X                A Proposed Standard for the Stream-Based
  49. X                          Transmission of News
  50. X
  51. XStatus of This Memo
  52. X
  53. X   NNTP specifies a protocol for the distribution, inquiry, retrieval,
  54. X   and posting of news articles using a reliable stream-based
  55. X   transmission of news among the ARPA-Internet community.  NNTP is
  56. X   designed so that news articles are stored in a central database
  57. X   allowing a subscriber to select only those items he wishes to read.
  58. X   Indexing, cross-referencing, and expiration of aged messages are also
  59. X   provided. This RFC suggests a proposed protocol for the ARPA-Internet
  60. X   community, and requests discussion and suggestions for improvements.
  61. X   Distribution of this memo is unlimited.
  62. X
  63. X1.  Introduction
  64. X
  65. X   For many years, the ARPA-Internet community has supported the
  66. X   distribution of bulletins, information, and data in a timely fashion
  67. X   to thousands of participants.  We collectively refer to such items of
  68. X   information as "news".  Such news provides for the rapid
  69. X   dissemination of items of interest such as software bug fixes, new
  70. X   product reviews, technical tips, and programming pointers, as well as
  71. X   rapid-fire discussions of matters of concern to the working computer
  72. X   professional. News is very popular among its readers.
  73. X
  74. X   There are popularly two methods of distributing such news: the
  75. X   Internet method of direct mailing, and the USENET news system.
  76. X
  77. X1.1.  Internet Mailing Lists
  78. X
  79. X   The Internet community distributes news by the use of mailing lists.
  80. X   These are lists of subscriber's mailbox addresses and remailing
  81. X   sublists of all intended recipients.  These mailing lists operate by
  82. X   remailing a copy of the information to be distributed to each
  83. X   subscriber on the mailing list.  Such remailing is inefficient when a
  84. X   mailing list grows beyond a dozen or so people, since sending a
  85. X   separate copy to each of the subscribers occupies large quantities of
  86. X   network bandwidth, CPU resources, and significant amounts of disk
  87. X   storage at the destination host.  There is also a significant problem
  88. X   in maintenance of the list itself: as subscribers move from one job
  89. X   to another; as new subscribers join and old ones leave; and as hosts
  90. X   come in and out of service.
  91. X
  92. X
  93. X
  94. X
  95. XKantor & Lapsley                                                [Page 1]
  96. X
  97. X
  98. X
  99. XRFC 977                                                    February 1986
  100. XNetwork News Transfer Protocol
  101. X
  102. X
  103. X1.2.  The USENET News System
  104. X
  105. X   Clearly, a worthwhile reduction of the amount of these resources used
  106. X   can be achieved if articles are stored in a central database on the
  107. X   receiving host instead of in each subscriber's mailbox. The USENET
  108. X   news system provides a method of doing just this.  There is a central
  109. X   repository of the news articles in one place (customarily a spool
  110. X   directory of some sort), and a set of programs that allow a
  111. X   subscriber to select those items he wishes to read.  Indexing,
  112. X   cross-referencing, and expiration of aged messages are also provided.
  113. X
  114. X1.3.  Central Storage of News
  115. X
  116. X   For clusters of hosts connected together by fast local area networks
  117. X   (such as Ethernet), it makes even more sense to consolidate news
  118. X   distribution onto one (or a very few) hosts, and to allow access to
  119. X   these news articles using a server and client model.  Subscribers may
  120. X   then request only the articles they wish to see, without having to
  121. X   wastefully duplicate the storage of a copy of each item on each host.
  122. X
  123. X1.4.  A Central News Server
  124. X
  125. X   A way to achieve these economies is to have a central computer system
  126. X   that can provide news service to the other systems on the local area
  127. X   network.  Such a server would manage the collection of news articles
  128. X   and index files, with each person who desires to read news bulletins
  129. X   doing so over the LAN.  For a large cluster of computer systems, the
  130. X   savings in total disk space is clearly worthwhile.  Also, this allows
  131. X   workstations with limited disk storage space to participate in the
  132. X   news without incoming items consuming oppressive amounts of the
  133. X   workstation's disk storage.
  134. X
  135. X   We have heard rumors of somewhat successful attempts to provide
  136. X   centralized news service using IBIS and other shared or distributed
  137. X   file systems.  While it is possible that such a distributed file
  138. X   system implementation might work well with a group of similar
  139. X   computers running nearly identical operating systems, such a scheme
  140. X   is not general enough to offer service to a wide range of client
  141. X   systems, especially when many diverse operating systems may be in use
  142. X   among a group of clients.  There are few (if any) shared or networked
  143. X   file systems that can offer the generality of service that stream
  144. X   connections using Internet TCP provide, particularly when a wide
  145. X   range of host hardware and operating systems are considered.
  146. X
  147. X   NNTP specifies a protocol for the distribution, inquiry, retrieval,
  148. X   and posting of news articles using a reliable stream (such as TCP)
  149. X   server-client model. NNTP is designed so that news articles need only
  150. X
  151. X
  152. XKantor & Lapsley                                                [Page 2]
  153. X
  154. X
  155. X
  156. XRFC 977                                                    February 1986
  157. XNetwork News Transfer Protocol
  158. X
  159. X
  160. X   be stored on one (presumably central) host, and subscribers on other
  161. X   hosts attached to the LAN may read news articles using stream
  162. X   connections to the news host.
  163. X
  164. X   NNTP is modelled upon the news article specifications in RFC 850,
  165. X   which describes the USENET news system.  However, NNTP makes few
  166. X   demands upon the structure, content, or storage of news articles, and
  167. X   thus we believe it easily can be adapted to other non-USENET news
  168. X   systems.
  169. X
  170. X   Typically, the NNTP server runs as a background process on one host,
  171. X   and would accept connections from other hosts on the LAN.  This works
  172. X   well when there are a number of small computer systems (such as
  173. X   workstations, with only one or at most a few users each), and a large
  174. X   central server.
  175. X
  176. X1.5.  Intermediate News Servers
  177. X
  178. X   For clusters of machines with many users (as might be the case in a
  179. X   university or large industrial environment), an intermediate server
  180. X   might be used.  This intermediate or "slave" server runs on each
  181. X   computer system, and is responsible for mediating news reading
  182. X   requests and performing local caching of recently-retrieved news
  183. X   articles.
  184. X
  185. X   Typically, a client attempting to obtain news service would first
  186. X   attempt to connect to the news service port on the local machine.  If
  187. X   this attempt were unsuccessful, indicating a failed server, an
  188. X   installation might choose to either deny news access, or to permit
  189. X   connection to the central "master" news server.
  190. X
  191. X   For workstations or other small systems, direct connection to the
  192. X   master server would probably be the normal manner of operation.
  193. X
  194. X   This specification does not cover the operation of slave NNTP
  195. X   servers.  We merely suggest that slave servers are a logical addition
  196. X   to NNTP server usage which would enhance operation on large local
  197. X   area networks.
  198. X
  199. X1.6.  News Distribution
  200. X
  201. X   NNTP has commands which provide a straightforward method of
  202. X   exchanging articles between cooperating hosts. Hosts which are well
  203. X   connected on a local area or other fast network and who wish to
  204. X   actually obtain copies of news articles for local storage might well
  205. X   find NNTP to be a more efficient way to distribute news than more
  206. X   traditional transfer methods (such as UUCP).
  207. X
  208. X
  209. XKantor & Lapsley                                                [Page 3]
  210. X
  211. X
  212. X
  213. XRFC 977                                                    February 1986
  214. XNetwork News Transfer Protocol
  215. X
  216. X
  217. X   In the traditional method of distributing news articles, news is
  218. X   propagated from host to host by flooding - that is, each host will
  219. X   send all its new news articles on to each host that it feeds.  These
  220. X   hosts will then in turn send these new articles on to other hosts
  221. X   that they feed.  Clearly, sending articles that a host already has
  222. X   obtained a copy of from another feed (many hosts that receive news
  223. X   are redundantly fed) again is a waste of time and communications
  224. X   resources, but for transport mechanisms that are single-transaction
  225. X   based rather than interactive (such as UUCP in the UNIX-world <1>),
  226. X   distribution time is diminished by sending all articles and having
  227. X   the receiving host simply discard the duplicates.  This is an
  228. X   especially true when communications sessions are limited to once a
  229. X   day.
  230. X
  231. X   Using NNTP, hosts exchanging news articles have an interactive
  232. X   mechanism for deciding which articles are to be transmitted.  A host
  233. X   desiring new news, or which has new news to send, will typically
  234. X   contact one or more of its neighbors using NNTP.  First it will
  235. X   inquire if any new news groups have been created on the serving host
  236. X   by means of the NEWGROUPS command.  If so, and those are appropriate
  237. X   or desired (as established by local site-dependent rules), those new
  238. X   newsgroups can be created.
  239. X
  240. X   The client host will then inquire as to which new articles have
  241. X   arrived in all or some of the newsgroups that it desires to receive,
  242. X   using the NEWNEWS command.  It will receive a list of new articles
  243. X   from the server, and can request transmission of those articles that
  244. X   it desires and does not already have.
  245. X
  246. X   Finally, the client can advise the server of those new articles which
  247. X   the client has recently received.  The server will indicate those
  248. X   articles that it has already obtained copies of, and which articles
  249. X   should be sent to add to its collection.
  250. X
  251. X   In this manner, only those articles which are not duplicates and
  252. X   which are desired are transferred.
  253. X
  254. X
  255. X
  256. X
  257. X
  258. X
  259. X
  260. X
  261. X
  262. X
  263. X
  264. X
  265. X
  266. XKantor & Lapsley                                                [Page 4]
  267. X
  268. X
  269. X
  270. XRFC 977                                                    February 1986
  271. XNetwork News Transfer Protocol
  272. X
  273. X
  274. X2.  The NNTP Specification
  275. X
  276. X2.1.  Overview
  277. X
  278. X   The news server specified by this document uses a stream connection
  279. X   (such as TCP) and SMTP-like commands and responses.  It is designed
  280. X   to accept connections from hosts, and to provide a simple interface
  281. X   to the news database.
  282. X
  283. X   This server is only an interface between programs and the news
  284. X   databases. It does not perform any user interaction or presentation-
  285. X   level functions. These "user-friendly" functions are better left to
  286. X   the client programs, which have a better understanding of the
  287. X   environment in which they are operating.
  288. X
  289. X   When used via Internet TCP, the contact port assigned for this
  290. X   service is 119.
  291. X
  292. X2.2.  Character Codes
  293. X
  294. X   Commands and replies are composed of characters from the ASCII
  295. X   character set.  When the transport service provides an 8-bit byte
  296. X   (octet) transmission channel, each 7-bit character is transmitted
  297. X   right justified in an octet with the high order bit cleared to zero.
  298. X
  299. X2.3.  Commands
  300. X
  301. X   Commands consist of a command word, which in some cases may be
  302. X   followed by a parameter.  Commands with parameters must separate the
  303. X   parameters from each other and from the command by one or more space
  304. X   or tab characters.  Command lines must be complete with all required
  305. X   parameters, and may not contain more than one command.
  306. X
  307. X   Commands and command parameters are not case sensitive. That is, a
  308. X   command or parameter word may be upper case, lower case, or any
  309. X   mixture of upper and lower case.
  310. X
  311. X   Each command line must be terminated by a CR-LF (Carriage Return -
  312. X   Line Feed) pair.
  313. X
  314. X   Command lines shall not exceed 512 characters in length, counting all
  315. X   characters including spaces, separators, punctuation, and the
  316. X   trailing CR-LF (thus there are 510 characters maximum allowed for the
  317. X   command and its parameters).  There is no provision for continuation
  318. X   command lines.
  319. X
  320. X
  321. X
  322. X
  323. XKantor & Lapsley                                                [Page 5]
  324. X
  325. X
  326. X
  327. XRFC 977                                                    February 1986
  328. XNetwork News Transfer Protocol
  329. X
  330. X
  331. X2.4.  Responses
  332. X
  333. X   Responses are of two kinds, textual and status.
  334. X
  335. X2.4.1.  Text Responses
  336. X
  337. X   Text is sent only after a numeric status response line has been sent
  338. X   that indicates that text will follow.  Text is sent as a series of
  339. X   successive lines of textual matter, each terminated with CR-LF pair.
  340. X   A single line containing only a period (.) is sent to indicate the
  341. X   end of the text (i.e., the server will send a CR-LF pair at the end
  342. X   of the last line of text, a period, and another CR-LF pair).
  343. X
  344. X   If the text contained a period as the first character of the text
  345. X   line in the original, that first period is doubled.  Therefore, the
  346. X   client must examine the first character of each line received, and
  347. X   for those beginning with a period, determine either that this is the
  348. X   end of the text or whether to collapse the doubled period to a single
  349. X   one.
  350. X
  351. X   The intention is that text messages will usually be displayed on the
  352. X   user's terminal whereas command/status responses will be interpreted
  353. X   by the client program before any possible display is done.
  354. X
  355. X2.4.2.  Status Responses
  356. X
  357. X   These are status reports from the server and indicate the response to
  358. X   the last command received from the client.
  359. X
  360. X   Status response lines begin with a 3 digit numeric code which is
  361. X   sufficient to distinguish all responses.  Some of these may herald
  362. X   the subsequent transmission of text.
  363. X
  364. X   The first digit of the response broadly indicates the success,
  365. X   failure, or progress of the previous command.
  366. X
  367. X      1xx - Informative message
  368. X      2xx - Command ok
  369. X      3xx - Command ok so far, send the rest of it.
  370. X      4xx - Command was correct, but couldn't be performed for
  371. X            some reason.
  372. X      5xx - Command unimplemented, or incorrect, or a serious
  373. X            program error occurred.
  374. X
  375. X
  376. X
  377. X
  378. X
  379. X
  380. XKantor & Lapsley                                                [Page 6]
  381. X
  382. X
  383. X
  384. XRFC 977                                                    February 1986
  385. XNetwork News Transfer Protocol
  386. X
  387. X
  388. X   The next digit in the code indicates the function response category.
  389. X
  390. X      x0x - Connection, setup, and miscellaneous messages
  391. X      x1x - Newsgroup selection
  392. X      x2x - Article selection
  393. X      x3x - Distribution functions
  394. X      x4x - Posting
  395. X      x8x - Nonstandard (private implementation) extensions
  396. X      x9x - Debugging output
  397. X
  398. X   The exact response codes that should be expected from each command
  399. X   are detailed in the description of that command.  In addition, below
  400. X   is listed a general set of response codes that may be received at any
  401. X   time.
  402. X
  403. X   Certain status responses contain parameters such as numbers and
  404. X   names. The number and type of such parameters is fixed for each
  405. X   response code to simplify interpretation of the response.
  406. X
  407. X   Parameters are separated from the numeric response code and from each
  408. X   other by a single space. All numeric parameters are decimal, and may
  409. X   have leading zeros. All string parameters begin after the separating
  410. X   space, and end before the following separating space or the CR-LF
  411. X   pair at the end of the line. (String parameters may not, therefore,
  412. X   contain spaces.) All text, if any, in the response which is not a
  413. X   parameter of the response must follow and be separated from the last
  414. X   parameter by a space.  Also, note that the text following a response
  415. X   number may vary in different implementations of the server. The
  416. X   3-digit numeric code should be used to determine what response was
  417. X   sent.
  418. X
  419. X   Response codes not specified in this standard may be used for any
  420. X   installation-specific additional commands also not specified. These
  421. X   should be chosen to fit the pattern of x8x specified above.  (Note
  422. X   that debugging is provided for explicitly in the x9x response codes.)
  423. X   The use of unspecified response codes for standard commands is
  424. X   prohibited.
  425. X
  426. X   We have provided a response pattern x9x for debugging.  Since much
  427. X   debugging output may be classed as "informative messages", we would
  428. X   expect, therefore, that responses 190 through 199 would be used for
  429. X   various debugging outputs.  There is no requirement in this
  430. X   specification for debugging output, but if such is provided over the
  431. X   connected stream, it must use these response codes.  If appropriate
  432. X   to a specific implementation, other x9x codes may be used for
  433. X   debugging.  (An example might be to use e.g., 290 to acknowledge a
  434. X   remote debugging request.)
  435. X
  436. X
  437. XKantor & Lapsley                                                [Page 7]
  438. X
  439. X
  440. X
  441. XRFC 977                                                    February 1986
  442. XNetwork News Transfer Protocol
  443. X
  444. X
  445. X2.4.3.  General Responses
  446. X
  447. X   The following is a list of general response codes that may be sent by
  448. X   the NNTP server.  These are not specific to any one command, but may
  449. X   be returned as the result of a connection, a failure, or some unusual
  450. X   condition.
  451. X
  452. X   In general, 1xx codes may be ignored or displayed as desired;  code
  453. X   200 or 201 is sent upon initial connection to the NNTP server
  454. X   depending upon posting permission; code 400 will be sent when the
  455. X   NNTP server discontinues service (by operator request, for example);
  456. X   and 5xx codes indicate that the command could not be performed for
  457. X   some unusual reason.
  458. X
  459. X      100 help text
  460. X      190
  461. X        through
  462. X      199 debug output
  463. X
  464. X      200 server ready - posting allowed
  465. X      201 server ready - no posting allowed
  466. X
  467. X      400 service discontinued
  468. X
  469. X      500 command not recognized
  470. X      501 command syntax error
  471. X      502 access restriction or permission denied
  472. X      503 program fault - command not performed
  473. X
  474. X3.  Command and Response Details
  475. X
  476. X   On the following pages are descriptions of each command recognized by
  477. X   the NNTP server and the responses which will be returned by those
  478. X   commands.
  479. X
  480. X   Each command is shown in upper case for clarity, although case is
  481. X   ignored in the interpretation of commands by the NNTP server.  Any
  482. X   parameters are shown in lower case.  A parameter shown in [square
  483. X   brackets] is optional.  For example, [GMT] indicates that the
  484. X   triglyph GMT may present or omitted.
  485. X
  486. X   Every command described in this section must be implemented by all
  487. X   NNTP servers.
  488. X
  489. X
  490. X
  491. X
  492. X
  493. X
  494. XKantor & Lapsley                                                [Page 8]
  495. X
  496. X
  497. X
  498. XRFC 977                                                    February 1986
  499. XNetwork News Transfer Protocol
  500. X
  501. X
  502. X   There is no prohibition against additional commands being added;
  503. X   however, it is recommended that any such unspecified command begin
  504. X   with the letter "X" to avoid conflict with later revisions of this
  505. X   specification.
  506. X
  507. X   Implementors are reminded that such additional commands may not
  508. X   redefine specified status response codes.  Using additional
  509. X   unspecified responses for standard commands is also prohibited.
  510. X
  511. X3.1.  The ARTICLE, BODY, HEAD, and STAT commands
  512. X
  513. X   There are two forms to the ARTICLE command (and the related BODY,
  514. X   HEAD, and STAT commands), each using a different method of specifying
  515. X   which article is to be retrieved.  When the ARTICLE command is
  516. X   followed by a message-id in angle brackets ("<" and ">"), the first
  517. X   form of the command is used; when a numeric parameter or no parameter
  518. X   is supplied, the second form is invoked.
  519. X
  520. X   The text of the article is returned as a textual response, as
  521. X   described earlier in this document.
  522. X
  523. X   The HEAD and BODY commands are identical to the ARTICLE command
  524. X   except that they respectively return only the header lines or text
  525. X   body of the article.
  526. X
  527. X   The STAT command is similar to the ARTICLE command except that no
  528. X   text is returned.  When selecting by message number within a group,
  529. X   the STAT command serves to set the current article pointer without
  530. X   sending text. The returned acknowledgement response will contain the
  531. X   message-id, which may be of some value.  Using the STAT command to
  532. X   select by message-id is valid but of questionable value, since a
  533. X   selection by message-id does NOT alter the "current article pointer".
  534. X
  535. X3.1.1.  ARTICLE (selection by message-id)
  536. X
  537. X   ARTICLE <message-id>
  538. X
  539. X   Display the header, a blank line, then the body (text) of the
  540. X   specified article.  Message-id is the message id of an article as
  541. X   shown in that article's header.  It is anticipated that the client
  542. X   will obtain the message-id from a list provided by the NEWNEWS
  543. X   command, from references contained within another article, or from
  544. X   the message-id provided in the response to some other commands.
  545. X
  546. X   Please note that the internally-maintained "current article pointer"
  547. X   is NOT ALTERED by this command. This is both to facilitate the
  548. X   presentation of articles that may be referenced within an article
  549. X
  550. X
  551. XKantor & Lapsley                                                [Page 9]
  552. X
  553. X
  554. X
  555. XRFC 977                                                    February 1986
  556. XNetwork News Transfer Protocol
  557. X
  558. X
  559. X   being read, and because of the semantic difficulties of determining
  560. X   the proper sequence and membership of an article which may have been
  561. X   posted to more than one newsgroup.
  562. X
  563. X3.1.2.  ARTICLE (selection by number)
  564. X
  565. X   ARTICLE [nnn]
  566. X
  567. X   Displays the header, a blank line, then the body (text) of the
  568. X   current or specified article.  The optional parameter nnn is the
  569. X
  570. X   numeric id of an article in the current newsgroup and must be chosen
  571. X   from the range of articles provided when the newsgroup was selected.
  572. X   If it is omitted, the current article is assumed.
  573. X
  574. X   The internally-maintained "current article pointer" is set by this
  575. X   command if a valid article number is specified.
  576. X
  577. X   [the following applies to both forms of the article command.] A
  578. X   response indicating the current article number, a message-id string,
  579. X   and that text is to follow will be returned.
  580. X
  581. X   The message-id string returned is an identification string contained
  582. X   within angle brackets ("<" and ">"), which is derived from the header
  583. X   of the article itself.  The Message-ID header line (required by
  584. X   RFC850) from the article must be used to supply this information. If
  585. X   the message-id header line is missing from the article, a single
  586. X   digit "0" (zero) should be supplied within the angle brackets.
  587. X
  588. X   Since the message-id field is unique with each article, it may be
  589. X   used by a news reading program to skip duplicate displays of articles
  590. X   that have been posted more than once, or to more than one newsgroup.
  591. X
  592. X3.1.3.  Responses
  593. X
  594. X   220 n <a> article retrieved - head and body follow
  595. X           (n = article number, <a> = message-id)
  596. X   221 n <a> article retrieved - head follows
  597. X   222 n <a> article retrieved - body follows
  598. X   223 n <a> article retrieved - request text separately
  599. X   412 no newsgroup has been selected
  600. X   420 no current article has been selected
  601. X   423 no such article number in this group
  602. X   430 no such article found
  603. X
  604. X
  605. X
  606. X
  607. X
  608. XKantor & Lapsley                                               [Page 10]
  609. X
  610. X
  611. X
  612. XRFC 977                                                    February 1986
  613. XNetwork News Transfer Protocol
  614. X
  615. X
  616. X3.2.  The GROUP command
  617. X
  618. X3.2.1.  GROUP
  619. X
  620. X   GROUP ggg
  621. X
  622. X   The required parameter ggg is the name of the newsgroup to be
  623. X   selected (e.g. "net.news").  A list of valid newsgroups may be
  624. X   obtained from the LIST command.
  625. X
  626. X   The successful selection response will return the article numbers of
  627. X   the first and last articles in the group, and an estimate of the
  628. X   number of articles on file in the group.  It is not necessary that
  629. X   the estimate be correct, although that is helpful; it must only be
  630. X   equal to or larger than the actual number of articles on file.  (Some
  631. X   implementations will actually count the number of articles on file.
  632. X   Others will just subtract first article number from last to get an
  633. X   estimate.)
  634. X
  635. X   When a valid group is selected by means of this command, the
  636. X   internally maintained "current article pointer" is set to the first
  637. X   article in the group.  If an invalid group is specified, the
  638. X   previously selected group and article remain selected.  If an empty
  639. X   newsgroup is selected, the "current article pointer" is in an
  640. X   indeterminate state and should not be used.
  641. X
  642. X   Note that the name of the newsgroup is not case-dependent.  It must
  643. X   otherwise match a newsgroup obtained from the LIST command or an
  644. X   error will result.
  645. X
  646. X3.2.2.  Responses
  647. X
  648. X   211 n f l s group selected
  649. X           (n = estimated number of articles in group,
  650. X           f = first article number in the group,
  651. X           l = last article number in the group,
  652. X           s = name of the group.)
  653. X   411 no such news group
  654. X
  655. X
  656. X
  657. X
  658. X
  659. X
  660. X
  661. X
  662. X
  663. X
  664. X
  665. XKantor & Lapsley                                               [Page 11]
  666. X
  667. X
  668. X
  669. XRFC 977                                                    February 1986
  670. XNetwork News Transfer Protocol
  671. X
  672. X
  673. X3.3.  The HELP command
  674. X
  675. X3.3.1.  HELP
  676. X
  677. X   HELP
  678. X
  679. X   Provides a short summary of commands that are understood by this
  680. X   implementation of the server. The help text will be presented as a
  681. X   textual response, terminated by a single period on a line by itself.
  682. X
  683. X   3.3.2.  Responses
  684. X
  685. X   100 help text follows
  686. X
  687. X3.4.  The IHAVE command
  688. X
  689. X3.4.1.  IHAVE
  690. X
  691. X   IHAVE <messageid>
  692. X
  693. X   The IHAVE command informs the server that the client has an article
  694. X   whose id is <messageid>.  If the server desires a copy of that
  695. X   article, it will return a response instructing the client to send the
  696. X   entire article.  If the server does not want the article (if, for
  697. X   example, the server already has a copy of it), a response indicating
  698. X   that the article is not wanted will be returned.
  699. X
  700. X   If transmission of the article is requested, the client should send
  701. X   the entire article, including header and body, in the manner
  702. X   specified for text transmission from the server. A response code
  703. X   indicating success or failure of the transferral of the article will
  704. X   be returned.
  705. X
  706. X   This function differs from the POST command in that it is intended
  707. X   for use in transferring already-posted articles between hosts.
  708. X   Normally it will not be used when the client is a personal
  709. X   newsreading program.  In particular, this function will invoke the
  710. X   server's news posting program with the appropriate settings (flags,
  711. X   options, etc) to indicate that the forthcoming article is being
  712. X   forwarded from another host.
  713. X
  714. X   The server may, however, elect not to post or forward the article if
  715. X   after further examination of the article it deems it inappropriate to
  716. X   do so.  The 436 or 437 error codes may be returned as appropriate to
  717. X   the situation.
  718. X
  719. X   Reasons for such subsequent rejection of an article may include such
  720. X
  721. X
  722. XKantor & Lapsley                                               [Page 12]
  723. X
  724. X
  725. X
  726. XRFC 977                                                    February 1986
  727. XNetwork News Transfer Protocol
  728. X
  729. X
  730. X   problems as inappropriate newsgroups or distributions, disk space
  731. X   limitations, article lengths, garbled headers, and the like.  These
  732. X   are typically restrictions enforced by the server host's news
  733. X   software and not necessarily the NNTP server itself.
  734. X
  735. X3.4.2.  Responses
  736. X
  737. X   235 article transferred ok
  738. X   335 send article to be transferred.  End with <CR-LF>.<CR-LF>
  739. X   435 article not wanted - do not send it
  740. X   436 transfer failed - try again later
  741. X   437 article rejected - do not try again
  742. X
  743. X   An implementation note:
  744. X
  745. X   Because some host news posting software may not be able to decide
  746. X   immediately that an article is inappropriate for posting or
  747. X   forwarding, it is acceptable to acknowledge the successful transfer
  748. X   of the article and to later silently discard it.  Thus it is
  749. X   permitted to return the 235 acknowledgement code and later discard
  750. X   the received article.  This is not a fully satisfactory solution to
  751. X   the problem.  Perhaps some implementations will wish to send mail to
  752. X   the author of the article in certain of these cases.
  753. X
  754. X3.5.  The LAST command
  755. X
  756. X3.5.1.  LAST
  757. X
  758. X   LAST
  759. X
  760. X   The internally maintained "current article pointer" is set to the
  761. X   previous article in the current newsgroup.  If already positioned at
  762. X   the first article of the newsgroup, an error message is returned and
  763. X   the current article remains selected.
  764. X
  765. X   The internally-maintained "current article pointer" is set by this
  766. X   command.
  767. X
  768. X   A response indicating the current article number, and a message-id
  769. X   string will be returned.  No text is sent in response to this
  770. X   command.
  771. X
  772. X3.5.2.  Responses
  773. X
  774. X   223 n a article retrieved - request text separately
  775. X           (n = article number, a = unique article id)
  776. X
  777. X
  778. X
  779. XKantor & Lapsley                                               [Page 13]
  780. X
  781. X
  782. X
  783. XRFC 977                                                    February 1986
  784. XNetwork News Transfer Protocol
  785. X
  786. X
  787. X   412 no newsgroup selected
  788. X   420 no current article has been selected
  789. X   422 no previous article in this group
  790. X
  791. X3.6.  The LIST command
  792. X
  793. X3.6.1.  LIST
  794. X
  795. X   LIST
  796. X
  797. X   Returns a list of valid newsgroups and associated information.  Each
  798. X   newsgroup is sent as a line of text in the following format:
  799. X
  800. X      group last first p
  801. X
  802. X   where <group> is the name of the newsgroup, <last> is the number of
  803. X   the last known article currently in that newsgroup, <first> is the
  804. X   number of the first article currently in the newsgroup, and <p> is
  805. X   either 'y' or 'n' indicating whether posting to this newsgroup is
  806. X   allowed ('y') or prohibited ('n').
  807. X
  808. X   The <first> and <last> fields will always be numeric.  They may have
  809. X   leading zeros.  If the <last> field evaluates to less than the
  810. X   <first> field, there are no articles currently on file in the
  811. X   newsgroup.
  812. X
  813. X   Note that posting may still be prohibited to a client even though the
  814. X   LIST command indicates that posting is permitted to a particular
  815. X   newsgroup. See the POST command for an explanation of client
  816. X   prohibitions.  The posting flag exists for each newsgroup because
  817. X   some newsgroups are moderated or are digests, and therefore cannot be
  818. X   posted to; that is, articles posted to them must be mailed to a
  819. X   moderator who will post them for the submitter.  This is independent
  820. X   of the posting permission granted to a client by the NNTP server.
  821. X
  822. X   Please note that an empty list (i.e., the text body returned by this
  823. X   command consists only of the terminating period) is a possible valid
  824. X   response, and indicates that there are currently no valid newsgroups.
  825. X
  826. X3.6.2.  Responses
  827. X
  828. X   215 list of newsgroups follows
  829. X
  830. X
  831. X
  832. X
  833. X
  834. X
  835. X
  836. XKantor & Lapsley                                               [Page 14]
  837. X
  838. X
  839. X
  840. XRFC 977                                                    February 1986
  841. XNetwork News Transfer Protocol
  842. X
  843. X
  844. X3.7.  The NEWGROUPS command
  845. X
  846. X3.7.1.  NEWGROUPS
  847. X
  848. X   NEWGROUPS date time [GMT] [<distributions>]
  849. X
  850. X   A list of newsgroups created since <date and time> will be listed in
  851. X   the same format as the LIST command.
  852. X
  853. X   The date is sent as 6 digits in the format YYMMDD, where YY is the
  854. X   last two digits of the year, MM is the two digits of the month (with
  855. X   leading zero, if appropriate), and DD is the day of the month (with
  856. X   leading zero, if appropriate).  The closest century is assumed as
  857. X   part of the year (i.e., 86 specifies 1986, 30 specifies 2030, 99 is
  858. X   1999, 00 is 2000).
  859. X
  860. X   Time must also be specified.  It must be as 6 digits HHMMSS with HH
  861. X   being hours on the 24-hour clock, MM minutes 00-59, and SS seconds
  862. X   00-59.  The time is assumed to be in the server's timezone unless the
  863. X   token "GMT" appears, in which case both time and date are evaluated
  864. X   at the 0 meridian.
  865. X
  866. X   The optional parameter "distributions" is a list of distribution
  867. X   groups, enclosed in angle brackets.  If specified, the distribution
  868. X   portion of a new newsgroup (e.g, 'net' in 'net.wombat') will be
  869. X   examined for a match with the distribution categories listed, and
  870. X   only those new newsgroups which match will be listed.  If more than
  871. X   one distribution group is to be listed, they must be separated by
  872. X   commas within the angle brackets.
  873. X
  874. X   Please note that an empty list (i.e., the text body returned by this
  875. X   command consists only of the terminating period) is a possible valid
  876. X   response, and indicates that there are currently no new newsgroups.
  877. X
  878. X3.7.2.  Responses
  879. X
  880. X   231 list of new newsgroups follows
  881. X
  882. X
  883. X
  884. X
  885. X
  886. X
  887. X
  888. X
  889. X
  890. X
  891. X
  892. X
  893. XKantor & Lapsley                                               [Page 15]
  894. X
  895. X
  896. X
  897. XRFC 977                                                    February 1986
  898. XNetwork News Transfer Protocol
  899. X
  900. X
  901. X3.8.  The NEWNEWS command
  902. X
  903. X3.8.1.  NEWNEWS
  904. X
  905. X   NEWNEWS newsgroups date time [GMT] [<distribution>]
  906. X
  907. X   A list of message-ids of articles posted or received to the specified
  908. X   newsgroup since "date" will be listed. The format of the listing will
  909. X   be one message-id per line, as though text were being sent.  A single
  910. X   line consisting solely of one period followed by CR-LF will terminate
  911. X   the list.
  912. X
  913. X   Date and time are in the same format as the NEWGROUPS command.
  914. X
  915. X   A newsgroup name containing a "*" (an asterisk) may be specified to
  916. X   broaden the article search to some or all newsgroups.  The asterisk
  917. X   will be extended to match any part of a newsgroup name (e.g.,
  918. X   net.micro* will match net.micro.wombat, net.micro.apple, etc). Thus
  919. X   if only an asterisk is given as the newsgroup name, all newsgroups
  920. X   will be searched for new news.
  921. X
  922. X   (Please note that the asterisk "*" expansion is a general
  923. X   replacement; in particular, the specification of e.g., net.*.unix
  924. X   should be correctly expanded to embrace names such as net.wombat.unix
  925. X   and net.whocares.unix.)
  926. X
  927. X   Conversely, if no asterisk appears in a given newsgroup name, only
  928. X   the specified newsgroup will be searched for new articles. Newsgroup
  929. X   names must be chosen from those returned in the listing of available
  930. X   groups.  Multiple newsgroup names (including a "*") may be specified
  931. X   in this command, separated by a comma.  No comma shall appear after
  932. X   the last newsgroup in the list.  [Implementors are cautioned to keep
  933. X   the 512 character command length limit in mind.]
  934. X
  935. X   The exclamation point ("!") may be used to negate a match. This can
  936. X   be used to selectively omit certain newsgroups from an otherwise
  937. X   larger list.  For example, a newsgroups specification of
  938. X   "net.*,mod.*,!mod.map.*" would specify that all net.<anything> and
  939. X   all mod.<anything> EXCEPT mod.map.<anything> newsgroup names would be
  940. X   matched.  If used, the exclamation point must appear as the first
  941. X   character of the given newsgroup name or pattern.
  942. X
  943. X   The optional parameter "distributions" is a list of distribution
  944. X   groups, enclosed in angle brackets.  If specified, the distribution
  945. X   portion of an article's newsgroup (e.g, 'net' in 'net.wombat') will
  946. X   be examined for a match with the distribution categories listed, and
  947. X   only those articles which have at least one newsgroup belonging to
  948. X
  949. X
  950. XKantor & Lapsley                                               [Page 16]
  951. X
  952. X
  953. X
  954. XRFC 977                                                    February 1986
  955. XNetwork News Transfer Protocol
  956. X
  957. X
  958. X   the list of distributions will be listed.  If more than one
  959. X   distribution group is to be supplied, they must be separated by
  960. X   commas within the angle brackets.
  961. X
  962. X   The use of the IHAVE, NEWNEWS, and NEWGROUPS commands to distribute
  963. X   news is discussed in an earlier part of this document.
  964. X
  965. X   Please note that an empty list (i.e., the text body returned by this
  966. X   command consists only of the terminating period) is a possible valid
  967. X   response, and indicates that there is currently no new news.
  968. X
  969. X3.8.2.  Responses
  970. X
  971. X   230 list of new articles by message-id follows
  972. X
  973. X3.9.  The NEXT command
  974. X
  975. X3.9.1.  NEXT
  976. X
  977. X   NEXT
  978. X
  979. X   The internally maintained "current article pointer" is advanced to
  980. X   the next article in the current newsgroup.  If no more articles
  981. X   remain in the current group, an error message is returned and the
  982. X   current article remains selected.
  983. X
  984. X   The internally-maintained "current article pointer" is set by this
  985. X   command.
  986. X
  987. X   A response indicating the current article number, and the message-id
  988. X   string will be returned.  No text is sent in response to this
  989. X   command.
  990. X
  991. X3.9.2.  Responses
  992. X
  993. X   223 n a article retrieved - request text separately
  994. X           (n = article number, a = unique article id)
  995. X   412 no newsgroup selected
  996. X   420 no current article has been selected
  997. X   421 no next article in this group
  998. X
  999. X
  1000. X
  1001. X
  1002. X
  1003. X
  1004. X
  1005. X
  1006. X
  1007. XKantor & Lapsley                                               [Page 17]
  1008. X
  1009. X
  1010. X
  1011. XRFC 977                                                    February 1986
  1012. XNetwork News Transfer Protocol
  1013. X
  1014. X
  1015. X3.10.  The POST command
  1016. X
  1017. X3.10.1.  POST
  1018. X
  1019. X   POST
  1020. X
  1021. X   If posting is allowed, response code 340 is returned to indicate that
  1022. X   the article to be posted should be sent. Response code 440 indicates
  1023. X   that posting is prohibited for some installation-dependent reason.
  1024. X
  1025. X   If posting is permitted, the article should be presented in the
  1026. X   format specified by RFC850, and should include all required header
  1027. X   lines. After the article's header and body have been completely sent
  1028. X   by the client to the server, a further response code will be returned
  1029. X   to indicate success or failure of the posting attempt.
  1030. X
  1031. X   The text forming the header and body of the message to be posted
  1032. X   should be sent by the client using the conventions for text received
  1033. X   from the news server:  A single period (".") on a line indicates the
  1034. X   end of the text, with lines starting with a period in the original
  1035. X   text having that period doubled during transmission.
  1036. X
  1037. X   No attempt shall be made by the server to filter characters, fold or
  1038. X   limit lines, or otherwise process incoming text.  It is our intent
  1039. X   that the server just pass the incoming message to be posted to the
  1040. X   server installation's news posting software, which is separate from
  1041. X   this specification.  See RFC850 for more details.
  1042. X
  1043. X   Since most installations will want the client news program to allow
  1044. X   the user to prepare his message using some sort of text editor, and
  1045. X   transmit it to the server for posting only after it is composed, the
  1046. X   client program should take note of the herald message that greeted it
  1047. X   when the connection was first established. This message indicates
  1048. X   whether postings from that client are permitted or not, and can be
  1049. X   used to caution the user that his access is read-only if that is the
  1050. X   case. This will prevent the user from wasting a good deal of time
  1051. X   composing a message only to find posting of the message was denied.
  1052. X   The method and determination of which clients and hosts may post is
  1053. X   installation dependent and is not covered by this specification.
  1054. X
  1055. X3.10.2.  Responses
  1056. X
  1057. X   240 article posted ok
  1058. X   340 send article to be posted. End with <CR-LF>.<CR-LF>
  1059. X   440 posting not allowed
  1060. X   441 posting failed
  1061. X
  1062. X
  1063. X
  1064. XKantor & Lapsley                                               [Page 18]
  1065. X
  1066. X
  1067. X
  1068. XRFC 977                                                    February 1986
  1069. XNetwork News Transfer Protocol
  1070. X
  1071. X
  1072. X   (for reference, one of the following codes will be sent upon initial
  1073. X   connection; the client program should determine whether posting is
  1074. X   generally permitted from these:) 200 server ready - posting allowed
  1075. X   201 server ready - no posting allowed
  1076. X
  1077. X3.11.  The QUIT command
  1078. X
  1079. X3.11.1.  QUIT
  1080. X
  1081. X   QUIT
  1082. X
  1083. X   The server process acknowledges the QUIT command and then closes the
  1084. X   connection to the client.  This is the preferred method for a client
  1085. X   to indicate that it has finished all its transactions with the NNTP
  1086. X   server.
  1087. X
  1088. X   If a client simply disconnects (or the connection times out, or some
  1089. X   other fault occurs), the server should gracefully cease its attempts
  1090. X   to service the client.
  1091. X
  1092. X3.11.2.  Responses
  1093. X
  1094. X   205 closing connection - goodbye!
  1095. X
  1096. X3.12.  The SLAVE command
  1097. X
  1098. X3.12.1.  SLAVE
  1099. X
  1100. X   SLAVE
  1101. X
  1102. X   Indicates to the server that this client connection is to a slave
  1103. X   server, rather than a user.
  1104. X
  1105. X   This command is intended for use in separating connections to single
  1106. X   users from those to subsidiary ("slave") servers.  It may be used to
  1107. X   indicate that priority should therefore be given to requests from
  1108. X   this client, as it is presumably serving more than one person.  It
  1109. X   might also be used to determine which connections to close when
  1110. X   system load levels are exceeded, perhaps giving preference to slave
  1111. X   servers.  The actual use this command is put to is entirely
  1112. X   implementation dependent, and may vary from one host to another.  In
  1113. X   NNTP servers which do not give priority to slave servers, this
  1114. X   command must nonetheless be recognized and acknowledged.
  1115. X
  1116. X3.12.2.  Responses
  1117. X
  1118. X   202 slave status noted
  1119. X
  1120. X
  1121. XKantor & Lapsley                                               [Page 19]
  1122. X
  1123. X
  1124. X
  1125. XRFC 977                                                    February 1986
  1126. XNetwork News Transfer Protocol
  1127. X
  1128. X
  1129. X4.  Sample Conversations
  1130. X
  1131. X   These are samples of the conversations that might be expected with
  1132. X   the news server in hypothetical sessions.  The notation C: indicates
  1133. X   commands sent to the news server from the client program; S: indicate
  1134. X   responses received from the server by the client.
  1135. X
  1136. X4.1.  Example 1 - relative access with NEXT
  1137. X
  1138. X   S:      (listens at TCP port 119)
  1139. X
  1140. X   C:      (requests connection on TCP port 119)
  1141. X   S:      200 wombatvax news server ready - posting ok
  1142. X
  1143. X   (client asks for a current newsgroup list)
  1144. X   C:      LIST
  1145. X   S:      215 list of newsgroups follows
  1146. X   S:      net.wombats 00543 00501 y
  1147. X   S:      net.unix-wizards 10125 10011 y
  1148. X           (more information here)
  1149. X   S:      net.idiots 00100 00001 n
  1150. X   S:      .
  1151. X
  1152. X   (client selects a newsgroup)
  1153. X   C:      GROUP net.unix-wizards
  1154. X   S:      211 104 10011 10125 net.unix-wizards group selected
  1155. X           (there are 104 articles on file, from 10011 to 10125)
  1156. X
  1157. X   (client selects an article to read)
  1158. X   C:      STAT 10110
  1159. X   S:      223 10110 <23445@sdcsvax.ARPA> article retrieved - statistics
  1160. X           only (article 10110 selected, its message-id is
  1161. X           <23445@sdcsvax.ARPA>)
  1162. X
  1163. X   (client examines the header)
  1164. X   C:      HEAD
  1165. X   S:      221 10110 <23445@sdcsvax.ARPA> article retrieved - head
  1166. X           follows (text of the header appears here)
  1167. X   S:      .
  1168. X
  1169. X   (client wants to see the text body of the article)
  1170. X   C:      BODY
  1171. X   S:      222 10110 <23445@sdcsvax.ARPA> article retrieved - body
  1172. X           follows (body text here)
  1173. X   S:      .
  1174. X
  1175. X   (client selects next article in group)
  1176. X
  1177. X
  1178. XKantor & Lapsley                                               [Page 20]
  1179. X
  1180. X
  1181. X
  1182. XRFC 977                                                    February 1986
  1183. XNetwork News Transfer Protocol
  1184. X
  1185. X
  1186. X   C:      NEXT
  1187. X   S:      223 10113 <21495@nudebch.uucp> article retrieved - statistics
  1188. X           only (article 10113 was next in group)
  1189. X
  1190. X   (client finishes session)
  1191. X   C:      QUIT
  1192. X   S:      205 goodbye.
  1193. X
  1194. X4.2.  Example 2 - absolute article access with ARTICLE
  1195. X
  1196. X   S:      (listens at TCP port 119)
  1197. X
  1198. X   C:      (requests connection on TCP port 119)
  1199. X   S:      201 UCB-VAX netnews server ready -- no posting allowed
  1200. X
  1201. X   C:      GROUP msgs
  1202. X   S:      211 103 402 504 msgs Your new group is msgs
  1203. X           (there are 103 articles, from 402 to 504)
  1204. X
  1205. X   C:      ARTICLE 401
  1206. X   S:      423 No such article in this newsgroup
  1207. X
  1208. X   C:      ARTICLE 402
  1209. X   S:      220 402 <4105@ucbvax.ARPA> Article retrieved, text follows
  1210. X   S:      (article header and body follow)
  1211. X   S:      .
  1212. X
  1213. X   C:      HEAD 403
  1214. X   S:      221 403 <3108@mcvax.UUCP> Article retrieved, header follows
  1215. X   S:      (article header follows)
  1216. X   S:      .
  1217. X
  1218. X   C:      QUIT
  1219. X   S:      205 UCB-VAX news server closing connection.  Goodbye.
  1220. X
  1221. X4.3.  Example 3 - NEWGROUPS command
  1222. X
  1223. X   S:      (listens at TCP port 119)
  1224. X
  1225. X   C:      (requests connection on TCP port 119)
  1226. X   S:      200 Imaginary Institute News Server ready (posting ok)
  1227. X
  1228. X   (client asks for new newsgroups since April 3, 1985)
  1229. X   C:      NEWGROUPS 850403 020000
  1230. X
  1231. X   S:      231 New newsgroups since 03/04/85 02:00:00 follow
  1232. X
  1233. X
  1234. X
  1235. XKantor & Lapsley                                               [Page 21]
  1236. X
  1237. X
  1238. X
  1239. XRFC 977                                                    February 1986
  1240. XNetwork News Transfer Protocol
  1241. X
  1242. X
  1243. X   S:      net.music.gdead
  1244. X   S:      net.games.sources
  1245. X   S:      .
  1246. X
  1247. X   C:      GROUP net.music.gdead
  1248. X   S:      211 0 1 1 net.music.gdead Newsgroup selected
  1249. X           (there are no articles in that newsgroup, and
  1250. X           the first and last article numbers should be ignored)
  1251. X
  1252. X   C:      QUIT
  1253. X   S:      205 Imaginary Institute news server ceasing service.  Bye!
  1254. X
  1255. X4.4.  Example 4 - posting a news article
  1256. X
  1257. X   S:      (listens at TCP port 119)
  1258. X
  1259. X   C:      (requests connection on TCP port 119)
  1260. X   S:      200 BANZAIVAX news server ready, posting allowed.
  1261. X
  1262. X   C:      POST
  1263. X   S:      340 Continue posting; Period on a line by itself to end
  1264. X   C:      (transmits news article in RFC850 format)
  1265. X   C:      .
  1266. X   S:      240 Article posted successfully.
  1267. X
  1268. X   C:      QUIT
  1269. X   S:      205 BANZAIVAX closing connection.  Goodbye.
  1270. X
  1271. X4.5.  Example 5 - interruption due to operator request
  1272. X
  1273. X   S:      (listens at TCP port 119)
  1274. X
  1275. X   C:      (requests connection on TCP port 119)
  1276. X   S:      201 genericvax news server ready, no posting allowed.
  1277. X
  1278. X           (assume normal conversation for some time, and
  1279. X           that a newsgroup has been selected)
  1280. X
  1281. X   C:      NEXT
  1282. X   S:      223 1013 <5734@mcvax.UUCP> Article retrieved; text separate.
  1283. X
  1284. X   C:      HEAD
  1285. X   C:      221 1013 <5734@mcvax.UUCP> Article retrieved; head follows.
  1286. X
  1287. X   S:      (sends head of article, but halfway through is
  1288. X           interrupted by an operator request.  The following
  1289. X           then occurs, without client intervention.)
  1290. X
  1291. X
  1292. XKantor & Lapsley                                               [Page 22]
  1293. X
  1294. X
  1295. X
  1296. XRFC 977                                                    February 1986
  1297. XNetwork News Transfer Protocol
  1298. X
  1299. X
  1300. X   S:      (ends current line with a CR-LF pair)
  1301. X   S:      .
  1302. X   S:      400 Connection closed by operator.  Goodbye.
  1303. X   S:      (closes connection)
  1304. X
  1305. X4.6.  Example 6 - Using the news server to distribute news between
  1306. X      systems.
  1307. X
  1308. X   S:      (listens at TCP port 119)
  1309. X
  1310. X   C:      (requests connection on TCP port 119)
  1311. X   S:      201 Foobar NNTP server ready (no posting)
  1312. X
  1313. X   (client asks for new newsgroups since 2 am, May 15, 1985)
  1314. X   C:      NEWGROUPS 850515 020000
  1315. X   S:      235 New newsgroups since 850515 follow
  1316. X   S:      net.fluff
  1317. X   S:      net.lint
  1318. X   S:      .
  1319. X
  1320. X   (client asks for new news articles since 2 am, May 15, 1985)
  1321. X   C:      NEWNEWS * 850515 020000
  1322. X   S:      230 New news since 850515 020000 follows
  1323. X   S:      <1772@foo.UUCP>
  1324. X   S:      <87623@baz.UUCP>
  1325. X   S:      <17872@GOLD.CSNET>
  1326. X   S:      .
  1327. X
  1328. X   (client asks for article <1772@foo.UUCP>)
  1329. X   C:      ARTICLE <1772@foo.UUCP>
  1330. X   S:      220 <1772@foo.UUCP> All of article follows
  1331. X   S:      (sends entire message)
  1332. X   S:      .
  1333. X
  1334. X   (client asks for article <87623@baz.UUCP>
  1335. X   C:      ARTICLE <87623@baz.UUCP>
  1336. X   S:      220 <87623@baz.UUCP> All of article follows
  1337. X   S:      (sends entire message)
  1338. X   S:      .
  1339. X
  1340. X   (client asks for article <17872@GOLD.CSNET>
  1341. X   C:      ARTICLE <17872@GOLD.CSNET>
  1342. X   S:      220 <17872@GOLD.CSNET> All of article follows
  1343. X   S:      (sends entire message)
  1344. X   S:      .
  1345. X
  1346. X
  1347. X
  1348. X
  1349. XKantor & Lapsley                                               [Page 23]
  1350. X
  1351. X
  1352. X
  1353. XRFC 977                                                    February 1986
  1354. XNetwork News Transfer Protocol
  1355. X
  1356. X
  1357. X   (client offers an article it has received recently)
  1358. X   C:      IHAVE <4105@ucbvax.ARPA>
  1359. X   S:      435 Already seen that one, where you been?
  1360. X
  1361. X   (client offers another article)
  1362. X   C:      IHAVE <4106@ucbvax.ARPA>
  1363. X   S:      335 News to me!  <CRLF.CRLF> to end.
  1364. X   C:      (sends article)
  1365. X   C:      .
  1366. X   S:      235 Article transferred successfully.  Thanks.
  1367. X
  1368. X   (or)
  1369. X
  1370. X   S:      436 Transfer failed.
  1371. X
  1372. X   (client is all through with the session)
  1373. X   C:      QUIT
  1374. X   S:      205 Foobar NNTP server bids you farewell.
  1375. X
  1376. X4.7.  Summary of commands and responses.
  1377. X
  1378. X   The following are the commands recognized and responses returned by
  1379. X   the NNTP server.
  1380. X
  1381. X4.7.1.  Commands
  1382. X
  1383. X   ARTICLE
  1384. X   BODY
  1385. X   GROUP
  1386. X   HEAD
  1387. X   HELP
  1388. X   IHAVE
  1389. X   LAST
  1390. X   LIST
  1391. X   NEWGROUPS
  1392. X   NEWNEWS
  1393. X   NEXT
  1394. X   POST
  1395. X   QUIT
  1396. X   SLAVE
  1397. X   STAT
  1398. X
  1399. X4.7.2.  Responses
  1400. X
  1401. X   100 help text follows
  1402. X   199 debug output
  1403. X
  1404. X
  1405. X
  1406. XKantor & Lapsley                                               [Page 24]
  1407. X
  1408. X
  1409. X
  1410. XRFC 977                                                    February 1986
  1411. XNetwork News Transfer Protocol
  1412. X
  1413. X
  1414. X   200 server ready - posting allowed
  1415. X   201 server ready - no posting allowed
  1416. X   202 slave status noted
  1417. X   205 closing connection - goodbye!
  1418. X   211 n f l s group selected
  1419. X   215 list of newsgroups follows
  1420. X   220 n <a> article retrieved - head and body follow 221 n <a> article
  1421. X   retrieved - head follows
  1422. X   222 n <a> article retrieved - body follows
  1423. X   223 n <a> article retrieved - request text separately 230 list of new
  1424. X   articles by message-id follows
  1425. X   231 list of new newsgroups follows
  1426. X   235 article transferred ok
  1427. X   240 article posted ok
  1428. X
  1429. X   335 send article to be transferred.  End with <CR-LF>.<CR-LF>
  1430. X   340 send article to be posted. End with <CR-LF>.<CR-LF>
  1431. X
  1432. X   400 service discontinued
  1433. X   411 no such news group
  1434. X   412 no newsgroup has been selected
  1435. X   420 no current article has been selected
  1436. X   421 no next article in this group
  1437. X   422 no previous article in this group
  1438. X   423 no such article number in this group
  1439. X   430 no such article found
  1440. X   435 article not wanted - do not send it
  1441. X   436 transfer failed - try again later
  1442. X   437 article rejected - do not try again.
  1443. X   440 posting not allowed
  1444. X   441 posting failed
  1445. X
  1446. X   500 command not recognized
  1447. X   501 command syntax error
  1448. X   502 access restriction or permission denied
  1449. X   503 program fault - command not performed
  1450. X
  1451. X4.8.  A Brief Word about the USENET News System
  1452. X
  1453. X   In the UNIX world, which traditionally has been linked by 1200 baud
  1454. X   dial-up telephone lines, the USENET News system has evolved to handle
  1455. X   central storage, indexing, retrieval, and distribution of news.  With
  1456. X   the exception of its underlying transport mechanism (UUCP), USENET
  1457. X   News is an efficient means of providing news and bulletin service to
  1458. X   subscribers on UNIX and other hosts worldwide.  The USENET News
  1459. X
  1460. X
  1461. X
  1462. X
  1463. XKantor & Lapsley                                               [Page 25]
  1464. X
  1465. X
  1466. X
  1467. XRFC 977                                                    February 1986
  1468. XNetwork News Transfer Protocol
  1469. X
  1470. X
  1471. X   system is discussed in detail in RFC 850.  It runs on most versions
  1472. X   of UNIX and on many other operating systems, and is customarily
  1473. X   distributed without charge.
  1474. X
  1475. X   USENET uses a spooling area on the UNIX host to store news articles,
  1476. X   one per file. Each article consists of a series of heading text,
  1477. X   which contain the sender's identification and organizational
  1478. X   affiliation, timestamps, electronic mail reply paths, subject,
  1479. X   newsgroup (subject category), and the like.  A complete news article
  1480. X   is reproduced in its entirety below.  Please consult RFC 850 for more
  1481. X   details.
  1482. X
  1483. X      Relay-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site
  1484. X      sdcsvax.UUCP
  1485. X      Posting-Version: version B 2.10.1 6/24/83 SMI; site unitek.uucp
  1486. X      Path:sdcsvax!sdcrdcf!hplabs!qantel!ihnp4!alberta!ubc-vision!unitek
  1487. X      !honman
  1488. X      From: honman@unitek.uucp (Man Wong)
  1489. X      Newsgroups: net.unix-wizards
  1490. X      Subject: foreground -> background ?
  1491. X      Message-ID: <167@unitek.uucp>
  1492. X      Date: 25 Sep 85 23:51:52 GMT
  1493. X      Date-Received: 29 Sep 85 09:54:48 GMT
  1494. X      Reply-To: honman@unitek.UUCP (Hon-Man Wong)
  1495. X      Distribution: net.all
  1496. X      Organization: Unitek Technologies Corporation
  1497. X      Lines: 12
  1498. X
  1499. X      I have a process (C program) which generates a child and waits for
  1500. X      it to return.  What I would like to do is to be able to run the
  1501. X      child process interactively for a while before kicking itself into
  1502. X      the background so I can return to the parent process (while the
  1503. X      child process is RUNNING in the background).  Can it be done?  And
  1504. X      if it can, how?
  1505. X
  1506. X      Please reply by E-mail.  Thanks in advance.
  1507. X
  1508. X      Hon-Man Wong
  1509. X
  1510. X
  1511. X
  1512. X
  1513. X
  1514. X
  1515. X
  1516. X
  1517. X
  1518. X
  1519. X
  1520. XKantor & Lapsley                                               [Page 26]
  1521. X
  1522. X
  1523. X
  1524. XRFC 977                                                    February 1986
  1525. XNetwork News Transfer Protocol
  1526. X
  1527. X
  1528. X5.  References
  1529. X
  1530. X   [1]  Crocker, D., "Standard for the Format of ARPA Internet Text
  1531. X        Messages", RFC-822, Department of Electrical Engineering,
  1532. X        University of Delaware, August, 1982.
  1533. X
  1534. X   [2]  Horton, M., "Standard for Interchange of USENET Messages",
  1535. X        RFC-850, USENET Project, June, 1983.
  1536. X
  1537. X   [3]  Postel, J., "Transmission Control Protocol- DARPA Internet
  1538. X        Program Protocol Specification", RFC-793, USC/Information
  1539. X        Sciences Institute, September, 1981.
  1540. X
  1541. X   [4]  Postel, J., "Simple Mail Transfer Protocol", RFC-821,
  1542. X        USC/Information Sciences Institute, August, 1982.
  1543. X
  1544. X6.  Acknowledgements
  1545. X
  1546. X   The authors wish to express their heartfelt thanks to those many
  1547. X   people who contributed to this specification, and especially to Erik
  1548. X   Fair and Chuq von Rospach, without whose inspiration this whole thing
  1549. X   would not have been necessary.
  1550. X
  1551. X7.  Notes
  1552. X
  1553. X   <1> UNIX is a trademark of Bell Laboratories.
  1554. X
  1555. X
  1556. X
  1557. X
  1558. X
  1559. X
  1560. X
  1561. X
  1562. X
  1563. X
  1564. X
  1565. X
  1566. X
  1567. X
  1568. X
  1569. X
  1570. X
  1571. X
  1572. X
  1573. X
  1574. X
  1575. X
  1576. X
  1577. XKantor & Lapsley                                               [Page 27]
  1578. X
  1579. END_OF_FILE
  1580.   if test 53460 -ne `wc -c <'nntp/rfc977'`; then
  1581.     echo shar: \"'nntp/rfc977'\" unpacked with wrong size!
  1582.   fi
  1583.   # end of 'nntp/rfc977'
  1584. fi
  1585. if test ! -d 'utils' ; then
  1586.     echo shar: Creating directory \"'utils'\"
  1587.     mkdir 'utils'
  1588. fi
  1589. if test -f 'utils/mofs.c' -a "${1}" != "-c" ; then 
  1590.   echo shar: Will not clobber existing file \"'utils/mofs.c'\"
  1591. else
  1592.   echo shar: Extracting \"'utils/mofs.c'\" \(2716 characters\)
  1593.   sed "s/^X//" >'utils/mofs.c' <<'END_OF_FILE'
  1594. X/******************************************************************************
  1595. X* Module    :   Used for debugging UNPOST, this routine will start doing
  1596. X*               a MORE at the specified offset in the file.
  1597. X*
  1598. X* Author    :   John W. M. Stevens
  1599. X******************************************************************************/
  1600. X
  1601. X#include    <stdio.h>
  1602. X#include    <stdlib.h>
  1603. X#include    <string.h>
  1604. X
  1605. Xvoid    main(int    argc,
  1606. X             char   **argv)
  1607. X{
  1608. X    register    int     i;
  1609. X    register    int     j;
  1610. X    auto        FILE    *FlPtr;
  1611. X    auto        long    Ofs;
  1612. X    static      char    Bfr[513];
  1613. X
  1614. X    /*  Check the command line arguments.   */
  1615. X    if (argc != 3)
  1616. X    {
  1617. X        fprintf(stderr,
  1618. X                "%s %d : Error - Syntax is: mofs <+ofs> <file name>\n",
  1619. X                __FILE__,
  1620. X                __LINE__);
  1621. X        exit( 1 );
  1622. X    }
  1623. X
  1624. X    /*  Get the offset. */
  1625. X    if (argv[1][0] != '+')
  1626. X    {
  1627. X        fprintf(stderr,
  1628. X                "%s %d : Error - Syntax is: mofs <+ofs> <file name>\n",
  1629. X                __FILE__,
  1630. X                __LINE__);
  1631. X        exit( 1 );
  1632. X    }
  1633. X    Ofs = atol(argv[1] + 1);
  1634. X
  1635. X    /*  Open the file to more.  */
  1636. X    if ((FlPtr = fopen(argv[2], "r")) == NULL)
  1637. X    {
  1638. X        fprintf(stderr,
  1639. X                "%s %d : Error - %s\n",
  1640. X                __FILE__,
  1641. X                __LINE__,
  1642. X                sys_errlist[errno]);
  1643. X        exit( 1 );
  1644. X    }
  1645. X
  1646. X    /*  Position the file pointer.  */
  1647. X    if ( fseek(FlPtr, Ofs, SEEK_SET) )
  1648. X    {
  1649. X        fprintf(stderr,
  1650. X                "%s %d : Error - %s\n",
  1651. X                __FILE__,
  1652. X                __LINE__,
  1653. X                sys_errlist[errno]);
  1654. X        exit( 1 );
  1655. X    }
  1656. X
  1657. X    /*  More the file.  */
  1658. X    for ( ; ; )
  1659. X    {
  1660. X        /*  Dump out lines. */
  1661. X        for (i = 0; i < 24; i++)
  1662. X        {
  1663. X            /*  Get a line. */
  1664. X            if (fgets(Bfr, 512, FlPtr) == NULL)
  1665. X                exit( 0 );
  1666. X
  1667. X            /*  Check for auto scroll.  */
  1668. X            j = strlen( Bfr );
  1669. X            if (j > 80)
  1670. X                i += j / 80;
  1671. X            fputs(Bfr, stdout);
  1672. X        }
  1673. X
  1674. X        /*  Get the input from the user.    */
  1675. X        fgets(Bfr, 512, stdin);
  1676. X        if (*Bfr >= '0' && *Bfr <= '9')
  1677. X        {
  1678. X            /*  Get the offset. */
  1679. X            Ofs = atol( Bfr );
  1680. X
  1681. X            /*  Position the file pointer.  */
  1682. X            if ( fseek(FlPtr, Ofs, SEEK_SET) )
  1683. X            {
  1684. X                fprintf(stderr,
  1685. X                        "%s %d : Error - %s\n",
  1686. X                        __FILE__,
  1687. X                        __LINE__,
  1688. X                        sys_errlist[errno]);
  1689. X                exit( 1 );
  1690. X            }
  1691. X        }
  1692. X        else if (*Bfr == 'q' || *Bfr == 'Q')
  1693. X            break;
  1694. X    }
  1695. X
  1696. X    /*  Close the file. */
  1697. X    fclose( FlPtr );
  1698. X}
  1699. END_OF_FILE
  1700.   if test 2716 -ne `wc -c <'utils/mofs.c'`; then
  1701.     echo shar: \"'utils/mofs.c'\" unpacked with wrong size!
  1702.   fi
  1703.   # end of 'utils/mofs.c'
  1704. fi
  1705. echo shar: End of archive 1 \(of 7\).
  1706. cp /dev/null ark1isdone
  1707. MISSING=""
  1708. for I in 1 2 3 4 5 6 7 ; do
  1709.     if test ! -f ark${I}isdone ; then
  1710.     MISSING="${MISSING} ${I}"
  1711.     fi
  1712. done
  1713. if test "${MISSING}" = "" ; then
  1714.     echo You have unpacked all 7 archives.
  1715.     rm -f ark[1-9]isdone
  1716. else
  1717.     echo You still must unpack the following archives:
  1718.     echo "        " ${MISSING}
  1719. fi
  1720. exit 0
  1721. exit 0 # Just in case...
  1722.