home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / BBS / MISC / SCRIPTS.ZIP / GEMAILU.T < prev    next >
Encoding:
Text File  |  1990-10-05  |  4.0 KB  |  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-04-90.   File = %item"
  6.     on !c return
  7.         pattern
  8.         open -!tg %item
  9.     grab s4
  10.     split s4 " ";  if "!Jz0,=/" goto nox
  11.     split s4 "="
  12.     if !f%z0 echo "%z0: NOT FOUND"; goto foox
  13.         put "m200:11\r"
  14.     pat 0l "receiving Personal Com"
  15.     wait
  16.     if %z1 put "%z1\r"
  17.     else put "%z0\r"
  18.     pat 0i "item, or <Q>uit"
  19.     wait
  20.     put "2\r"
  21.     pat 0l "INPUT\r"
  22.     wait
  23.     sx %z0
  24.     pat 0 "Press <Return>"
  25.     wait
  26.     put "\r"
  27.  
  28.     grab s4
  29.  
  30. nox:    if "!js4,:" goto oldfmt        ; check for old format
  31.     echoc "New format message"
  32.     split s4 ": " " "
  33.     sets s4 %z1
  34.     set s5 ""
  35. again:    
  36.     grab s0
  37.     ss s0 "(^To: *|^cc: *|^ *)([^ ]+)"
  38.     if !%z2 goto sub
  39.     if Iz2,s4 goback again        : Strip respondent's extra copy
  40.     if %s5 sets s5 "%s5,"
  41.     sets s5 "%s5%z2"
  42.     goto again
  43. sub:    grab s0
  44.         if !t echoc "%item Short file! ";  goto foox
  45.     if "js0,:" split s0 " :" ""; sets s0 %z1;
  46.     ss s0 "(^ *)(.*)"; ss z2 "(.*)( *$)"; sets s0 %z1
  47.     if %s0>30 echo "Subject line will be shortened!"
  48.     : echo <TO>%s4
  49.     : echo <CARBON>%s5
  50.     : echo <SUBJECT>%s0
  51.         put "m200:6\r"
  52.     pat 0$ "To:"
  53.         wait
  54.     put %s4\r
  55.     pat 0 "Carbon Copy:"
  56.     pat 1 "ignored - not found "
  57.     wait
  58.     : One or more addressees not found - abort
  59.     if 1 put "*X\r"; wait -f15; put "*X\r"; wait -f15; goto foobar
  60.     put %s5\r
  61.     : echo <TO>%s4
  62.     : echo <CARBON>%s5
  63.     : echo <SUBJECT>%s0
  64.     goto sub2
  65.  
  66. oldfmt:    echoc "Old format message"
  67.     grab s0
  68.         if !t echoc "%item Short file! ";  goto foox
  69.     if %s0>30 echo "Subject line will be shortened!"
  70.         put "m200:6\r"
  71. xo:    split s4 "    "
  72.     pat 0$ "To:"
  73.         wait
  74.     put %z0\r
  75.     pat 0 "Carbon Copy:"
  76.     wait
  77.     put %z1\r
  78. sub2:    pat 0 "Sub:"
  79.     pat 1 "Sub: XMODEM File:"
  80.     wait
  81.     put %s0\r
  82.     pat 0 "FOR INPUT"
  83.     pat 1 "text:"
  84.         wait -f40
  85.     set blankfill " "
  86.         pg62; pp600; t -gxp
  87.     ena -t!p; pp250
  88.     put "*S\r"
  89.     set blankfill ""
  90.     pat
  91.     pat 2c "Sent"
  92.     pat 0 "%pr"
  93.         wait -f15
  94.         if !2 goto foobar
  95.         if !dv "!%mv %item Z%item.tmp"
  96.         if dv "!%rename %item Z%item.tmp"
  97.         echoc "File Uploaded: %item moved to Z%item.tmp"
  98.         ena -gt
  99.         return
  100. foobar: echoc "File Not Accpeted"
  101. foox:    echo "Moving file to backup name"
  102.     : abort;    **********
  103.     if !dv "!%mv %item Y%item.tmp"
  104.     if dv "!%rename %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.