home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / info / qwkmail / qwk.txt < prev    next >
Text File  |  1991-04-10  |  4KB  |  82 lines

  1. This file briefly describes the QWK file format.
  2.  
  3. The following is an abbreviated version of Appendix G of DELUXE.DOC:
  4. ──────────────────────────────────────────────────────────────────────────
  5.          All of the messages in a mail packet are contained in a file
  6.          named MESSAGES.DAT.  The file's logical record length is 128
  7.          bytes.  The first record of MESSAGES.DAT always contains
  8.          Sparkware's copyright notice produced by The Qmail Door.
  9.          Messages start in record #2 and use this format:
  10.  
  11.               Starting Position,Length   Description
  12.               ------------------------   ----------------------------
  13.                         1,1              Message status flag
  14.                         2,7              Message number
  15.                         9,8              Date (MM-DD-YY)
  16.                        17,5              Time (HH:MM)
  17.                        22,25             To
  18.                        47,25             From
  19.                        72,25             Subject
  20.                        97,12             Password
  21.                       109,8              Message reference number
  22.                       117,6              Number of blocks
  23.                       123,1              Message status
  24.                       124,2              Conference number
  25.  
  26.          The text of message continues in the next record.  You can
  27.          find out how many blocks make up one message by looking at
  28.          the value of "Number of blocks".   Message text is delimited
  29.          by a pi symbol (ASCII 227) between lines.
  30.  
  31.          The xxx.NDX files contain record numbers that point into the
  32.          MESSAGES.DAT file for actual messages.  Each conference that
  33.          contains messages has its own "xxx.NDX" file.  The "xxx" is
  34.          the conference number for the index file.
  35.  
  36.          Each .NDX file uses a five byte logical record length and is
  37.          formatted to:
  38.  
  39.               Starting Position,Length      Description
  40.               ------------------------      ------------------------
  41.                        1,4                  Record number of message
  42.                                             in MKS$ format.
  43.                        5,1                  Conference number.
  44. ──────────────────────────────────────────────────────────────────────────
  45.  
  46. The formula for converting x, a LONGINT in MKS$ format, to MKSToNum, a
  47. binary integer, is:
  48.  
  49. MKSToNum := ((x AND NOT $ff000000) OR $00800000)
  50.              SHR (24 - ((x SHR 24) AND $7f));
  51.  
  52. It's not pretty but it works (and it only handles positive numbers).
  53.  
  54. The CONTROL.DAT is a text file containing information about
  55. the host BBS and conference information.  Here is a sample
  56. one with comments:
  57.  
  58. Ivo Andric Memorial BBS                 ;bbs name
  59. Victoria, BC, CANADA                    ;bbs location
  60. 604-380-0297                            ;bbs number
  61. Gwen Barnes, Sysop                      ;format is "First Last, Sysop"
  62. 20001,ANDRIC                            ;DOOR_SERIAL,PACKET_ID
  63. 01-09-1991,14:54:44                     ;mm-dd-yyyy,hh:mm:ss ..pkt time
  64. GREG HEWGILL                            ;user name
  65.                                         ;name of QMENU file if exists
  66. 0                                       ;unknown
  67. 0                                       ;unknown
  68. 254                                     ;total # of conferences - 1
  69. 0                                       ;# of first conf
  70. Local                                   ;name of conf (10 chars max)
  71. 1                                       ;# of second conf
  72. I_Central                               ;etc...for 255 confs
  73. ...
  74. 255                                     ;this is the 255'th conf (#24
  75. U_C_Prog                                ; is omitted from this packet)
  76. HELLO                                   ;filename of welcome file
  77. NEWS                                    ;filename of news file
  78. GOODBYE                                 ;filename of goodbye file
  79.  
  80. If you're looking at a real CONTROL.DAT, any further lines you can
  81. ignore because current mail doors don't generate it (it's obsolete).
  82.