From: jamesd@techbook.com (James Deibele)
Subject: Re: .QWK mail reader for Waffle (part 4)
Keywords: waffle, qwk, mail, offline
Organization: TECHbooks of Beaverton Oregon - Public Access Unix
Date: Sat, 12 Dec 1992 04:50:26 GMT

OK, so we've got the flow chart for our script.  Now we have to get out
the Procomm or Telix manuals.  I just tried another zip experiment: it
took 11 minutes and 30 seconds to zip 1414 messages, which took 1885K of
disk.  I have expire running at the moment, so I hope that zip will be a
little faster later.  But that's not so bad when you consider it would
take 2-3 hours to download at 2400 baud ...

Now on to the import side of things.  As far as I know, there's no way
for straight DOS to get the "basename" of a file.  If you want to unpack
FILENAME.ZIP into FILENAME, you have to specify "FILENAME" ahead of
time.  You can't say FILENAME=`echo $i | cut -f 1 -d .` for each file
the way you can with the shell.

Maybe we can supply a DOS "cut".  Or we could brute-force it, writing a
batch file that took the third field in newsgrp.lst and said something
like: 

for %%i in waffle bbs flame do unzip news_in\%%i.zip %%i
for %%i in waffle bbs flame do delete news_in\%%i.zip 

(This is pretty awful, because it makes no provision for damaged or
short zip files.  I don't remember my DOS batch file syntax very well
--- been a long time since I tried to do anything useful with it (thank
goodness!)).

After unzipping, the import program needs to adjust the high number
stored in the newsgrp.lst file.  That should be fairly simple to do.

Specifications for import program
(1) For each archive in NEWS_IN change to the directory of the basename
	--- so would change to ~/WAFFLE for waffle.zip
(2) Test ../NEWS_IN/$basename.zip
(3) If not OK, delete it.
(4)	If OK, unpack it and delete it.
(5) Find match for $basename in field 3 of ../newsgroup.lst
(6) Replace digit(s) in field 2 of ../newsgroup.lst with high number in
	current directory

OK, so now we have a reader.  I'd like to see a thread-oriented 
newsreader like trn or nn, but for the first version, I'll take almost
anything I can get.  "MAIL_IN" might be area #0, with the other areas
being numbered according to their placement in newsgroup.lst.  The
"change area" command would also change directories.

Specifications for offline reader:

First version:

(1) Read a typical UNIX file without need for conversion and display it 
	on local screen.  Be careful to wrap lines greater than 80 chars.
(2) Create file with proper heading for mail or news, then append
	message converted to MS-DOS format with ">" at start of each line
	and being careful to wrap lines greater than 80 characters. 
	(FfRr and maybe Mm keys)
(3) Invoke external editor, passing along name of temporary file.  After
	user exits editor, ask if they want to save file.
(4) If temporary mail message saved, create a file in directory
	MAIL_OUT.  If news message saved, create file in NEWS_OUT.  Erase
	temporary file
(5) Kill (delete) file?  (Kk) (Might be slow, but avoids need for expire)
(6) Save file, converting UNIX format to DOS while saving (Ss).
(7) Quit (Qq)
(8) Be able to select different area from a list of newsgroup areas,
	including a mail area (MAIL_IN).
(9) Space would move a screen at a time, return a line at a time, ^B
	would back up a screen.  Space on the last message in an area would
	move to the next area or ask "quit?" if last area. 
(10) "G" would show list of newsgroups from newsgrp.lst a screen at a 
	time and let you pick by number or name.

Future versions would have all the best features of nn and elm and all
the other newsreaders and mail agents.  :-)  But it would be nice to
have a kill file that could interact with a program on the host.  If the
kill file were small enough, it could be sent every time.  The host
could then use it to decide what messages to send --- the "nov" project
might mean a standardized database, at least for UNIX hosts, that could
be quickly compared to the kill file sent by the caller.  A little bit
of work on the host could drastically reduce the transfer time, as
messages <weren't> zipped and therefore <weren't> mailed.

The fact that QWK offline readers send everything is one of my biggest
complaints about them.  I've heard that "tin" can be used in batch mode.
Maybe the DOS reader should be able to maintain a tin-format file,
upload it to the host when it's changed, and convert the resulting text 
back to messages (I assume tin writes each area to a text file) once it's 
been downloaded.

Anyway.  I know that there are PC versions of elm and mush, and I'm not
sure how big a job it would be to convert trn or nn or something similar
to run under DOS.  But I haven't seen anything under DOS that can
compare to UNIX newsreaders, and I'd be reluctant to give that up.  So
(IMHO) effort should be made to port one of the good UNIX newsreaders to
DOS (and then to OS/2 or Windows or Mac or whatever), rather than make
do with a flashy but empty reader.

So there you go, my ideas on how to implement an offline reader for
Waffle and/or UNIX.  Note that it should be quite easy to provide for
additional functions because you just add a "sendfile" (or whatever)
command to Waffle or UNIX if you want to let a user do batch downloading
by uploading a text file.  Just add a couple lines to our standard
script, etc.

Comments, suggestions, code?  :-)