home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #1
/
monster.zip
/
monster
/
WIN_UTL2
/
RFDMAIL.ZIP
/
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%
Transmit %sz%
Transmit $LETTER.FILENAME
Cr
When %szprompt1% Goto DOWNLD_LETTER
Timeout 20 Goto ABORT_DOWNLD
End
Begin ABORT_DOWNLD
Control X
Control X
Control X
Control X
Control X
Control X
Control X
Control C
When %prompt% Goto JUMP_TO_MAIL
When %mailprompt% Goto REQUEST_DOWNLOAD
Timeout 20 Goto JUMP_TO_MAIL
End
Begin PAUSE_FOR_DOWNLD
Timeout 1 Goto DOWNLD_LETTER
End
Begin DOWNLD_LETTER
Caption 'Starting Local Download Receive'
Download %dnloadproto% Then DOWNLD_SUCCESS Else RETRY_DNLOAD
End
Begin RETRY_DNLOAD
Caption 'Retrying Download'
Transmit %mailnull%
Cr
When %mailprompt% Goto RETRY_REQDNLOAD
Timeout 5 Goto RETRY_REQDNLOAD
End
Begin RETRY_REQDNLOAD
Transmit %mailshellesc%
Transmit %sz%
Transmit $LETTER.FILENAME
Cr
When %szprompt1% Goto RETRY_DOWNLD_LETTER
Timeout 20 Goto ABORT_DOWNLD
End
Begin RETRY_DOWNLD_LETTER
Download %dnloadproto% Then DOWNLD_SUCCESS Else GIVE_UP
End
Begin DOWNLD_SUCCESS
Confirm LETTER.RECEIVED Successful
Caption 'Letter Received'
Transmit %mailnull%
Cr
When %mailprompt% Goto DELETE_LETTER
Timeout 5 Goto SEND_DOWNLD_CR
End
Begin SEND_DOWNLD_CR
Transmit %mailnull%
Cr
When %mailprompt% Goto DELETE_LETTER
Timeout 5 Goto SEND_DOWNLD_CR
End
Begin DELETE_LETTER
Caption 'Deleting Letter'
Transmit %deleteletter%
Transmit ' '
Transmit $INDEX
Cr
When %mailprompt% Goto DEL_TMPFILE
Timeout 10 Goto DEL_TMPFILE
End
Begin NO_MORE_MAIL
Caption 'Fetched Mail'
When %mailprompt% Goto END_FETCH
Timeout 10 Goto END_FETCH
End
Begin END_FETCH
Transmit %quitmail%
Cr
If MORE_LETTERS Then SEND_MAIL
When %mailprompt% Goto END_FETCH
When %prompt% Goto LOG_OFF
Timeout 10 Goto LOG_OFF
End
;------------------------------------------------------
; These states execute for each letter to send. First
; the letter is uploaded into the mail.tmp file, then
; the host's mail program is run, giving it the address,
; then the subject, body, and CC information.
;
Begin SEND_MAIL
When %prompt% Goto DEL_UPFILE
Timeout 15 Goto DEL_UPFILE
End
Begin DEL_UPFILE
Transmit %rm%
Transmit $LETTER.FILENAME
Cr
When %prompt% Goto REQUEST_UPLOAD_LETTER
Timeout 30 Goto GIVE_UP
End
Begin REQUEST_UPLOAD_LETTER
Transmit %rz%
Cr
When %rzprompt1% Goto BEGIN_LETTER_UPLOAD
When %rzprompt2% Goto BEGIN_LETTER_UPLOAD
Timeout 20 Goto GIVE_UP
End
Begin WAIT_FOR_UPLOAD
Timeout 1 Goto BEGIN_LETTER_UPLOAD
End
Begin BEGIN_LETTER_UPLOAD
NewLetter
Upload %uploadproto% Then UPLOAD_SUCCESS Else GIVE_UP
End
Begin UPLOAD_SUCCESS
Caption 'Letter Uploaded'
Cr
When %prompt% Goto SEND_LETTER
Timeout 5 Goto END_LETTER_UPLOAD
End
Begin END_LETTER_UPLOAD
Cr
When %prompt% Goto SEND_LETTER
Timeout 5 Goto END_LETTER_UPLOAD2
End
Begin END_LETTER_UPLOAD2
Control C
When %prompt% Goto SEND_LETTER
Timeout 5 Goto GIVE_UP
End
Begin SEND_LETTER
Transmit %sendmail%
Transmit $LETTER.DEST.USERNAME
Cr
When %subjectprompt% Goto SEND_SUBJECT
When 'not found' Goto RETRY_SEND_LETTER
Timeout 15 Goto GIVE_UP
End
Begin RETRY_SEND_LETTER
Transmit %sendmail%
Transmit $LETTER.DEST.USERNAME
Cr
When %subjectprompt% Goto SEND_SUBJECT
When 'not found' Goto GIVE_UP
Timeout 15 Goto GIVE_UP
End
Begin SEND_SUBJECT
Transmit $LETTER.SUBJECT
Cr
Timeout 2 Goto SEND_BODY
End
Begin SEND_BODY
Transmit '~r '
Transmit $LETTER.FILENAME
Cr
Timeout 1 Goto %signature%
End
Begin SEND_SIG
Transmit '~r .signature'
Cr
Timeout 1 Goto NO_SIGNATURE
End
Begin SEND_CC
Transmit '~c '
CreateCC 0 80 Delimiter ','
Transmit $LETTER.CC
Cr
Timeout 1 Goto NO_SIGNATURE
End
Begin NO_SIGNATURE
If LETTER.CC Then SEND_CC
Control D
When %prompt% Goto LETTER_SENT
When %ccprompt1% Goto SEND_CC_CR
When %ccprompt2% Goto SEND_CC_CR
When %ccprompt3% Goto SEND_CC_CR
Timeout 5 Goto NO_SIGNATURE
End
Begin SEND_CC_CR
Cr
When %prompt% Goto LETTER_SENT
When %ccprompt1% Goto SEND_CC_CR
When %ccprompt2% Goto SEND_CC_CR
When %ccprompt3% Goto SEND_CC_CR
Timeout 10 Goto SEND_CC_CR
End
Begin LETTER_SENT
Caption 'Letter Sent'
Confirm LETTER.SENT Successful
Transmit %rm%
Transmit $LETTER.FILENAME
Cr
When %prompt% Goto SEND_MORE_MAIL
Timeout 15 Goto GIVE_UP
End
Begin SEND_MORE_MAIL
If MORE_LETTERS Then REQUEST_UPLOAD_LETTER
If TRUE Then LOG_OFF
End
;------------------------------------------------------
; These states deal with logging off the system
;
Begin WAIT_TO_LOG_OFF
When %prompt% Goto LOG_OFF
Timeout 20 Goto GIVE_UP
End
Begin LOG_OFF
Transmit %logoff%
Cr
Caption 'Logging off'
When 'NO CAR' Goto EXIT_PROGRAM
When %logoffbanner1% Goto HANGUP_PHONE
When %logoffbanner2% Goto HANGUP_PHONE
When %prompt% Goto LOG_OFF
CarrierLoss Goto EXIT_PROGRAM
Timeout 20 Goto GIVE_UP
End
Begin EXIT_PROGRAM
Caption 'Logged off'
CarrierLoss Goto EXIT_PROGRAM
Timeout 3 Goto BYE_BYE
End
Begin GIVE_UP
Caption 'Aborting'
Hangup
CarrierLoss Goto EXIT_PROGRAM
End
Begin HANGUP_PHONE
Hangup
CarrierLoss Goto EXIT_PROGRAM
End
Begin NO_LOGIN
Timeout 5 Goto GIVE_UP
End
Begin BYE_BYE
Exit
End