How To run Multi Relay Chat on RemoteAccess
Hi Everyone,

The following is an overview of how I got RemoteAccess, DOS BBS software from the early 90s, to allow users to participate on the modern Internet based Multi Relay Chat (MRC, formerly Mystic Relay Chat).


Software used to make this work
- NetFoss (PC Micro Systems)
- NFU (PC Micro Systems)
- TelnetDoor by R&M Software
- Phenom's PN-MRC129.ZIP mrc_client mod (StackFault)
- RemoteAccess (originally Andrew Milner, now Bruce Morse)
- Mystic (originally James Coyle)
- Python 2.7 (Python Software Federation)
- A few snazzy batch files (me!)


Where can I find these amazing programs?
Netfoss/NFU - www.pcmicro.com
TelnetDoor - www.randm.ca
Phenom's PN-MRC129.ZIP mrc_client - files.scene.org
Python - www.python.org


A few things to note for the examples below

- My BBS server's internal IP is: 192.168.12.2
- The BBS server runs both RemoteAccess AND Mystic at the same time in separate DOS (NTVDM) sessions.
- Mystic is configured to ONLY listen for RLOGINs on port 513. Nothing else.
- NetFoss listens for Telnet connections coming from outside on port 23.
- TELNET:23 is the ONLY port open to the world.
- RLOGIN:513 is NOT open to the public internet. It's only internally accessible.
- When NetFoss receives a valid Telnet:23 connection, it launches RemoteAccess, NOT Mystic.
- Examples show NODE1 in use, if a user was on NODE2 then the paths/file names would reflect NODE2, etc...


How it works (or... how to cheat and make it work) :)

- A user connects to the Netfoss telnet server and the telnet server loads the RA BBS.
- Once the user has logged in, they choose the CHAT sub-menu.
- The CHAT sub-menu loads, but the first thing it does is automatically run a batch file (Type-7) that uses NFU to create a DOOR32.SYS file containing the logged in users handle & name (amongst other things).
- The batch file extracts the users handle & name from the DOOR32.SYS file NFU just created and tries to create a new user in Mystic using the extracted handle & name. It sets a generic password and user security level of 10.
- If the user already exists in Mystic's userbase, the newuser creation silently fails. If the user didn't exist, they do now! :)
- The RA caller then sees the CHAT menu and presses {M} to launch MRC.
- RA is setup to execute a 'TYPE-7 external program' as it does to run most doors. It launches NFU for the appropriate NODE# the user is logged into, creating a fresh DOOR32.SYS file and then calls GO#.BAT (# being the node number).
- GO#.BAT extracts the users current handle from the fresh DOOR32.SYS file and stores it in a variable (%line6%). It then launches telnetdoor.exe -R -S192.168.12.2 -Y%line6% -Xpassword -Dc:\ra\node1\door32.sys
- This logs the user into the local Mystic server (running on the same machine as RA) using the users handle variable & preset password.
- Mystic's prelogin menu is set to go directly to the Mystic Main menu, Hot Key set to EVERY.
- Mystic's Main menu is set to launch MPL program 'mrc_client' when the menu loads. Hot Key: FIRSTCMD
- Yay! We're chatting on MRC using the proper handle as our name!
- When the user quits the MRC client (/quit) and is returned to the Mystic Main menu, the next command in sequence executes, which is Hangup Immediately.
- The user is disconnected from the Mystic RLOGIN session and returned to RemoteAccess in the CHAT menu.


Ready to make this happen on your RemoteAccess BBS?
Read on...


Step by Step - HOWTO

I'm assuming you already have a working RemoteAccess BBS that is accessible over telnet using Netfoss.
I also won't go over how to use an ANSI editor to create the menus. You can do that.
Download the required software listed at the top of this document.
Have it ready to install but don't install it all yet.

** We'll do a VERY minimal configuration of Mystic, since we're just using Mystic as a framework for running the MRC_CLIENT and not actually running a full blown Mystic BBS.
We don't need to worry about security much on the Mystic BBS because there is no way for a user to login manually.
All credentials are passed from RA directly and Mystic's RLOGIN port of 513 is NOT open to the public internet.

**


STEP 1 - Installing/Configuring Mystic

We're going to install Mystic onto your BBS computer.
I installed mine into C:\MYSTIC
Go ahead and run the installer.
Once installed, we need to create the Mystic Sysop user.
Go into the MYSTIC directory and type: MYSTIC -L
This will launch a LOCAL instance of Mystic so you can create a user.
This will later become the Sysop user.
Once the user has been created, LOGOFF and return to the command prompt.
Type: MYSTIC -CFG to launch Mystics configuration utility.

Press down and move over the EDITORS menu. Choose USERS.
Select the user you just created and ENTER.
Press CTRL+U to upgrade the users security.
Give the user level 255 (Sysop) security.
ESC out and save the changes to the user.



Go into the EDITORS menu, go down to SECURITY LEVEL EDITOR.
Choose LEVEL 10
Set the TIME PER DAY to however long a user can spend on MRC each day in minutes (120 for 2 hours, etc..)
You can also set other limits here if you want.
Press ESC when done to back out to the EDITORS menu.

Go into the CONFIGURATION menu.
Choose GENERAL SETTINGS.
Here you can setup your BBS name, Sysop name, etc...
Leave the START MENU set as PRELOGIN.



Next, let's setup your Mystic SERVER options.
Because we're not actually running a Mystic BBS, just using the Mystic framework as a means to run the MRC_CLIENT, we don't need to worry about accepting SSH, TELNET, etc.. connections.
In MYSTIC -CFG go over to the SERVERS menu and down to GENERAL OPTIONS.
Here you can enter the DOMAIN NAME of your BBS (mine is bbs.dsbbs.ca), how many NODES your BBS has (RemoteAccess Shareware comes with 2 nodes, so set it to 2 unless you're lucky enough to have RA PRO or purchased additional nodes).
That's pretty much the only settings that need to be defined in this screen.
Press ESC once to back up a level.
Choose CONFIGURE SERVERS.
Go down the AVAILABLE SERVERS listing and press enter on all the ACTIVE (yes) servers and set them to NO with the exception of RLOGIN.
Once all the ACTIVE SERVERS are set to NO, go into RLOGIN and make sure it is set to: ACTIVE - YES
If it's not there, type the IP address of your internal network (my server's internet IP is 192.168.12.2)
The default RLOGIN port is 513. If you NEED to change this, write it down because we'll need it later.
No need to setup the country block, as your users are already authenticated by RemoteAccess. Mystic isn't accepting any NEW LIVE user connections. Just existing user connections passed from RA.
Press ESC to back out to the SERVERS menu.
Go down and choose EDIT IP WHITELIST.
Put your servers IP address in here, otherwise Mystic will think your server is hammering it with logins and could block RA. :)
Press ESC and save changes.

That's it for Mystic Configurations for now...
We'll come back to it once we have the MRC_CLIENT installed so we can configure our menus.


STEP 2 - Python

Install Python 2.7.x
At the time of this writing, 2.7.18 was the latest version that would still run on 32bit XP PRO.


STEP 3 - Install Phenom's modified MRC_CLIENT

UnZIP mrc_client.py and mrc_client.py into your MYSTIC directory. In my case, c:\mystic\
EDIT mrc_config.py and put your BBS info in there.
This information will display when someone on MRC chat types /INFO yourbbs#.
Save the file and exit.

You need to start mrc_client.py and keep it running at all times for the whole thing to work properly.
I start mrc_client.py using my BBS startup batch file.

This file starts Mystic listening for RLOGIN connections.
Starts the mrc_client.py and connects it to mrc.bottomlessabyss.net on port 5000
Starts my mailer/tosser (D'Bridge).
and finally, starts my telnet server (net2bbs) that in turn calls my RA startup batch file when a user connects over telnet.

Here's my BBS startup batch file that automatically runs when the computer boots.

----- dsbbs.bat START -----
@echo off
cls
c:
cd\mystic
start python mrc_client.py mrc.bottomlessabyss.net 5000
start mis server
start call c:\db4\go.bat
cd\netfoss
net2bbs.exe
----- dsbbs.bat END -----

Now let's setup mrc_client MPL in Mystic.

Extract scripts/mrc_client.mps into your Mystic /SCRIPTS directory (C:\MYSTIC\THEMES\DEFAULT\SCRIPTS\)
Extract text/mrcmain.ans into your Mystic /TEXT diretory (C:\MYSTIC\THEMES\DEFAULT\TEXT\)
Extract text/mrchelp.ans into your Mystic /TEXT diretory (C:\MYSTIC\THEMES\DEFAULT\TEXT\)
Extract text/mrcscrl.ans into your Mystic /TEXT diretory (C:\MYSTIC\THEMES\DEFAULT\TEXT\)

Compile mrc_clients.mps

Go into C:\MYSTIC
Type: MPLC C:\MYSTIC\THEMES\DEFAULT\SCRIPTS\MRC_CLIENT.MPS
After a few seconds it should report that it was happily compiled.
Almost done with Mystic...


STEP 4 - Mystic Menus


Let's create the menu entries to accept a user into Mystic and launch the MRC_CLIENT automatically, then log them off Mystic, back to RA when done chatting.

Go into MYSTIC -CFG
Our default START MENU under GENERAL SETTINGS is still prelogin correct? You did listen to me? :)
Move over to EDITORS and down to MENU EDITOR
Press ENTER on DEFAULT



We now see a list of all the default menus that exist.
We only need to change 2 of them, since we're not running a full Mystic BBS and don't want/need to give the connected user any options.
Go down and press ENTER on PRELOGIN.




Highlight every option there, press / and choose DELETE
Once blank, press ENTER and start creating a new command.
Display Text, lightbar on/off just leave as is.



Move down to HOT KEY and press CTRL+L.
Choose EVERY (Auto run before menu is displayed).
Press TAB to move down into the lower ACTION LIST section.
Press ENTER to create an action (erase any that are in there if there are any).
COMMAND should be GO (Go to a new menu)
DATA main

Press ESC 3 times to back out. Save the changes.



Now choose MAIN from the list of default menus.
Again, highlight each option and press the / key. Choose DELETE so there is nothing in here.
Now, at the top blank spot, press ENTER.
Don't care about DISPLAY TEXT, LIGHT BAR on/off etc..



Go down to HOT KEY and press CTRL+L.
Choose FIRSTCMD - Auto run once when menu is loaded.
DISPLAY WHEN should be ALWAYS.

Press TAB to go down to the ACTION LIST area.
Again, make sure this area is EMPTY.
Press ENTER to create a new action.
COMMAND GX (Execute MPL program)
DATA mrc_client

Press ESC a few times to get back to the menu list, saving when prompted to back out.
You should now have a single entry in the MAIN menu.

Move to the blank space under your FIRSTCMD entry and press ENTER.
Again, we don't care about DISPLAY TEXT, etc...
Go down to HOT KEY and press CTRL+L.
Choose FIRSTCMD - Auto run once when menu is loaded.
DISPLAY WHEN should be ALWAYS



Press TAB to go into the ACTIONS area and erase anything in there.
Press ENTER to create a new ACTION.
COMMAND (GI) Hangup immediately.
No DATA this time.
Press ESC a few times, save the changes.

Leave the Mystic Configuration.

That's it! Your automated menus should now be setup.

Here's how this menu fun works:
A user connects from RA into Mystic. Their login/password is supplied in the RLOGIN connection string from RA so Mystic does not ask for a login.
prelogin sends them directly to the MAIN menu.
The MAIN menu starts executing the commands you just created.
Command 1, that runs ONCE when the menu is first loaded tells it to launch mrc_client.
Yay! The user is chatting happily.
Now the user leaves the MRC chat by typing /quit.
The MAIN menu loads AGAIN <- (KEY) bypassing the first command that only runs ONCE and goes to the second command, which is an action to immediately hangup.
This hangup causes Mystic to think the user has logged off and control is passed back to RA where the user finds themselves at the RA CHAT menu again.

**
Make sure the Mystic server is running at all times to accept RLOGIN connections.
You do this by calling MIS SERVER from the C:\MYSTIC directory.
For more info, see the startup batch file in Step 3 above.

**


STEP 5 - Creating Mystic users from RemoteAccess
Now that Mystic is configured to accept RA's users, let's give it some users!
Since we don't allow anyone to directly connect to our Mystic install, we need a way to add new users into the Mystic userbase and we need to match those users handles with the handles coming from the users logged into RA so their MRC names are correct.

We accomplish this by using NFU to generate a DOOR32.SYS drop file and the MYSTIC -NEWUSER command line switch.

The easiest way to create a new user is to create an entry at the top of the RA menu where the link to MRC is.

Open RACONFIG.
Go into MANAGER then MENUS and select the menu where your MRC link will be.



INSERT a new blank line at the TOP of the menu (we'll call this menu the CHAT menu).
Make the ACTION a Type -7 - Execute sub-program.
OPTDATA: c:\netfoss\nfu.exe c:\ra\node1 "c:\mystic\newuser1.bat" *M
Obviously change the paths to match your installations...



No HOTKEY.
AUTOEXEC should be YES.



Go into the NODES section and press ALT+U to un-tag ALL the nodes.
Now, move to NODE 1 and press SPACE.
Only NODE 1 should have a square next to it.
Press ESC.
So, this menu option will run for everyone logged into NODE1.
Press ESC a few more times and save your new menu changes.

Now, go into C:\MYSTIC\
Create the following batch file in here...

---------- START OF NEWUSER1.BAT ----------

@echo off
cls

for /F "skip=5 delims=" %%i in (c:\ra\node1\door32.sys) do set "line5=%%i"&GOTO :LINEONE
:LINEONE

for /F "skip=6 delims=" %%i in (c:\ra\node1\door32.sys) do set "line6=%%i"&GOTO :LINETWO
:LINETWO

c:
cd\mystic
mystic -newuser handle=%line6% name=%line5% pass=password level=10
exit

---------- END OF NEWUSER1.BAT ----------

Name it NEWUSER1.BAT

So here's what we just did...
When a user logged into RA loads the menu we just added the type-7 automatic entry to (we're calling it CHAT menu), NFU is called and looks in c:\ra\node1\ for DOOR.SYS
NFU then converts DOOR.SYS to DOOR32.SYS and calls our NEWUSER1.BAT file from the C:\MYSTIC\ directory.

NEWUSER1.BAT looks at the DOOR32.SYS drop file created by NFU, located in C:\RA\NODE1\ and places the values on line 5 and line 6 into variables.
Line 5 contains the RA User's name and Line 6 contains their handle.

It then tells MYSTIC to create a new user using the HANDLE and NAME variables of the logged in RA user.
It sets the password to "password" and gives the new user a security level of 10.
Remember, assigning a generic password of "password" to each Mystic user, we don't have to worry about the RA user changing their password in RA and trying to keep the Mystic userbase side in sync.
They will always log into the Mystic MRC chat side using the user "password" password.

Since we aren't using Mystic as a conventional BBS and our Firewall is blocking any external connection into Mystic (RLOGIN:513), there's no security issue because the only way to log into Mystic is through the scripted RA menu interface.


Step 6 - TelnetDoor installation

Extract TelnetDoor into your RA DOORS directory.
Since we will be giving TelnetDoor the address and credentials for our destination server, we don't need to setup any menu options.
Just remember the path to where you installed it, you may need to modify my batch files to match.


STEP 7 - Adding the actual MRC chat to the RA menu! FINALLY!

Last step!

Open RACONFIG and go into the menu where MRC is going to be an option (same menu as above).



Create a new blank line with the INSERT key.
Action is a Type-7 - Execute sub-program.
OPTDATA c:\netfoss\nfu.exe c:\ra\node1 "c:\mystic\go1.bat" *M
HOTKEY whatever key you want to load MRC... {M}?
Go into the NODES section and press ALT+U to un-tag ALL the nodes.
Now, move to NODE 1 and press SPACE.
Only NODE 1 should have a square next to it.
Press ESC.

Again, this entry is only available for users connected to NODE 1.
Just repeat the process for NODE 2, 3, 4, 5, etc... changing the relevant NODE# for each in the batch files/file names, etc.. using the same HOTKEY value {M} for each node instance.
You could get fancy any include the *N variable from within RA to indicate the node number the caller is on, but it gets dicy further along in the scripts. so I chose to hard code it.

Save the newly modified RA menu.

Go into C:\MYSTIC and create a batch file named GO1.BAT

It should look like this:

---------- START OF GO1.BAT ----------

for /F "skip=5 delims=" %%i in (c:\ra\node1\door32.sys) do set "line5=%%i"&GOTO :LINEONE
:LINEONE

for /F "skip=6 delims=" %%i in (c:\ra\node1\door32.sys) do set "line6=%%i"&GOTO :LINETWO
:LINETWO

c:\ra\doors\mrc\bin\release\telnetdoor.exe -R -S192.168.12.2 -Y%line6% -Xpassword -Dc:\ra\node1\door32.sys
exit

---------- END OF GO1.BAT ----------

So when a caller visits the RA menu where MRC is an option, the first NEWUSER1.BAT file tried to create a Mystic user for them.
Then, when the user presses {M} to launch MRC from the RA menu, NFU creates a fresh DOOR32.SYS file in C:\RA\NODE1\ and then calls GO1.BAT

GO1.BAT loads the fresh DOOR32.SYS handle and name variables and runs TELNETDOOR.EXE to connect to our locally installed MYSTIC BBS!

telnetdoor.exe -R -S192.168.12.2 -Y%line6% -Xpassword -Dc:\ra\node1\door32.sys

-R tells TELNETDOOR that this is an RLOGIN connection.
-S192.168.12.2 is address of the server we're trying to connect to (port 513 is the RLOGIN default).
-Y is the users handle, extracted from DOOR32.SYS.
-X is the generic password for our Mystic users.
-D tells TELNETDOOR where the DOOR32.SYS file is for it's own use.



DONE!
That's it!
At this point you should be able to create a new user in RA, visit your RA menu that contains the MRC option, have a corresponding user created in Mystic with a generic password and load the MRC_CLIENT!

Just make sure that you have the python mrc_client.py running in the background at all times or you won't be able to chat.


I hope you enjoyed this HowTo, it was a lot of fun figuring out a way to get MRC working with RA, even if technically it's cheating a little bit. :)

As a bonus, you should be able to use this RLOGIN technique from RA into Mystic to run any Mystic specific doors/utilities/etc...

Please contact me with ANY questions, comments, etc...

Aaron/DW
1:229/428



Telnet: bbs.dsbbs.ca:23
wWw: www.dsbbs.ca

HOME