From:	SMTP%"bailey@HMIVAX.HUMGEN.UPENN.EDU" 20-SEP-1993 12:51:14.59
To:	EVERHART
CC:	
Subj:	Patch: Add File/NoJunk doesn't feed rejects

Message-Id: <9309182307.AA23774@uu7.psi.com>
Date:         Fri, 17 Sep 1993 16:30:38 GMT
Reply-To: Charles Bailey <bailey@HMIVAX.HUMGEN.UPENN.EDU>
Sender: ANU-NEWS Discussion <ANU-NEWS@VM1.NoDak.EDU>
Comments:     Warning -- original Sender: tag was news@NETNEWS.UPENN.EDU
From: Charles Bailey <bailey@HMIVAX.HUMGEN.UPENN.EDU>
Organization: HHMI/Human Genetics, Univ of Pa.
Subject:      Patch: Add File/NoJunk doesn't feed rejects
To: Multiple recipients of list ANU-NEWS <ANU-NEWS@VM1.NoDak.EDU>

At present, when executing an Add File command, an item which is rejected by
the local News.Sys filter or newsgroup list will be junked and fed to
downstream sites, unless the /NoJunk qualifier to Add File is used, in which
case NEITHER of these actions will be taken.  I believe this is a bug; News
should feed a well formed item to downstream sites regardless of the local
action.  Appended to this post is a patch designed to do just this.  On the off
chance that the current behavior might be useful in some circumstances (e.g.
you know that downstream sites in a local heirarchy get the same distributions
as you, so you don't want to feed them rejects from the local batches, but you
do want to feed rejects from your regular nntp feed), I've placed the revised
action under control of a new qualifier to Add File.  Here's the News.Hlp
entry:

/FEEDTHROUGH
 /FEEDTHROUGH
 /NOFEEDTHROUGH  [default]

 When the /NOJUNK qualifier is specified and an item is rejected on
 the local system because of the News.Sys filter or because no match
 to a local newsgroup is found,the default behavior is not to feed
 that item to downstream sites. Specifying the /FEEDTHROUGH qualifier
 causes items rejected for these reasons to be fed to downstream sites
 anyway.  Items rejected due to syntax errors will not be fed.

 This qualifier has no effect in the absence of /NOJUNK.

Unless people feel it's useful to retain this, I'd recommend just changing the
default behavior and getting rid of the qualifier for the next release of News.
Sorry if I'm complicating the issue here by trying to be particularly careful.

                    Regards,
                    Charles Bailey

!-------------------------------------------------------------------------------
!             Dept. of Genetics / Howard Hughes Medical Institute
! University of Pennsylvania School of Medicine  Rm. 430 Clinical Research Bldg.
!     422 Curie Blvd.  Philadelphia, PA 19104 USA      Tel. (215) 898-1699
!          Internet: bailey@genetics.upenn.edu  (IN 128.91.200.37)
!-------------------------------------------------------------------------------
$! ------------------ CUT HERE -----------------------
$ v='f$verify(f$trnlnm("SHARE_UNPACK_VERIFY"))'
$!
$! This archive created:
$!  Name : 930917_NEWSADD.PATCH
$!  By   : bailey@hmivax.humgen.upenn.edu
$!  Date : 17-SEP-1993 12:22:09.91
$!  Using: VMS_SHARE 8.4, (C) 1993 Andy Harper, Kings College London UK
$!
$! Credit is due to these people for their original ideas:
$!    James Gray, Michael Bednarek
$!
$! 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. 930917_NEWSADD.PATCH;2
$!
$ set="set"
$ set symbol/scope=(nolocal,noglobal)
$ f=f$parse("SHARE_UNPACK_TEMP","SYS$SCRATCH:."+f$getjpi("","PID"))
$ e="write sys$error  ""%UNPACK"", "
$ w="write sys$output ""%UNPACK"", "
$ if .not. f$trnlnm("SHARE_UNPACK_LOG") then $ w = "!"
$ if f$getsyi("CPU") .gt. 127 then $ goto start
$ 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, P3=attributes,P4=size
$ 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:
$ x=f$search(P1)
$ if x .eqs. "" then $ goto file_absent
$ e "-W-EXISTS, File ''P1' exists. Skipped"
$ delete 'f'*
$ exit
$file_absent:
$ w "-I-UNPACK, Unpacking ", P5, " of ", P6, " - ", P1, " - ", P4, " Blocks"
$ n=P1
$ if P3 .nes. "" then $ n=f
$ if .not. f$verify() then $ define/user sys$output nl:
$ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT/NOJOURNAL 'f'/OUT='n'
PROCEDURE GetHex(s,p)LOCAL x1,x2;x1:=INDEX(t,SUBSTR(s,p,1))-1;x2:=INDEX(t,
SUBSTR(s,p+1,1))-1;RETURN 16*x1+x2;ENDPROCEDURE;PROCEDURE SkipPartsep LOCAL m;
LOOP m:=MARK(NONE);EXITIF m=END_OF(b);DELETE(m);EXITIF INDEX(ERASE_LINE,
"-+-+-+-+-+-+-+-+")=1;ENDLOOP;ENDPROCEDURE;PROCEDURE ProcessLine LOCAL c,s,l,b,
n,p;c := ERASE_CHARACTER(1);s := ERASE_LINE;IF c = "X" THEN SPLIT_LINE; ENDIF;
MOVE_HORIZONTAL(-1);l := LENGTH(s);p := 1;LOOP EXITIF p > l;c := SUBSTR(s,p,1);
p := p+1;CASE c FROM ' ' TO '`' ['`']: COPY_TEXT(ASCII(GetHex(s,p))); p:=p+2;[
' ']: p:=p+1;[INRANGE,OUTRANGE]: COPY_TEXT(c);ENDCASE;ENDLOOP;ENDPROCEDURE;
PROCEDURE Decode LOCAL m;POSITION(BEGINNING_OF(b));LOOP m:=MARK(NONE);EXITIF m=
END_OF(b);DELETE(m);IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+-")=
1 THEN SkipPartSep;ELSE ProcessLine;MOVE_HORIZONTAL(1);ENDIF;ENDLOOP;
ENDPROCEDURE;SET(FACILITY_NAME,"UNPACK");SET(SUCCESS,OFF);SET(INFORMATIONAL,
OFF);t:="0123456789ABCDEF";f:=GET_INFO(COMMAND_LINE,"file_name");b:=
CREATE_BUFFER(f,f);Decode;WRITE_FILE(b,GET_INFO(COMMAND_LINE,"output_file"));
QUIT;
$ if p3 .eqs. "" then $ goto dl
$ open/write fdl &f
$ write fdl "RECORD"
$ write fdl P3
$ close fdl
$ w "-I-CONVRFM, Converting record format to ", P3
$ convert/fdl=&f &f-1 &P1
$dl: delete 'f'*
$ checksum 'P1'
$ if checksum$checksum .nes. P2 then $ -
  e "-E-CHKSMFAIL, Checksum of ''P1' failed."
$ exit
$ endsubroutine
$start:
$!
$ create 'f'
XANU`20News`20Patch
XPatch`20ID:`20930917_newsadd.c!bailey@genetics.upenn.edu
XDate:`2017-Sep-1993
XAuthor:`20Charles`20Bailey`20`20bailey@genetics.upenn.edu
XNews`20Version:`206.1beta8
XNews`20Files:`20NewsAdd.C,`20NewsCmd.Cld,`20News.Hlp
XDescription:`20Adds`20/FeedThrough`20qualifier`20to`20Add`20File`20command.`20
V`20If`20specified
Xalong`20with`20the`20/NoJunk`20qualifier,`20causes`20items`20which`20were`20re
Vjected`20by`20the`20local
XSYS`20filter`20to`20be`20fed`20to`20downstream`20sites`20anyhow.`20`20Has`20no
V`20effect`20in`20the`20absence
Xof`20the`20/NoJunk`20qualifier.
X***`20newsadd.c
X---`20newsadd_new.c
X**************
X***`20170,172
X`20`20**--
X`20`20**/
X`20`20`0C
X---`20170,174`20-----
X+`20**`09V6.1b8`09`2017-Sep-1993`09bailey@genetics.upenn.edu
X+`20**`09`20`20`20`20`20`20-`20add`20/FeedThrough`20qualifier`20to`20Add`20Fil
Ve
X`20`20**--
X`20`20**/
X`20`20`0C
X**************
X***`20274,279
X`20`20`20`20`20`20mod_add`20=`200,
X`20`20`20`20`20`20control_squelch`20=`200,
X`20`20`20`20`20`20genid`20=`200,
X`20`20`20`20`20`20temp_file_error`20=`200,
X`20`20`20`20`20`20loc_junk`20=`200;
X`20`20
X---`20276,282`20-----
X`20`20`20`20`20`20mod_add`20=`200,
X`20`20`20`20`20`20control_squelch`20=`200,
X`20`20`20`20`20`20genid`20=`200,
X+`20`20`20`20`20feed_through`20=`200,
X`20`20`20`20`20`20temp_file_error`20=`200,
X`20`20`20`20`20`20loc_junk`20=`200;
X`20`20
X**************
X***`20513,518
X`20`20`20`20if`20(!sys_local_accept(newsgroup,itm`5BDISTRIBUTION`5D)`20`26`26
V`20strcmp(newsgroup,junk))`20`7B
X`20`20`20`20`20`20if`20(!junk_it)`20`7B
X`20`20`20`20`20`20`20`20printf(":`20REJECT`20(SYS`20filter)`5Cn");
X`20`20`20`20`20`20`20`20return;
X`20`20`20`20`20`20`20`20`7D
X`20`20`20`20`20`20printf(":`20JUNK`20(SYS`20filter)");
X---`20516,526`20-----
X`20`20`20`20if`20(!sys_local_accept(newsgroup,itm`5BDISTRIBUTION`5D)`20`26`26
V`20strcmp(newsgroup,junk))`20`7B
X`20`20`20`20`20`20if`20(!junk_it)`20`7B
X`20`20`20`20`20`20`20`20printf(":`20REJECT`20(SYS`20filter)`5Cn");
X+`20`20`20`20`20`20`20if`20(feed_through)`20`7B
X+`20`20`20`20`20`20`20`20`20if`20(!fn)`20fn`20=`20create_article(NULL,NULL);
X+`20`20`20`20`20`20`20`20`20if`20(fn)`20sys_remote_send(itm`5BPATH`5D,itm`5BNE
VWSGROUPS`5D,itm`5BDISTRIBUTION`5D,
X+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20fn,itm`5BMESSAGE_ID`5D,!mod_add);
X+`20`20`20`20`20`20`20`20`20`7D
X`20`20`20`20`20`20`20`20return;
X`20`20`20`20`20`20`20`20`7D
X`20`20`20`20`20`20printf(":`20JUNK`20(SYS`20filter)");
X**************
X***`20522,527
X`20`20`20`20if`20((!*cre_grp)`20`26`26`20(strcmp(newsgroup,junk)))`20`7B
X`20`20`20`20`20`20if`20(!junk_it)`20`7B
X`20`20`20`20`20`20`20`20printf(":`20REJECT`20(No`20local`20Newsgroup`20match)
V`5Cn");
X`20`20`20`20`20`20`20`20return;
X`20`20`20`20`20`20`20`20`7D
X`20`20`20`20`20`20printf(":`20JUNK`20(No`20local`20Newsgroup`20match)");
X---`20530,540`20-----
X`20`20`20`20if`20((!*cre_grp)`20`26`26`20(strcmp(newsgroup,junk)))`20`7B
X`20`20`20`20`20`20if`20(!junk_it)`20`7B
X`20`20`20`20`20`20`20`20printf(":`20REJECT`20(No`20local`20Newsgroup`20match)
V`5Cn");
X+`20`20`20`20`20`20`20if`20(feed_through)`20`7B
X+`20`20`20`20`20`20`20`20`20if`20(!fn)`20fn`20=`20create_article(NULL,NULL);
X+`20`20`20`20`20`20`20`20`20if`20(fn)`20sys_remote_send(itm`5BPATH`5D,itm`5BNE
VWSGROUPS`5D,itm`5BDISTRIBUTION`5D,
X+`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20`20`20`20`20fn,itm`5BMESSAGE_ID`5D,!mod_add);
X+`20`20`20`20`20`20`20`20`20`7D
X`20`20`20`20`20`20`20`20return;
X`20`20`20`20`20`20`20`20`7D
X`20`20`20`20`20`20printf(":`20JUNK`20(No`20local`20Newsgroup`20match)");
X**************
X***`201779,1784
X`20`20`20`20del_after`20=`20(cli$present(c$dsc("DELETE"))`20`26`201);
X`20`20`20`20skip_loop_test`20=`20cli$present(c$dsc("RETRY"))`20`26`201;
X`20`20`20`20genid`20=`20cli$present(c$dsc("GENID"))`20`26`201;
X`20`20
X`20`20`20`20exec_opt`20=`200;
X`20`20`20`20exec_switch`20=`200;
X---`201792,1798`20-----
X`20`20`20`20del_after`20=`20(cli$present(c$dsc("DELETE"))`20`26`201);
X`20`20`20`20skip_loop_test`20=`20cli$present(c$dsc("RETRY"))`20`26`201;
X`20`20`20`20genid`20=`20cli$present(c$dsc("GENID"))`20`26`201;
X+`20`20`20feed_through`20=`20(cli$present(c$dsc("FEEDTHROUGH"))`20`26`201);
X`20`20
X`20`20`20`20exec_opt`20=`200;
X`20`20`20`20exec_switch`20=`200;
X**************
X***`201868,1873
X`20`20`20`20`20`20`20`20`7D
X`20`20`20`20`20`20else`20strcpy(force_newsgroup,force_news);
X`20`20`20`20`20`20lower_case(force_newsgroup);
X`20`20
X`20`20`20`20`20`20add_dsc.dsc$w_length`20=`20strlen(fnam);
X`20`20`20`20`20`20while`20((status`20=`20lib$find_file(`26add_dsc,`26rnam_dsc,
V`26context,0,0,0,0))`20`26`201)`20`7B
X---`201882,1889`20-----
X`20`20`20`20`20`20`20`20`7D
X`20`20`20`20`20`20else`20strcpy(force_newsgroup,force_news);
X`20`20`20`20`20`20lower_case(force_newsgroup);
X+`20
X+`20`20`20`20`20feed_through`20=`20(cli$present(c$dsc("FEEDTHROUGH"))`20`26`20
V1);
X`20`20
X`20`20`20`20`20`20add_dsc.dsc$w_length`20=`20strlen(fnam);
X`20`20`20`20`20`20while`20((status`20=`20lib$find_file(`26add_dsc,`26rnam_dsc,
V`26context,0,0,0,0))`20`26`201)`20`7B
X***`20newscmd.cld
X---`20newscmd_new.cld
X**************
X***`2036,38
X`20`20!
X`20`20!--
X`20`20
X---`2036,40`20-----
X+`20!`20`20`206.1b8`20`2017-Sep-1993`20`20Charles`20Bailey`20`20bailey@genetic
Vs.upenn.edu
X+`20!`20`20`20`20-`20added`20/FeedThrough`20qualifier`20to`20Add`20File
X`20`20!
X`20`20!--
X`20`20
X**************
X***`20246,251
X`20`20`20`20`20`20qualifier`20`20`20NETFEED`20`20`20`20`20placement=positional
V,negatable,default
X`20`20`20`20`20`20qualifier`20`20`20JUNK`20`20`20`20`20`20`20`20placement=posi
Vtional,negatable
X`20`20`20`20`20`20qualifier`20`20`20ACCEPT`20`20`20`20`20`20placement=position
Val,negatable
X`20`20`20`20`20`20qualifier`20`20`20NEWSGROUP`20`20`20placement=positional,val
Vue
X`20`20`20`20`20`20qualifier`20`20`20NOCONTROL`20`20`20nonnegatable
X`20`20`20`20`20`20qualifier`20`20`20GENID
X---`20248,254`20-----
X`20`20`20`20`20`20qualifier`20`20`20NETFEED`20`20`20`20`20placement=positional
V,negatable,default
X`20`20`20`20`20`20qualifier`20`20`20JUNK`20`20`20`20`20`20`20`20placement=posi
Vtional,negatable
X`20`20`20`20`20`20qualifier`20`20`20ACCEPT`20`20`20`20`20`20placement=position
Val,negatable
X+`20`20`20`20`20qualifier`20`20`20FEEDTHROUGH`20placement=positional,negatable
V
X`20`20`20`20`20`20qualifier`20`20`20NEWSGROUP`20`20`20placement=positional,val
Vue
X`20`20`20`20`20`20qualifier`20`20`20NOCONTROL`20`20`20nonnegatable
X`20`20`20`20`20`20qualifier`20`20`20GENID
X***`20news.hlp
X---`20news_new.hlp
X**************
X***`20541,546
X`20`20`20are`20immediately`20deleted.`20In`20all`20cases`20a`20log`20of`20the
V`20actions`20performed
X`20`20`20will`20be`20posted`20to`20address`20"USENET".
X`20`20
X`20`20/JUNK
X`20`20`20/JUNK`20`20`20`5Bdefault`5D
X`20`20`20/NOJUNK
X---`20541,561`20-----
X`20`20`20are`20immediately`20deleted.`20In`20all`20cases`20a`20log`20of`20the
V`20actions`20performed
X`20`20`20will`20be`20posted`20to`20address`20"USENET".
X`20`20
X+`20!`20Added`2017-Sep-1993`20by`20Charles`20Bailey`20`20bailey@genetics.upenn
V.edu
X+`20!`20Temporary`20(I`20hope)
X+`20/FEEDTHROUGH
X+`20`20/FEEDTHROUGH
X+`20`20/NOFEEDTHROUGH`20`20`20`5Bdefault`5D
X+`20
X+`20`20When`20the`20/NOJUNK`20qualifier`20is`20specified`20and`20an`20item`20i
Vs`20rejected`20on
X+`20`20the`20local`20system`20because`20of`20the`20News.Sys`20filter`20or`20be
Vcause`20no`20match
X+`20`20to`20a`20local`20newsgroup`20is`20found,the`20default`20behavior`20is
V`20not`20to`20feed
X+`20`20that`20item`20to`20downstream`20sites.`20Specifying`20the`20/FEEDTHROUG
VH`20qualifier
X+`20`20causes`20items`20rejected`20for`20these`20reasons`20to`20be`20fed`20to
V`20downstream`20sites
X+`20`20anyway.`20`20Items`20rejected`20due`20to`20syntax`20errors`20will`20not
V`20be`20fed.
X+`20
X+`20`20This`20qualifier`20has`20no`20effect`20in`20the`20absence`20of`20/NOJUN
VK.
X+`20
X`20`20/JUNK
X`20`20`20/JUNK`20`20`20`5Bdefault`5D
X`20`20`20/NOJUNK
X***`20patchlist.h;-1
X---`20patchlist.h
X**************
X***`201,1
X`20`20=+=+=`20End`20=+=+=
X---`201,2`20-----
X+`20930917_newsadd.c!bailey@genetics.upenn.edu
X`20`20=+=+=`20End`20=+=+=
$ call unpack 930917_NEWSADD.PATCH;2 -
 1095109656 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 11 1 1
$ v=f$verify(v)
$ exit
