home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / comm / qns311.zip / Q-MM2.SCR < prev    next >
Text File  |  1991-02-19  |  4KB  |  79 lines

  1. ;┌──────────────────────────────────────────────────────────────────────────┐
  2. ;│ Q-MM2.SCR          Copyright 1988-1991 by Rik Brown                      │
  3. ;│                                                                          │
  4. ;│                    Markmail 2.x door script                              │
  5. ;└──────────────────────────────────────────────────────────────────────────┘
  6.  
  7.   SEND "^~OPEN $maildoor^M"             ; Open netmail door
  8.   WHEN                                  ; Clear all WHENs
  9.   WHEN "(NS)?" "^~N^M"
  10.   WHEN "upcoming board function" LOGOFF ; Logoff if event is non-sliding
  11.   WHEN "Fatal Error"             LOGOFF ; Logoff if door problem
  12.   WHEN "Cannot Continue"         LOGOFF ; Log off if MarkMail door error
  13.   TIMEOUT 40               DIALSEQUENCE ; Wait max 40 secs for next line
  14.   WAITFOR "ommand?"
  15.  
  16. ULMAIL:
  17.  
  18.   WHEN
  19.   WHEN "NO CARRIER"        DIALSEQUENCE ; Error handling (carrier loss)
  20.   WHEN "Cannot Continue"         LOGOFF ; Log off if MarkMail door error
  21.   EXIST $maildir\SUCCESS.SND     DLMAIL ; Error handling (carrier loss)
  22.   IF "$2" = "0"                  DLMAIL ; Download mail if no mail to send
  23.   IF "$4" = "$maxulmail"         DLMAIL ; Counter check: ul attempts
  24.   INCR 4                                ; Increment ULMAIL counter
  25.   SEND "^~^M"                           ; Get "command" prompt
  26.   TIMEOUT 10                     DLMAIL ; Online test (grab command prompt)
  27.   WAITFOR "ommand?"
  28.   SEND "^~U^M"                          ; Upload current mail packet
  29.   TIMEOUT 60               DIALSEQUENCE ; Wait max 60 seconds for ready
  30.   WAITFOR "(Ctrl-X) Aborts Transfer"    ; MarkMail door is read to receive
  31.   PAUSE 1000                            ; Pause 1 sec (or overrun next cmd)
  32.   DOS "qnssz.bat $maildir $mailUL"      ; Call transfer BAT file
  33.   IF $OFFLINE              DIALSEQUENCE ; Error handling (carrier loss)
  34.   PAUSE 1000
  35.   DOS "if exist $maildir\SUCCESS.SND del $maildir\$mailUL"
  36. ; If mail upload was successful, it will be deleted. But if mail upload
  37. ; failed, it will be uploaded the next time the script is run. In this
  38. ; way no replies are lost. Pending mail files must be successfully uploaded
  39. ; before a totally new mail file can be created.
  40.   CLRSCR                                ; Exit DSZ status line
  41.   EXIST $maildir\SUCCESS.SND     DLMAIL ; Set to your location
  42.   PAUSE 6000                            ; 6 sec pause for door to recycle
  43.   GOTO ULMAIL
  44.  
  45. DLMAIL:
  46.  
  47.   WHEN
  48.   WHEN "NO CARRIER"        DIALSEQUENCE ; Error handling (carrier loss)
  49.   WHEN "No Messages Found"       LOGOFF ; Skip download if no mail is found
  50.   WHEN "Cannot Continue"         LOGOFF ; Log off if MarkMail door error
  51.   WHEN "Error Creating Packet"   LOGOFF ; Log off if MarkMail door error
  52.   WHEN "Pointers NOT Updated"    DLMAIL ; Try again if error
  53.   WHEN "[G]oodbye When Done?" "^~^~Y^M" ; Download the packet. No auto-logoff
  54.   EXIST $maildir\SUCCESS.RCV     LOGOFF ; Error handling (prior carrier loss)
  55.   IF "$3" = "$maxdlmail"         LOGOFF ; Counter check: dl attempts
  56.   INCR 3                                ; Increment DLMAIL counter
  57.   SEND "^~^M"                           ; Get "command" prompt
  58.   TIMEOUT 60                     LOGOFF ; Keep large
  59.   WAITFOR "ommand?"
  60.   SEND "^~D^M"                          ; Download mail packet
  61.   TIMEOUT 2000             DIALSEQUENCE ; Wait max 20 minutes for packet
  62.   WAITFOR "(Ctrl-X) Aborts Transfer"    ; Wait for file to compress
  63.   PAUSE 1000                            ; Pause 1 sec (or overrun next cmd)
  64.   DOS "if exist $maildir\$mailDL del $maildir\$mailDL"
  65. ; Delete any prior non-completed Zmodem download of a incoming mail file
  66.   DOS "qnsrz.bat $maildir $mailDL"      ; Call transfer BAT file
  67.   IF $OFFLINE              DIALSEQUENCE ; Error handling (carrier loss)
  68.   CLRSCR                                ; Exit DSZ status line
  69.   EXIST $maildir\SUCCESS.RCV     LOGOFF ; Log off is DL successful
  70.   PAUSE 10000                           ; 10 sec pause for door to cycle
  71.   GOTO                           DLMAIL ; Try again if unsuccessful
  72.  
  73.   RETURN
  74.  
  75. DIALSEQUENCE:
  76.   SCRIPT Q-LOGON.SCR
  77. LOGOFF:
  78.   SCRIPT Q-LOGOFF.SCR
  79.