home *** CD-ROM | disk | FTP | other *** search
- #slipdial
- debug 1
- call configure
- icon/file=<slipdial$resources>.mailboxes
- alarm /repeat /time=04:30 /id=everyday "call doall"
- alarm /stop="goto loop"
- port sp_dual 0;speed 57600;retry 3 30
- call mailicon
- # main loop
- :loop
- menu "Start All:call doall" "Start Mail:call domail" -
- "Start News:call donews" -
- "Interactive:call dointer" -
- "Debatch:call endcall" -
- "Setup:call setup1"
- wait /event
- goto loop
- exit
-
- # dial up & enter SLIP mode
- :dialup
- if (!claim 3) goto dialup
- init ATZQ0V1
- retry 2 4
- if (!dial/retry=50/delay=5/nodial=60 6261920) return 0
- message/capture="This"/centre/max=5
- # set username & password for authentication
- set username allan@mnhepz.hep.umn.edu
- :waitloop
- set result {wait /del=50 name: word: server> denied}
- case %result
- when 0; goto dialup
- when 1; send %username
- when 2; send %password
- when 3; goto endwaitloop
- when 4; set username alla0008@gold.tc.umn.edu
- endcase
- if (!?line/dcd) goto dialup
- goto waitloop
- :endwaitloop
- send slip
- ipget 134.
- return 1
-
- # start a session for all activities (smtp, nntp)
- :doall
- set nntp nntp
- set pop pop
- set hanguptime "15 2 3"
- call/lock dialup
- goto common
-
- # start a session for mail only
- :domail
- set nntp #nntp
- set pop pop
- set hanguptime "15 2 3"
- call/lock dialup
- goto common
-
- # start interactive session
- :dointer
- set nntp #nntp
- set pop #pop
- set hanguptime "600 2 2"
- call/lock dialup
- goto common
-
- # start a session for news only
- :donews
- set nntp nntp
- set pop #pop
- set hanguptime "15 2 3"
- call/lock dialup
- :common
- make SLIPdial:umnsrc <TCPIP$Dir>.AutoExec
- :starttcp
- task/exit="if (?line/dcd) goto starttcp"/id="TCPIP" <TCPIP$dir>.!Run
- alarm/dcd "goto tcpkill"
- :hupwait
- wait /event
- goto hupwait
- :tcpkill
- message/close
- task /kill="TCPIP"
-
- # routine to end call & test for arrived files
- :endcall
- release
- set newmail
- if (?file/size <Mail$dir>.spool.mail.text.efp) call movemail efp
- if (?file/size <Mail$dir>.spool.mail.text.gta) call movemail gta
- if (?file <Mail$dir>.folder.umnNews) move <Mail$dir>.folder.umnNews <NewsSpool$dir>.news*
- if (?file <Mail$dir>.folder.demNews) move <Mail$dir>.folder.demNews <NewsSpool$dir>.news*
- if (?file <NewsSpool$dir>.mail*) call mailicon;message/cent "New mail for %newmail"
- if (?file <NewsSpool$dir>.*) task <Debatch$dir>.!run
- # now trim history files if neccessary
- call trimfile <TCPIP$Dir>.UmnHist
- call trimfile <TCPIP$Dir>.DemHist
- return
-
- :trimfile
- if (?lt {?file/size %p1} 5000) return
- echo/status "Trimming %p1"
- copy/tail=200 %p1 %p1-T;delete %p1;move %p1-T %p1
- return
-
- :movemail
- append <Mail$dir>.spool.mail.text.%p1 <Mail$dir>.spool.mail.%p1
- append <Mail$dir>.spool.mail.text.%p1 <Mail$dir>.%p1
- move <Mail$dir>.spool.mail.text.%p1 <NewsSpool$dir>.mail*
- set newmail %newmail%p1
- return
-
- :mailclick
- if (?file <Mail$Dir>.gta) task "filer_run <Mail$Dir>.gta"
- if (?file <Mail$Dir>.efp) task "filer_run <Mail$Dir>.efp"
- task "remove <Mail$Dir>.gta"
- task "remove <Mail$Dir>.efp"
-
- :mailicon
- set icon nomail
- if (?file <Mail$Dir>.gta) set icon mail
- if (?file <Mail$Dir>.efp) set icon mail
- icon/id=mail/action="call mailclick" %icon
- return
-
- #
- # This loads password config from file or prompts for data to create file.
- #
- :configure
- set filename {?file/expand slipdial:umnconfig}
- if (!?file %filename) call setup1
- open/read/id=conf/error="return" %filename
- read/id=conf/eof="goto closeconf" password
- read/id=conf/eof="goto closeconf" gtapass
- read/id=conf/eof="goto closeconf" efppass
- :closeconf
- close/id=conf
- return
-
- :setup1
- input/prompt="Enter authorization password:" password
- input/prompt="Enter gta password:" gtapass
- input/prompt="Enter efppass:" efppass
- open/id=conf/write %filename
- write/id=conf %password
- write/id=conf %gtapass
- write/id=conf %efppass
- close/id=conf
- return
-