home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Current Shareware 1994 January
/
SHAR194.ISO
/
email
/
qprn103.zip
/
QWKPRUNE.DOC
< prev
next >
Wrap
Text File
|
1993-08-29
|
23KB
|
487 lines
QWKPRUNE 1.03
-----
A utility to remove unwanted messages from QWK-format mail packets.
QWKPRUNE.EXE, KILLMSG.EXE, ZIPPYZAP.EXE, SAVEQWK.EXE, MKPRN.EXE, this
documentation, and all associated documentation are Copyright (c) 1992,
1993, and GRABNUM.EXE and KMSG-D2.EXE are Copyright (c) 1993 by David
Harden. All rights reserved.
PARM.EXE is hereby released into the public domain.
The code used to qualify filenames is based on QFN.C by Ray Duncan.
The original code was published in Vol. 7, No. 14 of PC Magazine, and is
copyrighted by Ziff-Davis.
Autodetection of LHA and ZOO files is based on information from GUS
(General Unpack Shell) version 1.70, by Johan Zwiekhorst.
All brand or product names mentioned in this documentation or any
associated files are trademarks or registered trademarks of their
respective owners. All products mentioned are copyrighted by their
respective owners. My use of these trademarks does not imply that their
owners have endorsed QWKPRUNE, nor does it imply that I have endorsed
their products.
QWKPRUNE should not be confused with QWKMerge, which is a trademark and
copyrighted product of Mike King. QWKPRUNE and David Harden are not
affiliated with Mike King.
Disclaimer of Liability
-----
There is no warranty of any kind, either express or implied, covering
this software or any associated materials. This software and all
associated materials are provided as is, use them at your own risk.
The copyright holder is in no way responsible or liable for any losses or
damages of any kind that may result from the use of this software or any
associated materials, or from inability to use them.
System requirements
DOS 3.x or higher is preferred. I see no reason why this program
shouldn't work with DOS 2.x, but this hasn't been tested. Approximately
194K free RAM is needed to process a 400-message QWK. This includes a 64K
dynamically allocated buffer used to write the new MESSAGES.DAT to disk,
and 42K dynamic memory used to store data from the message headers.
Dynamic memory is allocated at runtime, so larger QWKs will take more
memory, and smaller ones will take less memory. The write buffer won't
be allocated if the /T or /TQ are used. QWKPRUNE should be able to handle
any size QWK, as long as there is enough free RAM to store the message
data and enough free disk space to write the new MESSAGES.DAT.
What does it do?
-----
Removes unwanted messages from QWK-format mail packets based on the
contents of their message headers. The modified packet can either be
repacked or fed into a mail reader or other QWK utility. See READER.DOC
for more details.
An "unkill" option allows flexibility in deciding which messages are
pruned out.
Removes (R) and Re: prefixes, as well as leading whitespace, from
the subject field of messages. Up to ten additional user-defined
prefixes can also be stripped from subject lines.
Can tag messages for processing by programs such as KingQWK and QWKMerge.
Transparently repairs conference numbers in packets from older doors that
pad the conference number with a space. Repairs "garbage" conference
numbers in packets from Virtual QWK.
Fixes null-terminated string fields in message headers. Also fixes
headers in which the To: and From: fields are terminated with linefeed
characters.
"Untrashes" QWK packets altered by EZ-RDR.
How to install it
-----
Place QWKPRUNE.EXE in a directory on your DOS path. Use your editor
to create the needed control files (see below). That's all.
Files
-----
QWKPRUNE's configuration and prune files are ASCII text files that may be
created and modified by any text editor, or by a word processor in
nondocument mode. Lines may be up to 99 characters long, but usually
shouldn't need to be that long. If a line begins with a semicolon, its
contents will be ignored.
The configuration file
-----
The configuration file is named QWKPRUNE.CFG, and is located in the same
directory as QWKPRUNE.EXE. A configuration file may look something like
this:
ZIP = pkzip
UNZIP = pkunzip
LHA = lha a /m
UNLHA = lha e
ARJ = arj a -e
UNARJ = arj e
ZOO = zoo -add %q *
UNZOO = zoo -extract %q *
USER_PACK = pkpak -a
USER_UNPACK = pkunpak
QWK = c:\download\qwk
WORK = c:\
PRUNE = c:\prune
GLOBAL = global.prn
STRIP = Re :, Re(2):, Re ,
MAX_QWK_AGE = 0
FORCE_REPACK = ON
QWKPRUNE will automatically detect ZIP, LHA, ARJ, and ZOO files.
USER_PACK and USER_UNPACK are commands to pack and unpack files
compressed with another archiver. In these entries, %q may be used as a
substitute for the QWK file name. If %q isn't used, QWKPRUNE assumes
that the QWK file name is at the end of the command.
In many cases, packers and unpackers may be silenced by redirecting their
output to NUL. Of course, %q has to be used if this is done. For
example, ZIP = pkzip %q > NUL will silence PKZIP.
QWK is the directory where you want QWKPRUNE to look for QWK files. WORK
is the directory where QWKPRUNE will create its work directory. A
directory named QP$WORK will be created under this directory. PRUNE is
the default directory where prune files are located. GLOBAL is the name
of a global prune file, which will be used for all QWK packets. If
GLOBAL is not specified, a global prune file will not be used.
STRIP is the list of prefixes, other than (R) and Re:, that you want to
strip from subject lines. Up to ten prefixes may be specified, and
individual prefixes may be up to twelve characters long. Prefixes may
have trailing spaces. The list may end with a comma, but doesn't have to
unless the last prefix has trailing spaces. Case is not significant.
If FORCE_REPACK is set to either ON or YES, QWKPRUNE will always repack
QWKs, even if they haven't been changed.
If MAX_QWK_AGE is set to a number, QWKs more than that many days old
won't be processed if wildcards are used in the QWK file name or the
default (*.Q*) is used. For example, MAX_QWK_AGE = 0 limits processing
to packets with the current date.
A packer and unpacker for at least one archive type must be specified.
If QWK or WORK is left unspecified, the current working directory will be
used for that option. If PRUNE is not specified, it's assumed that prune
files are located in the same directory as QWKPRUNE.EXE. Options may
appear in any order, and case is not significant. If a line is not a
valid option, it should be ignored.
If the work directory exists and is empty, QWKPRUNE will use it without
comment. If it isn't empty, you'll be asked if you want to abort the
program or delete all the files in the work directory.
If you use a batch file to call the packer or unpacker, place COMMAND /C
in front of the batch file's name, or use PARM.EXE.
A sample configuration file is included in the distribution archive.
Prune files
-----
Prune files control which messages will be removed from the QWK packet.
By default, they are named BBSID.PRN, and are located in the same
directory as QWKPRUNE.EXE. Normally, BBSID is the name the board's mail
door gives to QWK packets. For example, if a BBS creates packets named
ABC.QWK, the default prune file name for that board should be ABC.PRN.
QWKPRUNE takes the BBSID from CONTROL.DAT, so it doesn't matter what the
QWK packet is named on disk. A line should have the following format:
[!]conference number,switch[option]:text. At present, there can only be
one conference number per line. A prune file may have up to 75 entries,
minus the number of entries in the global prune file.
The conference number is the conference to prune messages from, and must
be followed by a comma or semicolon. Switch values are F,T,B,S,D,N,P and
A. Option may be either P or B, or it may be omitted. If an invalid
option is used, it will be ignored. The switch (or option, if used) must
be followed by a colon or tilde (~). Text is the text to search for.
Case is not significant, and invalid lines should be ignored.
To search the entire packet, enter an 'A' as the conference number.
If this option is used with the N switch, the line will be ignored.
If 'Z' is used for the conference number, you can delete ("zap") certain
files from the packet. In this case, the format is Z,text. If "text"
starts with BLT, it'll be treated as a filename, and the bulletin(s)
specified will be deleted. For example, Z,BLT*.* will delete all
bulletins. If "text" is SESSION, SESSION.TXT will be deleted. If it's
FILES, NEWFILES.DAT will be deleted. If "text" is HELLO, NEWS, or
GOODBYE, the logon screen, BBS news file, or logoff screen will be
deleted. QWKPRUNE gets the names of these files from CONTROL.DAT. These
entries do not count against the maximum number of entries allowed in a
prune file. This option may not be used in a global prune file.
F: assumes that "text" is a user name, and will delete all messages from
that user. T: works similarly, except that it kills messages to a user.
B: finds messages that are both from and to a user. If "text" is @ME@,
it'll be replaced with your user name from CONTROL.DAT.
S: prunes out all messages that have "text" as their subject line.
If any of these switches are followed by P, all messages that contain
"text" within the appropriate field(s) will be removed.
If the S switch is followed by a B, all messages whose subject line
begins with "text" will be deleted.
D: treats "text" as a number of days before the current date. Messages
older than that will be removed from the packet.
N: assumes that "text" is a message number, and deletes that message.
If the colon is followed by a > (greater than) or < (less than) sign,
messages with numbers greater than or less than "text" will be removed.
When deleting messages greater than or less than a number, "text" may be
given as HIGH - nnn and LOW + nnn, where HIGH and LOW are the highest and
lowest message number in the specified conference. Note that some BBS
software uses a single numbering system for all messages, rather than a
separate numbering system for each conference. This option probably
won't work too well with packets from such systems.
P: assumes that "text" is a user name, and will cause all message to that
user to be marked as personal.
A: prunes out all messages within a conference. Anything following the
'A' will be ignored.
If a line begins with an exclamation point, messages meeting the search
specification will be "unkilled". This allows you to do things such as
killing all messages in a conference, then unkilling those you want to
keep. For example:
10,A:
!10,N:100
!10,SP:Interesting subject
A,B:Joe Schmuck
A,D:30
will kill all messages in conference 10, except for message number 100
and all messages with "interesting subject" in their subject fields. It
will then kill all messages either to or from "Joe Schmuck". Finally, it
will delete all messages more than 30 days old.
If the switch (or option, if used) is followed by a tilde (~), all
messages in the conference that do not meet the search specification will
be removed. This has the same effect as killing all messages in a
conference, then unkilling those that meet the search specification.
In the example above, the first two lines could be replaced by
10,N~100. This also works with the D switch. For example, A,D~30 will
delete all messages that are 30 or less days old. Of course, it'll also
work with the unkill option.
These features do not work with the P switch, or when zapping files.
You can define a global prune file in the configuration file. This file
may contain up to 25 entries, and will be used with all QWK packets. The
only valid conference numbers in this file are 'A' and 0. Also, the N
switch is invalid within it. In all other ways, it acts like a normal
prune file. When scanning a QWK packet, entries in the global prune file
will be processed before those in the regular prune file.
Command line syntax
-----
The command line syntax is:
QWKPRUNE [d:][dir][QWK_file] [d:][dir][prune_file] [options]
If you give a drive and/or directory with the prune file, QWKPRUNE will
still look for the global prune file in the default prune directory
specified in QWKPRUNE.CFG.
DOS wildcards (* and ?) may be used in the QWK file name.
If no extension is given, .Q* will be appended to the QWK file name,
and .PRN will be appended to the prune file name.
The QWK and prune directories can be specified on the command line by
ending the appropriate entry with a colon, backslash, or period.
This will override the QWK and/or PRUNE entries in the configuration
file.
If you wish to specify the prune file or prune directory, you must
enter something for the QWK file, unless you're using the /M option.
The options are:
/M[d:][dir] - If this switch is set, QWKPRUNE assumes that the QWK file
has already been unpacked. If a drive and/or directory is given, it'll
look there for it, otherwise the current directory will be used. It will
not create its work directory or repack the QWK file. Note: When using
this option, only give the name of the prune file on the command line.
When giving a drive and/or directory, there must not be a space between
the M and the drive/directory. Use this switch if you want to feed the
output to a mail reader.
/B - "Batch" mode. If this switch is set, the work directory won't be
removed.
/C[d:][dir]filename.ext - This option lets you use a configuration file
other than the default QWKPRUNE.CFG. There must not be a space between
the C and the filename to use.
/T - Use this switch to tag messages to be deleted later.
/TQ - Use this option to tag messages for processing by KingQWK and
QWKMerge. /T and /TQ will be ignored if /N has appeared earlier in the
command line.
/N - Use this option if you don't want to use a prune file. Messages
that have been tagged for deletion by KingQWK, KILLMSG, ZIPPYZAP, or
QWKPRUNE /T will still be pruned out. Also, (R) and Re: prefixes,
user-defined prefixes, and leading whitespace will still be stripped from
the subject lines. This will be ignored if either /T or /TQ appeared
earlier in the command line.
/NG - If a global prune file is defined, this switch keeps it from being
used. Regular prune files will still be used.
/Dnn - If wildcards are used in the QWK file name, or the default (*.Q*)
is used, packets older than nn days will not be pruned. There
must not be a space between the D and the number. If this is
given as /D- or /DA, QWKPRUNE will process all packets that match
the QWK file name, no matter what MAX_QWK_AGE is set to.
/P - If this option is used, QWKPRUNE will always repack QWKs, even if
they haven't been changed. If this option is entered as /P-, QWKs
will only be repacked if they've been changed, even iF FORCE_REPACK
is ON.
Things to watch out for
-----
QWKPRUNE hasn't been tested with DOS 2.x, but I see no reason why it
shouldn't work. QWKPRUNE.EXE won't be able to find itself under DOS 2.x,
so it'll assume that its configuration file and prune files are in the
current directory.
If your mail reader keeps "bookmarks", you may want to mark packets as
unread after pruning them. Otherwise, they'll no longer be accurate. If
your reader can't mark packets as unread, you can manually delete the
"bookmarks". QWKPRUNE will delete bookmarks from EZ-RDR, KingQWK, DeLuxe²,
Session Manager, Blue Wave, and MikeMayl if any messages are pruned out.
Don't use the /M option on a QWK while you're reading it, unless you're
also using the /T option. Some readers may leave MESSAGES.DAT open while
running outside programs. Rewriting MESSAGES.DAT under such conditions
may garble the file. Even if your reader closes MESSAGES.DAT, it may not
reload the changed .NDX files generated by QWKPRUNE.
Users on networks or using multitaskers should be sure that the QWK file
isn't being read or modified by any other process while it's being
pruned.
Error Messages
-----
Prune file(s) empty:
Neither the regular prune file nor the global prune file (if
defined) contained any valid message-procession entries. There
may have been file deletion entries. (R) and Re: prefixes,
user-defined prefixes, and leading whitespace were still stripped
from the subject lines.
No messages pruned:
No messages were found to prune.
Not enough memory to store all records:
A check of the far heap didn't find enough memory to store all
the message headers.
Memory allocation error:
An error occurred when allocating dynamic memory. Probably caused
by attempting to allocate more memory than was available. Since
QWKPRUNE checks to see how much far memory is available before
allocating any, this shouldn't happen. Please let me know if it
does.
Unable to open config file:
QWKPRUNE was unable to open its configuration file.
Unsupported archive type:
Either a packer or unpacker wasn't defined for the archive type of
the QWK file.
Unable to locate QWK file(s):
No .QWK packets matching the search specifications (filespec
and/or age) could be found.
Unable to open CONTROL.DAT:
QWKPRUNE was unable to open the CONTROL.DAT file from the mail
packet. If this error occurs, the mail packet is probably not a
QWK packet. If the packet was compressed with LHA or ZOO, it
also may indicate that there wasn't enough disk space to unpack
CONTROL.DAT. If a batch file was used to call the unpacker, there
may not have been enough free memory to unpack it.
Error in CONTROL.DAT:
An error occurred when reading CONTROL.DAT. Either it's garbled,
or it isn't from a QWK file.
Unable to open MESSAGES.DAT:
QWKPRUNE was unable to open the MESSAGES.DAT file from the QWK
packet. If the packet was compressed with LHA or ZOO, this may
indicate that there wasn't enough disk space to unpack it. If you
used a batch file to call the unpacker, it may also indicate there
wasn't enough free memory to unpack it.
MESSAGES.DAT is corrupt:
An entry in one of the .NDX files doesn't point to a valid message
header.
No .NDX files found:
QWKPRUNE was unable to locate the .NDX files from the mail packet.
Either the mail packet isn't a QWK, or the mail door didn't create
.NDX files, or there are no messages in the packet. If the QWK
door that produced the packet was configured not to create .NDX
files, you'll need to rebuild them before pruning the packet.
[QWK/prune/work] directory not found:
The QWK, prune, or work directory does not exist.
DOS error levels
----
4: Not enough memory to store all records.
5: Unsupported archive type.
6: Unable to open CONTROL.DAT.
7: Error in CONTROL.DAT.
8: Unable to open MESSAGES.DAT.
9: No .NDX files found.
10: An error occurred when unpacking the QWK file.
11: File write error due to lack of disk space.
12: MESSAGES.DAT is corrupt.
13: Invalid command line option.
14: Unable to locate QWK file(s).
15: Error changing to the drive the work directory is on.
Error changing to the work directory.
16: An error occurred when attempting to spawn a program.
17: An error occurred when repacking the QWK file.
18: File open error.
19: File write error.
20: Memory allocation error.
21: Unable to open config file.
22: The work, QWK, or prune directory does not exist.
23: Control-break exit.
24: The program was aborted by the user because the work directory wasn't
empty.
Acknowledgements
-----
Thanks to Mark May and Patrick Lee for gathering and distributing
information on the QWK specification, and to all those they collected
this data from.
Thanks to Jack Hudgions for providing information from GUS on detecting
archive types.
Thanks also to Joe and Pat McNeal, Diane Merriam, Bill Peek, and Darrell
Kitchen.
How to reach me
-----
Please send comments, suggestions, bug reports, etc. to me at:
RIME Shareware or Offline conference. R/O capable at site ->1066
RIME Common conference. Routed R/O ONLY at site ->1066
Ilink Shareware or Offline conference.
Fido Offline conference
Fido netmail 1:2320/110
WWIVnet email #360@8262
CompuServe mail 73760,2217 or >INTERNET:david.harden@tfd.coplex.com
Internet Email david.harden@tfd.coplex.com
Or send mail to:
David Harden
P.O. Box 197086
Louisville, KY 40259