Mods made to Jnos 1.10h to yield 1.10i:

ipcmd.c				Make route cmds table DFAR.

iproute.c			Change TX encap PID default from 94 to 4.

trace.c				time-stamp monitor-style trace if MONSTAMP
				is defined.

smtpserv.c			Create Date and Message-id headers if missing.
				Return error 550 if REWRITE maps recipient to
				"refuse".  Allow 8-digit DOS sequence numbers.
				Handle delivery attempt to locked mboxes better.

pc.c, pc.h			Disallow ! (shell) without args and Mail commands
				unless they came from the console kbd.  Create
				TMP dir.  Fix ^PgUp and ^PgDn keycodes.

mboxmail.c			Disallow msg-abort via ^A during BBS forwarding.
				Properly detect bids in msgs we originated.

main.c, alloc.c			Added memory allocs/frees tracing.  Exit command
				returns its first arg as a return code.  Tail
				now uses all but 7 lines of the screen.  Don't
				change flow mode for Command and Trace sessions.

at.c				slight change in how maturation is calculated.

forward.c			If an address contains an '@' any '!' is an
				ordinary character.  Fix memory leak in FBBFWD.
				Don't send Cc: and Apparently-to: if smtptoo
				set.  FBBFWD processes optional dest field in
				forward.bbs file.  Don't FBB-forward while
				expire runs.  Handle 8-digit msgid's.  Added
				support for digis in forward.bbs file.

mailbox.c			Correct test for issuing a bye message, and
				fix telnet to port 513 (sysop).  Fix J cmd's
				display permissions test to obey 'mb hideport'.

mailbox.h			Add fwdareas.opt_dest pointer.

timer.c, timer.h		Correct conversion of ms to/from ticks.
global.h			Added #define for uint32.

ax25cmd.c			Diagnose invalid interface in connect cmd.

pktdrvr.c,pktdrvr.h,config.c	Add pkstat cmd, fix set_rcv_mode.

nntpcli.c			Eliminate To: headers in news articles.

makefile			Add targets dumpdate, clean, realclean and
				depend.

dumpdate.c			New program to display USER.DAT & bid HISTORY.

ftpserv.c			Test that CWD path is a directory.  Corrected
ftpserv.h			binwarn reply code.  Added PASV support.
				Eliminate automatic sending of message.ftp and
				desc.ftp files if the ftp passwd begins with '-'.

files.c				Allow = to flag which dir in ftpusers is to be
pathname.c			the home dir.  = is allowed where a tab is legal.

dirutil.c			Added UNIX_DIR_LIST compile-time dir-style opt.

pop[23]serv.c,nntpserv.c	Replace rip2 and rrip by rip calls.  Do locking.
index.c				Redo rip to strip \r as well as \n.  Try to
				keep XOVER response from killing Jnos.

usock.h				Increase SOBUF to 512 if NNTP/NNTPS defined.

ax25dump.c			Fix trace of pkts sent to us with NO_BCSTS flag.

expire.c			Allow for other routines to tell when expire
				is running, and wait until FBBSendCnt == 0.

pi.c				Replaced with newer version.

arp.h				Allow ARPLIFE to be predefined.

mboxcmd.c			Fix AN command's column counting.
============================================

Andrew G8FSL, provided code in pktdrvr.c to fix 'param <iface> rcvmode N' and
to add the pkstat command (which provides statistics on packet drivers).
Andrew also pointed out that the attach syntax prompts sometimes used "buffers"
when they meant "bufsize".  Accordingly, I've changed the prompts in config.c.

I noticed that the cmds table for the route command's options was lacking
the DFAR attribute, so I added it (in ipcmd.c).  Should help eliminate exceeding
DGROUP size when configuring many modules in Jnos.  Probably we should do the
same in other modules...

Since 1 March 95 was 'flag' day for switching to a packet-id code of 4 for
IP-IP encapsulation, I changed iproute.c to use IP_PTCL instead of IP_PTCL_OLD.
This should only affect Internet wormhole stations, and may be changed to the
previous behaviour by issuing "ip encap 94".  Remember, this only affects
which PID is transmitted.  Both 4 and 94 continue to be accepted in received
packets.  Gateway stations behind a firewall will probably have to make a
change to the firewall configuration, or revert to PID 94.

Some applications would benefit from a timestamp in the monitor-style
trace mode.  This is enabled if MONSTAMP is defined.

I added Andrew G8FSL's mods to getmsgtxt() in smtpserv.c, to create new Date
and Message-id headers when they are missing from an incoming msg, thus
avoiding problems with this msg later on.  I also added code to return an error
code (550 Unknown address) if the REWRITE file maps the recipient address to
"refuse", thus allowing email to be rejected.  Selcuk pointed out a problem
when trying to deliver to a locked mailbox: a tight retry loop resulted.  I
changed mailit() to just fail the attempt, rather than trying to requeue
locally and claim the delivery succeeded.

I changed doshell() in pc.c to prevent a remote sysop from executing a "shell"
command without arguments, since there's no one at the console to type the exit
command to MSDOS (done in memory of sysop Rich's Thanksgiving Day drive to
reset a Jnos node for this reason!).  "shell" without arguments is only allowed
from the console, since, for example, 'at "!"' will lockup things too.
A similar change was made to dobmail() to disallow the Mail command except
from the console.
I also changed ioinit() in pc.c to create the dir named in the TMP environment
variable, as Jnos' mkname() replacement relies on it.  Finally, I swapped the
keycodes for ^PgUp and ^PgDn to match how my keyboard (and others') behaves!

I sometimes wonder how close Jnos gets to using all the file handles available.
The Borland library routines support at most 20 file handles, so increasing the
FILES= value in CONFIG.SYS may not help (depends on what multitasker you use,
I should think).  Anyhow, status line 1 can be made to show the number of
available file handles under MSDOS if SHOWFH is #defined.  I added this
experimental feature to pc.c ... let me know how low it gets and under what
circumstances!


I observed problems with a message arriving from an FBB bbs, that contained
^A in column 1.  It was taken to be a msg-abort request, which should not be
accepted as such during a bbs forward.  Now fixed to treat ^A as data in this
case (dosend() in mboxmail.c).

I also changed msgidcheck() in mboxmail.c to properly scan bids to find those
we originated. The original code was not looking for the mbox Haddress, and
since it may not equal the Hostaddr, some bulletins we originated were coming
back as duplicates.

I added code to produce a disk log of memory allocations and frees, when
MEMLOG is defined.  This is for debugging memory leaks only; it drastically
impacts performance and might corrupt mailboxes if a stackframe grows too large.
A program, memlog.c, will analyze which routines did memory allocations that
were never freed.  Programs changed were alloc.c and main.c.
Coding by KF5MG and N5KNX.

Both the tail and taillog commands now use all lines available on the screen,
less 7.  So 43/50 line console screens are more utilized.  From PE1DGZ.

I added the ability of the exit command to return it's first argument as
a numeric return code.  This will allow batch files to act upon the code
returned by a Jnos invocation.  The default code is 0 if none is supplied.
Files modified include main.c, curses.c, smisc.c, smtpserv.c, sockuser.c
and global.h.  An exit that occurs as the result of the "remote" command's
exit option, returns code 100.

I noticed that keyboard() in main.c was forcing flowmode ON for the
command session, and OFF for the trace session, whenever they were selected
by F10/F9.  Since one might want to change the flow mode from the default
I no longer change flowmode when switching to these two sessions.
For the Command session, use 'session 0 flow on/off', and for the Trace
session, use 'session <Nsessions-1> flow on/off' (but it won't affect
packet trace output anyhow).

I modified makecl() in forward.c to treat '!' as an ordinary character
if the address contains an '@'.  Thus SB SALE!@ALLUSA will now work. I
also fixed a memory leak in dofbbrecv().  I eliminated Cc: and Apparently-to:
headers from being forwarded when the "mbox smtptoo" flag is set.  FBB
forwarding changed to obey a destination address if given after the area
name in forward.bbs.  The destination address override is useful, by the
way, since it permits internet mailing lists, mapped into an area, to be
forwarded and not produce a mailloop (since otherwise a destination system
running Jnos, would attempt to deliver it to the To: address)!

I fixed domboxbye() in mailbox.c to use the correct bitmask to test for
expert mode, thus restoring the farewell msg display.  Also, the correct
mask is now used to limit the Jheard list display for hidden ports.
I also found that mbxrecvline() was not handling telnet options for the
sysop "rlogin" via port 513, and so changed it to test to support telnet
options only for TCP protocol links.  Finally, I removed the U option from
the upload syntax display, as it's not implemented (presumably an auto
uudecode after the upload is complete was envisioned someday).

In timer.c I found that the value used to convert from ms to ticks
(MSPTICK == 55) was the cause of the perceived Jnos clock running fast.
The actual value is 54.92541, derived from a clock freq of
14.31818 divided by 12 to feed the 8254 PIT which divides by 65536 to
yield a timer tick interrupt. (whew!)  The effect of this bug was that an
hour timer would mature 5 seconds early, causing certain repeated AT commands
to run too often.  Affected routines are set_timer(), read_timer() and
dur_timer().  I changed the interpretation of the set_timer
ms-duration argument to an unsigned long, since it can't be negative.

In at.c I changed the seconds value of all timer settings, from :00 to :05,
to allow some safety factor for repeating at commands.  This "should" be
unnecessary, but anyhow won't hurt anything.

I added a test for an invalid interface in ax25cmd.c doconnect().  Thanks
Brian, KO4KS.

I found that news articles that arrived via NNTP, and contained To: (or
equivalent) headers, would later cause trouble if that NNTP area were
forwarded to a Jnos system.  I changed nntpcli.c getarticle() to remove
such headers (the Newsgroup: header should suffice, and the To: headers
were a vestige of how the message came to become a News article).

I added targets clean and realclean to the makefile, to assist in deleting
derived targets.  Target depend added to help rebuild the dependencies listed
at the end of the makefile.  I made nos.exe depend on version.obj too.

I added a new program, dumpdate.c, to enable the sysop to display the contents
of the USERS.DAT file, and to display the bid HISTORY file, in a useful manner.
Usage is:  dumpdate [-v] file_path
where -v implies a verbose display, and the file path defaults to
/spool/user.dat.  dumpdate.exe is obtained by:  make  dumpdate

I added a test in ftpserv.c, that the path argument to the CWD command is
indeed a directory.  Also, the warning msg that ASCII mode was being used
to transfer a possible binary file, was changed to have reply code "150-"
to match the "150 Opening data connection" msg that immediately follows.
This was needed since at most one 1xx reply code can be sent per RFC-959.
I added the PASV support from G4IDE via Selcuk, so that Unix' proxy-ftp
can be used with Jnos.  Apparently other programs use PASV too.
I applied Selcuk's change to eliminate automatic sending of message.ftp and
desc.ftp files if the ftp passwd begins with '-'.

I applied Selcuk's mods to userlogin() in files.c and firstpath() in
pathname.c, to permit an '=' to flag the following dir as the home directory
in an FTPUSERS entry.  This permits having different ftp permissions at
each level in a directory tree and still control which is the initial dir:
anonymous * /pub/wr_only 2  /pub/rw_del 7   =/pub 1

Since some uses of Jnos require the ftp dir command output to be in a
recognizable format, I added a compile-time option UNIX_DIR_LIST, which when
defined (typically in config.h) will produce a unix-style directory listing.
The code was adapted from Doug WA3DSP's dirutil.c in 1.08dff.  If you need
a Windows or Windows-NT presentation, see Doug's version of dirutil.c.

Andrew G8FSL pointed out that rip(), rip2() and rrip() could be combined
into one routine, thereby saving a few bytes.  I modified rip() in index.c
to thus trim off CR as well as LF, and changed all references to rip()
in pop2serv.c, pop3serv.c, and nntpserv.c.  Also I applied Selcuk's fixes
to pop3serv.c: noop command, delayed flushing, mbox locking and pwaits().
I also applied similar changes to pop2serv.c.

Per Roger G4IDE, I changed nntpserv.c to eliminate a memory leak if
nntp access were denied.  I also tried to keep the XOVER response from
overflowing the 512-char limit for NNTP lines, and increased SOBUF in
usock.h from 256 to 512 when NNTP/NNTPS is defined.  There may be places
in nntpserv.c that yield a crash because too many chars are written for
usprintf() to handle.  Stktrace will provide info on where this occurred.


I changed ax_forus() in ax25dump.c to return TRUE when the destination
address matches the cdigi call, or the bbscall, in addition to the interface's
hardware address callsign.  This allows the NO_BROADCASTS trace flag to
work properly for ax.25 tracing.

Since expire rewrites areas, and FBB-forwarding code retains area indices
for up to 5 messages before resyncing, there is a window in which either
null message bodies are sent, or possibly garbled messages are sent.  To
prevent this from happening, I disallowed new FBB-style sending while expire
is running.  I also defer expire until all current FBB-style sending terminates.
Affected are Expireprocess() in expire.c, and fwdinit(), dofbbfwd() and 
dofbbsend() in forward.c.  I also changed sendmsg() to detect errors reading
areas, to avoid sending a null or damaged message.  In this case, the connection
is closed without terminating the current msg.

I added support for a digipeater string in the ax25 connect lines found
in forward.bbs.  It's been documented to work, and now it truly does!

Since it is such a pain when the sequence number wraps from 99999 to 00001
(last-message-read calculations are unreliable, necesitating waiting until
old msgs are expired or otherwise deleted, and resetting/deleting the *.usr
files) I have extended the sequence numbers to 99999999 (eight digits).  Thus
the hassle occurs 1/1000-th as often!  As a consequence, msgid's in R: lines
(the #:nnnnn field) are now built modulo 100000.  Also, bids on bulletins we
originate are handled similarly.  Affected routines are makecl() and
sendmsg() in forward.c, get_msgid() in smtpserv.c and msgidcheck() in
mboxmail.c.  Also, any external programs which use the sequence.seq file's
contents should be prepared to obtain 8 digit numbers (eg, BM.EXE, BMH.EXE).

Barry VE3JF provided a newer version of the PI card driver, pi.c.  The
older one was renamed to pi_old.c.  Improvements include faster B channel
baud.

I changed arp.h to allow ARPLIFE to be predefined, perhaps in the makefile
or in global.h, to permit other than a 900 second timeout of non-manual
arp responses.  This is desired by 1200 baud RSPF users.

I noticed that the mailbox AN command didn't do column counting right,
and so fixed listnewmail() in mboxcmd.c.
