home *** CD-ROM | disk | FTP | other *** search
/ Network Support Encyclopedia 96-1 / novell-nsepro-1996-1-cd2.iso / download / gw / smtslp.exe / SMTPSLIP.TXT next >
Text File  |  1995-03-07  |  18KB  |  767 lines

  1.  
  2.  
  3.                       GroupWise 4.1 SMTP Gateway and 
  4.                         Automated SLIP/PPP Dialup  
  5.  
  6.  
  7. This document has been prepared to provide information for setting up an
  8. Automated Dialup SLIP environment for the Novell GroupWise 4.1 SMTP
  9. Gateway.  It provides a foundation for creating the environment and
  10. includes various working configurations.
  11.  
  12. This document is not complete.  Other configurations are welcome and will
  13. be appended if sent to celliot@novell.com.
  14.  
  15. This document■s information is intended solely to be a help--not a
  16. supported solution.  
  17.  
  18.  
  19.  
  20. What is needed: 
  21.  
  22. The GroupWise SMTP DOS Gateway is designed to run in an environment where
  23. the Internet is accessible at all times.  In other words, when the gateway
  24. is running the Internet is to be attainable through the application
  25. providing the TCPIP kernel (i.e., LAN WorkPlace for DOS). If the Gateway
  26. doesn't receive verification of the Internet then a time out error will
  27. occur.   
  28.  
  29. Seeing that the SMTP gateway is designed for continuous connection, there
  30. is no need for dialup handshaking between the SMTP Gateway and LAN
  31. WorkPlace.  This handshaking or communication with LAN WorkPlace provides
  32. the controlling commands for the SLIP connection.  These controlling
  33. commands dictate dialup to the provider, login, upload, etc.  Our objective
  34. then is to create an environment to run the SMTP gateway in that
  35. incorporates these abilities.
  36.  
  37. With the understanding above, clearly there are a lot of needed components
  38. to create an automated dial-up slip environment.  Listed below is a sketch
  39. of components that form the foundation of the environment: 
  40.  
  41.  
  42. (on X or condition Y continue)
  43. (dial-up Provider, login)
  44. (establish SLIP communication)
  45. (load gateway)                         (provider component)
  46. (time delay X or condition Y continue)
  47. (unload gateway)
  48. (logout of provider)
  49. (unload SLIP)
  50. (loop back to beginning)
  51.  
  52.  
  53. **************************** NOTE ***************************** 
  54.  
  55. The Provider component is the most critical piece in getting the
  56. environment to function.  This component needs to be worked out with a
  57. provider in your area.  I want to emphasize "worked out" because not all
  58. providers are willing to make special arrangements (see below) on their end
  59. of the SLIP connection.  Make this your first step:  find a provider in
  60. your area that understands what you are trying to accomplish and will help
  61. you with their end.
  62.  
  63. ***************************************************************  
  64.  
  65. Providers primarily need to:
  66.  
  67. 1) Queue mail when you are not connected.
  68. 2) On X send queued mail to you.
  69. 3) Base your mail on a fixed IP address.
  70.  
  71.  
  72. SMTP Gateway Makeup
  73.  
  74. Before building the environment, we need to take a look at the gateway
  75. makeup.  First, the gateway is composed of two parts: SMTP.EXE and the
  76. daemon SMTPDN.EXE*.  The two executables can be run on separate machines,
  77. together on the same machine with the message server, or SMTP.EXE can be
  78. run on the message server PC and the daemon can be run on another PC. 
  79. Whatever the configuration, SMTP and SMTPDN will be running independent of
  80. each other.  
  81.  
  82. The first part of the gateway SMTP is responsible for polling various
  83. directories for messages.  If a message is found, SMTP.EXE will convert the
  84. message and drop it into another directory.  SMTP.EXE can't be terminated
  85. from the command line; it can only be terminated by a manual shutdown or by
  86. a shutdown command from the message server.  Message server (MS) launching
  87. and downing of the gateway is only accomplished with the MS Launch
  88. configuration.
  89.  
  90. The second part of the gateway SMTPDN.EXE (the daemon) is responsible for
  91. sending to and receiving from the Internet via the TCPIP kernel.  It is
  92. this part of the gateway that will give a time out error if confirmation of
  93. the Internet isn't received.  The daemon can be loaded and unloaded from
  94. the command line with the /u startup switch.  When given the unload
  95. command, smtpdn will not unload until it finishes receiving or sending a
  96. message.
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105. * SMTPDF.EXE if running the gateway on FTP PC/TCP.
  106.                               Configurations
  107.  
  108.  
  109. Configuration 1 -- Created by  Courtney Elliott     Pg. 100
  110.  
  111. Courtney keeps with a basic functioning setup that can be added upon as
  112. needed.  The environment is accomplished by running the gateway message
  113. server launched and smtpdn stand alone on a PC. Scripting allows Dialup and
  114. Login.  The configuration for provider mail queuing and mail download has
  115. been left out due to the variety of solutions that will be provided by the
  116. helping provider.
  117.  
  118. Environment Aplications: 
  119. LAN WorkPlace 4.2 
  120. Procomm Plus for DOS 
  121. TP
  122.  
  123.  
  124. Configuration 2 -- Created by Darin May             Pg. 200 
  125.  
  126. Mday creates a complex environment that incorporates error and status
  127. checking of the environment.  The environment is accomplished by running
  128. the gateway message server launched and smtpdn stand alone on a PC.
  129. Scripting allows Dialup, Login and client requested down load of queued
  130. mailed.   
  131.  
  132. Environment Aplications: 
  133. LAN WorkPlace 4.1/4.2 
  134. QmodemPro 1.53.  
  135. DTR  
  136. HDELAY
  137.  
  138.  
  139.  
  140.  
  141.  
  142. **** NOTE ****
  143.  
  144. The configurations presented are not an end all in creating the
  145. environment.  Due to the range of programs available and their various
  146. functions, the makeup of the configuration is left to the environment■s
  147. creator.  
  148.  
  149.  
  150.  
  151.  
  152. Configuration 1 -- created by  Courtney Elliott    Pg. 100
  153.  
  154. AUTOEXEC.BAT  
  155.  
  156.  
  157. C:\WINDOWS\SMARTDRV.EXE
  158. SET PCPLUS=C:\PCPLUS
  159. echo off
  160. SET PROMPT=$P$G
  161. SET TEMP=C:\DOS
  162. PATH C:\WINDOWS;C:\NFSCLNT;C:\DOS;c:\net\bin;c:\
  163. C:vshield /m /lock /swap c:\
  164. C:\lsl.com
  165. C:\exp16odi.com
  166. C:\ipxodi.com
  167. LH /L:1,153392 c:\netx.exe
  168. G:
  169. login server1/sysadmin
  170. LH /L:1,16944 C:\DOS\share.exe /F:5100 /L:500
  171. map root r:=server1/GW:\wpdomain\wpgate\smtp40\
  172.  
  173. :startloop
  174. echo *********       
  175. echo START LOOP
  176. rem  30 minutes and 5+ files before continuing.
  177. R:\tp 30 5 r:\send\*.*
  178. echo *********
  179. echo DIALING PROVIDER
  180. rem Execute Procomm Plus with a compiled script D_PROVIDER.ASX
  181. C:\pcplus\pcplus /fD_PROVID.ASX
  182. echo *********
  183. echo LOADING SLIP
  184. rem Load slip stack.
  185. C:\net\bin\slip_ppp
  186. C:\net\bin\tcpip
  187. echo *********
  188. echo LOADING SMTPDN
  189. R:
  190. rem Load smtpdn.
  191. smtpdn.exe /hn-novell 
  192. rem Times smtpdn to be up for 5 minutes.
  193. rem Increase this value as smtp traffic increases over time. 
  194. R:\tp 5    
  195. echo *********
  196. echo UNLOADING SMTPDN
  197. rem Unload of smtpdn.  
  198. rem The daemon will not unload until the message it is working on rem is
  199. either sent or received.  
  200. smtpdn.exe /u 
  201. echo *********
  202. echo UNLOAD SLIP
  203.  
  204.  
  205.  
  206.  
  207. Configuration 1 -- created by  Courtney Elliott    Pg. 101
  208.  
  209. AUTOEXEC.BAT (continued)
  210.  
  211. rem Unload stack. 
  212. C:\net\bin\tcpip /u
  213. rem Unloading of slip_ppp will disconnect the modem.
  214. C:\net\bin\slip_ppp /u
  215. echo *********
  216. echo PROVIDER CONECTION CLOSED
  217. tp 1 
  218. goto startloop
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262. Configuration 1 -- created by  Courtney Elliott     Pg. 103
  263.  
  264. Procomm Plus Login script. 
  265.  
  266.  
  267.  
  268. ;        **************  Auto Dial-up Login  ****************
  269.  
  270. define PROVIDER "2"                 ; sets PROVIDER to dialing entry 1
  271. proc main                           ; main procedure
  272.     clear                           ; clear the screen
  273.     emulate ansi                    ; set terminal emulation
  274.     dial PROVIDER                   ; dialing entry one
  275.     set txpace 50                   ; set character pacing to 50 ms
  276.     log open "dial.log"             ; open a log file
  277.     pause 2                         ; pause 2 seconds
  278.     transmit "sysadmin"             ; send your first name
  279.     transmit "^M"                   ; carriage return
  280.     waitfor "password:"             ; wait for "Last name?" prompt
  281.     transmit "thepassword"          ; send your password
  282.     transmit "^M"                   ; carriage return
  283.  
  284.     ; **** at this point you are logged in ******
  285.     
  286.     pause 6                         ; pause to stabilize
  287.     transmit "slip"                 ; start provider slip
  288.     transmit "^M"                   ; carriage return
  289.     pause 5                         ; pause to stabilize
  290.     log close                       ; close log file
  291.     bye                             ; exit pcplus with line active
  292.  
  293. endproc                             ; end of main procedure
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316. Configuration 2 -- Created by  Darin May        Pg. 200 
  317.  
  318.  
  319. Darin May will provide help on his following write-up as free time allows. 
  320.  
  321. Darin May - dmay@netscape.com -- http://home.mcom.com/people/dmay
  322. Systems Administrator -- Netscape Communications Corporation
  323.  
  324.  
  325.  
  326. Basics:
  327.  
  328. Our domain = sccm.org (fixed, single, IP address)our service provider =
  329. cerf.net unmetered SLIP account = $250/month
  330. SMTP MX records = sccm.org 0 sccm.org  sccm.org 90 nic.cerf.net
  331. (Remember that mail is delivered to lowest priority record 1st (0 in this
  332. case), but since we're not connected most of the time, mail goes to 90).
  333.  
  334. Using Novell LAN Workplace for DOS 4.1/4.2 for SLIP software. NOTE!
  335. I'm using the 4.1 SLIP_PPP.COM ***NOT*** the 4.2 SLIP_PPP.COM.  4.2 handles
  336. sharing of the com port differently,  but I use the 4.2 TCPIP.EXE stack as
  337. it's cleaner than the 4.1 version. 
  338.  
  339. Using QmodemPro 1.53.  *Any* DOS based comm program should work fine as
  340. long as it has a scripting facility which can launch a script from the
  341. command line.  QmodemPro for DOS is easy to use, some other products'
  342. script language look like ALGOL...
  343.  
  344.  
  345. Workings:
  346.  
  347. 1. Launch Qmodem to establish the SLIP connection. Part of the script
  348. creates a "flag" file if the SLIP connection is established; so that status
  349. can be detected outside of Qmodem.  If this "flag" file doesn't exist when
  350. qmodem exits, then skip down to step 13. Exit Qmodem with DTR HIGH (or call
  351. will be disconnected).
  352.  
  353. 2. Load SLIP software including telnet API:
  354.       SLIP_PPP
  355.       TCPIP
  356.       TELAPI
  357.  
  358. 3. Establish telnet session via TELAPI's Int14 virtual COM port.  I have
  359. the batch file try three times for the telnet connection because some times
  360. cerf.net is busy or a modem-retrain (v.32bis) can cause SLIP packet delays,
  361. thereby dumping the telnet connect attempt.
  362.      TSU -o cerf.net c1
  363. ("c1" is the named telnet session)
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372. Configuration 2 -- Created by  Darin May         Pg. 201 
  373.  
  374. Workings (Continued)
  375.  
  376.  
  377. 4. Setup telnet 
  378.  
  379. parameters:
  380.      TSU -f c1 termtype VT100
  381.      TSU -a c1 COM2
  382. (This sets the connection to an INT14 connect via virtual COM2)
  383.  
  384. 5. Load SMTP daemon.  I could have done this before setting up the telnet
  385. session, but in reality, in doing so, the SMTP daemon hogs the
  386. SLIP connection and complicates establishing the telnet interface!
  387. I also use the /mh (mail host) option to push all outbound mail
  388. tocerf.net's sendmail queue for better deferred mail processing.
  389.  
  390. 6. Load QmodemPro again to pull queued mail from cerf.net. this time using
  391. a pre-defined int14/com2 setup.  Qmodem is great for this ability -- having
  392. different hardware setups selectable from the command line.  Remember that
  393. the SMTP daemon, once loaded, starts pushing mail until the ...\SMTP40\SEND
  394. directory is empty.
  395.  
  396. 7. The QModem script basically does a "sendmail -Rsccm.org" then quits once
  397. the cerf.net command prompt returns.
  398.  
  399. 8. Delay 60 seconds to allow any pending received mail to complete
  400. transferring.
  401.  
  402. 9. Check to see if ...\SMTP40\SEND is empty, if not, go back to step 8
  403.  
  404. 10. OK all done!  Unload SMTP daemon:
  405.      SMTPD /u
  406.  
  407. 11. Unload telnet interface and TCP stack
  408.     TSU -c c1
  409.     TELAPI /u
  410.     TCPIP /u
  411.  
  412. 12.  Drop carrier, unload SLIP_PPP.COM.  (I have a public domain until
  413. called DTR that drops DTR on the specified com port for 1 second).
  414.     DTR 1
  415.     SLIP_PPP /u
  416.     remove flag file
  417.  
  418. 13.  Delay here for however long you want (20/45/60 minutes) before doing
  419. it all over again.
  420.  
  421.  
  422.  
  423.  
  424. Configuration 2 -- Created by  Darin May          Pg. 202 
  425.  
  426. AUTOEXEC.BAT 
  427.  
  428. @echo off
  429.      cls
  430.  
  431.      echo STARTING GroupWise SMTP LOOP
  432.      echo Press Ctrl-C to exit loop and logout, any key to   continue.
  433.      echo.
  434.      hdelay 15
  435.  
  436. :LOOP
  437. REM Check special "flag" file to disable SLIP attempt from starting.
  438. REM Handy when need to stop SLIP remotely
  439.      if exist f:\usr\gwsmtpd\!noppp goto NOPPP
  440.  
  441. REM Remove active SLIP flag if present
  442.      if exist h:\usr\data\wpo40\!ppp del h:\usr\data\wpo40\!ppp
  443.  
  444. REM Drop DTR (hangup) just in case on-line
  445.      dtr 1
  446.  
  447. REM Call cerf.net
  448.      h:
  449.      echo Loading Qmodem to call cerf.net, use script CERFSLIP.SCR
  450.      call qmsst /s=cerfslip
  451.  
  452. REM abort process if initial connect failed
  453.      if not exist h:\usr\data\wpo40\!ppp goto NOPPP
  454.  
  455. REM Switch to LAN WorkPlace directory
  456.      g:
  457.      cd \sys\lwp\bin
  458.  
  459.      echo Loading PPP and TCP/IP interface...
  460.      slip_dos
  461.      tcpip
  462.      telapi
  463.      if errorlevel 1 goto SKIP
  464.  
  465.      echo Opening Telnet session...
  466.      echo ...try 1...
  467.      tsu -o cerf.net c1
  468.      if errorlevel 1 goto TRY2
  469.      goto OK
  470.  
  471.  
  472.  
  473.  
  474.  
  475.  
  476.  
  477. Configuration 2 -- Created by  Darin May          Pg. 203 
  478.  
  479. AUTOEXEC.BAT (Continued)
  480.  
  481.  
  482. :TRY2
  483.      echo ...try 2...
  484.      tsu -o cerf.net c1
  485.      if errorlevel 1 goto TRY3
  486.      goto OK
  487.  
  488.  
  489. :TRY3
  490.      echo ...try 3...
  491.      tsu -o cerf.net c1
  492.      if errorlevel 1 goto SKIP
  493.  
  494. :OK
  495.      echo Connected!
  496.  
  497. REM Set terminal type
  498.      tsu -f c1 termtype VT100
  499.      if errorlevel 1 goto SKIP
  500.  
  501. REM Setup virtual Int14/Com2 connection
  502.      tsu -a c1 COM2
  503.      if errorlevel 1 goto SKIP
  504.  
  505. REM Load SMTP daemon
  506.      cd \app\wpo40\wpgate\smtp40
  507.      smtpdn /h /hn-sccm.org
  508.  
  509.      cd h:\usr\%login_name%\modem
  510.      cd g:\app\qmodem
  511.      cd u:\app\qmodem
  512.      h:
  513.  
  514. REM Re-run Qmodem  as telnet client.  Use alternate hardware setup (Int14)
  515. REM Run script CERFPM.SCR
  516.      echo.
  517.      echo Loading Qmodem for telnet client to push mail through...
  518.      g:qmpro /device=LWP /s=cerfpm
  519.  
  520.      REM Check to see if there is still anything to send
  521. :SENDWAIT
  522.      echo.
  523.      echo Waiting for SEND queue to clear...
  524.      echo DO NOT PRESS CTRL-C NOW! Otherwise TSR drivers will not unload
  525. properly!
  526.      echo.
  527.      hdelay 60
  528.      if exist g:\app\wpo40\wpgate\smtp40\send\*.* goto SENDWAIT
  529.  
  530.  
  531. Configuration 2 -- Created by  Darin May          Pg. 204 
  532.  
  533. AUTOEXEC.BAT (Continued)
  534.  
  535.  
  536.  
  537.  
  538. REM No more outbound mail, unload SMTP daemon
  539.      cd \app\wpo40\wpgate\smtp40
  540.      smtpdn /u
  541.  
  542.  
  543. :SKIP
  544.      cd u:\sys\run
  545.      cd h:\usr\%login_name%
  546.  
  547.      g:
  548.      cd \sys\lwp\bin
  549.  
  550.      echo Removing TCP/IP API and stack...
  551.      tsu -c c1
  552.      telapi /u
  553.      tcpip /u
  554.  
  555.      dtr 1
  556.      slip_dos /u
  557.  
  558. REM Remove SLIP active flag
  559.      if exist h:\usr\data\wpo40\!ppp del h:\usr\data\wpo40\!ppp
  560.  
  561. :NOPPP
  562. REM wait long time before start all over again
  563.      hdelay 2400
  564.      goto LOOP
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586. Configuration 2 -- Created by  Darin May          Pg. 205 
  587.  
  588. QmodemPro Dialup Script   
  589.  
  590.  
  591. ;  Call cerf.net and establish SLIP connection
  592. ;  May require editing before use.
  593. ;
  594.      TurnON    8_BIT
  595.      TurnOFF   LINEFEED
  596.      TurnOFF   XON/XOFF
  597.      TurnOFF   NOISE
  598.      TurnON    MUSIC
  599.      TurnON    SCROLL
  600.      TurnOFF   PRINT
  601.      TurnOFF   SPLIT
  602.      TurnON    STATUSLN
  603.      TurnOFF   DOORWAY
  604.  
  605.      TimeOut   30   Halt ; Set Wait for 30 seconds
  606.  
  607. ; Dial entry in phone book with CERF in description
  608.      DIAL "TCERF"
  609.  
  610. ; Abort if dialing unsuccessful
  611.      if $OFFLINE Halt
  612.  
  613. ; Use UserID and Password from dialing directory entry
  614.      Waitfor   "Username:"
  615.      Delay     100
  616.      Send "$USERID^M"
  617.  
  618.      Waitfor   "Password:"
  619.      Delay     100
  620.      Send "$PASSWORD^M"
  621.  
  622. ; Get to command prompt and start SLIP server
  623. ; In cerf.net's case our fixed IP address is linked to our account name
  624. ; with the same password
  625.      Waitfor   "pipeline.cerf.net>"
  626.      Delay     100
  627.      Send "slip $USERID^M"
  628.  
  629.      Waitfor   "Password:"
  630.      Delay     100
  631.      Send "$PASSWORD^M"
  632.  
  633. ; SLIP established, let connection stabilize
  634.      Waitfor   "Header"
  635.      pause     1000
  636.      Flush     COM
  637.  
  638.  
  639.  
  640. Configuration 2 -- Created by  Darin May          Pg. 206 
  641.  
  642. QmodemPro Dialup Script (Continued)
  643.  
  644.  
  645.  
  646. "flag" file to signal SLIP connection established
  647.      Openfile h:\usr\data\wpo40\!ppp REWRITE
  648.  
  649.  
  650. ; Exit leaving DTR high (X)
  651.      System    X
  652.      Exit
  653.  
  654. ; ERROR exist dropping DTR (Y) -- Hangup
  655. Halt:
  656.      System    Y
  657.      Exit
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.  
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695. Configuration 2 -- Created by  Darin May          Pg. 207 
  696.  
  697. QmodemPro Telnet Script   
  698.  
  699. ;
  700. ;    Push mail from service provider via telnet session.
  701. ;
  702.  
  703. ; Set telnet account login name and password here.
  704.      string    ACCOUNT PASSWD
  705.      assign    ACCOUNT   "youraccnt"
  706.      assign    PASSWD    "yourpw"
  707.  
  708.      graphics  VT100
  709.      TimeOut        90   Abort
  710.  
  711. ; Wake up telnet.
  712.      Send "^M"
  713.      delay     1000
  714.      Waitfor   ":"
  715.  
  716.      Send "^M"
  717.      delay     1000
  718.      Waitfor   ":"
  719.  
  720.      Send "^M"
  721.      delay     1000
  722.      Waitfor   ":"
  723.  
  724.      Send "$ACCOUNT^M"
  725.  
  726.      Waitfor   "Password:"
  727.      Delay     100
  728.      Send "$PASSWD^M"
  729.  
  730. ; From this point on, do what is needed to get to command prompt.
  731. ; Skip first "nic%" in login bulletin screen
  732.      Waitfor   "nic%"
  733.      Delay     100
  734.  
  735. ; real command prompt
  736.      Waitfor   "nic%"
  737.      Delay     100
  738.  
  739. ; Change timeout to allow for sendmail queue processing.
  740.      TimeOut   1500 Abort
  741.  
  742. ; Command to pull mail.
  743.      Send "queuerun sccm.org^M"
  744.      waitfor   "nic%"
  745.      delay     100
  746.  
  747. ; Done exit Qmodem.
  748.  
  749.  
  750. Configuration 2 -- Created by  Darin May          Pg. 208 
  751.  
  752. QmodemPro Telnet Script (Continued)
  753.  
  754.  
  755.  
  756.  
  757.  
  758.      Send "exit^M"
  759.  
  760.  Abort:
  761.      System    Y
  762.      Exit
  763.  
  764.  
  765.  
  766.  
  767.