home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / comm / zcm_scrp.zip / GEMAILU.T < prev    next >
Text File  |  1989-11-21  |  4KB  |  155 lines

  1. ::
  2. :: This one is a file named "gemailu.t" and it goes in %lib
  3. ::  Discussion at end of script
  4. ::
  5.     echo "GEMAILU.T Revised 10-11-89.   File = %item"
  6.         pattern
  7.         open -!tg %item
  8.     grab s4
  9.     split s4 " ";  if "!Jz0,=/" goto nox
  10.     split s4 "="
  11.     if !f%z0 echo "%z0: NOT FOUND"; goto foox
  12.         put "m200:11\r"
  13.     pat 0l "receiving Personal Com"
  14.     wait
  15.     if %z1 put "%z1\r"
  16.     else put "%z0\r"
  17.     pat 0i "item, or <Q>uit"
  18.     wait
  19.     put "2\r"
  20.     pat 0l "INPUT\r"
  21.     wait
  22.     sx %z0
  23.     pat 0 "Press <Return>"
  24.     wait
  25.     put "\r"
  26.  
  27.     grab s4
  28.     grab s0
  29.         if !t echoc "%item Short file! ";  goto foox
  30.     if %s0>30 echo "Subject line will be shortened!"
  31.     goto xo
  32.  
  33. nox:    if "!js4,:" goto oldnox        ; check for old format
  34.     echoc "New format message"
  35.     split s4 ": " " "
  36.     sets s4 %z1
  37.     set s5 ""
  38. again:    
  39.     grab s0
  40.     ss s0 "(^To: *|^cc: *|^ *)([^ ]+)"
  41.     if !%z2 goto sub
  42.     if Iz2,s4 goback again        : Strip respondent's extra copy
  43.     if %s5 sets s5 "%s5,"
  44.     sets s5 "%s5%z2"
  45.     goto again
  46. sub:    grab s0
  47.         if !t echoc "%item Short file! ";  goto foox
  48.     if "js0,:" split s0 " :" ""; sets s0 %z1;
  49.     ss s0 "(^ *)(.*)"; ss z2 "(.*)( *$)"; sets s0 %z1
  50.     if %s0>30 echo "Subject line will be shortened!"
  51.     : echo <TO>%s4
  52.     : echo <CARBON>%s5
  53.     : echo <SUBJECT>%s0
  54.         put "m200:6\r"
  55.     pat 0$ "To:"
  56.         wait
  57.     put %s4\r
  58.     pat 0 "Carbon Copy:"
  59.     pat 1 "ignored - not found "
  60.     wait
  61.     : One or more addressees not found - abort
  62.     if 1 put "*X\r"; wait -f15; put "*X\r"; wait -f15; goto foobar
  63.     put %s5\r
  64.     : echo <TO>%s4
  65.     : echo <CARBON>%s5
  66.     : echo <SUBJECT>%s0
  67.     goto sub2
  68.  
  69. oldnox:    echoc "Old format message"
  70.     grab s0
  71.         if !t echoc "%item Short file! ";  goto foox
  72.     if %s0>30 echo "Subject line will be shortened!"
  73.         put "m200:6\r"
  74. xo:    split s4 "    "
  75.     pat 0$ "To:"
  76.         wait
  77.     put %z0\r
  78.     pat 0 "Carbon Copy:"
  79.     wait
  80.     put %z1\r
  81. sub2:    pat 0 "Sub:"
  82.     wait
  83.     put %s0\r
  84.     pat 0 "FOR INPUT"
  85.     pat 1 "text:"
  86.         wait -f40
  87.     set blankfill " "
  88.         pg62; pp600; t -gxp
  89.     ena -t!p; pp250
  90.     put "*S\r"
  91.     set blankfill ""
  92.     pat
  93.     pat 2c "Sent"
  94.     pat 0 "%pr"
  95.         wait -f15
  96.         if !2 goto foobar
  97.         obey "!mv %item Z%item.tmp"
  98.         echoc "File Uploaded: %item moved to Z%item.tmp"
  99.         ena -gt
  100.         return
  101. foobar: echoc "File Not Accpeted"
  102. foox:    echo "Moving file to backup name"
  103.     : abort;    **********
  104.     obey "!mv %item Y%item.tmp"
  105.         echoc "File Rejected: %item moved to Y%item.tmp"
  106.         ena -gt
  107.         nolog closetx
  108.         return
  109. ::
  110. :: file for email uploads takes one of 3 formats (Xmodem u/l, Old and New).
  111. ::  The Xmodem format uploads a file as part of an old format message.
  112. ::  The old format is handy for originiating messages.
  113. ::  The new format is handier for answering messages
  114. ::
  115. XMODEM Format:
  116. ***************************
  117. local_pathname[=remote_filename]
  118.    This line must have a "/" in it or end with "=" to be recognized
  119.    as file spec instead of To: address.  NO SPACES!
  120.      Example: /yam/phones.t=cafpho.t
  121.      Example: ./orders.dat
  122.    Rest of message is Old Format.
  123.  
  124. Old Format:
  125. ***************************
  126. to[<TAB>carbon]                             %s4
  127. Subject                                     %s0
  128. text
  129. ***************************
  130. New Format (from incoming message) :
  131. ***************************
  132. From:    HOMCHICK                        Paul Homchick,IBM PC RoundTbl SYSOP
  133.         D.KOZINN                        David Kozinn
  134.         ROCKNEY                         Vaughn Rockney
  135.         SCHNEIDER                       Leo Schneider
  136.         STROM                           Charles Strom
  137. caf
  138.  
  139. Sub: Overthruster Downloads
  140. ***************************
  141. Notes on new format:  The colon on the first distinguishes it from the
  142. old format.  First line gets parsed to the main To address, minus the
  143. long name if present.
  144.  
  145. Succeeding lines are carbon copies, parsed the
  146. same way.  The leading spaces are optional.
  147.  
  148. Then a blank line.
  149.  
  150. Next is subject.  Leading Sub: is eliminated.
  151.  
  152. Rest of file is the body of the message.
  153.  
  154. Do not begin any lines with Nathan.
  155.