#! /usr/bin/perl ## Usenet death penalty; Rich $alz , April 93. ## Original name and concept by Eliot Lear, years ago. ## ## Typical use is via this entry in newsfeeds file: ## udp:*:Tc,WO:.../udp [flags] 'rsalz@.*.uu.net' ## Flags are '-global' to post cancel messages (default just removes ## articles from your local spool) and '-debug' to send cancels to ## stdout. First (and only) arg is Perl regexp to match against From ## line; to kill multiple people use the | meta-char. ## Parse JCL. $local = 1; $production = 1; args: while ( $_ = $ARGV[0], /^-/ ) { shift; if ( $_ eq '-debug' ) { $production = 0; next args; } if ( $_ eq '-global' ) { $local = 0; next args; } die 'Bad flag\n'; } $who = shift || die 'Not enough args.\n'; shift && die 'Too many args.\n'; ## Set header values if we're going to be posting. if ( $local == 0 ) { $pathhost = `innconfval pathhost`; chop($pathhost); @pw = getpwuid($<); $canceller = $pathhost . '!' . $pw[0]; ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = gmtime; $year += 1900; $monthname = substr('JanFebMarAprMayJunJulAugSepOctNovDec', $mon * 3, 3); $date = "$mday $monthname $year $hour:$min:$sec GMT"; } ## Main loop; process each line. line: while ( ) { next line unless ( $paths, $subj, $from, $xdate, $msgid ) = split('\t', $_); next line unless $from =~ /$who/io; if ( $local ) { foreach ( split(' ', $paths) ) { unlink $_ || warn "Can't unlink $_ $!"; } } else { open(FH, '|rnews') && select FH if $production; $myid = $msgid; $myid =~ s/