GroupWise 4.1 SMTP Gateway and Automated SLIP/PPP Dialup This document has been prepared to provide information for setting up an Automated Dialup SLIP environment for the Novell GroupWise 4.1 SMTP Gateway. It provides a foundation for creating the environment and includes various working configurations. This document is not complete. Other configurations are welcome and will be appended if sent to celliot@novell.com. This documentūs information is intended solely to be a help--not a supported solution. What is needed: The GroupWise SMTP DOS Gateway is designed to run in an environment where the Internet is accessible at all times. In other words, when the gateway is running the Internet is to be attainable through the application providing the TCPIP kernel (i.e., LAN WorkPlace for DOS). If the Gateway doesn't receive verification of the Internet then a time out error will occur. Seeing that the SMTP gateway is designed for continuous connection, there is no need for dialup handshaking between the SMTP Gateway and LAN WorkPlace. This handshaking or communication with LAN WorkPlace provides the controlling commands for the SLIP connection. These controlling commands dictate dialup to the provider, login, upload, etc. Our objective then is to create an environment to run the SMTP gateway in that incorporates these abilities. With the understanding above, clearly there are a lot of needed components to create an automated dial-up slip environment. Listed below is a sketch of components that form the foundation of the environment: (on X or condition Y continue) (dial-up Provider, login) (establish SLIP communication) (load gateway) (provider component) (time delay X or condition Y continue) (unload gateway) (logout of provider) (unload SLIP) (loop back to beginning) **************************** NOTE ***************************** The Provider component is the most critical piece in getting the environment to function. This component needs to be worked out with a provider in your area. I want to emphasize "worked out" because not all providers are willing to make special arrangements (see below) on their end of the SLIP connection. Make this your first step: find a provider in your area that understands what you are trying to accomplish and will help you with their end. *************************************************************** Providers primarily need to: 1) Queue mail when you are not connected. 2) On X send queued mail to you. 3) Base your mail on a fixed IP address. SMTP Gateway Makeup Before building the environment, we need to take a look at the gateway makeup. First, the gateway is composed of two parts: SMTP.EXE and the daemon SMTPDN.EXE*. The two executables can be run on separate machines, together on the same machine with the message server, or SMTP.EXE can be run on the message server PC and the daemon can be run on another PC. Whatever the configuration, SMTP and SMTPDN will be running independent of each other. The first part of the gateway SMTP is responsible for polling various directories for messages. If a message is found, SMTP.EXE will convert the message and drop it into another directory. SMTP.EXE can't be terminated from the command line; it can only be terminated by a manual shutdown or by a shutdown command from the message server. Message server (MS) launching and downing of the gateway is only accomplished with the MS Launch configuration. The second part of the gateway SMTPDN.EXE (the daemon) is responsible for sending to and receiving from the Internet via the TCPIP kernel. It is this part of the gateway that will give a time out error if confirmation of the Internet isn't received. The daemon can be loaded and unloaded from the command line with the /u startup switch. When given the unload command, smtpdn will not unload until it finishes receiving or sending a message. * SMTPDF.EXE if running the gateway on FTP PC/TCP. Configurations Configuration 1 -- Created by Courtney Elliott Pg. 100 Courtney keeps with a basic functioning setup that can be added upon as needed. The environment is accomplished by running the gateway message server launched and smtpdn stand alone on a PC. Scripting allows Dialup and Login. The configuration for provider mail queuing and mail download has been left out due to the variety of solutions that will be provided by the helping provider. Environment Aplications: LAN WorkPlace 4.2 Procomm Plus for DOS TP Configuration 2 -- Created by Darin May Pg. 200 Mday creates a complex environment that incorporates error and status checking of the environment. The environment is accomplished by running the gateway message server launched and smtpdn stand alone on a PC. Scripting allows Dialup, Login and client requested down load of queued mailed. Environment Aplications: LAN WorkPlace 4.1/4.2 QmodemPro 1.53. DTR HDELAY **** NOTE **** The configurations presented are not an end all in creating the environment. Due to the range of programs available and their various functions, the makeup of the configuration is left to the environmentūs creator. Configuration 1 -- created by Courtney Elliott Pg. 100 AUTOEXEC.BAT C:\WINDOWS\SMARTDRV.EXE SET PCPLUS=C:\PCPLUS echo off SET PROMPT=$P$G SET TEMP=C:\DOS PATH C:\WINDOWS;C:\NFSCLNT;C:\DOS;c:\net\bin;c:\ C:vshield /m /lock /swap c:\ C:\lsl.com C:\exp16odi.com C:\ipxodi.com LH /L:1,153392 c:\netx.exe G: login server1/sysadmin LH /L:1,16944 C:\DOS\share.exe /F:5100 /L:500 map root r:=server1/GW:\wpdomain\wpgate\smtp40\ :startloop echo ********* echo START LOOP rem 30 minutes and 5+ files before continuing. R:\tp 30 5 r:\send\*.* echo ********* echo DIALING PROVIDER rem Execute Procomm Plus with a compiled script D_PROVIDER.ASX C:\pcplus\pcplus /fD_PROVID.ASX echo ********* echo LOADING SLIP rem Load slip stack. C:\net\bin\slip_ppp C:\net\bin\tcpip echo ********* echo LOADING SMTPDN R: rem Load smtpdn. smtpdn.exe /hn-novell rem Times smtpdn to be up for 5 minutes. rem Increase this value as smtp traffic increases over time. R:\tp 5 echo ********* echo UNLOADING SMTPDN rem Unload of smtpdn. rem The daemon will not unload until the message it is working on rem is either sent or received. smtpdn.exe /u echo ********* echo UNLOAD SLIP Configuration 1 -- created by Courtney Elliott Pg. 101 AUTOEXEC.BAT (continued) rem Unload stack. C:\net\bin\tcpip /u rem Unloading of slip_ppp will disconnect the modem. C:\net\bin\slip_ppp /u echo ********* echo PROVIDER CONECTION CLOSED tp 1 goto startloop Configuration 1 -- created by Courtney Elliott Pg. 103 Procomm Plus Login script. ; ************** Auto Dial-up Login **************** define PROVIDER "2" ; sets PROVIDER to dialing entry 1 proc main ; main procedure clear ; clear the screen emulate ansi ; set terminal emulation dial PROVIDER ; dialing entry one set txpace 50 ; set character pacing to 50 ms log open "dial.log" ; open a log file pause 2 ; pause 2 seconds transmit "sysadmin" ; send your first name transmit "^M" ; carriage return waitfor "password:" ; wait for "Last name?" prompt transmit "thepassword" ; send your password transmit "^M" ; carriage return ; **** at this point you are logged in ****** pause 6 ; pause to stabilize transmit "slip" ; start provider slip transmit "^M" ; carriage return pause 5 ; pause to stabilize log close ; close log file bye ; exit pcplus with line active endproc ; end of main procedure Configuration 2 -- Created by Darin May Pg. 200 Darin May will provide help on his following write-up as free time allows. Darin May - dmay@netscape.com -- http://home.mcom.com/people/dmay Systems Administrator -- Netscape Communications Corporation Basics: Our domain = sccm.org (fixed, single, IP address)our service provider = cerf.net unmetered SLIP account = $250/month SMTP MX records = sccm.org 0 sccm.org sccm.org 90 nic.cerf.net (Remember that mail is delivered to lowest priority record 1st (0 in this case), but since we're not connected most of the time, mail goes to 90). Using Novell LAN Workplace for DOS 4.1/4.2 for SLIP software. NOTE! I'm using the 4.1 SLIP_PPP.COM ***NOT*** the 4.2 SLIP_PPP.COM. 4.2 handles sharing of the com port differently, but I use the 4.2 TCPIP.EXE stack as it's cleaner than the 4.1 version. Using QmodemPro 1.53. *Any* DOS based comm program should work fine as long as it has a scripting facility which can launch a script from the command line. QmodemPro for DOS is easy to use, some other products' script language look like ALGOL... Workings: 1. Launch Qmodem to establish the SLIP connection. Part of the script creates a "flag" file if the SLIP connection is established; so that status can be detected outside of Qmodem. If this "flag" file doesn't exist when qmodem exits, then skip down to step 13. Exit Qmodem with DTR HIGH (or call will be disconnected). 2. Load SLIP software including telnet API: SLIP_PPP TCPIP TELAPI 3. Establish telnet session via TELAPI's Int14 virtual COM port. I have the batch file try three times for the telnet connection because some times cerf.net is busy or a modem-retrain (v.32bis) can cause SLIP packet delays, thereby dumping the telnet connect attempt. TSU -o cerf.net c1 ("c1" is the named telnet session) Configuration 2 -- Created by Darin May Pg. 201 Workings (Continued) 4. Setup telnet parameters: TSU -f c1 termtype VT100 TSU -a c1 COM2 (This sets the connection to an INT14 connect via virtual COM2) 5. Load SMTP daemon. I could have done this before setting up the telnet session, but in reality, in doing so, the SMTP daemon hogs the SLIP connection and complicates establishing the telnet interface! I also use the /mh (mail host) option to push all outbound mail tocerf.net's sendmail queue for better deferred mail processing. 6. Load QmodemPro again to pull queued mail from cerf.net. this time using a pre-defined int14/com2 setup. Qmodem is great for this ability -- having different hardware setups selectable from the command line. Remember that the SMTP daemon, once loaded, starts pushing mail until the ...\SMTP40\SEND directory is empty. 7. The QModem script basically does a "sendmail -Rsccm.org" then quits once the cerf.net command prompt returns. 8. Delay 60 seconds to allow any pending received mail to complete transferring. 9. Check to see if ...\SMTP40\SEND is empty, if not, go back to step 8 10. OK all done! Unload SMTP daemon: SMTPD /u 11. Unload telnet interface and TCP stack TSU -c c1 TELAPI /u TCPIP /u 12. Drop carrier, unload SLIP_PPP.COM. (I have a public domain until called DTR that drops DTR on the specified com port for 1 second). DTR 1 SLIP_PPP /u remove flag file 13. Delay here for however long you want (20/45/60 minutes) before doing it all over again. Configuration 2 -- Created by Darin May Pg. 202 AUTOEXEC.BAT @echo off cls echo STARTING GroupWise SMTP LOOP echo Press Ctrl-C to exit loop and logout, any key to continue. echo. hdelay 15 :LOOP REM Check special "flag" file to disable SLIP attempt from starting. REM Handy when need to stop SLIP remotely if exist f:\usr\gwsmtpd\!noppp goto NOPPP REM Remove active SLIP flag if present if exist h:\usr\data\wpo40\!ppp del h:\usr\data\wpo40\!ppp REM Drop DTR (hangup) just in case on-line dtr 1 REM Call cerf.net h: echo Loading Qmodem to call cerf.net, use script CERFSLIP.SCR call qmsst /s=cerfslip REM abort process if initial connect failed if not exist h:\usr\data\wpo40\!ppp goto NOPPP REM Switch to LAN WorkPlace directory g: cd \sys\lwp\bin echo Loading PPP and TCP/IP interface... slip_dos tcpip telapi if errorlevel 1 goto SKIP echo Opening Telnet session... echo ...try 1... tsu -o cerf.net c1 if errorlevel 1 goto TRY2 goto OK Configuration 2 -- Created by Darin May Pg. 203 AUTOEXEC.BAT (Continued) :TRY2 echo ...try 2... tsu -o cerf.net c1 if errorlevel 1 goto TRY3 goto OK :TRY3 echo ...try 3... tsu -o cerf.net c1 if errorlevel 1 goto SKIP :OK echo Connected! REM Set terminal type tsu -f c1 termtype VT100 if errorlevel 1 goto SKIP REM Setup virtual Int14/Com2 connection tsu -a c1 COM2 if errorlevel 1 goto SKIP REM Load SMTP daemon cd \app\wpo40\wpgate\smtp40 smtpdn /h /hn-sccm.org cd h:\usr\%login_name%\modem cd g:\app\qmodem cd u:\app\qmodem h: REM Re-run Qmodem as telnet client. Use alternate hardware setup (Int14) REM Run script CERFPM.SCR echo. echo Loading Qmodem for telnet client to push mail through... g:qmpro /device=LWP /s=cerfpm REM Check to see if there is still anything to send :SENDWAIT echo. echo Waiting for SEND queue to clear... echo DO NOT PRESS CTRL-C NOW! Otherwise TSR drivers will not unload properly! echo. hdelay 60 if exist g:\app\wpo40\wpgate\smtp40\send\*.* goto SENDWAIT Configuration 2 -- Created by Darin May Pg. 204 AUTOEXEC.BAT (Continued) REM No more outbound mail, unload SMTP daemon cd \app\wpo40\wpgate\smtp40 smtpdn /u :SKIP cd u:\sys\run cd h:\usr\%login_name% g: cd \sys\lwp\bin echo Removing TCP/IP API and stack... tsu -c c1 telapi /u tcpip /u dtr 1 slip_dos /u REM Remove SLIP active flag if exist h:\usr\data\wpo40\!ppp del h:\usr\data\wpo40\!ppp :NOPPP REM wait long time before start all over again hdelay 2400 goto LOOP Configuration 2 -- Created by Darin May Pg. 205 QmodemPro Dialup Script ; Call cerf.net and establish SLIP connection ; May require editing before use. ; TurnON 8_BIT TurnOFF LINEFEED TurnOFF XON/XOFF TurnOFF NOISE TurnON MUSIC TurnON SCROLL TurnOFF PRINT TurnOFF SPLIT TurnON STATUSLN TurnOFF DOORWAY TimeOut 30 Halt ; Set Wait for 30 seconds ; Dial entry in phone book with CERF in description DIAL "TCERF" ; Abort if dialing unsuccessful if $OFFLINE Halt ; Use UserID and Password from dialing directory entry Waitfor "Username:" Delay 100 Send "$USERID^M" Waitfor "Password:" Delay 100 Send "$PASSWORD^M" ; Get to command prompt and start SLIP server ; In cerf.net's case our fixed IP address is linked to our account name ; with the same password Waitfor "pipeline.cerf.net>" Delay 100 Send "slip $USERID^M" Waitfor "Password:" Delay 100 Send "$PASSWORD^M" ; SLIP established, let connection stabilize Waitfor "Header" pause 1000 Flush COM Configuration 2 -- Created by Darin May Pg. 206 QmodemPro Dialup Script (Continued) "flag" file to signal SLIP connection established Openfile h:\usr\data\wpo40\!ppp REWRITE ; Exit leaving DTR high (X) System X Exit ; ERROR exist dropping DTR (Y) -- Hangup Halt: System Y Exit Configuration 2 -- Created by Darin May Pg. 207 QmodemPro Telnet Script ; ; Push mail from service provider via telnet session. ; ; Set telnet account login name and password here. string ACCOUNT PASSWD assign ACCOUNT "youraccnt" assign PASSWD "yourpw" graphics VT100 TimeOut 90 Abort ; Wake up telnet. Send "^M" delay 1000 Waitfor ":" Send "^M" delay 1000 Waitfor ":" Send "^M" delay 1000 Waitfor ":" Send "$ACCOUNT^M" Waitfor "Password:" Delay 100 Send "$PASSWD^M" ; From this point on, do what is needed to get to command prompt. ; Skip first "nic%" in login bulletin screen Waitfor "nic%" Delay 100 ; real command prompt Waitfor "nic%" Delay 100 ; Change timeout to allow for sendmail queue processing. TimeOut 1500 Abort ; Command to pull mail. Send "queuerun sccm.org^M" waitfor "nic%" delay 100 ; Done exit Qmodem. Configuration 2 -- Created by Darin May Pg. 208 QmodemPro Telnet Script (Continued) Send "exit^M" Abort: System Y Exit