home *** CD-ROM | disk | FTP | other *** search
/ Current Shareware 1994 January / SHAR194.ISO / email / qprn103.zip / QWKPRUNE.DOC < prev    next >
Text File  |  1993-08-29  |  23KB  |  487 lines

  1.                                QWKPRUNE  1.03
  2.                                    -----
  3.   A utility to remove unwanted messages from QWK-format mail packets.
  4.  
  5.   QWKPRUNE.EXE, KILLMSG.EXE, ZIPPYZAP.EXE, SAVEQWK.EXE, MKPRN.EXE, this
  6.   documentation, and all associated documentation are Copyright (c) 1992,
  7.   1993, and GRABNUM.EXE and KMSG-D2.EXE are Copyright (c) 1993 by David
  8.   Harden.  All rights reserved.
  9.  
  10.   PARM.EXE is hereby released into the public domain.
  11.  
  12.   The code used to qualify filenames is based on QFN.C by Ray Duncan.
  13.   The original code was published in Vol. 7, No. 14 of PC Magazine, and is
  14.   copyrighted by Ziff-Davis.
  15.  
  16.   Autodetection of LHA and ZOO files is based on information from GUS
  17.   (General Unpack Shell) version 1.70, by Johan Zwiekhorst.  
  18.   
  19.   All brand or product names mentioned in this documentation or any
  20.   associated files are trademarks or registered trademarks of their
  21.   respective owners.  All products mentioned are copyrighted by their
  22.   respective owners.  My use of these trademarks does not imply that their
  23.   owners have endorsed QWKPRUNE, nor does it imply that I have endorsed
  24.   their products.
  25.  
  26.   QWKPRUNE should not be confused with QWKMerge, which is a trademark and
  27.   copyrighted product of Mike King.  QWKPRUNE and David Harden are not
  28.   affiliated with Mike King.
  29.  
  30.  
  31.                           Disclaimer of Liability
  32.                                    -----
  33.   There is no warranty of any kind, either express or implied, covering
  34.   this software or any associated materials.  This software and all
  35.   associated materials are provided as is, use them at your own risk.
  36.   The copyright holder is in no way responsible or liable for any losses or
  37.   damages of any kind that may result from the use of this software or any
  38.   associated materials, or from inability to use them.
  39.  
  40.  
  41.                             System requirements
  42.  
  43.   DOS 3.x or higher is preferred.  I see no reason why this program
  44.   shouldn't work with DOS 2.x, but this hasn't been tested.  Approximately
  45.   194K free RAM is needed to process a 400-message QWK. This includes a 64K
  46.   dynamically allocated buffer used to write the new MESSAGES.DAT to disk,
  47.   and 42K dynamic memory used to store data from the message headers.
  48.   Dynamic memory is allocated at runtime, so larger QWKs will take more
  49.   memory, and smaller ones will take less memory.  The write buffer won't
  50.   be allocated if the /T or /TQ are used. QWKPRUNE should be able to handle
  51.   any size QWK, as long as there is enough free RAM to store the message
  52.   data and enough free disk space to write the new MESSAGES.DAT.
  53.  
  54.  
  55.                               What does it do?
  56.                                    -----
  57.   Removes unwanted messages from QWK-format mail packets based on the
  58.   contents of their message headers.  The modified packet can either be
  59.   repacked or fed into a mail reader or other QWK utility.  See READER.DOC
  60.   for more details.
  61.  
  62.   An "unkill" option allows flexibility in deciding which messages are
  63.   pruned out.
  64.  
  65.   Removes (R) and Re: prefixes, as well as leading whitespace, from
  66.   the subject field of messages.  Up to ten additional user-defined
  67.   prefixes can also be stripped from subject lines.
  68.   
  69.   Can tag messages for processing by programs such as KingQWK and QWKMerge.
  70.  
  71.   Transparently repairs conference numbers in packets from older doors that
  72.   pad the conference number with a space.  Repairs "garbage" conference
  73.   numbers in packets from Virtual QWK.
  74.  
  75.   Fixes null-terminated string fields in message headers.  Also fixes
  76.   headers in which the To: and From: fields are terminated with linefeed
  77.   characters.
  78.  
  79.   "Untrashes" QWK packets altered by EZ-RDR.
  80.  
  81.  
  82.                              How to install it
  83.                                    -----
  84.   Place QWKPRUNE.EXE in a directory on your DOS path.  Use your editor
  85.   to create the needed control files (see below).  That's all.
  86.  
  87.  
  88.                                    Files
  89.                                    -----
  90.   QWKPRUNE's configuration and prune files are ASCII text files that may be
  91.   created and modified by any text editor, or by a word processor in
  92.   nondocument mode.  Lines may be up to 99 characters long, but usually
  93.   shouldn't need to be that long.  If a line begins with a semicolon, its
  94.   contents will be ignored.
  95.  
  96.  
  97.                            The configuration file
  98.                                    -----
  99.   The configuration file is named QWKPRUNE.CFG, and is located in the same
  100.   directory as QWKPRUNE.EXE.  A configuration file may look something like
  101.   this:
  102.  
  103.   ZIP = pkzip
  104.   UNZIP = pkunzip
  105.   LHA = lha a /m
  106.   UNLHA = lha e
  107.   ARJ = arj a -e
  108.   UNARJ = arj e
  109.   ZOO = zoo -add %q *
  110.   UNZOO = zoo -extract %q *
  111.   USER_PACK = pkpak -a
  112.   USER_UNPACK = pkunpak
  113.   QWK = c:\download\qwk
  114.   WORK = c:\
  115.   PRUNE = c:\prune
  116.   GLOBAL = global.prn
  117.   STRIP = Re :, Re(2):, Re ,
  118.   MAX_QWK_AGE = 0
  119.   FORCE_REPACK = ON
  120.  
  121.   QWKPRUNE will automatically detect ZIP, LHA, ARJ, and ZOO files.
  122.   USER_PACK and USER_UNPACK are commands to pack and unpack files
  123.   compressed with another archiver.  In these entries, %q may be used as a
  124.   substitute for the QWK file name.  If %q isn't used, QWKPRUNE assumes
  125.   that the QWK file name is at the end of the command.
  126.  
  127.   In many cases, packers and unpackers may be silenced by redirecting their
  128.   output to NUL.  Of course, %q has to be used if this is done.  For
  129.   example, ZIP = pkzip %q > NUL will silence PKZIP.
  130.  
  131.   QWK is the directory where you want QWKPRUNE to look for QWK files.  WORK
  132.   is the directory where QWKPRUNE will create its work directory.  A
  133.   directory named QP$WORK will be created under this directory.  PRUNE is
  134.   the default directory where prune files are located.  GLOBAL is the name
  135.   of a global prune file, which will be used for all QWK packets.  If
  136.   GLOBAL is not specified, a global prune file will not be used.
  137.  
  138.   STRIP is the list of prefixes, other than (R) and Re:, that you want to
  139.   strip from subject lines.  Up to ten prefixes may be specified, and
  140.   individual prefixes may be up to twelve characters long.  Prefixes may
  141.   have trailing spaces.  The list may end with a comma, but doesn't have to
  142.   unless the last prefix has trailing spaces.  Case is not significant.
  143.  
  144.   If FORCE_REPACK is set to either ON or YES, QWKPRUNE will always repack
  145.   QWKs, even if they haven't been changed.
  146.  
  147.   If MAX_QWK_AGE is set to a number, QWKs more than that many days old
  148.   won't be processed if wildcards are used in the QWK file name or the
  149.   default (*.Q*) is used.  For example, MAX_QWK_AGE = 0 limits processing
  150.   to packets with the current date.
  151.  
  152.   A packer and unpacker for at least one archive type must be specified.
  153.   If QWK or WORK is left unspecified, the current working directory will be
  154.   used for that option.  If PRUNE is not specified, it's assumed that prune
  155.   files are located in the same directory as QWKPRUNE.EXE.  Options may
  156.   appear in any order, and case is not significant.  If a line is not a
  157.   valid option, it should be ignored.
  158.  
  159.   If the work directory exists and is empty, QWKPRUNE will use it without
  160.   comment.  If it isn't empty, you'll be asked if you want to abort the
  161.   program or delete all the files in the work directory.
  162.  
  163.   If you use a batch file to call the packer or unpacker, place COMMAND /C
  164.   in front of the batch file's name, or use PARM.EXE.
  165.  
  166.   A sample configuration file is included in the distribution archive.
  167.  
  168.  
  169.                                 Prune files
  170.                                    -----
  171.   Prune files control which messages will be removed from the QWK packet.
  172.   By default, they are named BBSID.PRN, and are located in the same
  173.   directory as QWKPRUNE.EXE.  Normally, BBSID is the name the board's mail
  174.   door gives to QWK packets.  For example, if a BBS creates packets named
  175.   ABC.QWK, the default prune file name for that board should be ABC.PRN.
  176.   QWKPRUNE takes the BBSID from CONTROL.DAT, so it doesn't matter what the
  177.   QWK packet is named on disk.  A line should have the following format:
  178.   [!]conference number,switch[option]:text.  At present, there can only be
  179.   one conference number per line.  A prune file may have up to 75 entries,
  180.   minus the number of entries in the global prune file.
  181.  
  182.   The conference number is the conference to prune messages from, and must
  183.   be followed by a comma or semicolon.  Switch values are F,T,B,S,D,N,P and
  184.   A.  Option may be either P or B, or it may be omitted.  If an invalid
  185.   option is used, it will be ignored.  The switch (or option, if used) must
  186.   be followed by a colon or tilde (~).  Text is the text to search for.
  187.   Case is not significant, and invalid lines should be ignored.
  188.  
  189.   To search the entire packet, enter an 'A' as the conference number.
  190.   If this option is used with the N switch, the line will be ignored.
  191.  
  192.   If 'Z' is used for the conference number, you can delete ("zap") certain
  193.   files from the packet.  In this case, the format is Z,text.  If "text"
  194.   starts with BLT, it'll be treated as a filename, and the bulletin(s)
  195.   specified will be deleted.  For example, Z,BLT*.* will delete all
  196.   bulletins.  If "text" is SESSION, SESSION.TXT will be deleted.  If it's
  197.   FILES, NEWFILES.DAT will be deleted.  If "text" is HELLO, NEWS, or
  198.   GOODBYE, the logon screen, BBS news file, or logoff screen will be
  199.   deleted.  QWKPRUNE gets the names of these files from CONTROL.DAT.  These
  200.   entries do not count against the maximum number of entries allowed in a
  201.   prune file.  This option may not be used in a global prune file.
  202.  
  203.   F: assumes that "text" is a user name, and will delete all messages from
  204.   that user.  T: works similarly, except that it kills messages to a user.
  205.   B: finds messages that are both from and to a user.  If "text" is @ME@,
  206.   it'll be replaced with your user name from CONTROL.DAT.
  207.  
  208.   S: prunes out all messages that have "text" as their subject line.
  209.  
  210.   If any of these switches are followed by P, all messages that contain
  211.   "text" within the appropriate field(s) will be removed.
  212.  
  213.   If the S switch is followed by a B, all messages whose subject line
  214.   begins with "text" will be deleted.
  215.  
  216.   D: treats "text" as a number of days before the current date.  Messages
  217.   older than that will be removed from the packet.
  218.  
  219.   N: assumes that "text" is a message number, and deletes that message.
  220.   If the colon is followed by a > (greater than) or < (less than) sign,
  221.   messages with numbers greater than or less than "text" will be removed.
  222.  
  223.   When deleting messages greater than or less than a number, "text" may be
  224.   given as HIGH - nnn and LOW + nnn, where HIGH and LOW are the highest and
  225.   lowest message number in the specified conference.  Note that some BBS
  226.   software uses a single numbering system for all messages, rather than a
  227.   separate numbering system for each conference.  This option probably
  228.   won't work too well with packets from such systems.
  229.  
  230.   P: assumes that "text" is a user name, and will cause all message to that
  231.   user to be marked as personal.  
  232.   
  233.   A: prunes out all messages within a conference.  Anything following the
  234.   'A' will be ignored.
  235.  
  236.   If a line begins with an exclamation point, messages meeting the search
  237.   specification will be "unkilled".  This allows you to do things such as
  238.   killing all messages in a conference, then unkilling those you want to
  239.   keep.  For example:
  240.                                    10,A:
  241.                                    !10,N:100
  242.                                    !10,SP:Interesting subject
  243.                                    A,B:Joe Schmuck
  244.                                    A,D:30
  245.  
  246.   will kill all messages in conference 10, except for message number 100
  247.   and all messages with "interesting subject" in their subject fields.  It
  248.   will then kill all messages either to or from "Joe Schmuck".  Finally, it
  249.   will delete all messages more than 30 days old.
  250.  
  251.   If the switch (or option, if used) is followed by a tilde (~), all
  252.   messages in the conference that do not meet the search specification will
  253.   be removed.  This has the same effect as killing all messages in a
  254.   conference, then unkilling those that meet the search specification.
  255.   In the example above, the first two lines could be replaced by
  256.   10,N~100.  This also works with the D switch.  For example, A,D~30 will
  257.   delete all messages that are 30 or less days old.  Of course, it'll also
  258.   work with the unkill option.
  259.  
  260.   These features do not work with the P switch, or when zapping files.
  261.  
  262.   You can define a global prune file in the configuration file.  This file
  263.   may contain up to 25 entries, and will be used with all QWK packets.  The
  264.   only valid conference numbers in this file are 'A' and 0.  Also, the N
  265.   switch is invalid within it.  In all other ways, it acts like a normal
  266.   prune file.  When scanning a QWK packet, entries in the global prune file
  267.   will be processed before those in the regular prune file.
  268.  
  269.  
  270.                             Command line syntax
  271.                                    -----
  272.   The command line syntax is:
  273.     QWKPRUNE [d:][dir][QWK_file] [d:][dir][prune_file] [options]
  274.  
  275.   If you give a drive and/or directory with the prune file, QWKPRUNE will
  276.   still look for the global prune file in the default prune directory
  277.   specified in QWKPRUNE.CFG.
  278.  
  279.   DOS wildcards (* and ?) may be used in the QWK file name.
  280.  
  281.   If no extension is given, .Q* will be appended to the QWK file name,
  282.   and .PRN will be appended to the prune file name.
  283.  
  284.   The QWK and prune directories can be specified on the command line by
  285.   ending the appropriate entry with a colon, backslash, or period.
  286.   This will override the QWK and/or PRUNE entries in the configuration
  287.   file.
  288.  
  289.   If you wish to specify the prune file or prune directory, you must
  290.   enter something for the QWK file, unless you're using the /M option.
  291.  
  292.   The options are:
  293.  
  294.   /M[d:][dir] -  If this switch is set, QWKPRUNE assumes that the QWK file
  295.   has already been unpacked. If a drive and/or directory is given, it'll
  296.   look there for it, otherwise the current directory will be used.  It will
  297.   not create its work directory or repack the QWK file.  Note: When using
  298.   this option, only give the name of the prune file on the command line.
  299.   When giving a drive and/or directory, there must not be a space between
  300.   the M and the drive/directory.  Use this switch if you want to feed the
  301.   output to a mail reader.
  302.  
  303.   /B -  "Batch" mode.  If this switch is set, the work directory won't be
  304.   removed.
  305.  
  306.   /C[d:][dir]filename.ext -  This option lets you use a configuration file
  307.   other than the default QWKPRUNE.CFG.  There must not be a space between
  308.   the C and the filename to use.
  309.  
  310.   /T -  Use this switch to tag messages to be deleted later.
  311.  
  312.   /TQ - Use this option to tag messages for processing by KingQWK and
  313.   QWKMerge.  /T and /TQ will be ignored if /N has appeared earlier in the
  314.   command line.
  315.  
  316.   /N -  Use this option if you don't want to use a prune file.  Messages
  317.   that have been tagged for deletion by KingQWK, KILLMSG, ZIPPYZAP, or
  318.   QWKPRUNE /T will still be pruned out.  Also, (R) and Re: prefixes,
  319.   user-defined prefixes, and leading whitespace will still be stripped from
  320.   the subject lines.  This will be ignored if either /T or /TQ appeared
  321.   earlier in the command line.
  322.  
  323.   /NG - If a global prune file is defined, this switch keeps it from being
  324.   used.  Regular prune files will still be used.
  325.  
  326.   /Dnn - If wildcards are used in the QWK file name, or the default (*.Q*)
  327.          is used, packets older than nn days will not be pruned.  There
  328.          must not be a space between the D and the number.  If this is
  329.          given as /D- or /DA, QWKPRUNE will process all packets that match
  330.          the QWK file name, no matter what MAX_QWK_AGE is set to.
  331.  
  332.   /P - If this option is used, QWKPRUNE will always repack QWKs, even if
  333.        they haven't been changed.  If this option is entered as /P-, QWKs
  334.        will only be repacked if they've been changed, even iF FORCE_REPACK
  335.        is ON.
  336.  
  337.  
  338.                           Things to watch out for
  339.                                    -----
  340.   QWKPRUNE hasn't been tested with DOS 2.x, but I see no reason why it
  341.   shouldn't work.  QWKPRUNE.EXE won't be able to find itself under DOS 2.x,
  342.   so it'll assume that its configuration file and prune files are in the
  343.   current directory.
  344.  
  345.   If your mail reader keeps "bookmarks", you may want to mark packets as
  346.   unread after pruning them.  Otherwise, they'll no longer be accurate.  If
  347.   your reader can't mark packets as unread, you can manually delete the
  348.   "bookmarks".  QWKPRUNE will delete bookmarks from EZ-RDR, KingQWK, DeLuxe²,
  349.   Session Manager, Blue Wave, and MikeMayl if any messages are pruned out.
  350.  
  351.   Don't use the /M option on a QWK while you're reading it, unless you're
  352.   also using the /T option.  Some readers may leave MESSAGES.DAT open while
  353.   running outside programs.  Rewriting MESSAGES.DAT under such conditions
  354.   may garble the file.  Even if your reader closes MESSAGES.DAT, it may not
  355.   reload the changed .NDX files generated by QWKPRUNE.
  356.  
  357.   Users on networks or using multitaskers should be sure that the QWK file
  358.   isn't being read or modified by any other process while it's being
  359.   pruned.
  360.  
  361.  
  362.                                Error Messages
  363.                                    -----
  364.   Prune file(s) empty:
  365.          Neither the regular prune file nor the global prune file (if
  366.          defined) contained any valid message-procession entries.  There
  367.          may have been file deletion entries.  (R) and Re: prefixes,
  368.          user-defined prefixes, and leading whitespace were still stripped
  369.          from the subject lines.
  370.  
  371.   No messages pruned:
  372.          No messages were found to prune.
  373.  
  374.   Not enough memory to store all records:
  375.          A check of the far heap didn't find enough memory to store all
  376.          the message headers.
  377.  
  378.   Memory allocation error:
  379.          An error occurred when allocating dynamic memory.  Probably caused
  380.          by attempting to allocate more memory than was available.  Since
  381.          QWKPRUNE checks to see how much far memory is available before
  382.          allocating any, this shouldn't happen.  Please let me know if it
  383.          does.
  384.  
  385.   Unable to open config file:
  386.          QWKPRUNE was unable to open its configuration file.
  387.  
  388.   Unsupported archive type:
  389.          Either a packer or unpacker wasn't defined for the archive type of
  390.          the QWK file.
  391.  
  392.   Unable to locate QWK file(s):
  393.          No .QWK packets matching the search specifications (filespec
  394.          and/or age) could be found.
  395.  
  396.   Unable to open CONTROL.DAT:
  397.          QWKPRUNE was unable to open the CONTROL.DAT file from the mail
  398.          packet.  If this error occurs, the mail packet is probably not a
  399.          QWK packet.  If the packet was compressed with LHA or ZOO, it 
  400.          also may indicate that there wasn't enough disk space to unpack
  401.          CONTROL.DAT.  If a batch file was used to call the unpacker, there
  402.          may not have been enough free memory to unpack it.
  403.  
  404.   Error in CONTROL.DAT:
  405.          An error occurred when reading CONTROL.DAT.  Either it's garbled,
  406.          or it isn't from a QWK file.
  407.  
  408.   Unable to open MESSAGES.DAT:
  409.          QWKPRUNE was unable to open the MESSAGES.DAT file from the QWK
  410.          packet.  If the packet was compressed with LHA or ZOO, this may
  411.          indicate that there wasn't enough disk space to unpack it.  If you
  412.          used a batch file to call the unpacker, it may also indicate there
  413.          wasn't enough free memory to unpack it.
  414.  
  415.   MESSAGES.DAT is corrupt:
  416.          An entry in one of the .NDX files doesn't point to a valid message
  417.          header.
  418.  
  419.   No .NDX files found:
  420.          QWKPRUNE was unable to locate the .NDX files from the mail packet.
  421.          Either the mail packet isn't a QWK, or the mail door didn't create
  422.          .NDX files, or there are no messages in the packet.  If the QWK
  423.          door that produced the packet was configured not to create .NDX
  424.          files, you'll need to rebuild them before pruning the packet.
  425.  
  426.   [QWK/prune/work] directory not found:
  427.          The QWK, prune, or work directory does not exist.
  428.  
  429.                               DOS error levels
  430.                                     ----
  431. 4:  Not enough memory to store all records.
  432. 5:  Unsupported archive type.
  433. 6:  Unable to open CONTROL.DAT.
  434. 7:  Error in CONTROL.DAT.
  435. 8:  Unable to open MESSAGES.DAT.
  436. 9:  No .NDX files found.
  437. 10: An error occurred when unpacking the QWK file.
  438. 11: File write error due to lack of disk space.
  439. 12: MESSAGES.DAT is corrupt.
  440. 13: Invalid command line option.
  441. 14: Unable to locate QWK file(s).
  442. 15: Error changing to the drive the work directory is on.
  443.     Error changing to the work directory.
  444. 16: An error occurred when attempting to spawn a program.
  445. 17: An error occurred when repacking the QWK file.
  446. 18: File open error.
  447. 19: File write error.
  448. 20: Memory allocation error.
  449. 21: Unable to open config file.
  450. 22: The work, QWK, or prune directory does not exist.
  451. 23: Control-break exit.
  452. 24: The program was aborted by the user because the work directory wasn't
  453.     empty.
  454.  
  455.  
  456.                               Acknowledgements
  457.                                    -----
  458.   Thanks to Mark May and Patrick Lee for gathering and distributing
  459.   information on the QWK specification, and to all those they collected
  460.   this data from.
  461.  
  462.   Thanks to Jack Hudgions for providing information from GUS on detecting
  463.   archive types.
  464.  
  465.   Thanks also to Joe and Pat McNeal, Diane Merriam, Bill Peek, and Darrell
  466.   Kitchen.
  467.  
  468.  
  469.                               How to reach me
  470.                                    -----
  471.   Please send comments, suggestions, bug reports, etc. to me at:
  472.  
  473.   RIME Shareware or Offline conference.  R/O capable at site ->1066
  474.   RIME Common conference.                Routed R/O ONLY at site ->1066
  475.   Ilink Shareware or Offline conference.
  476.   Fido Offline conference
  477.   Fido netmail    1:2320/110
  478.   WWIVnet email   #360@8262
  479.   CompuServe mail 73760,2217 or >INTERNET:david.harden@tfd.coplex.com
  480.   Internet Email  david.harden@tfd.coplex.com
  481.  
  482.   Or send mail to:
  483.  
  484.   David Harden
  485.   P.O. Box 197086
  486.   Louisville, KY 40259
  487.