home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / soup12.zip / SOUP12.DOC
Text File  |  1993-08-17  |  40KB  |  839 lines

  1.            Simple Offline USENET Packet Format (SOUP) Version 1.2
  2.  
  3.               Copyright (c) 1992-1993 Rhys Weatherley
  4.  
  5.                     rhys@cs.uq.oz.au
  6.  
  7.                       Last Update: 14 August 1993
  8.  
  9. DISTRIBUTION
  10.  
  11. Permission to use, copy, and distribute this material for any purpose
  12. and without fee is hereby granted, provided that the above copyright notice
  13. and this permission notice appear in all copies, and that the name of Rhys
  14. Weatherley not be used in advertising or publicity pertaining to this material
  15. without specific, prior written permission.  RHYS WEATHERLEY MAKES NO
  16. REPRESENTATIONS ABOUT THE ACCURACY OR SUITABILITY OF THIS MATERIAL FOR ANY
  17. PURPOSE.  IT IS PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
  18.  
  19. NOTE: This document is NOT in the public domain.  It is copyrighted.
  20. However, the free distribution of this document is unlimited.
  21.  
  22. If you create a product which uses this packet format, it is suggested
  23. that you include an UNMODIFIED copy of this document to inform your users
  24. as to the packet format.  All queries about this format, or requests for
  25. the latest version should be directed to Rhys Weatherley at the above
  26. e-mail address.
  27.  
  28. INTRODUCTION
  29.  
  30. For many years, the FidoNet community has been using QWK and other formats to
  31. enable users to download their mail and conferences to be read while off-line.
  32. This not only saves phone charges and prevents tying up BBS lines for long
  33. periods of time; it also allows a user to use much more powerful tools on
  34. their own machine to process the downloaded "packets" than what can be made
  35. available in an on-line environment.
  36.  
  37. To date however, very little work has been done in the USENET and dial-in Unix
  38. community to facilitate the same user operations.  Some attempts have been
  39. made to use QWK, but due to QWK's limitations and unsuitability for the USENET
  40. message formats, such efforts have not been very successful.
  41.  
  42. Within USENET, the tendency seems to be either "dial-in to some other machine
  43. and put up with it", or "set up your own USENET site".  The former keeps the
  44. user at the mercy of whatever user interfaces the admin of the other machine
  45. sees fit to install, and the latter requires far more computing knowledge than
  46. the average computer user is expected to have.  Both of these can serve to
  47. lock out large portions of the computer-literate public from experiencing
  48. USENET.  The latter option can also give rise to security problems in the form
  49. of forged USENET messages, which a more controlled dial-in system avoids.
  50.  
  51. The purpose of this document is to define a new packet format which is aware
  52. of the conventions used in the USENET community, forming a middle ground
  53. between dial-in user interfaces and full USENET connectivity.  It is not
  54. limited to downloading USENET news however.  The same format could be used
  55. to enable a Unix user to package up their Unix mailbox and download it for
  56. later perusal.  The format is extensible to other kinds of news or conference
  57. systems, so it is feasible, although not yet defined, that QWK or FidoNet
  58. messages could be accomodated within the same packet as USENET messages.
  59.  
  60. REVISION HISTORY
  61.  
  62. 1.2    Add COMMANDS and ERRORS files.  Renamed to "Simple Offline USENET
  63.     Packet Format".  A few extra fields and type codes for the AREAS and
  64.     LIST files.  Message area summaries.
  65.  
  66. 1.1    Add description of the LIST file.  Everything else is identical to 1.0.
  67.  
  68. 1.0    Original version of the document.
  69.  
  70. Previously, this document was known as the "Helldiver Packet Format" (HDPF).
  71. A variant of HDPF, called the "Simple Local News Packet format" (SLNP) was
  72. created by Philippe Goujard (ppg@oasis.icl.co.uk).  This document combines
  73. the features of both previous formats and the name was changed to make it
  74. less product-oriented.
  75.  
  76. TERMINOLOGY
  77.  
  78. Packet: a set of files, collected into a compressed archive.
  79.  
  80. Message packet: the primary kind of packet which contains messages for
  81.     the user to read.
  82.  
  83. Reply packet: a special kind of packet which contains replies composed by
  84.     the user, usually in response to the messages in a message packet.
  85.  
  86. Packet generator: a program which generates packets to be downloaded and
  87.     read, and which processes uploaded reply packets.
  88.  
  89. Packet reader: a program which reads packets, usually by presenting the
  90.     messages in a packet to the user, and which generates reply packets.
  91.  
  92. Packet processor: either a packet generator or a packet reader.
  93.  
  94. Generating host: the computer on which the packet generator executes.
  95.  
  96. Reading host: the computer on which the packet reader executes.
  97.  
  98. Download: the transfer of a packet from the generating host to the reading
  99.     host.  This transfer may take place in any fashion, although the
  100.     most common method is through the use of a file transfer protocol
  101.     such as Zmodem or Kermit.
  102.  
  103. Upload: the transfer of a packet from the reading host to the generating host.
  104.  
  105. Packet stream: a logical link between the generating and reading hosts over
  106.     which downloads and uploads of packets take place.
  107.  
  108. Message area: a collection of messages which are related by a common topic
  109.     or purpose.  Examples of message areas include USENET newsgroups,
  110.     Unix mailboxes, and FidoNet conferences.
  111.  
  112. Reply message area: a special kind of message area which contains replies
  113.     being uploaded to a generating host.
  114.  
  115. Text file: an ASCII file consisting of lines terminated by linefeed characters
  116.     (LF, 10 decimal).  Some operating systems terminate lines in a text
  117.     file by CRLF pairs: such files must be converted to LF-terminated
  118.     lines for transmission in a packet.
  119.  
  120. ANATOMY OF A PACKET
  121.  
  122. A packet is a group of files, collected into a compressed archive.  The
  123. standard compression technique defined by this document is ZIP.  Other
  124. techniques such as ARJ, ZOO, ARC, LZH, etc can also be used.  It is also
  125. possible for Unix's tar.Z format to be used to transmit packets.  The minimum
  126. requirement is a method to collect a group of files into a single packet,
  127. and a method to expand the packet back into the original files.  ZIP is
  128. specified to provide a common compression format for packet processors.
  129. Each of the filenames in a packet should be stored in upper case on those
  130. systems where case matters (e.g. Unix).
  131.  
  132. The following file specifications may appear in a packet:
  133.  
  134.     INFO        Optional textual information.
  135.     LIST        List of message areas on the generating host.
  136.     AREAS        Index of the message areas within the packet.
  137.     REPLIES        Index of the reply message areas from the reading host.
  138.     *.MSG        Text of the messages in a particular message area.
  139.     *.IDX        Index information for messages in a message area.
  140.     COMMANDS    Extra commands sent along with a packet.
  141.     ERRORS        Errors that occurred during the execution of commands.
  142.  
  143. Other filenames may also appear in the packet, but are not defined by this
  144. specification, so they should be avoided by generating software, and ignored
  145. by receiving software.
  146.  
  147. The INFO file is an optional text file which may contain any kind of textual
  148. information from the generating system.  Typically this file would only be
  149. present if there is some kind of urgent message that must be sent to the
  150. receiving user.  Use of this file to store the name of the generating host
  151. and other such static information is possible, but discouraged to save space
  152. and transmission time.  If such information is required, then the COMMANDS
  153. file can be used to transfer it.
  154.  
  155. The LIST file is an optional text file which contains a list of all message
  156. areas that are available on the generating host, together with the format of
  157. the messages.  It is specified further in the section "LIST FILE".
  158.  
  159. The AREAS file is a text file which contains an index of the message areas
  160. present within the packet, specifying the name of the message area, the
  161. filename the messages may be found in, and the message format.  This is
  162. specified further in the next section.
  163.  
  164. The REPLIES file is a text file which contains an index of the message areas
  165. present within the packet that contain replies from the user which should
  166. be mailed or posted on the generating host.  In most cases, a packet will
  167. contain either an AREAS file or a REPLIES file, but both may be present.
  168. See the section "REPLIES FILE" below for more information.
  169.  
  170. The *.MSG files contain the text of the messages from a single message area.
  171. The actual format of this file depends on the type of message area specified
  172. in the AREAS file.  See the section "MESSAGE FILES" below for more information.
  173.  
  174. The *.IDX files provide an index into the *.MSG files, usually specifying
  175. where each message starts and the contents of some of the common message
  176. header fields.  These files are intended for use by reading software on the
  177. recipient's system to quickly display an overview of the messages present in
  178. a message area.  See the section "INDEX FILES" below for more information.
  179.  
  180. The COMMANDS file is a text file which contains commands to be executed on
  181. the reading or generating hosts to change the behaviour of the hosts at
  182. each end of a packet stream.  The ERRORS file contains textual error messages
  183. to report to a human at the host the packet is destined for.  These two files
  184. are explained further in the section "SENDING COMMANDS BETWEEN SYSTEMS" below.
  185.  
  186. AREAS FILE
  187.  
  188. The AREAS file is a text file containing zero or more lines, each of which
  189. specifies a single message area, its encoding and the name of the message/index
  190. file pair in which the messages appear.  In particular, each line has the
  191. following form:
  192.  
  193.     prefix<TAB>area name<TAB>encoding[<TAB>description[<TAB>number]]
  194.  
  195. where "prefix" specifies the name of the message/index file pair, "area name"
  196. is the name of the message area, "encoding" specifies the formats of the
  197. message and index files and the type of message area, "description" is a
  198. descriptive name for the message area, and "number" is the number of messages
  199. in the message file.  The last two fields are optional.  Additional fields may
  200. be added in a future version of this specification.
  201.  
  202. The message and index files corresponding to the message area have the names
  203. "prefix.MSG" and "prefix.IDX" respectively.  If "prefix" contains alphabetic
  204. characters, they must be upper case.
  205.  
  206. The message area name may be any sequence of printable ASCII characters (space
  207. through tilde).  Under USENET, this is typically a dotted name like
  208. "comp.lang.c".  Other networks may include spaces or other unusual characters
  209. in the area names, so the receiving software must be aware of this fact,
  210. and act accordingly.  Also, receiving software must deal gracefully with
  211. characters that have the high bit set, or names that contain control
  212. characters, since people in other countries that speak a language other than
  213. English may wish to use their country's native encoding for the message area
  214. name.  The only hard rule is that the name may not contain TAB, CR or LF.
  215. Receiving software should treat the name as an indivisible string to be
  216. displayed to the user.
  217.  
  218. The encoding field consists of two or three ASCII characters (usually
  219. alphabetic).  The first specifies the format of the message file, the second
  220. specifies the format of the index file, and the optional third specifies the
  221. kind of area (private or public).  The following message file formats are
  222. currently defined (case is significant):
  223.  
  224.     u    USENET news articles
  225.     m    Unix mailbox articles
  226.     M    Mailbox articles in the MMDF format
  227.     b    Binary 8-bit clean mail format
  228.     B    Binary 8-bit clean news format
  229.     i    Index file only
  230.  
  231. The individual message file encodings are explained further in the next
  232. section.  The format 'i' indicates that no message file is present, and
  233. the index file should be used as a summary of the messages in the message
  234. area.  This is explained further in the section "MESSAGE AREA SUMMARIES".
  235. The following index file formats are currently defined (again, case is
  236. significant):
  237.  
  238.     n    No index file
  239.     c    C-news overview database format
  240.     C    Shorter C-news overview database format
  241.     i    Offset/length pairs delineating the messages
  242.  
  243. These types are explained further in the section "INDEX FILES" below.
  244.  
  245. See the section "MINIMAL CONFORMANCE" for information on the minimal number
  246. of message and index formats that should be supported by packet generators
  247. and packet readers.
  248.  
  249. The following kind of message areas are currently defined (again, case is
  250. significant):
  251.  
  252.     m    The message area contains private mail
  253.     n    The message area contains public messages, or news
  254.     u    The message area kind is unknown (the default)
  255.  
  256. This third letter is optional.  If it is not present or unknown, the kind
  257. of area depends on the message file type.  Message types 'm', 'M', and 'b'
  258. default to kind 'm', and message types 'u', 'B' and 'i' default to kind 'n'.
  259. It is not recommended that the value 'u' for this third letter be used,
  260. although future versions of this specification may add additional letters,
  261. necessitating 'u' to be placed in the third letter if the kind is unknown.
  262. If the message area kind can be solely determined from the message file
  263. type, it is recommended that the third letter be omitted to save space and
  264. transmission time.
  265.  
  266. Further types may be defined in future versions of this specification.  If
  267. the packet processor does not recognise a message file type, it should ignore
  268. the corresponding message and index files.  If the packet processor does
  269. not recognise a index file type, it can either ignore the message file, or
  270. attempt to break down the message file into separate messages by some other
  271. means.  If the packet processor does not recognise a message area kind,
  272. the kind should be treated as unknown.  The user should be warned if a message
  273. area has been ignored.
  274.  
  275. The optional message area description in the AREAS file consists of any
  276. sequence of printable ASCII characters.  This may be used to insert a
  277. "readable" name for the message area.  It may not contain TAB, CR or LF.
  278.  
  279. A message area may appear more than once in the AREAS file, each time with a
  280. different prefix, but this is discouraged.  This could be used to split large
  281. message areas across more than one message file, but this is more conveniently
  282. handled by generating a separate packet containing the area contination.
  283.  
  284. The following examples demonstrate the capabilities of the AREAS file:
  285.  
  286. 0000000    Email    mn
  287. 0000001    comp.lang.c    uc    C Programming Language Discussions    125
  288. 0000002    news.future    Bc    Future of USENET    38
  289.  
  290. EMAIL    /usr/spool/mail/fred    unm    Private e-mail for fred
  291. U000001    comp.bbs.misc    MCn
  292. U000002 comp.bbs.waffle    ui
  293.  
  294. MESSAGE FILES
  295.  
  296. The format of the message file depends on the message file format specified in
  297. the AREAS file.  This version of the specification defines three formats,
  298. which are in common use in the USENET and Unix community, and two additional
  299. binary formats which permit messages to be stored with no modification or
  300. assumptions about line lengths and byte values.
  301.  
  302. For each of these formats, lines are terminated with LF characters.  Any CR
  303. characters in the messages should be considered as data characters, or ignored
  304. on receipt.  In particular, MS-DOS systems should strip CR characters from
  305. text messages before writing them to a packet.
  306.  
  307. A 'u' (USENET) message file is a text file consisting of one or more messages
  308. prefixed with an rnews header.  This header has the form "#! rnews n" where
  309. "n" is the number of bytes in the message that follows the header, excluding
  310. the line-feed character which terminates the header.  If the number in the
  311. header is followed by white space and other characters, these other characters
  312. should be ignored, until the terminating LF character is encountered.
  313.  
  314. A note about the rnews header: although a terser separator could be used, the
  315. rnews header has the following advantages: (a) the messages can be extracted
  316. in the absense of index files, or where the index files have an unknown type,
  317. and (b) the message files can be imported into a USENET system as standard
  318. rnews batches.  Thus, if the user wishes to set up a real USENET site, or
  319. simply use dedicated USENET software to read packets, they can use their
  320. existing packet provider as a convenient read-only newsfeed, with no extra
  321. burden placed on the system administrator of the generating system.
  322.  
  323. A 'm' (Unix mailbox) message file is a text file consisting of one or more
  324. messages.  The first line of each message must start with the character
  325. sequence "From ".  Any remaining lines in the message which start with
  326. "From " should have the character '>' prepended.  Thus the "From " lines
  327. delimit the message file into separate messages.
  328.  
  329. A 'M' (MMDF mailbox) message file is a sequence of one or more messages,
  330. separated by at least 4 Control-A characters.  The message file may optionally
  331. start and end with a sequence of such characters.  If a sequence of 4 or more
  332. Control-A characters occurs in a message, it should be "adjusted" by the
  333. insertion of spaces to split the sequence.  The use of Control-A characters
  334. within a message is discouraged.
  335.  
  336. The 'm' and 'M' formats were chosen for mail because of their common
  337. occurrence in the Unix community.  The generating system may elect to instead
  338. convert a mailbox into the USENET format if it wishes, and set the area kind
  339. to 'm' to inform the packet reader that the message area contains private
  340. e-mail rather than news.
  341.  
  342. The 'b' (binary mail) and 'B' (binary news) formats are identical.  The
  343. contents of each message must conform to RFC-822/1036 and may contain content
  344. information compatible with RFC-1341 (MIME).  The only difference between
  345. the messages of these formats and the preceding formats is that no assumption
  346. is made about line lengths, and any of the 256 values for a byte may be used
  347. in any position.  Each message is preceded by a 4-byte value which indicates
  348. the length of the message in bytes, stored in big-endian order (i.e. high
  349. byte first, low byte last).  The difference between 'b' and 'B' is a semantic
  350. one: message files of type 'b' are expected to contain mail messages, and
  351. message files of type 'B' are expected to contain news messages.  Thus, reader
  352. software can make a distinction between the two if it desires.
  353.  
  354. For most practical purposes, 'u', 'm' and 'M' should be sufficient.  The binary
  355. 'b' and 'B' types should be used for articles that contain 8-bit binary data.
  356. It is possible to use type 'u' for binary data as well, but 'm' and 'M'
  357. cannot be because the message contents may be modified.  When MIME becomes
  358. more wide-spread, it is expected that binary messages containing programs,
  359. sound, pictures and video will become popular, necessitating these binary
  360. types.
  361.  
  362. Note that MIME messages can be stored in 'u', 'm' and 'M' message files, but
  363. any binary components should be encoded with quoted-printable or base64 (which
  364. is expected to be the most common usage of MIME in the near future).  It is
  365. not required that 'b' or 'B' be used for MIME messages: only those containing
  366. raw unencoded binary data (as indicated by the Content-transfer-encoding
  367. header value "binary").
  368.  
  369. INDEX FILES
  370.  
  371. This specification defines four index file types, which provide varying
  372. degrees of support for packet readers.
  373.  
  374. Type 'n' indicates that no index file is present, and it is up to the packet
  375. reader to extract messages from the message file.  It is useful where the
  376. generating system is providing a USENET newsfeed using packets, and the
  377. receiving system is not interested in the index information.
  378.  
  379. A type 'c' index file is a text file (LF terminated lines), with one line per
  380. message that occurs in the message file.  The lines in the index file should
  381. be in the same order as the corresponding messages.  Each line has the
  382. following form:
  383.  
  384.     offset<TAB>subject<TAB>author<TAB>date<TAB>mesgid<TAB>
  385.     refs<TAB>bytes<TAB>lines[<TAB>selector]
  386.  
  387. [Note: the line-wrapping here is for document-formating purposes only.  No
  388. line-wrapping occurs in the index files].  The fields have the following
  389. semantics:
  390.  
  391.     offset    Seek position in the message file of where the corresponding
  392.         message starts.  The first seek position is 0.  For the 'u'
  393.         format, this indicates the start of the line following the
  394.         rnews header line.  For the 'm' format, this indicates the
  395.         start of the "From " line and for the 'M' format, this
  396.         indicates the start of the article after the Control-A
  397.         sequence.  For the 'b' and 'B' formats, this indicates the
  398.         first byte of the message after the 4-byte message length.
  399.  
  400.     subject    The "Subject:" line from the message.
  401.  
  402.     author    The "From:" line from the message.
  403.  
  404.     date    The "Date:" line from the message.
  405.  
  406.     mesgid    The "Message-Id:" line from the message.
  407.  
  408.     refs    The "References:" line from the message.
  409.  
  410.     bytes    The number of bytes in the message.  If this field is zero,
  411.         then it indicates that there is no corresponding message
  412.         in the message file.  This is used for summaries: see the
  413.         section "MESSAGE AREA SUMMARIES" for more details.
  414.  
  415.     lines    The "Lines:" line from the message.  Note that this field
  416.         is pretty useless these days on USENET, but is still popular.
  417.         It is meant to indicate the number of lines in the body of
  418.         the message.  Generating software may elect to re-generate
  419.         this value if it is not present in the original message,
  420.         but this is not required.
  421.  
  422.     selector A string used for summaries to request that a message be
  423.         sent in a future packet.  See the section "MESSAGE AREA
  424.         SUMMARIES" for more details.  This string will usually be
  425.         a number, but other values such as Message-ID's could be
  426.         used.  Packet readers should treat this string as an
  427.         indivisible string to be sent in a "sendme" command in the
  428.         COMMANDS file.  A zero-length string indicates that there
  429.         is no selector string.
  430.  
  431. If any of these fields contained TAB's, newlines or other white space in the
  432. original articles, they should be converted into single spaces.  All fields
  433. must be present, but some may be empty.  The "bytes" field must not be empty,
  434. since it provides necessary information for packet readers.  Each field must
  435. conform to the Internet RFC documents RFC-822 or RFC-1036.
  436.  
  437. Optionally, a header line may end with one or more extra TAB-separated fields
  438. for other RFC-compliant header fields, together with the header field names.
  439. e.g. "Supersedes: <1234@foovax>".  These fields are not defined by this
  440. version of the specification, and are by arrangement between the generating
  441. host and the reading host only.
  442.  
  443. This format is compatible with the news overview (NOV) database format of
  444. C-news.  The only difference being the substitution of an offset for the
  445. article number used by C-news, and the addition of the "selector" field.
  446. The C-news format was designed to assist threading newsreaders, so this packet
  447. format should provide similar assistance to threading packet readers.
  448.  
  449. The 'C' format is similar to 'c', except that the "mesgid" and "refs" fields
  450. are dropped.  These fields can commonly be quite long and are mainly of use to
  451. packet readers which perform Message-ID based message threading.  Packet
  452. readers which perform subject threading (i.e. sort on the subject line and
  453. then on the date and/or arrival order) do not require such information.  The
  454. format of the header lines in this case is as follows:
  455.  
  456.    offset<TAB>subject<TAB>author<TAB>date<TAB>bytes<TAB>lines[<TAB>selector]
  457.  
  458. Further TAB-separated fields may be added in future versions of this
  459. specification.
  460.  
  461. The "author" field is slightly different to the 'c' format.  Instead of
  462. an RFC-822 format address, it is just the author's name, extracted from the
  463. "From:" line of the message.  Most RFC-822 and RFC-1036 "From:" lines have one
  464. of the following forms:
  465.  
  466.         address
  467.         address (name)
  468.         name <address>
  469.  
  470. Names may sometimes be surrounded by double-quote characters, have embedded
  471. "(...)" sequences, or contain "useless" information after a comma (",") or
  472. slash ("/").  The main requirement is that the generating software produce
  473. some kind of (more or less) meaningful string for the name of the author which
  474. can be displayed to the user by a packet reader.  See RFC-822 and RFC-1036
  475. for more information on the syntax of the "From:" line in messages.
  476.  
  477. The 'i' index format is purely binary, using 8 bytes for each message in the
  478. corresponding message file.  The first 4 bytes specify the offset into the
  479. message file of the message and the remaining 4 bytes specify the number of
  480. bytes in the message.  Each 4-byte quantity is stored in big-endian order
  481. (high byte first).  This format is supplied to provide a trade-off between
  482. transmission time and easy extraction of messages from a message file.
  483.  
  484. REPLIES FILE
  485.  
  486. One of the requirements for an off-line reading system is a mechanism for a
  487. user to upload replies or new messages to a generating system for mailing or
  488. posting.  While it is possible to re-use the AREAS file for this purpose,
  489. keeping the download and upload sections separate will help prevent messages
  490. being fed back into a network erroneously.
  491.  
  492. The REPLIES file has a similar format to the AREAS file.  Each line has the
  493. following form:
  494.  
  495.     prefix<TAB>reply kind<TAB>encoding
  496.  
  497. The "prefix" and "encoding" fields are as before.  The "reply kind" field
  498. indicates the mechanism to use when transmitting the messages in the message
  499. file.  The following values are currently defined:
  500.  
  501.     mail    Transmit an RFC-822 compliant personal mail message
  502.     news    Transmit an RFC-1036 compliant USENET news posting
  503.  
  504. On a Unix system, transmission of mail and news is usually performed with the
  505. "sendmail" and "inews" programs respectively.  Additional kinds may be
  506. specified in a future version of this specification for other message formats.
  507. Note: it is discouraged that the kinds "mail" and "news" be used for anything
  508. other than RFC-compliant messages.  In particular, FidoNet or QWK messages
  509. should use a different reply kind.  Messages of the same reply kind can be
  510. placed in the same message file, or in separate message files.
  511.  
  512. Further TAB-separated fields may be added to the lines in the REPLIES file
  513. in a future version of this specification.
  514.  
  515. It is recommended that a message file type of 'b' or 'B' be used for sending
  516. replies to minimise the chance of message corruption.  The recommended index
  517. file types for replies are 'i' and 'n'.  The index types 'c' and 'C' are
  518. discouraged because they do not provide useful information for reply purposes.
  519.  
  520. The format of the messages in the message files should follow the relevant
  521. RFC standards, with the following restriction: any "From:", "Sender:",
  522. "Control:", "Approved:" or other similar "dangerous" header lines should be
  523. ignored by the system transmitting the replies to prevent forgeries from
  524. occuring.  In particular, the "From:" header should be determined from the
  525. user's login name, or some other similar means, rather than from any data
  526. supplied in the user's message.
  527.  
  528. In most cases, mail messages will contain "To:", "Subject:", "Cc:", "Bcc:"
  529. and "Reply-To:" header lines, and news messages will contain "Newsgroups:",
  530. "Subject:", "Followup-To:", "Keywords:", "Summary:" and "Reply-To:" header
  531. lines.  Other optional headers (especially MIME content headers) may also
  532. be present.
  533.  
  534. The automatic addition of a signature by the generating host which receives
  535. the reply packet is discouraged.  Signatures should be added by the user's
  536. packet reading software instead, if desired.
  537.  
  538. A method for allowing replies from more than one person to be stored in the
  539. same packet was considered, but was rejected for security reasons.
  540.  
  541. The following example demonstrates the capabilities of the REPLIES file:
  542.  
  543. R001    mail    bn
  544. R002    mail    bi
  545. R003    news    Bn
  546. R004    news    Bi
  547.  
  548. LIST FILE
  549.  
  550. The LIST file may be used to send a list of available message areas to the
  551. receiving system.  Its format is similar to the AREAS file, with the prefix
  552. field deleted.  Each line has the following form:
  553.  
  554.     area name<TAB>encoding[<TAB>description]
  555.  
  556. where "area name" is the name of the message area, "encoding" is a 2, 3 or 4
  557. letter message, index, area kind, and subscription code, and "description"
  558. is an optional message area description.  Further optional fields may be
  559. added in a future version of this specification.
  560.  
  561. The message, index, and area kind codes are the same as for the AREAS file.
  562. The subscription code has one of the following values:
  563.  
  564.     y    The user is subscribed to the message area
  565.     n    The user is not subscribed to the message area
  566.  
  567. If this field is not present, it defaults to 'n'.
  568.  
  569. Note that the message areas in the LIST file should only be those that can
  570. be subscribed to or unsubscribed from using a request in the COMMANDS file.
  571. Private e-mail message areas will normally not appear in the list.
  572.  
  573. The following example demonstrates the capabilities of the LIST file:
  574.  
  575. alt.flame    ucnn
  576. comp.bbs.misc    ucny
  577. comp.bbs.waffle    ucny
  578. comp.lang.c    ucnn    C Programming Language Discussions
  579. news.future    ucny    Future of USENET
  580.  
  581. SENDING COMMANDS BETWEEN SYSTEMS
  582.  
  583. The COMMANDS and ERRORS files contain information for changing the behaviour
  584. of each end of a packet stream, or for reporting errors in the execution of
  585. commands or the generation of packets.  Each is a text file with LF-terminated
  586. lines.
  587.  
  588. The ERRORS file is the simplest: it consists of error messages from the
  589. program which generated the packet to report on the progress of previously
  590. executed commands.  The format of these error messages is not defined, but
  591. they should be human readable so that packet readers may present the errors
  592. to the user for perusal.
  593.  
  594. The COMMANDS file consists of a sequence of commands, one per line, which
  595. modify the behaviour of the packet processor at the other end of the
  596. packet stream.  Usually these commands are sent from the packet reader
  597. to the packet generator to change the subscribed message areas, send
  598. files, etc.  The names of the commands are NOT case significant, but SHOULD
  599. be sent in lower case.  Any commands that are not understood by a program
  600. should be ignored.
  601.  
  602. version n.m
  603.  
  604.     The command specifies the version of this specification that the
  605.     packet conforms to.  For this document the version is "1.2".
  606.  
  607. date dd mmm ccyy hh:mm:ss [zone]
  608.  
  609.     The date and time when the packet was created.  To prevent confusion
  610.     with different country's date formats, the date MUST always appear
  611.     as "dd mmm ccyy".  For example, "25 Jul 1993".  This date format can
  612.     be converted to local conventions if desired.  "hh:mm:ss" is a
  613.     24-hour clock time value.  The "zone" field is the number of hours
  614.     and minutes that the timezone is offset from Greenwich Mean Time as
  615.     "+HHMM" or "-HHMM".  For example, US Eastern Standard Time (EST) is
  616.     "-0500", and Australian Eastern Standard Time is "+1000".  If the
  617.     zone is omitted, it defaults to "local time", however the zone should
  618.     only be omitted if there is no way to determine it.
  619.  
  620. subscribe name
  621.  
  622.     This command requests the packet generating program to subscribe to
  623.     a new message area.  The area name may contain spaces, but not TABs.
  624.     Additional fields may be added in a future version of this
  625.     specification after a separating TAB.  For now, ignore anything after
  626.     a TAB.  This command may generate an error message if the message area
  627.     does not exist, or cannot be subscribed to.
  628.  
  629. unsubscribe name
  630.  
  631.     This command requests the packet generating program to unsubscribe
  632.     from a message area.  The same remarks about TABs and errors above
  633.     also apply to this command.
  634.  
  635. catchup [name]
  636.  
  637.     This command requests the packet generating program to catchup on
  638.     the nominated message area.  That is, to mark all messages in the
  639.     area as read and continue batching from the next message received.
  640.     If the area name is not present, the packet generating program
  641.     should catchup on all message areas.
  642.  
  643. list [always|never]
  644.  
  645.     This command requests the packet generating program to send a
  646.     full list of all available message areas as a LIST file in
  647.     the next packet.  If the argument "always" is present, then
  648.     the LIST file should be sent in every packet.  The argument
  649.     value "never" reverses this.  For minimal compliance,
  650.     "list always" should be treated as "list", and "list never"
  651.     should be ignored.
  652.  
  653. hostname string
  654.  
  655.     This command specifies the name of the host or BBS the packet was
  656.     generated on.  It serves an informational role only.  The string
  657.     can be any sequence of printable ASCII characters.
  658.  
  659. software string
  660.  
  661.     This command specifies the name and version of the software which
  662.     generated the packet.  It servers an informational role only.  The
  663.     string can be any sequence of printable ASCII characters.
  664.  
  665. sendme<TAB>area<TAB>selector[<TAB>selector[...]]
  666.  
  667.     This command requests that the packet generator send a number of
  668.     messages from the nominated message area.  The "selector" arguments
  669.     are taken from the "selector" fields in a 'c' or 'C' index file.
  670.     Multiple "sendme" commands for the same message area may be present
  671.     in a COMMANDS file.  The maximum length for this command is 500
  672.     characters.  Note that other commands use spaces to separate
  673.     arguments, but this command uses TAB's.
  674.  
  675. mail y
  676. mail n
  677.  
  678.     This command changes whether or not private e-mail should be sent
  679.     in generated packets.
  680.  
  681. deletemail y
  682. deletemail n
  683.  
  684.     This command changes whether or not the user's private mailbox should
  685.     be deleted after being batched into a packet.
  686.  
  687. mailindex x
  688.  
  689.     Set the preferred mail index format, where 'x' is one of the values
  690.     'n', 'c', 'C' or 'i'.
  691.  
  692. newsindex x
  693.  
  694.     Set the preferred news index format, where 'x' is one of the values
  695.     'n', 'c', 'C' or 'i'.
  696.  
  697. get filename [putname]
  698.  
  699.     Request that a file on the generating side be placed into a packet
  700.     and sent to the packet reader.  "putname" specifies the "filename"
  701.     argument for the corresponding "put" command.  If "putname" is
  702.     not specified, the default is to use the base name of "filename".
  703.     If directory paths are specified, the separator must be '/'.  It
  704.     should be noted that security could be breached through the use
  705.     of this command, so programs which support this command should be
  706.     very careful, preferably restricting requests to a particular
  707.     directory tree.
  708.  
  709. put pktname filename
  710.  
  711.     This command is usually sent in response to a "get" command, although
  712.     it can be sent on its own.  "pktname" specifies the name of the file
  713.     in the packet which contains the requested file's contents.  The
  714.     "filename" argument specifies destination file to write the contents
  715.     to.  Note that security could be breached with this command, so
  716.     the destination filename should be checked, or restricted to a
  717.     particular directory tree.  It is also recommended that the user
  718.     be prompted for confirmation before writing the file.  If directory
  719.     paths are specified in "filename", the separator must be '/'.  It
  720.     is recommended that the extension "FIL" be used for files in a
  721.     packet which contain data sent with this command.  For example,
  722.     "put 001.FIL abc.zip"
  723.  
  724. supported cmd ...
  725.  
  726.     This command is usually sent from a packet generator to inform a
  727.     packet reader as to which commands are supported by the generating
  728.     program.  The argument is a space-separated list of command names.
  729.     For example, "supported subscribe unsubscribe list", or "supported
  730.     subscribe unsubscribe catchup list mail deletemail".
  731.  
  732. It is recommended that at least "subscribe", "unsubscribe" and "list" (with
  733. no arguments) be supported.  Packet generators are recommended to add a
  734. "supported" line to all packets generated to inform the packet reader
  735. which commands can be used.  In the absence of a "supported" line, only
  736. "subscribe", "unsubscribe" and "list" should be assumed to be supported.
  737.  
  738. If more than one command is received for the same item (e.g. "subscribe",
  739. "unsubscribe", "list", "mail", ...), then the last command in the COMMANDS
  740. file takes precedence over any previous commands.
  741.  
  742. The following example demonstrates a typical COMMANDS file sent from a
  743. packet generator:
  744.  
  745.     version 1.2
  746.     date 25 Jul 1993 12:34:38 +1000
  747.     hostname frobozz.domain.com
  748.     software Fubar 1.3
  749.     supported subscribe unsubscribe catchup list sendme get
  750.     put 001.FIL abc.zip
  751.     put 002.FIL def.txt
  752.  
  753. The following example demonstrates a typical COMMANDS file sent from a
  754. packet reader:
  755.  
  756.     subscribe comp.lang.c
  757.     subscribe comp.lang.misc
  758.     unsubscribe alt.swedish.chef.bork.bork.bork
  759.     list
  760.     get xyzzy.zip
  761.     get /usr/local/lib/fubar.txt frobozz.txt
  762.  
  763. MESSAGE AREA SUMMARIES
  764.  
  765. The preceding sections have described a number of features for supporting
  766. message area summaries.  This section provides greater detail.
  767.  
  768. Since some message areas, notably USENET newsgroups, can get quite large,
  769. the user may want to download a summary of a message area instead of all
  770. of the messages, and then request that messages of interest be sent at
  771. some later time for reading.  Usually the summary will list the messages'
  772. subjects, authors, and other similar "header information".  Optionally,
  773. the user may request that the first few lines of the messages also be
  774. sent so that the user may peruse the beginning of the message and decide
  775. whether to retrieve the rest of the message.
  776.  
  777. This activity is supported in the following fashion in this packet format:
  778. summary information is sent in an index file of type 'c' or 'C', usually
  779. with no accompanying message file.  Therefore, the message file format in
  780. the AREAS file will be set to 'i'.  Each line in the index file has its
  781. "bytes" field set to 0 to indicate that the message is not present in
  782. the message file, and the "selector" field is set to some string that can
  783. be used to request the message by way of a "sendme" command.  Usually this
  784. selection string will be the message number of the message on the generating
  785. host, but other values such as Message-ID's are allowable.
  786.  
  787. If the first few lines of each message are also desired, the message file
  788. format is set to something other than 'i', and the "offset" and "bytes" fields
  789. in the index file may be used to extract the trimmed-down messages for
  790. perusal.  The "selector" field is once again used to request that an entire
  791. message be sent at some later time, by way of a "sendme" command.
  792.  
  793. It is possible to create a message area which contains both ordinary messages
  794. and summary messages.  If the "selector" field is not present, or is
  795. zero-length, then the message should be processed in the usual way, and if
  796. the "selector" field is present and not zero-length, then it is a summary
  797. message and the "bytes" field can be used to determine if the first few
  798. lines of a message exist in the message file or not.  This mixture can be
  799. useful in some situations where the user wishes to download all messages
  800. less than a certain length, and download the larger messages as summaries,
  801. so that the larger messages can be explicitly requested only if the user
  802. really wants them.
  803.  
  804. MINIMAL CONFORMANCE
  805.  
  806. This section describes the minimal amount of work that a packet processor
  807. must do to be compliant with this specification.
  808.  
  809. Packet generators should be able to generate message areas for the 'b'
  810. and 'u' message formats for private and public message areas respectively,
  811. and process replies for the 'b' and 'B' message formats.  For minimal
  812. conformance, index format 'n' must be supported, and if message area
  813. summaries are required, one of index formats 'c' or 'C' should be supported.
  814. It is recommended that either 'c' or 'C' be supported in all packet
  815. generators, even when message summaries are not required.  If message
  816. summaries are supported, the minimal requirement is to send an index file
  817. with the message file format set to 'i'.  Packet generators should support
  818. the "subscribe", "unsubscribe" and "list" commands, and also the "sendme"
  819. command if message area summaries are required.
  820.  
  821. Packet readers should be able to read all message and index formats, and
  822. generate replies for the 'b' and 'B' message formats.  If message area
  823. summaries are not supported, all areas with message format 'i' should be
  824. flagged to the user as not understood.  Packet readers should also be
  825. able to display the INFO and LIST files if they are present in a packet
  826. and be able to prompt the user for "subscribe" and "unsubscribe" requests
  827. to be sent to the packet generator.
  828.  
  829. FUTURE ENHANCEMENTS
  830.  
  831. The obvious enhancement that can be made is to support other message formats,
  832. especially FidoNet formats.  Currently the message area file code 'q' is
  833. reserved for QWK-format messages.  This will be defined in a future version
  834. of this specification if demand warrants.
  835.  
  836. Experimentation with other formats and auxillary files is encouraged, but
  837. please contact the author first to prevent double-ups from occurring.
  838. The author may be contacted via e-mail at rhys@cs.uq.oz.au.
  839.