
 Third patch, this one is 2.0m.5C, these are additions to 2.0m.5B changes.
  (see the first two patches further further below)

 * WHY are these being released as patches ? because I would like a fair of
   time to pass to make sure they are all 'working' as planned before they
   get permanently added to the official release - Sorry :|

 1) nr4subr.c - try and better validate a NETROM CB (Control Block) when a
    NETROM disconnect is received, because we might be trying to free memory
    for something that may have disappeared already.

 2) Bumped up Nr_maxroutes to 10, seeing Nr_maxroutes exceeded in the logs.

 3) mboxmail.c - IMPORTANT - if a station that is NOT configured as a BBS in
    your ftpusers, sends a SID, JNOS will NOW send back terse message saying
    the user is not configured for BBS operation, disrupting the flow !

    This is my alternative to some modifications Brian (N1URO) came up with,
    the concern being to protect against rogue or ignorant incoming connects,
    which could result in possible malicious forwarding or illegal forwarding
    of 3rd party messages. Any events are also logged to the JNOS logfile.

    WARNING : IF you choose to apply this update, make sure ALL the remote
    systems you expect INCOMING forwards from have 0x02000 OR'd into their
    permissions - so for example, 0x0407f will become 0x0607f instead.

    I also cleaned up log calls in the capture_sid() function, thinking they
    should not be smack in the middle of link list processing, like what was
    encountered in the DUPE control code. I also removed some old code that
    was permanently commented out, no point leaving it there anymore.

 4) fbbfwd.c - updates to the DUPE control code introduced in 2.0m.5B.

    When duplicate messages are coming in simulaneously, we pick one of them,
    and then ignore the rest by refusing them. The problem with refusing them
    however is if anything bad happens during the processing of the message we
    picked, then we've taken away the ability for JNOS to receive the message
    again from our remote systems. I've changed it now to use defer instead.

    Also, if anything bad happens during processing, we need to make sure to
    remove the BID from the DUPE control list, or else JNOS will NEVER accept
    the message again, since the only other time it's removed is inside SMTP
    code after the message has been successfully delivered by JNOS.

 5) Added EHLO support to smtpserv.c (thought it was there already, oops)

    Discovered this by accident, when my android phone kept complaining that
    the SMTP to my JNOS was not working, a quick trace showed the EHLO cmd.

 Updated November 1, 2020

------

 Last updated October 25, 2020 just after 8:10 pm (Winnipeg Time) DST

 *** This is BETA, test the crap out of it, watch for DUPES ***

 ONLY APPLY THIS to the latest 2.0m.4 (from rsync repository), sorry ...

  please report ANY issues ASAP, thank you !

 This is the second patch, which sees the addition of DUPE protection for
 concurrent forwarding sessions from more then one remote host, where the
 same message with same BID is coming in from multiple sources, seconds of
 each other, even within a minute or so of each other. JNOS is vunerable
 to this, resulting in duplicate bulletins. This patch fixes the issue.

 The first patch was 2.0m.5, this one is 2.0m.5B !

 What this patch adds to the first patch
 ---------------------------------------

 1) As noted above, addition of DUPE protection, explanation below :

   When JNOS gets an incoming proposal and accepts a message with FS +, there
   is a period of time (depending how quick forwarding is with remote system),
   where if another message with the same BID shows up from another remote BBS
   or even in the same batch as the 1rst incoming proposal, JNOS will actually
   accept these messages with FS + as well ! That is because the BID does not
   get stored in the history file until the message being forwarded has been
   fully delivered by JNOS - that can take even several minutes believe it or
   not. So during this 'gap' we are vunerable to incoming DUPES, yes, true !

   So up till now, I have recommended some time ago to stagger forwards as
   best as possible so that your system only forwards with one remote host
   at a time, no concurrent forwarding with multiple remote systems. There
   is still a rare chance for dupes, but this strategy greatly reduces it.

   This new code now tracks ALL concurrent forwarding sessions, and watches
   for messages having identifical BIDS, only allowing the first message it
   sees to be accepted with FS + and processed by JNOS, the rest are ignored
   and JNOS responds to those with FS - instead. It seems to work quite well
   based on testing I was able to do with several systems definitely sending
   me dupes at the time (ironically now when I need to test, they've decided
   to follow the stagger recommendation, so harder to test now, how funny is
   that), anyways ...

   I'm still debating whether I should actually defer DUPE messages instead of
   refusing them (using FS= instead of FS-) since if something goes wrong with
   the delivery of the first message it sees, we loose the chance for another
   message to come in and try again, so we'll see how that plays out first.

 2) Better error logging in case there are errors saving BID to history file.

 How to update your JNOS 2.0m.4 system
 -------------------------------------

  run rsync on your source tree like you usually would, for example :

   cd <your JNOS source>

   rsync -av www.langelaar.net::jnos2 .

  after the rsync is complete, you should notice a new file called :

   update_jnos.2.0m.5B.tar.gz

  extract the files using :

   tar xvzf update_jnos.2.0m.5B.tar.gz

  if you need TNODE stuff, then add #define TNODE to config.h

  then do the usual make clean ; ./configure ; make

 What you got in the previous 2.0m.5 patch
 -----------------------------------------

 1) If I sent a message from my JNOS to someone else, the BID is of
    the format NNNNN_VE4KLM, where NNNNN runs between 1 and 99999.

    If an email client is used, NNNNN gets set from the last 5 characters
    of the usually lengthy message-id from the email client, for example :

         04027762-9c6f-a10b-94f5-5f8c9f8581ae@ve4klm.ampr.org

    will result in 581ae_VE4KLM, which as of late has been an issue, note it
    is not capitalized, and several instances of this have recently generated
    duplicate messages from various JNOS systems out there. 

    Why ? I suspect the uppercase/lowercase mods I did in 2018, started back
    in 2015 are possibly responsible for this, so it is imperative to get as
    many cases of JNOS 2.0 up to speed as possible once BETA tests are done.
     (in other words I may have bit myself in the ass back then, not sure)

    With this update, NNNNN is now a base36 number for both of the above cases,
    since the pool of sequence numbers now goes into the several million range,
    so for the case of email clients, it now draws from the JNOS sequence pool,
    hopefully that makes sense to everyone.

    If a message is NOT from our host, a crc and the callsign of where the
    message came from is used to generate the BID, I was hoping to replace
    the use of crc with the same base36 number, but some strange results
    occurred in my tests, so I've held off with that.

    Any time I release an update like this, I'm nervouse, so please keep your
    eyes open for issues.

 2) Instead of hardcoding NETROM parameters, I know several folks have had it
    done, please consider useing the following NEW commands in autoexec.nos :

      netrom obsoinit <value>     default is 6, for NEDA use 5
      netrom obsominbc <value>    default is 5, for NEDA use 3

    I saw acktime hardcoded as well in some cases, use an existing command :

      netrom acktime <value>      default is 3000, for NDEA use 64
                                    (you may want to confirm, 0100 octal)

 3) If you want to use Brian's (N1URO) mods for TNODE, then define TNODE in
    your config. h or in your makefile before you compile your code.

 4) There is other stuff I wanted to add, but this BID thing is important,
    and I want to get it out of the way, there will be more BID stuff at a
    later date, we're not done with this yet ...

 IF you are running two systems with the same Call Sign
 ------------------------------------------------------

  Please consider staggering your sequence numbers, since the sequence number
  pool is now into the several million range, not constrained to the old 1 to
  99999 and back. For example, in my /jnos/spool/mqueue/sequence.seq, I reset
  the value to 16801420, which starts my base36 bid at ANNNN, way ahead.

  If anyone sees a flaw in this, please talk to me :]

  Not so sure one should be running multi BBS with same callsigns, but ...

