home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD Direkt 1995 #1
/
Image.iso
/
cdd
/
winanw
/
rfdmail
/
tdc.scr
< prev
next >
Wrap
Text File
|
1994-01-19
|
14KB
|
518 lines
;------------------------------------------------------
;TDC.SCR --- The script file for TDC (dircon.co.uk)
;------------------------------------------------------
; We begin with the format specifiers to which allow
;the script to identify where the MailId, RealName,
;and Subject texts are in a newly downloaded letter.
;
Format
Subject: $SUBJECT$\n
Subj: $SUBJECT$\n
From: "$NAME$" <$UID$>\n
From: ""$NAME$"" <$UID$>\n
From: $NAME$<$UID$>\n
From: $UID$ ($NAME$)\n
From: $UID$ \n
From: $UID$\n
Endformat
;------------------------------------------------------
; Next is a set of aliases which determine various
; items such as where some of the standard commands
; like '/usr/ucb/mail' live.
;
Alias shellstart 'go ksh'
Alias sendmail 'mail '
Alias readmail 'mail'
Alias saveletter 's '
Alias deleteletter 'd '
Alias quitmail 'q'
Alias mailnull '#'
Alias mailshellesc '!'
Alias rm '/bin/rm -f '
Alias echo '/bin/echo '
Alias cat '/bin/cat '
Alias logoff 'off'
;------------------------------------------------------
; The following aliases determine the various prompts the
; script will look for.
;
Alias menuprompt ' -> '
Alias prompt '\n$ '
Alias mailprompt '\n& '
Alias subjectprompt '\nSubject: '
Alias ccprompt1 'Cc:'
Alias ccprompt2 'CC:'
Alias ccprompt3 'cc:'
Alias loginprompt 'login: '
Alias passwdprompt 'assword:'
Alias havemailprompt 'message'
Alias nomailprompt 'No mail'
;
; If you want to append your ~/.signature file to every outgoing
; message, set the following alias to SEND_SIG, otherwise set it
; to NO_SIGNATURE:
;
Alias signature NO_SIGNATURE
;
;------------------------------------------------------
; The following aliases determine what the script will look
; for to determine that we've successfully logged in
; (banner1-2), and what it will look for to determine that
; we've successfully logged out (logoffbanner1-2)
;
Alias banner1 'The Direct Connection'
Alias banner2 '\nLast login:'
Alias logoffbanner1 %loginprompt%
Alias logoffbanner2 'closed'
;------------------------------------------------------
; The following alias should be set TRUE if your modem
; drops carrier every time you make a connection. This
; alias simply forces the script to wait 2 seconds for
; the connection to settle before starting the script.
;
Alias waitasec FALSE
;
;------------------------------------------------------
; The following aliases determine the command to use for
; downloading, and the prompt the upload program will send
; when it's ready to send data. Comment these out if
; you don't want to use ZMODEM:
;
Alias sz 'sz '
Alias szprompt1 '\n**'
Alias dnloadproto ZMODEM
;
; Uncomment the following aliases if you want to use YMODEM
; as your download protocol:
;
;Alias sz 'sb '
;Alias szprompt1 '\nsb: 1 file'
;Alias dnloadproto YMODEM
;
; Uncomment the following aliases if you want to use XMODEM
; as your download protocol:
;
;Alias sz 'sx '
;Alias szprompt1 'command now.'
;Alias dnloadproto XMODEM
;
;------------------------------------------------------
; The following aliases determine the command to use for
; uploading, and the prompt the upload program will send
; when it's ready to receive data. Comment these out if
; you don't want to use ZMODEM:
;
Alias rz 'rz -a '
Alias rzprompt1 'to your modem '
Alias rzprompt2 'ready'
Alias uploadproto ZMODEM
;
; Uncomment the following aliases if you want to use YMODEM
; as your upload protocol:
;
;Alias rz 'rb -a '
;Alias rzprompt1 'to your modem'
;Alias rzprompt2 'ready'
;Alias uploadproto YMODEM
;
; Uncomment the following aliases if you want to use XMODEM
; as your upload protocol:
;
;Alias rz 'rx -ac '
;Alias rzprompt1 'to your modem'
;Alias rzprompt2 'ready to receive'
;Alias uploadproto XMODEM
;
; Uncomment the following aliases if you want to use KERMIT
; as your upload protocol:
;
;Alias rz 'kermit -e 256 -r '
;Alias rzprompt1 'READY TO RECEIVE'
;Alias rzprompt2 'ready to receive'
;Alias uploadproto KERMIT
;
;------------------------------------------------------
; This is the main entry-point for the script, which
; decides which intermediate network will be used to
; connect to the host.
;
Begin START
If %waitasec% Then WAIT_START
If TRUE Then DIRECT
End
Begin WAIT_START
Timeout 2 Goto DIRECT
End
;------------------------------------------------------
; This is the entry-point for The Direct Connection
; host. This state merely sends CR's every three
; seconds until it sees a login prompt.
;
Begin DIRECT
Caption 'login: '
Cr
When %loginprompt% Goto USERNAME
Timeout 3 Goto START
End
;------------------------------------------------------
; At this point we've seen the host's login prompt, and
; are attempting to log in.
;
Begin USERNAME
Transmit $USERNAME
Cr
When %passwdprompt% Goto PASSWORD
When %loginprompt% Goto USERNAME
Timeout 120 Goto NO_LOGIN
End
Begin PASSWORD
Transmit $PASSWORD
Cr
When %passwdprompt% Goto PASSWORD
When %loginprompt% Goto USERNAME
When %banner1% Goto LOGGED_IN
When %banner2% Goto LOGGED_IN
When %menuprompt% Goto GO_TO_SHELL
When %prompt% Goto JUMP_TO_MAIL
Timeout 120 Goto NO_LOGIN
End
Begin LOGGED_IN
Caption 'logged in'
When %menuprompt% Goto GO_TO_SHELL
When %prompt% Goto JUMP_TO_MAIL
Timeout 120 Goto NO_LOGIN
End
Begin GO_TO_SHELL
Caption 'Starting a Shell'
Transmit %shellstart%
Cr
When %prompt% Goto JUMP_TO_MAIL
Timeout 120 Goto NO_LOGIN
End
;------------------------------------------------------
; These states check to see if there is any mail waiting
; by running the host's mail program and looking for
; keywords indicating the presence/absence of mail.
; If there's mail (and the script is in fetch mode),
; then the FETCH_FROM_MAIN_MENU sequence is started.
; If there's no mail, but there are letters to send,
; the SEND_MAIL sequence is started. Otherwise the
; script just logs off.
;
Begin JUMP_TO_MAIL
Transmit %readmail%
Cr
When %nomailprompt% Goto NO_MAIL_WAITING
When %havemailprompt% Goto MAIL_WAITING
Timeout 10 Goto RETRY_JUMP
End
Begin RETRY_JUMP
Transmit %readmail%
Cr
When %nomailprompt% Goto NO_MAIL_WAITING
When %havemailprompt% Goto MAIL_WAITING
Timeout 15 Goto GIVE_UP
End
Begin NO_MAIL_WAITING
Caption 'No Mail'
If MORE_LETTERS Then SEND_MAIL
When %prompt% Goto LOG_OFF
Timeout 15 Goto GIVE_UP
End
Begin MAIL_WAITING
Caption 'You Have Mail'
If FETCHING Then FETCH_FROM_MAIN_MENU
If MORE_LETTERS Then SEND_BUT_QUIT
When %mailprompt% Goto QUIT_MAIL
Timeout 120 Goto LOG_OFF
End
Begin QUIT_MAIL
Transmit %quitmail%
Cr
When %mailprompt% Goto QUIT_MAIL
When %prompt% Goto LOG_OFF
Timeout 15 Goto GIVE_UP
End
Begin SEND_BUT_QUIT
Transmit %quitmail%
Cr
When %mailprompt% Goto SEND_BUT_QUIT
When %prompt% Goto REQUEST_UPLOAD_LETTER
Timeout 15 Goto GIVE_UP
End
;------------------------------------------------------
; These states execute for each letter to be downloaded.
; They save the letter to the mail.tmp file, download
; the file, instruct RFD to put the letter in the In Box,
; delete the letter on the host, then check for more mail.
;
Begin FETCH_FROM_MAIN_MENU
When %mailprompt% Goto PRESERVE_MAIL
Timeout 10 Goto PRESERVE_MAIL
End
Begin PRESERVE_MAIL
Transmit 'preserve *'
Cr
ClearIndex
When %mailprompt% Goto DEL_TMPFILE
Timeout 20 Goto DEL_TMPFILE
End
Begin DEL_TMPFILE
Transmit %mailshellesc%
Transmit %rm%
Transmit $LETTER.FILENAME
Cr
NextIndex
When %mailprompt% Goto SAVE_CURLETTER
Timeout 20 Goto SAVE_CURLETTER
End
Begin SAVE_CURLETTER
Transmit %saveletter%
Transmit $INDEX
Transmit ' '
Transmit $LETTER.FILENAME
Cr
When 'New file' Goto REQUEST_DOWNLOAD
When 'No messages' Goto NO_MORE_MAIL
When 'Invalid message' Goto NO_MORE_MAIL
Timeout 10 Goto REQUEST_DOWNLOAD
End
Begin REQUEST_DOWNLOAD
Caption 'Fetching Mail'
Transmit %mailshellesc%