$ v='f$verify(f$trnlnm("SHARE_VERIFY"))' $! $! This archive created by VMS_SHARE Version 7.2-007 22-FEB-1990 $! On 19-JAN-1992 21:28:04.29 By user AKE (Earle Ake ) $! $! This VMS_SHARE Written by: $! Andy Harper, Kings College London UK $! $! Acknowledgements to: $! James Gray - Original VMS_SHARE $! Michael Bednarek - Original Concept and implementation $! $! 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. AAAREADME.TXT;4 $! 2. GATEMAIL.C;19 $! 3. GATEMAIL.TXT;2 $! 4. GATENEWS.C;3 $! 5. GATENEWS.TXT;2 $! 6. INSTRUCTIONS.TXT;14 $! 7. NEWSSKIM-FRAG.COM;11 $! 8. SITE_DELIVER.COM;29 $! $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' XThis is a set of programs and command procedures to set up a Network News to V`20 XInternet Mail List gateway. This code allows the NEWS Articles to be sent t Vo`20 Xa Mail List and Mail articles to be posted to NEWS. Once the messages have V`20 Xbeen transferred from one system to another, then the normal distribution`20 Xmethods for that system will transfer the messages to other systems. X XThis program requires the MX messaging system and ANU News. Since MX suppor Vts`20 XMultinet TCP/IP, CMU TCP/IP, and UCX TCP/IP, plus DECUS UUCP and Joiner JNET V`20 Xnetwork software, this system can be used to interconnect any of these syste Vms. X XProblems and corrections can be sent to Ted Nieland`20 X(nieland_t@asd-yf.wpafb.af.mil). X XThis code is based on the work of Bob Sloane to convert messages between NEW VS`20 Xand JNET. X X---------------------------------------------------------------------------- V---- X3 June 1991 X XSome work was done on the command procedures involved and a bug fix was made V to Xthe gatenews.c file. A detailed instructions.txt file was added fully Xexplaining setting up the gateway programs in either direction. X XEarle Ake (ake@dayton.saic.com) X---------------------------------------------------------------------------- V---- X5 January 1992 X XSome work was done on the program gatemail.c. There were two headers that Xshould have been dropped before passing along to news "Return-Path" and X"Errors-To". X XThe way MX 3.0 handles site delivery has changed. This forced me to modify V the Xsite delivery command procedure and associated programs. It also forced a Xchange in the way you set up the route in MX. X XEarle Ake (ake@dayton.saic.com) $ CALL UNPACK AAAREADME.TXT;4 352332038 $ create 'f' X/* X * Gatemail - a program to convert Mail messages from a mailing list into X * News articles suitable for input to the ANU-NEWS ADD FILE X * command. X * X * Copyright 1989 by Robert R. Sloane . X * Permission is granted to anyone to make or distribute copie Vs X * of this program, provided that this copyright notice is X * preserved. X * X *`09Updated to support MX by Ted Nieland X * `09March 1991 X * X *`09Updated to support newer MX headers by Earle Ake X *`09January 1992 X * X */ X#include X#include X XFILE *mfd;`09/* MAIL file */ XFILE *bfd;`09/* NEWS Batch file */ X Xmain(int argc, char **argv) `7B X char line`5B1024`5D; X int i; X/* X * make sure user gave us both file names and the newsgroup name. X */ X if (argc < 2) `7B X`09printf("Usage: gtmail \n"); X`09exit(SS$_NORMAL); X `7D X if (argc < 5) X`09exit(SS$_INSFARG); X/* X * now open the input file X */ X if ( !(mfd=fopen(argv`5B1`5D,"r")) ) `7B X`09perror("can't open input file:"); X`09exit(SS$_ABORT); X `7D X/* X * and the output file X */ X if ( !(bfd=fopen(argv`5B2`5D,"a")) ) `7B X`09perror("can't open output file:"); X`09exit(SS$_ABORT); X `7D X/* X * now Start processing the mail message X */ X while ( get_head(line) ) `7B X/* X * check to see if this is the start of a new mail message X * and if it is, process it. MX will Start the message with the`20 X * "Received: " part of the header, and CBS will use "Via: " X */ X`09if (( strncmp(line,"Received: ", 10) == 0 ) `7C`7C X`09 ( strncmp(line,"Errors-To: ", 11) == 0 ) `7C`7C X`09 ( strncmp(line,"Via: ", 5) == 0 )) `7B X/* X * now output the headers we want to keep `20 X */ X`09 fputs("#! rnews ???\n",bfd); /* output batch separator */ X`09 fputs("Path: ",bfd); fputs(argv`5B3`5D,bfd); fputs("\n",bfd); X`09 fputs("Newsgroups: ",bfd); fputs(argv`5B4`5D,bfd); fputs("\n",bfd); X/* X * go through the rest of the header of the message X * drop any Path headers, received headers, and such that will X * confuse NEWS. Any others just copy into the output file. X */ X`09 while (get_head(line)) `7B /* look for first null line */ X`09`09if (strncmp(line,"Return-path: ",13) == 0 )continue; X`09`09if (strncmp(line,"Return-Path: ",13) == 0 )continue; X`09`09if (strncmp(line,"Errors-To: ", 11) == 0 )continue; X`09`09if (strncmp(line,"Newsgroups: ", 12) == 0 )continue; X`09`09if (strncmp(line,"Received: ", 10) == 0 )continue; X`09`09if (strncmp(line,"X-To: ", 6) == 0 )continue; X`09`09if (strncmp(line,"X-Listname: ", 12) == 0 )continue; X`09`09if (strncmp(line,"Path: ", 6) == 0 )continue; X`09`09if (strncmp(line,"Via: ", 5) == 0 )continue; X`09`09if (strncmp(line,"To: ", 4) == 0 )continue; X`09`09fputs(line,bfd); X`09 `7D X`09 fputs("\n",bfd); /* mark end of headers */ X `7D X/* X * if we get here, the headers are done, so copy each line of the text X */ X`09else `7B X/* X * Check each line, and if it looks like and NEWS Batch file separator, X * put a > in front of is, so NEWS won't get confused. X */ X`09 if (!strncmp(line,"#! rnews ",9)) X`09`09fputs(">",bfd); X`09 fputs(line,bfd); X`09`7D X `7D X while (get_line(line)) `7B /* look for first null line */ X fputs(line,bfd); X `7D X`7D X/* X * get_line: get one line of text from the input file, exit on EOF. X * If the line consists of just a form feed, concatenate the X * next line on the end. Makes looking for \f\nFrom:\t that X * separates mail messages easier to find. X */ Xget_line( char *line ) `7B X int status; X extern char *mygets(); X/* X * read the next line from the file X */ X if ( !mygets(line,1024,mfd) ) `7B X`09fclose(bfd); X`09exit(SS$_NORMAL); X `7D X/* X * if this line is just a FORMFEED, Combine it with the next line X */ X if ( line`5B0`5D == '\f' && line`5B1`5D == '\n' ) `7B X`09if ( !mygets(line+2,1022,mfd) ) `7B /* get the next line */ X`09 fclose(bfd); /* trailing formfeeds ignored */ X`09 exit(SS$_NORMAL); X`09`7D X `7D X return 1; X`7D X/* X * get_head: routine to get a single header line from the input file. X * RFC822 standard continuation lines are concatenated together X * to make processing easier. I assume that no header line wil Vl X * be longer than 1024 characters. X */ Xget_head( char *line ) `7B X int ch; X extern char *mygets(); X/* X * read the header line X */ X if ( !mygets(line,1024,mfd) ) `7B X`09fclose(bfd); /* close off the output file */ X`09exit(SS$_ENDOFFILE); /* error in header, exit */ X `7D X/* X * if this line is just a newline, then we have reached the end of the X * headers. X */ X if ( *line == '\n' ) return 0; X/* X * if the next line begins with a blank, then it is a continuation X * of this line. Append it to the end of the current line. X */ X while ( ungetc(getc(mfd),mfd) == ' ' ) X`09if ( !mygets(line+strlen(line),1024-strlen(line),mfd) ) `7B X`09 fclose(bfd); X`09 exit(SS$_ENDOFFILE); X`09`7D X return 1; X`7D X/* X * You may have been wondering why I used mygets rather than the standard X * C library routine gets. I started out that way, but there seems to be X * a problem in the C library when using ungetc, getc, and gets together X * on the same file. It was easier to just write my own than try to find X * out what the problem was with DEC's routine. X */ Xchar *mygets( char *line, int max, FILE *fd ) `7B X int i,ch; X/* X * read up to max characters from the input file X */ X for ( i=0; i. X * Permission is granted to anyone to make or distribute copie Vs X * of this program, provided that this copyright notice is X * preserved. X * X * Modified to Support MX and ANUNEWS by M. Edward (Ted) Nieland X * March 1990 Will support TCP/IP, UUCP, and BITNET through MX. X */ X#include X#include X XFILE *mfd = 0;`09/* MAIL file */ XFILE *mafd = 0;`09/* MAIL address file */ XFILE *bfd;`09/* NEWS Batch file */ X Xmain(int argc, char **argv) `7B X char line`5B1024`5D; X int i; X char sendcmd`5B1024`5D; X int control; X extern char *mygets(); X/* X * make sure user gave us the file name and the mailing address. X */ X if (argc < 3) `7B X`09printf("Usage: gtnews
\n"); X`09exit(SS$_NORMAL); X `7D X if (argc < 4) X`09exit(SS$_INSFARG); X/* X * now open the input file X */ X if ( !(bfd=fopen(argv`5B1`5D,"r")) ) `7B X`09perror("can't open input file:"); X`09exit(SS$_ABORT); X `7D X/* X * now fix up the command to send the mail X */ X strcpy(sendcmd,"MX_ENTER TEMPMAIL.TMP TEMPADD.TMP "); X strcat(sendcmd,argv`5B3`5D); X/* X * we don't want to send control messages to the mailing list, so set up X * a flag that says the current message is a control message. If we find X * a Control: line in the message this will be 1, otherwise 0 X */ X control = 0; /* not a control message for now */ X/* X * now copy selected parts of the input to the output file X */ X while ( mygets(line,1024,bfd) ) `7B X/* X * check to see if this is the start of a new mail message X * and if it is, process it. X */ X`09if ( !strncmp(line,"#! rnews ",9) `7C`7C !mfd ) `7B X/* X * first we need to close any previous file and send it to the mailing li Vst X */ X`09 if ( mfd && !control ) `7B X`09`09fclose(mfd); X`09`09mfd = 0; X`09`09system(sendcmd); X`09 `7D X`09 else if ( mfd ) `7B X`09`09fclose(mfd); X`09`09mfd = 0; X`09`09delete("TEMPMAIL.TMP;"); X`09 `7D X/* X * now open a new output temp file to hold the mail message X */ X`09 if ( !(mfd=fopen("TEMPMAIL.TMP","w")) ) `7B X`09`09perror("can't open scratch file:"); X`09`09exit(SS$_ABORT); X`09 `7D X/* X * now open a new output temp file to hold the mail address X */ X`09 if ( !(mafd=fopen("TEMPADD.TMP","w")) ) `7B X`09`09perror("can't open scratch file:"); X`09`09exit(SS$_ABORT); X`09 `7D X fputs(argv`5B2`5D,mafd); X fputs("\n",mafd); X/* X * skip over unwanted headers and output the ones we want to keep X */ X`09 fputs("To: ",mfd); fputs(argv`5B2`5D,mfd); fputs("\n",mfd); X`09 control=0; /* assume it's no control msg */ X`09 while (get_head(line)) `7B /* look for first null line */ X`09`09if (!strncmp(line,"From: ", 6))fputs(line,mfd); X`09`09if (!strncmp(line,"Date: ", 6))fputs(line,mfd); X`09`09if (!strncmp(line,"Sender: ", 8))fputs(line,mfd); X`09`09if (!strncmp(line,"Subject: ", 9))fputs(line,mfd); X`09`09if (!strncmp(line,"Reply-to: ", 10))fputs(line,mfd); X`09`09if (!strncmp(line,"Message-ID: ", 12))fputs(line,mfd); X`09`09if (!strncmp(line,"Organization: ",14))fputs(line,mfd); X`09`09if (!strncmp(line,"Control: ", 9))control=1; X`09 `7D X`09 fputs("\n",mfd); /* mark the end of the headers */ X`09`7D X`09else X/* X * if we get here, the headers for this message have been processed, X * so output the line of text. X */ X`09 fputs(line,mfd); X `7D X/* X * found the end of the input file, so send off the last message, if we X * haven't already. X */ X if ( mfd && !control ) `7B X`09fclose(mfd); X`09fclose(mafd); X`09system(sendcmd); X delete("TEMPMAIL.TMP;"); X delete("TEMPADD.TMP;"); X `7D X else if ( mfd ) `7B X`09fclose(mfd); X`09if ( mafd ) `7B X`09 fclose(mafd); X`09 delete("TEMPMAIL.TMP;"); X`09`7D X`09delete("TEMPADD.TMP;"); X `7D X`7D X/* X * get_head: get one header line from the input file. Continuation lines X * are concatenated into one long line. It is assumed that no header lin Ve X * is longer than 1024 characters. X */ Xget_head( char *line ) `7B X int ch; X char cline`5B1024`5D; X extern char *mygets(); X/* X * get the next header line from the input file. X */ X if ( !mygets(line,1024,bfd) ) `7B X`09fclose(mfd); X`09exit(SS$_ENDOFFILE); /* shouldn't get EOF here */ X `7D X/* X * if this line is null, it marks the end of the headers. X */ X if ( *line == '\n' ) return 0; /* return false if no more headers */ X/* X * make sure the header lines aren't longer than 80 characters. X * fold and continue them if needed. X */ X fold_header(line); X/* X * if the next input line starts with a blank, it is a continuation of th Vis X * line, so concatenate it onto the end of this line. X */ X while ( ungetc(ch=fgetc(bfd),bfd) == ' ' ) `7B X`09if ( !mygets(cline,1024-strlen(line),bfd) ) `7B X`09 fclose(mfd); X`09 exit(SS$_ENDOFFILE); /* this shouldn't happen */ X`09`7D X`09fold_header(cline); X`09strcat(line,cline); X `7D X return 1; X`7D X/* X * fold_header: folds headers so that they don't exceed the 80 column lim Vit X * on BITNET mail messages. X */ Xfold_header( char *line ) `7B X char cline`5B1024`5D; X char ch; X char *cp; X X cline`5B0`5D = '\0'; X while ( strlen(line) > 80 ) `7B X`09ch = line`5B80`5D;`09`09`09 /* save the 80th character */ X`09line`5B80`5D = '\0'; /* truncate line at col 80 */ X`09cp = strrchr( line, ' ' ); /* find the rightmost blank */ X`09line`5B80`5D = ch; /* in the first 80 characters * V/ X`09if ( cp == NULL ) `7B /* if there is no delimiter */ X`09 strcpy( &line`5B81`5D,&line`5B80`5D ); /* make room for a blank */ X`09 line`5B80`5D = ' '; /* and put one in */ X`09 cp = &line`5B80`5D;`09`09 /* set pointer to the blank */ X`09`7D X`09*cp = '\0'; /* end the line at the blank */ X`09strcat(cline,line); /* build the new line */ X`09strcat(cline,"\n "); /* and continue it later */ X`09strcpy(line,cp+1); /* now move rest of line over */ X `7D X strcat(cline,line); strcpy(line,cline); /* now put the line back */ X`7D X/* X * You may have been wondering why I used mygets rather than the standard X * C library routine gets. I started out that way, but there seems to be X * a problem in the C library when using ungetc, getc, and gets together X * on the same file. It was easier to just write my own than try to find X * out what the problem was with DEC's routine. X */ Xchar *mygets( char *line, int max, FILE *fd ) `7B X int i,ch; X/* X * read up to max characters from the input file X */ X for ( i=0; i" X XNotice that the logical name I am defining matches the subdirectory created Xunder news_manager minus the "gate_" portion. THIS IS IMPORTANT! X X`09NEWS_MANAGER_DEV:`5BGATE_info-multinet`5D X X`094) Compile and link the gatenews program and then copy the executable Xto the MX_EXE directory. X X$ cc gatenews X$ link gatenews X$ copy gatenews.exe mx_exe: X XThat should be all you need to do to gateway articles posted in the newsgrou Vp Xto the mailing list. X X`09Operation of newsgroup to mailing-list gateway. News articles that Xcome in from other sites are put into the gateway subdirectory. The newsski Vm Xprocedure collects these articles and sends them onto to the mailing-list Xmaintainer via the MX mail handler. X`0C X`09`09`09Gatewaying a Mailing List to a Newsgroup X`09`09`09---------------------------------------- X X`09To create a gateway that will pass articles posted to a mailing list on Xto a newsgroup, the following steps are taken: X X`091) In this example I am setting up a gateway between the mailing list Xinfo-multinet and the newsgroup vmsnet.networks.tcp-ip.multinet. Define an Xaddress that will be on the mailing list and will accept the mail bound for V the Xnewsgroup. X X$ MCP :== $MX_EXE:MCP X$ MCP XMCP> define alias "info-multinet-gate" "list@info-multinet-gate.site" XMCP> save X%MCP-I-WROTECFG, wrote configuration to file MX_ROOT:`5B000000`5DMX_CONFIG.M VXCFG;3 XMCP> exit X X`092) Using MCP, make sure that a path is defined for the SITE delivery Xagent. We use the "/route" qualifier to tell the site_delivery agent what Xnewsgroup to post this article to. X X$ MCP :== $MX_EXE:MCP X$ MCP XMCP> define path "info-multinet-gate.site" site/route="info-multinet-gate" XMCP> save X%MCP-I-WROTECFG, wrote configuration to file MX_ROOT:`5B000000`5DMX_CONFIG.M VXCFG;2 XMCP> exit X X`09Steps 1 and 2 above do the following. Step 1 says rewrite the address X"info-multinet-gate" so that it contains the ".site" piece. Step 2 then cau Vses Xthe router to send the message to the site_deliver.com where it is then post Ved Xto the correct newsgroup. X X`093) Make sure you have installed the SITE support under MX. If you have Xnot, you can add that in now using vmsinstal. X X`094) After those changed have been made, use MCP to reset the Xrunning processes. X X$ MCP :== $MX_EXE:MCP X$ MCP RESET/ALL X X`095) Edit the file site_deliver.com and then copy to the MX_EXE directory. XThe following lines are specific changes for the info-multinet gateway. The Xsite address string to look for has been previously defined as the "/route=" Xportion of the MCP define path command in step 2 above. The list_addr is wh Vat Xwill be placed on the "Path:" line of the news article. The newsgroup is th Ve Xname of the newsgroup to post the item. X X X$ site_addr1 = "INFO-MULTINET-GATE" ! <=== From the define path /route above X$ list_addr1 = "info-multinet-gate!list" ! <=== Put on the "Path:" line X$ newsgroup1 = "vmsnet.networks.tcp-ip.multinet" ! <=== What newsgroup`20 X$ gateway_num = 1`09! <=== Change when adding or deleting a gateway X X XMake sure that the list_addr matches the site added to the news.sys file abo Vve. X X$ list_addr1 = "info-multinet-gate!list" X `5E`5E`5E`5E`5E`5E`5E`5E`5E`5E`5E`5E`5E`5E`5E`5E`5E`5E X Xinfo-multinet-gate:\ X`5E`5E`5E`5E`5E`5E`5E`5E`5E`5E`5E`5E`5E`5E`5E`5E`5E`5E X XIMPORTANT! IF THE SITE NAME IN THE NEWS.SYS DOES NOT MATCH THE SITE USED FO VR XTHE GATEMAIL PROGRAM, THE MESSAGES POSTED TO THE MAILING LIST WILL GO THROUG VH XTHIS PROCEDURE AND BE LOOPED BACK TO THE MAILING LIST!!! X X`096) Compile and link the gatemail program and then copy to the MX_EXE Xdirectory. X X$ cc gatemail X$ link gatemail X$ copy gatemail.exe mx_exe: X X`097) You need to add a line in the NEWS_MANAGER:NEWSSKIM.COM file to Xadd the news batches automatically. The following is added to the message Xprocessing section of the NEWSSKIM command procedure. X X`09`09add file/delete news_manager:newsgate*.batch X X`098) Now the last step is to get the gateway address X"info-multinet-gate@dayton.saic.com" subscribed to the mailing list either b Vy Xcontacting the mailing list maintainer directly or using the MLFAKE utility Xprovided in MX. X X`09Operation of mailing-list to newsgroup gateway. Messages come in to Xthe router addressed to the user "info-multinet-gate@dayton.saic.com". MX Xparses this address and finds there is an alias defined for it and rewrites Xthe address as "info-multinet-gate@dayton.saic.com.site". The router then s Vees Xthat the address ends in ".SITE" and passes it along to the SITE agent. The Xsite agent runs the MX_EXE:SITE_DELIVER.COM. The message is then moved to t Vhe XNEWS_MANAGER directory awaiting the newsskim job to add it to the newsgroup. $ CALL UNPACK INSTRUCTIONS.TXT;14 1159135319 $ create 'f' X$! X$! This is a fragment of NEWSSKIM.COM to show how to set up the`20 X$! news to MAIL List interface. X$! X$ !********************************************************************** X$ !`09Copy news items to other sites X$ ! X$ ! Search for all directories of the form news_manager:gate_.dir X$ ! Process the files using the GATENEWS program for MX. X$ ! X$ ! X$ Gate: X$ set verify X$ gatenews :== $mx_exe:gatenews.exe X$ mx_enter :== $mx_exe:mx_site_in.exe X$ write sys$output "Gateway NEWS to mailing lists" X$ set on X$`09define wpafb-net "" X$`09define wpafb-admin ""`20 X$`09define wpafb-dec ""`20 X$`09define wpafb-mail ""`20 X$ gsearch_1: X$ gatedir = f$search("news_manager:gate_*.dir",2) X$ write sys$output gatedir X$ if gatedir .eqs. "" then goto abort X$ list = f$parse(gatedir,,,"NAME","SYNTAX_ONLY") - "GATE_" X$ write sys$output list X$ senddir = "news_manager_dev:`5Bgate_" + list + "`5D;" X$ savedfiles = senddir - ";" + "*.*;*" X$ write sys$output savedfiles X$ gsearch_2: X$ file = f$search(savedfiles,4) X$ write sys$output file X$ if file .eqs. "" then goto gsearch_1 X$ on error then goto gno_copy_2 X$ write sys$output "Gating list ''list'" X$ list_add = f$trnlog("''list'") X$ gatenews 'file 'list_add 'list_add X$ delete 'file X$ gno_copy_2: X$ goto gsearch_2 X$! X$ abort: $ CALL UNPACK NEWSSKIM-FRAG.COM;11 973081938 $ create 'f' X$! Simple SITE_DELIVER.COM which invokes a real program to do all the work. X$! This file must be placed in MX_EXE: for use with the MX SITE interface. X$! It is invoked by MX_SITE with: X$! X$! @MX_EXE:SITE_DELIVER route msg-file-spec dest-file-spec origin-address X$! X$! The originator address is stuck in a file since it can contain X$! characters that might confuse DCL when we invoke the delivery program. X$! X$! Site Delivery command procedure for MX to do NEWS/Mailing List Gateway X$! The code here will process an incoming mail message to change it to`20 X$! NEWS Format. X$! X$! X$! P1 is the route specified on the path statement X$! P2 is the name of the file containing the mail message with the headers X$! P3 is the name of the file containing the mail addresses X$! P4 is the PFC822 address of the originator of the message. X$! X$ set noon X$! X$ site_addr1 = "SAIC-DAY-CBD" X$ list_addr1 = "saic-day-cbd-gate" X$ newsgroup1 = "saic.day.cbd" X$! X$ gateway_num = 1`09! <=== Change when adding or deleting a gateway X$! X$ gatemail :== $ mx_exe:gatemail.exe X$ timestamp = f$cvtime(f$time()) - "-" - "-" - " " - ":" - ":" - "." - " " X$ timestamp = f$extract(2,14,timestamp) X$ address1 = p1 X$ eol = f$length(address1) X$ address1 = f$edit(address1, "upcase") X$ i = 1 X$! X$ 10: X$ site_addr = f$edit(site_addr'i', "upcase") X$ if f$locate("''site_addr'",address1) .nes. eol then goto proc_list X$ i = i + 1 X$ if i .le. gateway_num then goto 10 X$! X$! Notify Postmaster X$! X$ mail 'p2 mx%postmaster/subject="Strange Message given to MX SITE" X$ goto delete_em X$! X$! X$!Process Message for Mailing-List X$! X$ proc_list: X$ list_addr = list_addr'i' X$ newsgroup = newsgroup'i' X$ on error then goto Gate_err X$ gatemail 'p2 news_manager:newsgate_'timestamp'.batch "''list_addr'" "''new Vsgroup'" X$ goto delete_em X$! X$!Gateway Error Handling X$! X$ Gate_err: X$ set noon X$ mail 'p2 mx%postmaster/subject="Error handling message for Gateway" X$! X$ Delete_em: X$ delete/noconfirm 'p2 X$ delete/noconfirm 'p3 X$ exit $ CALL UNPACK SITE_DELIVER.COM;29 1849062998 $ v=f$verify(v) $ EXIT -------------------------------------------------------------------------------- Return-Path: Received: from ECS02 (ECS02::MAILER) by MDMVS (MX V3.0A) with SMTP (DECnet); Sun, 19 Jan 1992 21:36:28 EST Received: from DAYVB.DAYTON.SAIC.COM by vms.ecs.rpi.edu (MX V3.0A) with SMTP; Sun, 19 Jan 1992 21:37:35 EST Received: by Dayton.SAIC.COM (MX V3.0A) id 20438; Sun, 19 Jan 1992 21:34:01 EST