
 QWKFIX.EXE by Mark Zec 



 Overview 

If there's anyone who hasn't heard of the "dreaded" Y2K computer problem
yet, you're in for a huge surprise (and also a huge letdown, IMHO, since 
it's probably the most overhyped news story of the "millennium"), but I'll
go ahead and give a brief background anyway.

Basically, in the "old" days of computers, programmers used 2 digits to
represent years because both computer memory and disk space were very
expensive.  Unfortunately, as prices came down, and these types of 
constraints began to become irrelevant, a lot of programmers never
bothered to update their programs to 4-digit year capability.  

The Y2K problem also occurs in the BBS scene.  Both mail doors and offline
mail readers (OLMRs) are susceptible to the same types of Y2K date problems
as other programs, such as spreadsheets.  Luckily, the BBS problems aren't
nearly as fatal as if your bank doesn't calculate dates correctly. This is
where QWKFIX enters the picture.

QWKFIX can likely be used to fix two Y2K-related message problems on BBSes:

  1. Mail doors - Used for creating QWK (message) packets for use with
     offline readers, and for receiving REP (reply) packets that the same
     offline readers create.
  2. Offline mail readers - Used to read the aformentioned QWK packets, and
     create REP packets to send back to the mail doors.

I won't bore you with the gory details of how to use the various mail doors
and offline mail readers, because that's far beyond the scope of this 
little utility.     

On the BBS/Sysop side, QWKFIX can be used (depending on the BBS setup) to
repair REP packets that the BBS receives as well as fixing outgoing QWK
packets.  

On the user/caller side, QWKFIX can be used to repair QWK packets before 
reading (if the BBS you call isn't running a Y2K compliant mail door) as
well as repairing REP packets before they get sent to a BBS (if you happen
to be using a non-Y2K compliant mail reader).



 Syntax 

QWKFIX, despite its power, has an extremely easy-to-master syntax:
 
QWKFIX [-q/-r] [n]

   [-q] Tells QWKFIX to process QWK packets.         
   [-r] Tells QWKFIX to process REP packets.
   [n]  Optional.  [n] represents a number between 0 and 180 (30 is default
           if [n] is not provided) that QWKFIX uses for judging the accuracy
           of dates found in QWK/REP packets during processing.

Both [-q] and [-r] are required parameters for QWKFIX to operate, however
they cannot be used at the same time.  If you want to process all QWK and
REP packets in a single directory, the program has to be invoked twice, once
with the [-q] parameter and once with the [-r] parameter.

QWKFIX must be run in the directory where the packets are located, since at
this time it doesn't accept paths as a parameter.  If you're running this
via a batch file, it's easy enough to have it do this automatically.  For
example, if all of your packets wind up in the C:\PACKETS directory, and 
you set the [n] parameter to 30 (more on this parameter later), you could
easily have your batch file look like this:

CD\PACKETS
QWKFIX -Q 30

QWKFIX only supports the standard DOS PKZip/PKUnzip syntax at this time.  
Both PKZip and PKUnzip must be in your path for QWKFIX to be able to 
utilize them.  If I'm feeling good about myself <g>, I may even add an 
external configuration file at some time to permit the usage of different 
archivers.



 Functionality  

What QWKFIX does is this:

   [-q] Unzips QWK packets one at a time, extracting the MESSAGES.DAT file
        inside.  The .DAT file is processed, correcting "broken" dates, then
        re-zips the QWK packet with the new MESSAGES.DAT file.  No other 
        files inside the packet are modified.  Because some people tend to
        frequent many boards, and keep older packets on hand, QWKFIX will
        look for the extension of *.Q??, not just *.QWK.  Granted, it may
        have been "safer" to have QWKFIX just for *.QW?, but all it takes
        is having 10 packets on hand from one BBS and QWKFIX would "break"
        and not be able to process .Q10, .Q11, etc.  This means that QWKFIX
        will attempt to process *any* file with the *.Q?? extension, so
        I suggest keeping all of your packets in a directory by themselves.

   [-r] Unzips REP packets one at a time, extracting the BBSID.MSG file
        inside.  The .MSG file is processed, correcting "broken" dates, then
        re-zips the REP packet with the BBSID.MSG file.  No other files are
        included with REP packets, so obviously nothing else can be modified.

   [n]  Based on the number that you provide on the command line (and if you
        don't provide anything, QWKFIX defaults to 30 days), QWKFIX will 
        compare the dates in each message in the QWK/REP packets with the
        current computer system date.  If the message dates fall outside of
        the value of [n] on either side, the message date is changed to the
        current system date.  For example, if the current date is 12-25-99 
        and QWKFIX finds a message date of 12-01-99, the message date would
        be left unchanged if the default value of 30 is used, because      
        12-01-99 is within 30 days of 12-25-99.  Similarly, using the same
        system date, if a message date of 01-01-00 is found, it will again
        be left unchanged because it is again withing the 30 days specified.
        However, using the same examples as above, if message dates of     
        01-31-00 or 11-15-99 are found, they will be changed to the system
        date because both are not within 30 days of the current date.
        Providing a value of 0 will force QWKFIX to use the current system
        date for every message.

The [n] functionality is built in to allow a margin of error during message
processing, but is limited to 180 days (roughly 6 months) to keep the margin
from becoming too large.  Many network hubs have some kind of date checking
software in place for message handling so that "bad" dates don't get passed
all the way down the network.



 Sysop Usage 

If you're using this utility as a sysop, QWKFIX should be able (based on
your particular setup, of course) to be inserted into your mail processing
routines.  If your mail door handles archiving/unarchiving of mail packets
via batch files, it should be fairly easy to insert QWKFIX somewhere into
the batch to process QWK files after they're created, but before the mail
door sends them.  Similarly, it can be inserted to correct REP packets 
that users upload to the BBS before they get tossed to the message bases.

For example, if you have a batch file for sending QWK packets to users that
looks something like this (and I'm inventing a generic syntax):
 
PACK %1 %2 %3
ZMODEM /SEND %1

It should be possible to insert QWKFIX into the batch file to process the
QWK packet after it's created, but before it's sent to the user:

PACK %1 %2 %3
QWKFIX -Q 0 
ZMODEM /SEND %1

Similar syntax would apply (likely the exact opposite of the above) for 
processing REP packets:

ZMODEM /RECEIVE %1
QWKFIX -R 30
TOSS %1 %2 %3

PLEASE note that I'm not here to instruct you on how to integrate QWKFIX 
into your BBS mail software, but instead providing a basic example of how 
you may be able to use it with your particular setup.



 Caller Usage 

If you're using this utility as a caller to a BBS, and would like to ensure
that the packets you receive and send are "fixed", it would be fairly simple
to integrate QWKFIX into your setup.  After downloading your packets, simply
run QWKFIX with the [-q] parameter to process them all, then with the [-r]
parameter after all messages have been read/replied to, before sending the
REP packets to your favorite BBSes.



 Y2K Problems 

I've structured QWKFIX to correct as many Y2K problems as possible.  However,
that doesn't mean that it corrects everyone out there.  I used the web site
of Jim Hanoian (http://www.kannoncom.com/~jhanoian/readers/read-y2k.htm) as
a bit of a "reference library".  Jim has done considerable research into
Y2K related problems with mail doors and offline mail readers, and I used
just about all of the test packets he has available for download during the
testing of QWKFIX.  Thanks Jim!

If you have any Y2K-related questions about mail doors and readers, I'd
suggest you take a look at Jim's web site.  He has a lot of good information
available there, as well as a good number of links to BBS mail resources.



 Registration and Contact Information 

I'm releasing QWKFIX as freeware to the BBS community at large.  A lot of
mail utility authors closed up shop when the Internet started hittng BBSes
hard, and there are a lot of unsupported mail doors and readers out there.
I can't fix all of the programs, but I CAN write something that can hopefully
repair the output, especially to compensate for those authors that are still
around but aren't willing to "waste" their time to spend a few minutes to make
sure their programs won't screw things up when 2000 gets here.

Flames, praise, and questions can be directed to me on the BBS at 
mark.zec@haremail.com.  If you have a problem with a particular packet, 
send it my way...I can't find out what the problem is without it.  I'll 
do my best to correct the problem and get a new version of QWKFIX released,
but there's no promises.  After all, I'm doing this for free and in my
rather limited spare time.  <g>

Even though I'm releasing this as freeware, I'm not above accepting large
cash donations if you find this utility to be the best thing since sliced 
bread.  Currency in any U.S. denomination will be accepted, although I prefer
$50's and $100's.  <bg>
