$! ------------------ CUT HERE ----------------------- $ v='f$verify(f$trnlnm("SHARE_VERIFY"))' $! $! This archive created by VMS_SHARE Version 7.2-007 22-FEB-1990 $! On 14-MAR-1991 13:07:10.03 By user IMHW400 (Mark H. Wood, IUPUI, IN USA) $! $! This VMS_SHARE Written by: $! Andy Harper, Kings College London UK $! $! Acknowledgements to: $! James Gray - Original VMS_SHARE $! Michael Bednarek - Original Concept and implementation $! $!+ THIS PACKAGE DISTRIBUTED IN 2 PARTS, TO KEEP EACH PART $! BELOW 30 BLOCKS $! $! TO UNPACK THIS SHARE FILE, CONCATENATE ALL PARTS IN ORDER $! AND EXECUTE AS A COMMAND PROCEDURE ( @name ) $! $! THE FOLLOWING FILE(S) WILL BE CREATED AFTER UNPACKING: $! 1. FORWARD-UNKNOWN.COM;1 $! 2. MAIL.DELIVERY;1 $! 3. NOTE-ARCHIVE.COM;1 $! 4. POST-IT-NOTE.COM;1 $! $set="set" $set symbol/scope=(nolocal,noglobal) $f=f$parse("SHARE_TEMP","SYS$SCRATCH:.TMP_"+f$getjpi("","PID")) $e="write sys$error ""%UNPACK"", " $w="write sys$output ""%UNPACK"", " $ if f$trnlnm("SHARE_LOG") then $ w = "!" $ ve=f$getsyi("version") $ if ve-f$extract(0,1,ve) .ges. "4.4" then $ goto START $ e "-E-OLDVER, Must run at least VMS 4.4" $ v=f$verify(v) $ exit 44 $UNPACK: SUBROUTINE ! P1=filename, P2=checksum $ if f$search(P1) .eqs. "" then $ goto file_absent $ e "-W-EXISTS, File ''P1' exists. Skipped." $ delete 'f'* $ exit $file_absent: $ if f$parse(P1) .nes. "" then $ goto dirok $ dn=f$parse(P1,,,"DIRECTORY") $ w "-I-CREDIR, Creating directory ''dn'." $ create/dir 'dn' $ if $status then $ goto dirok $ e "-E-CREDIRFAIL, Unable to create ''dn'. File skipped." $ delete 'f'* $ exit $dirok: $ w "-I-PROCESS, Processing file ''P1'." $ if .not. f$verify() then $ define/user sys$output nl: $ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT 'f'/OUT='P1' PROCEDURE Unpacker ON_ERROR ENDON_ERROR;SET(FACILITY_NAME,"UNPACK");SET( SUCCESS,OFF);SET(INFORMATIONAL,OFF);f:=GET_INFO(COMMAND_LINE,"file_name");b:= CREATE_BUFFER(f,f);p:=SPAN(" ")@r&LINE_END;POSITION(BEGINNING_OF(b)); LOOP EXITIF SEARCH(p,FORWARD)=0;POSITION(r);ERASE(r);ENDLOOP;POSITION( BEGINNING_OF(b));g:=0;LOOP EXITIF MARK(NONE)=END_OF(b);x:=ERASE_CHARACTER(1); IF g=0 THEN IF x="X" THEN MOVE_VERTICAL(1);ENDIF;IF x="V" THEN APPEND_LINE; MOVE_HORIZONTAL(-CURRENT_OFFSET);MOVE_VERTICAL(1);ENDIF;IF x="+" THEN g:=1; ERASE_LINE;ENDIF;ELSE IF x="-" THEN IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+")= 1 THEN g:=0;ENDIF;ENDIF;ERASE_LINE;ENDIF;ENDLOOP;t:="0123456789ABCDEF"; POSITION(BEGINNING_OF(b));LOOP r:=SEARCH("`",FORWARD);EXITIF r=0;POSITION(r); ERASE(r);x1:=INDEX(t,ERASE_CHARACTER(1))-1;x2:=INDEX(t,ERASE_CHARACTER(1))-1; COPY_TEXT(ASCII(16*x1+x2));ENDLOOP;WRITE_FILE(b,GET_INFO(COMMAND_LINE, "output_file"));ENDPROCEDURE;Unpacker;QUIT; $ delete/nolog 'f'* $ CHECKSUM 'P1' $ IF CHECKSUM$CHECKSUM .eqs. P2 THEN $ EXIT $ e "-E-CHKSMFAIL, Checksum of ''P1' failed." $ ENDSUBROUTINE $START: $ create 'f' X$! Command procedure to forward an unmatched message to a chosen username. X$! For use w/ DELIVER. X$! Chosen username is passed via P1. X$! Unmatched message is in MESSAGE_FILE. X$! Symbols FROM, TO, and SUBJECT have the corresponding information from X$! the incoming mail message. We add them to the top of the message X$! file. X$!Tom Bailey 8/15/88 X$!----------------------------------------------------------------------- X$! X$! debugging stuff. X$ sho default X$ sho sym/all/local X$ type 'temp_file'.com X$! X$! get filename of message file to be used for temporary files. X$ temp_file = f$parse(MESSAGE_FILE,,,"NAME") X$ temp_mess_file = temp_file + ".tmpm" X$! X$! Open temp message file, write header stuff, and append message file. X$ open/write temp 'temp_mess_file' X$ write temp "FROM: " + FROM X$ write temp "TO: " + TO X$ write temp "SUBJECT: " + SUBJECT X$ write temp " " X$ close temp X$ append 'MESSAGE_FILE' 'temp_mess_file' X$! X$! mail the modified message to the chosen username. X$ mail/noself/subject="Unmatched mail" 'temp_mess_file' 'P1' X$! X$! delete our temporary files. get full names first. X$ temp_mess_file = f$parse(temp_mess_file) X$ delete 'temp_mess_file' X$! X$ exit $ CALL UNPACK FORWARD-UNKNOWN.COM;1 268982251 $ create 'f' X! MAIL.DELIVERY for user POST_IT to post CS-net interest list items X! to VAX NOTES conferences. X! Parse interest list mail by TO: address (the master X! re-distribution list). X! Call command file to post the message to the appropriate X! Notes conference. You must know the name of the X! Notes conference. X! X! Also, parse by first word of SUBJECT:. This allows X! VAX MAIL messages to be posted to a Notes conference X! by forwarding them to POST_IT with the appropriate first X! word of the subject. X! X! Currently we allow the incoming message to be placed in X! ONLY ONE Notes conference, the first one matched. X! X! TO ADD A NEW INTEREST LIST: X! 1) Create a new unrestricted Notes conference. X! 2) Add a directive line to match the TO: field in the first section X! below. You will probably have to receive a few messages X! first to note what the TO: field should be. X! 3) Add a directive line to match the SUBJECT: field in the second X! section below. This allows local users to post messages X! to the conference via DELIVER using an appropriate Subject X! value. X! TO ADD A NEW LOCAL CONFERENCE: X! 1) Create a new unrestricted Notes conference. X! 2) Add a directive line to match the SUBJECT: field in the second X! section below. This allows local users to post messages X! to the conference via DELIVER using an appropriate Subject X! value. X! X! Written by Tom Bailey, 8/11/88 X!--------------------------------------------------------------------------- V- X! Match network interest lists first, by TO: field X! X! PMDF interest list, Notes conference: PMDF_CS X* "*ipmdf*" * T E "@POST_IT_NOTE/output=pmdf.log PMDF_CS" X* "*info-pmdf*" * T E "@POST_IT_NOTE/output=pmdf.log PMDF_CS" X! AMIGA interest list, Notes conference: AMIGA_CS X* "*amiga*" * T E "@POST_IT_NOTE/output=amiga.log AMIGA_CS" X! Simulation interest list, Notes conference: SIMULATION_CS X* "*simulation*" * T E "@POST_IT_NOTE/output=simulation.log SIMULATION_CS" X! Info-VAX interest list, Notes conference: INFO_VAX_CS X* "*info-vax*" * T E "@POST_IT_NOTE/output=info_vax.log INFO_VAX_CS" X! Scheme interest list, Notes conference: SCHEME_CS X* "scheme*" * T E "@POST_IT_NOTE/output=SCHEME.log SCHEME_CS" X! Common Lisp interest list, Notes conference: COMMON_LISP_CS X* "*common-lisp*" * T E "@POST_IT_NOTE/output=COMMON_LISP.log COMMON_LISP V_CS" X* "cl*" * T E "@POST_IT_NOTE/output=COMMON_LISP.log COMMON_LISP_CS" X! Info-MAC interest list, Notes conference: INFO_MAC_CS X* "*info-mac*" * T E "@POST_IT_NOTE/output=INFO_MAC.log INFO_MAC_CS" X! Info-high-audio interest list, Notes conference: INFO_HIGH_AUDIO_CS X* "*info-high-audio*" * T E "@POST_IT_NOTE/output=INFO_HIGH_AUDIO.log X INFO_HIGH_AUDIO_CS" X! NA (numerical analysis) interest list, Notes conference: X NUMERICAL_ANALYSIS_CS X* "NA@*" * T E "@POST_IT_NOTE/output=NUMERICAL_ANALYSIS.log X NUMERICAL_ANALYSIS_CS" X! Neuron list, Notes conference: NEURON_CS X* "*neuron*" * T E "@POST_IT_NOTE/output=NEURON.log NEURON_CS" X! CA (cellular automata) interest list, Notes conference: CELL_AUTOMATA_C VS X* "CA@*" * T E "@POST_IT_NOTE/output=CELL_AUTOMATA.log CELL_AUTOMATA_CS" X!--------------------------------------------------------------------------- V--- X! Match mail by SUBJECT:. Intended to allow posting of local mail items X! to Notes conferences. Only post mail matched by subject if no X! previous directive applied to prevent posting net mail twice in X! the same conference. X! X! Notes conference: PMDF_CS X* * "pmdf*" O E "@POST_IT_NOTE/output=pmdf.log PMDF_CS" X! Notes conference: AMIGA_CS X* * "amiga*" O E "@POST_IT_NOTE/output=amiga.log AMIGA_CS" X! Notes conference: SIMULATION_CS X* * "simulation*" O E "@POST_IT_NOTE/output=simulation.log SIMULATION_CS" X! Notes conference: INFO_VAX_CS X* * "info_vax*" O E "@POST_IT_NOTE/output=info_vax.log INFO_VAX_CS" X! Scheme interest list, Notes conference: SCHEME_CS X* * "scheme*" O E "@POST_IT_NOTE/output=SCHEME.log SCHEME_CS" X! Common Lisp interest list, Notes conference: COMMON_LISP_CS X* * "common_lisp*" O E "@POST_IT_NOTE/output=COMMON_LISP.log COMMON_LISP_ VCS" X! Info-MAC interest list, Notes conference: INFO_MAC_CS X* * "info_mac*" O E "@POST_IT_NOTE/output=INFO_MAC.log INFO_MAC_CS" X! Info-high-audio interest list, Notes conference: INFO_HIGH_AUDIO_CS X* * "info_high_audio*" O E "@POST_IT_NOTE/output=INFO_HIGH_AUDIO.log X INFO_HIGH_AUDIO_CS" X! NA (numerical analysis) interest list, Notes conference: X NUMERICAL_ANALYSIS_CS X* * "num_anal*" O E "@POST_IT_NOTE/output=NUMERICAL_ANALYSIS.log X NUMERICAL_ANALYSIS_CS" X! Neuron list, Notes conference: NEURON_CS X* * "neuron*" O E "@POST_IT_NOTE/output=NEURON.log NEURON_CS" X! CA (cellular automata) interest list, Notes conference: CELL_AUTOMATA_C VS X* * "cell_auto*" O E "@POST_IT_NOTE/output=CELL_AUTOMATA.log X CELL_AUTOMATA_CS" X! X! VAX ELN local Notes conference: ELN_THINGS X* * "eln*" O E "@POST_IT_NOTE/output=eln.log ELN_THINGS" X! Local news Notes conference: RPL_LOCAL_NEWS X* * "local*" O E "@POST_IT_NOTE/output=local.log RPL_LOCAL_NEWS" X! Software tools local Notes conference: SOFTWARE_TOOLS X* * "software*" O E "@POST_IT_NOTE/output=soft.log SOFTWARE_TOOLS" X! TB testing local news Notes conference: TBTEST X* * "test*" O E "@POST_IT_NOTE/output=test.log TBTEST" X!--------------------------------------------------------------------------- V- X! forward any previously unmatched messages to Tom Bailey: username BAILEY X* * * O E "@FORWARD_UNKNOWN BAILEY" $ CALL UNPACK MAIL.DELIVERY;1 1853311937 $ create 'f' X$! procedure to archive a selected NOTES conference. X$! Created by Tom Bailey, 8/31/88 X$!----------------------------------------------------------------------- X$! There are some potential problems with this set-up, but it will work X$! most of the time. The problems I know about are: X$! 1) some messages may get archived but not deleted from the main X$! NOTES conference if a new message comes in after the X$! directory of the conference has been done. X$! 2) the convert/reclaim locks the NOTES file, so that any batch X$! process that is trying to post a note will fail, and the X$! message will be lost. X$! One solution that takes care all notes posted by DELIVER is to stop X$! the DELIVER queue and restart after all the sensitive operations X$! are done. X$! Also, only one process should run this procedure at-a-time. Otherwise, X$! things will get messed up because of non-unique file names. X$! The USERNAME that this procedure run under must be a moderator for the X$! desired NOTES conference. X$!------------------------------------------------------------------------ X$! NOTES file name to be archived comes in through P1. X$! X$ set process/priv=all X$ set def notes$library X$ set protection=w:rwe/default X$ on error then goto end X$! X$! get date, and form archival file name. X$ time = f$time() X$ year = f$cvtime(time,,"year") X$ month = f$cvtime(time,,"month") X$ day = f$cvtime(time,,"day") X$ arc_file = P1 + "_" + YEAR + "_" + MONTH + "_" + DAY + ".NOTE" X$! X$! open conference and get a listing of notes that will be archived. X$ notes 'p1' Xdir/output=note_del.tmp *.* Xclose Xexit X$! X$! use convert to make a copy of the notes conference. X$ convert/share 'p1'.note 'arc_file' X$! X$! call subroutine to process directory of conference and to determine X$! the number of the 1st and last notes in the conference. X$ call make_del_file 'p1' note_del.tmp 'p1'.tmp X$! X$! goto a subroutine to add a note telling what we archived and where it X$! is. X$ gosub add_archive_note X$! X$! Now delete all the archived notes from the conference by executing the X$! command file that make_del_file created. Do this twice to remove X$! any notes that were TOPICs which had replies. X$ @'p1'.tmp X$ @'p1'.tmp X$! X$! Reclaim buckets in main conference. Then make a new version of the file X$! using the FDL of a new NOTES conference so that we can recover some X$! of the disk space used by the delete notes. X$ convert/reclaim/statistics 'p1'.note X$ convert/fdl=note_dummy.fdl /create /statistics 'p1'.note 'p1'.note X$ delete 'p1'.note;-1 X$! X$! clean up stuff. X$ delete 'p1'*.tmp*;*/log X$ delete note_del*.tmp;*/log X$! X$! End of procedure. X$end: X$ exit X$! X$! X$add_archive_note: X$! add note to tell what we archived and where it went. X$! Put note text into a file, then post the file as a note. X$ open/write tmp note_del2.tmp X$ write tmp " Notes ''first' through ''last' have been archived to the" X$ write tmp " NOTES conference ''arc_file' ." X$ write tmp " " X$ write tmp " You can look at any old notes by adding the archive " X$ write tmp " conference to your NOTES notebook." X$ close tmp X$ notes 'p1' Xwrite/noedit note_del2.tmp XPREVIOUS NOTES HAVE BEEN ARCHIVED XY Xclose Xexit X$ return X$! X$! X$MAKE_DEL_FILE: SUBROUTINE X$! subroutine to process the output of a NOTES dir *.* to create a command X$! file which can be used to delete all the notes in a conference. X$! Also, puts the numbers of the first and last notes into the global symbol Vs X$! FIRST and LAST, respectively. X$! The name of the notes conference is passed in through P1. X$! The name of the file which contains a conference directory listing is X$! P2. X$! The name of the file which will contain the commands to delete the X$! selected notes is P3. X$! X$ open/read in 'p2' X$ open/write out 'p3' X$! X$! write out misc. commands at the start of the command file. X$ write out "$ notes ''p1'" X$ write out "set moderator" X$! X$ first == "" X$ last == "" X$! X$!skip 1st 5 lines (header of listing) X$ read in line X$ read in line X$ read in line X$ read in line X$ read in line X$! X$! don't need verify for around this loop X$ set nover X$! start processing loop. X$loop: X$! get line to parse. X$ read/end=end_sub/err=end_sub in line +-+-+-+-+-+-+-+- END OF PART 1 +-+-+-+-+-+-+-+-