home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / vmsnet / sources / 315 < prev    next >
Encoding:
Internet Message Format  |  1992-08-21  |  11.1 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!news.acns.nwu.edu!network.ucsd.edu!mvb.saic.com!vmsnet-sources
  2. From: munroe@dmc.com (Dick Munroe)
  3. Newsgroups: vmsnet.sources
  4. Subject: ORGANIZE_FTPMAIL PATCH 2: Fix for MAILSERV@ualr.edu, part 01/01
  5. Message-ID: <7869377@MVB.SAIC.COM>
  6. Date: Fri, 21 Aug 1992 20:59:51 GMT
  7. Organization: Doyle, Munroe Consultants, Inc., Hudson, MA
  8. Lines: 312
  9. Approved: Mark.Berryman@Mvb.Saic.Com
  10.  
  11. Submitted-by: munroe@dmc.com (Dick Munroe)
  12. Posting-number: Volume 3, Issue 121
  13. Archive-name: organize_ftpmail/patch2_01
  14. Patch-to: organize_ftpmail: Volume 3, Issue 101,106
  15.  
  16. This is a patch to ORGANIZE-FTPMAIL V1.0 to add functionality for
  17. organizing information retrieved from MAILSERV@ualr.edu (where I 
  18. managed to find a public domain BBS for VMS).
  19. -- 
  20. Dick Munroe                Internet: munroe@dmc.com
  21. Doyle Munroe Consultants, Inc.        UUCP: ...uunet!thehulk!munroe
  22. 267 Cox St.                Office: (508) 568-1618
  23. Hudson, Ma.                FAX: (508) 562-1133
  24.  
  25. GET CONNECTED!!! Send mail to info@dmc.com to find out about DMConnection.
  26.  
  27. $! ------------------ CUT HERE -----------------------
  28. $ v='f$verify(f$trnlnm("SHARE_VERIFY"))'
  29. $!
  30. $! This archive created by VMS_SHARE Version 7.2-010  25-Jun-1992
  31. $!   On  8-AUG-1992 20:47:06.71   By user MUNROE 
  32. $!
  33. $! This VMS_SHARE Written by:
  34. $!    Andy Harper, Kings College London UK
  35. $!
  36. $! Acknowledgements to:
  37. $!    James Gray       - Original VMS_SHARE
  38. $!    Michael Bednarek - Original Concept and implementation
  39. $!
  40. $! TO UNPACK THIS SHARE FILE, CONCATENATE ALL PARTS IN ORDER
  41. $! AND EXECUTE AS A COMMAND PROCEDURE  (  @name  )
  42. $!
  43. $! THE FOLLOWING FILE(S) WILL BE CREATED AFTER UNPACKING:
  44. $!       1. AAAREADME-V1-2.1ST;2
  45. $!       2. UTL-ORGANIZEFTPMAIL.PATCH02;1
  46. $!
  47. $set="set"
  48. $set symbol/scope=(nolocal,noglobal)
  49. $f=f$parse("SHARE_TEMP","SYS$SCRATCH:.TMP_"+f$getjpi("","PID"))
  50. $e="write sys$error  ""%UNPACK"", "
  51. $w="write sys$output ""%UNPACK"", "
  52. $ if f$trnlnm("SHARE_LOG") then $ w = "!"
  53. $ ve=f$getsyi("version")
  54. $ if ve-f$extract(0,1,ve) .ges. "4.4" then $ goto START
  55. $ e "-E-OLDVER, Must run at least VMS 4.4"
  56. $ v=f$verify(v)
  57. $ exit 44
  58. $UNPACK: SUBROUTINE ! P1=filename, P2=checksum
  59. $ x = P1 - f$parse(P1,,,"version")
  60. $ y = f$search(x)
  61. $ if y .eqs. "" then $ goto file_absent
  62. $ x = f$integer(f$parse(P1,,,"version")-";")
  63. $ y = f$integer(f$parse(y,,,"version")-";")
  64. $ if x .gt. y then $ goto file_absent
  65. $ if f$mode() .eqs. "INTERACTIVE" then $ goto file_interactive
  66. $ if x .eq. y then e "-W-EXISTS, File ''P1' exists. Skipped."
  67. $ if x .ne. y then e "-W-NEWERVERSION, of File ''P1' exists. Skipped."
  68. $file_delete:
  69. $ delete 'f'*
  70. $ exit
  71. $file_interactive:
  72. $ if x .eq. y then e "-W-EXISTS, File ''P1' exists."
  73. $ if x .ne. y then e "-W-NEWERVERSION, of File ''P1' exists."
  74. $ read/error=file_delete/end=file_delete-
  75.   /prompt="Create new version [y/n]: " -
  76.   sys$command x
  77. $ if .not. x then $ e "-W-SKIPPED, File ''P1' skipped."
  78. $ if .not. x then $ goto file_delete
  79. $ P1 = P1 - f$parse(P1,,,"version")
  80. $file_absent:
  81. $ if f$parse(P1) .nes. "" then $ goto dirok
  82. $ dn=f$parse(P1,,,"DIRECTORY")
  83. $ w "-I-CREDIR, Creating directory ''dn'."
  84. $ create/dir 'dn'
  85. $ if $status then $ goto dirok
  86. $ e "-E-CREDIRFAIL, Unable to create ''dn'. File skipped."
  87. $ delete 'f'*
  88. $ exit
  89. $dirok:
  90. $ w "-I-PROCESS, Processing file ''P1'."
  91. $ if .not. f$verify() then $ define/user sys$output nl:
  92. $ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT 'f'/OUT='P1'
  93. PROCEDURE Unpacker ON_ERROR ENDON_ERROR;SET(FACILITY_NAME,"UNPACK");SET(
  94. SUCCESS,OFF);SET(INFORMATIONAL,OFF);f:=GET_INFO(COMMAND_LINE,"file_name");b:=
  95. CREATE_BUFFER(f,f);p:=SPAN(" ")@r&LINE_END;POSITION(BEGINNING_OF(b));
  96. LOOP EXITIF SEARCH(p,FORWARD)=0;POSITION(r);ERASE(r);ENDLOOP;POSITION(
  97. BEGINNING_OF(b));g:=0;LOOP EXITIF MARK(NONE)=END_OF(b);x:=ERASE_CHARACTER(1);
  98. IF g=0 THEN IF x="X" THEN MOVE_VERTICAL(1);ENDIF;IF x="V" THEN APPEND_LINE;
  99. MOVE_HORIZONTAL(-CURRENT_OFFSET);MOVE_VERTICAL(1);ENDIF;IF x="+" THEN g:=1;
  100. ERASE_LINE;ENDIF;ELSE IF x="-" THEN IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+")=
  101. 1 THEN g:=0;ENDIF;ENDIF;ERASE_LINE;ENDIF;ENDLOOP;t:="0123456789ABCDEF";
  102. POSITION(BEGINNING_OF(b));LOOP r:=SEARCH("`",FORWARD);EXITIF r=0;POSITION(r);
  103. ERASE(r);x1:=INDEX(t,ERASE_CHARACTER(1))-1;x2:=INDEX(t,ERASE_CHARACTER(1))-1;
  104. COPY_TEXT(ASCII(16*x1+x2));ENDLOOP;WRITE_FILE(b,GET_INFO(COMMAND_LINE,
  105. "output_file"));ENDPROCEDURE;Unpacker;QUIT;
  106. $ delete/nolog 'f'*
  107. $ CHECKSUM 'P1'
  108. $ IF CHECKSUM$CHECKSUM .eqs. P2 THEN $ EXIT
  109. $ e "-E-CHKSMFAIL, Checksum of ''P1' failed."
  110. $ ENDSUBROUTINE
  111. $START:
  112. $ create 'f'
  113. XThis is a patch to ORGANIZE-FTPMAIL V1.0 to add functionality for
  114. Xorganizing information retrieved from MAILSERV@ualr.edu (where I managed
  115. Xto find a public domain BBS for VMS).
  116. X
  117. XThis assumes that you have applied all prior patches.
  118. X
  119. XApply it using PATCH (NOT the VMS PATCH utility, but the one that
  120. Xcomes with DECUS UUCP.  I believe it's available from CERRITOS or
  121. XWKUVX1.BITNET) as follows:
  122. X
  123. X1. Move to the directory containtaining ORGANIZE-FTPMAIL V1.1
  124. X2. Rename the original source for ORGANIZE-FTPMAIL to be
  125. XUTL-ORGANIZEFTPMAIL.TPU
  126. X3. Apply the patch:
  127. X
  128. X        PATCH <UTL-ORGANIZEFTPMAIL.DIFF
  129. X
  130. X4. You should have V1.2 of ORGANIZE-FTPMAIL.
  131. X5. Install the new version as per the original instructions.
  132. X
  133. XIf you have any problems, please let me know.
  134. X
  135. XDick Munroe
  136. XDoyle, Munroe Consultants, Inc.
  137. X267 Cox St.
  138. XHudson, Ma. 01749
  139. X(508) 568-1618
  140. X(FAX) (508) 562-1133
  141. Xmunroe@dmc.com
  142. $ CALL UNPACK AAAREADME-V1-2.1ST;2 1936937327
  143. $ create 'f'
  144. X*** `5B-.ref-lib`5Dutl-organizeftpmail.tpu
  145. X--- utl-organizeftpmail.tpu
  146. X**************
  147. X*** 12,18
  148. X  ! information is retained.  Use of this code for profit is forbidden witho
  149. Vut the
  150. X  ! express permission of the author.
  151. X  !
  152. X! ! OrganizeFTPMAIL V1.1
  153. X  !
  154. X  ! Not being blessed with a direct internet connection, I get all of my lar
  155. Vge
  156. X  ! file transactions through direct interactions with mail servers or indir
  157. Vect
  158. X--- 12,18 -----
  159. X  ! information is retained.  Use of this code for profit is forbidden witho
  160. Vut the
  161. X  ! express permission of the author.
  162. X  !
  163. X! ! OrganizeFTPMAIL V1.2
  164. X  !
  165. X  ! Not being blessed with a direct internet connection, I get all of my lar
  166. Vge
  167. X  ! file transactions through direct interactions with mail servers or indir
  168. Vect
  169. X**************
  170. X*** 67,72
  171. X  !       property of PDMF mail servers.  For now I'll assume its a property
  172. X  !       only of MRCSERV and generalize it later.
  173. X  !
  174. X  !--
  175. X `20
  176. X  procedure rchm_organizeFTPMAIL
  177. X--- 67,80 -----
  178. X  !       property of PDMF mail servers.  For now I'll assume its a property
  179. X  !       only of MRCSERV and generalize it later.
  180. X  !
  181. X+ !   0.002 Dick Munroe 08-Aug-92
  182. X+ !       And another one's been added, mailserv-reply@ualr.edu.  This one`2
  183. V0
  184. X+ !       puts out subject lines of the form:
  185. X+ !
  186. X+ !           Re: SEND `5Bdirectory`5Dname.ext
  187. X+ !
  188. X+ !       Where ext is SHARE_n and n varies from 1..n.  Make n 3 digits in
  189. X+ !       length before performing the subject extraction and sorting.
  190. X  !--
  191. X `20
  192. X  procedure rchm_organizeFTPMAIL
  193. X**************
  194. X*** 90,96
  195. X          xxxM,                                           ! Contains miscell
  196. Vaneous mark variables.
  197. X          xxxR,                                           ! Contains miscell
  198. Vaneous range variables.
  199. X          xxxS,
  200. X!         yyyI
  201. X          ;
  202. X `20
  203. X      subjectArrayS := create_array(100,0) ;              ! All arrays start
  204. V with 100 elements and are indexed with 0.
  205. X--- 98,105 -----
  206. X          xxxM,                                           ! Contains miscell
  207. Vaneous mark variables.
  208. X          xxxR,                                           ! Contains miscell
  209. Vaneous range variables.
  210. X          xxxS,
  211. X!         yyyI,
  212. X!         yyyR
  213. X          ;
  214. X `20
  215. X      subjectArrayS := create_array(100,0) ;              ! All arrays start
  216. V with 100 elements and are indexed with 0.
  217. X**************
  218. X*** 105,111
  219. X      ! Set the server type.
  220. X      !--
  221. X `20
  222. X!     xxxR := search_quietly(line_begin + "Return-Path:" + span(" `09") + "<
  223. VMRCSERV@mtroyal.ab.ca>", forward, no_exact) ;
  224. X      if xxxR <> 0
  225. X      then
  226. X          serverTypeI := 1 ;                              ! This collection
  227. V of messages came from Mt Royal College.
  228. X--- 114,122 -----
  229. X      ! Set the server type.
  230. X      !--
  231. X `20
  232. X!     xxxR := search_quietly(line_begin + "Subject:", forward, no_exact) ;
  233. X!     position(beginning_of(xxxR)) ;
  234. X!     xxxR := search_quietly(line_begin + "Return-Path:" + span(" `09") + "<
  235. VMRCSERV@mtroyal.ab.ca>", reverse, no_exact) ;
  236. X      if xxxR <> 0
  237. X      then
  238. X          serverTypeI := 1 ;                              ! This collection
  239. V of messages came from Mt Royal College.
  240. X**************
  241. X*** 110,115
  242. X      then
  243. X          serverTypeI := 1 ;                              ! This collection
  244. V of messages came from Mt Royal College.
  245. X      endif ;
  246. X `20
  247. X      !++
  248. X      ! Check to see if this message came from MRCSERV@mtroyal.ab.ca and if
  249. V it
  250. X--- 121,132 -----
  251. X      then
  252. X          serverTypeI := 1 ;                              ! This collection
  253. V of messages came from Mt Royal College.
  254. X      endif ;
  255. X+     xxxR := search_quietly(line_begin + "Return-Path:" + span(" `09") + "<
  256. Vmailserv-reply@ualr.edu>", reverse, no_exact) ;
  257. X+     if xxxR <> 0
  258. X+     then
  259. X+         serverTypeI := 2 ;                              ! This collection
  260. V of messages came from University of Arkansas at Little
  261. X+                                                         ! Rock.
  262. X+     endif ;
  263. X `20
  264. X      !++
  265. X      ! Check to see if this message came from MRCSERV@mtroyal.ab.ca and if
  266. V it
  267. X**************
  268. X*** 142,147
  269. X                  position(beginning_of(partNR)) ;
  270. X                  loop
  271. X                      exitif xxxI = xxx1I ;
  272. X                      copy_text("0") ;
  273. X                      xxxi := xxxi + 1 ;
  274. X                  endloop ;
  275. X--- 159,202 -----
  276. X                  position(beginning_of(partNR)) ;
  277. X                  loop
  278. X                      exitif xxxI = xxx1I ;
  279. X+                     copy_text("0") ;
  280. X+                     xxxi := xxxi + 1 ;
  281. X+                 endloop ;
  282. X+             endif ;
  283. X+             position(end_of(xxxR)) ;
  284. X+             move_horizontal(1) ;
  285. X+         endloop ;
  286. X+         set(modified,current_buffer,off) ;
  287. X+     endif ;   `20
  288. X+`20
  289. X+     if serverTypeI = 2
  290. X+     then
  291. X+         message("Fixing mailserv-reply@ualr.edu message headers") ;
  292. X+         loop
  293. X+             xxxR :=
  294. X+                 search_quietly (
  295. X+                     line_begin +`20
  296. X+                     "Subject:" +`20
  297. X+                     span(" `09") +`20
  298. X+                     "Re: " +
  299. X+                     remain,
  300. X+                     forward,`20
  301. X+                     no_exact) ;
  302. X+             exitif xxxR = 0 ;
  303. X+`20
  304. X+             partNR := 0 ;
  305. X+             search_quietly (
  306. X+                 ".share_" +
  307. X+                 (span("0123456789") @ partNR),
  308. X+                 forward,
  309. X+                 no_exact,
  310. X+                 xxxR) ;
  311. X+             xxxI := length(str(partNR)) ;
  312. X+             if xxxI < 3
  313. X+             then
  314. X+                 position(beginning_of(partNR)) ;
  315. X+                 loop
  316. X+                     exitif xxxI = 3 ;
  317. X                      copy_text("0") ;
  318. X                      xxxi := xxxi + 1 ;
  319. X                  endloop ;
  320. $ CALL UNPACK UTL-ORGANIZEFTPMAIL.PATCH02;1 1867933198
  321. $ v=f$verify(v)
  322. $ EXIT
  323.