Thread View: news.software.nn
5 messages
5 total messages
Started by Bruce Salem
Mon, 23 Jul 1990 21:51
Local parsing of junk into news groups.
Author: Bruce Salem
Date: Mon, 23 Jul 1990 21:51
Date: Mon, 23 Jul 1990 21:51
9 lines
989 bytes
989 bytes
I am using/administrating nn with nntp to a local machine. That machine does not recognize certian alt.* groups and so the messages all go into the junk newsgroup. Is there any way I can reconstruct the alt.* groups from the header info in the junk messages so that I can create them without having my server recognize them? Is there anyway I can post to these groups, then, even though my server doesn't recognize them? Bruce Salem
Re: Local parsing of junk into news groups.
Author: Jonathan Bayer
Date: Tue, 24 Jul 1990 11:31
Date: Tue, 24 Jul 1990 11:31
212 lines
7445 bytes
7445 bytes
salem@ace.sri.com (Bruce Salem) writes:
>I am using/administrating nn with nntp to a local machine. That
>machine does not recognize certian alt.* groups and so the messages
>all go into the junk newsgroup. Is there any way I can reconstruct
>the alt.* groups from the header info in the junk messages so that
>I can create them without having my server recognize them? Is there
>anyway I can post to these groups, then, even though my server
>doesn't recognize them?
I had the same type of problem, and it was solved by a posting to the net.
I have enclosed it below. Read the comments carefully as they are the only
documentation around. Run it once a day (or more often) from cron to solve
your problem.
#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:
# "End of shell archive."
# Contents: mvjunk
# Wrapped by root@ispi on Tue Jul 24 07:30:00 1990
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'mvjunk' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'mvjunk'\"
else
echo shar: Extracting \"'mvjunk'\" \(4680 characters\)
sed "s/^X//" >'mvjunk' <<'END_OF_FILE'
X#!/bin/sh
X# mvjunk.sh
X#
X# Move news files out of junk and into their proper directories,
X# updating the active list and localgroups as we go.
X# Unknown newsgroups found in junked articles are created by adding an
X# entry to the active file and creating the directory. A newgroups
X# article is also posted in case the group is required across the local net,
X# and to put the group creation into the news logs.
X#
X# TRW Advanced Technology Facility STA 2-Jun-1985
X#
X# Modified 10/22/85-James M. Scardelis, SA, Warner Computer Systems
X# to create newsgroups locally only.
X#
X# Modified April 1989 David Wright dww@stl.stc.co.uk
X# to fix bugs in group creation and make directories include parents
X#
X# This program is in the public domain - do with it whatever you like.
X#
X# Be CAREFUL with that active list! Although we try to write out
X# buffers as quickly as possible, conflicts can occur if someone else
X# tries to use it at the same time this script is running!
X#
X# Actions taken and strange occurences are recorded in mvjunk-log.
X
X# Set DISTRIB to cover your local net or organisation if you want any
X# new groups found to be created across your net. The default is local only
XDISTRIB=local
X
XJUNK=/usr/spool/news/junk
XSPOOL=/usr/spool/news
XLIB=/usr/lib/news # See line 121
X
Xumask 22
X
Xchmod u+wr $LIB/active
X
Xcd $JUNK
X
Xif /bin/test -z "`ls`" ; then exit
Xfi
X
Xchmod u+wr *
X
Xfor j in $JUNK/*
Xdo
X for group in `egrep '^Newsgroups:' $j | head -1 | \
X sed 's;Newsgroups:[ ];;' | \
X sed 's;,; ;g'`
X do
X echo "Found article $j for group $group"
X echo "Found article $j for group $group" >> $LIB/mvjunk-log
X l=`egrep '^Control:' $j`
X if /bin/test -n "$l" ; then
X GROUPDIR="control"
X group="control"
X else
X GROUPDIR=`echo $group | sed 's;\.;\/;g'`
X fi
X#
X cd $SPOOL
X if /bin/test -d $GROUPDIR ; then
X # Directory exists - work out number of the next article
X cd $GROUPDIR
X l=`ls`
X if /bin/test -n "$l" ; then
X a=`ls | sort -r -n`
X for f in $a
X do
X if /bin/test -f "$f" ; then
X article=`echo $f "+1" | bc`
X break
X fi
X done
X else
X article=1
X fi
X else
X # No directory for this group - create one, and set art.no = 1
X # Create parent directories too if they don't exist already
X dir=$SPOOL
X for subdir in `echo $group | sed 's;\.; ;g'`
X do
X dir=${dir}/${subdir}
X if /bin/test ! -d "$dir" ; then
X echo "Creating directory $dir"
X echo "Creating directory $dir">>$LIB/mvjunk-log
X mkdir $dir
X fi
X done
X article=1
X fi
X
X # Now we know where to put it, put it there,
X # and update active file too
X cd $SPOOL/$GROUPDIR
X if /bin/test ! -d "$article" ; then
X
X cp $j $SPOOL/$GROUPDIR/$article
X
X chmod ugo+wr $SPOOL/$GROUPDIR/$article
X chown news $SPOOL/$GROUPDIR/$article
X chgrp news $SPOOL/$GROUPDIR/$article
X the_date=`date`
X entry=`egrep "^$group " $LIB/active`
X if /bin/test -z "$entry" ; then
X echo \
X "Created $the_date to hold articles found in junk"|\
X $LIB/inews -d $DISTRIB -C $group
X echo "Created group $group at $the_date" \
X >> $LIB/mvjunk-log
X entry="$group 00001 00001 y"
X echo $entry >> $LIB/active
X echo \
X "$group found in junk; created at $the_date" \
X >> $LIB/localgroups
X fi
X entry="^$entry "
X#
X# There should be a way of passing shell variables into awk, but since
X# we don't know how to do that we just hardwire it. Kludgy... no?
X#
X echo $article $entry $the_date | \
X awk 'BEGIN { FS = " " } \
X { if ( NF != 11 ) printf "Munged active entry: %s\n",\
X $0 >"/usr/lib/news/mvjunk-log" ; \
X if ( length($1) > 5 ) printf "Field too large: %s\n",\
X $0 >"/usr/lib/news/mvjunk-log" ; \
X if ( length($3) > 5 ) printf "Field too large: %s\n",\
X $0 >"/usr/lib/news/mvjunk-log" ; \
X if ( length($4) > 5 ) printf "Field too large: %s\n",\
X $0 >"/usr/lib/news/mvjunk-log" ; \
X printf "/%s/s;%s;",$2,$3 ; \
X for ( i = 5 - length($1) ; i > 0 ; i-- ) printf "0" ; \
X print $1 ";" ; \
X if ( length($4) < 5 ) { \
X printf "s;%s;",$4 ; \
X for ( i = 5 - length($1) ; i > 0 ; i-- ) printf "0" ; \
X print $4 ";" \
X } \
X if ( $5 != "y" && $5 != "n" ) print "s;.$;y;" } \
X END { printf "w\nq\n" }' | ed - $LIB/active
X else
X echo \
X "Hey, there's a directory called $SPOOL/$GROUPDIR/$article!"
X echo \
X "Hey, there's a directory called $SPOOL/$GROUPDIR/$article!"\
X >> $LIB/mvjunk-log
X fi
X done
X if /bin/test -f $SPOOL/$GROUPDIR/$article ; then
X /bin/rm -f $j # But my MOTHER lives in Hackensack!
X else
X echo "Couldn't find the article I just installed!"
X echo "Couldn't find the article I just installed!" >> \
X $LIB/mvjunk-log
X fi
Xdone
X
X
X
END_OF_FILE
if test 4680 -ne `wc -c <'mvjunk'`; then
echo shar: \"'mvjunk'\" unpacked with wrong size!
fi
chmod +x 'mvjunk'
# end of 'mvjunk'
fi
echo shar: End of shell archive.
exit 0
JB
--
Jonathan Bayer Intelligent Software Products, Inc.
(201) 245-5922 500 Oakwood Ave.
jbayer@ispi.COM Roselle Park, NJ 07204
Re^2: Local parsing of junk into news groups.
Author: Bruce B. Salem
Date: Wed, 25 Jul 1990 00:46
Date: Wed, 25 Jul 1990 00:46
22 lines
1728 bytes
1728 bytes
I posting from a different machine than I originally posed the question, and although the sh file that has been posted is interesting, it doesn't adress my need, as best as I can tell. Maybe my original post wasn't clear, but I am running nn on machines that are NNTP clients, only. They do not own /usr/spool/news. I have an account on the machine that is the server and I could run the script there, but what I really want to do is to somehow have nntp or nn do the work. The original question was: How can I scan the junk newsgroup and somehow deposit its contents into groups that are indicated in the header but don't exist on the server? There is a macro facility in nn. Can it filter the junk newsgroup for a certian group, say, alt.security, and present those messages as if there were an alt.security newsgroup? Could I reply to messages so that my reply would get posted toalt.security on machines that carry that group? My intuition says No, once the message gets put in junk, it stays there. Bruce Salem
Re: Local parsing of junk into news groups.
Author: Kim F. Storm
Date: Thu, 26 Jul 1990 16:54
Date: Thu, 26 Jul 1990 16:54
37 lines
2257 bytes
2257 bytes
salem@fritz.sri.com (Bruce B. Salem) writes: >How can I scan the junk newsgroup and somehow deposit its contents into >groups that are indicated in the header but don't exist on the server? >I am running nn on machines that are NNTP clients, only. There is no way you can make nn deposit articles from the junk group into the proper groups - no way at all! >I have an account on the machine that is the server and I could >run the script there, but what I really want to do is to somehow >have nntp or nn do the work. Why? Doing it on the server is the *proper* thing to do. The reason articles are dropped in junk is that there is some inconsistency in your server, so the answer is to fix that. This is *much* easier than anything I can possibly implement in nn! >Could I reply to messages so that my reply would get posted to >alt.security on machines that carry >that group? My intuition says No, once the message gets put in >junk, it stays there. I don't know, but my intuition says Yes. There is nothing which should prevent a junked article from being forwarded to downsteam sites, since the forwarding is based on the Newsgroups: line and the sys file, not the group which it is stored in locally (although that is where it is taken from when it is batched). Anybody know for sure? ++Kim PS: What about upgrading your nn 6.3.~1 to the new 6.4 release? The Re^2 prefix on the subject line in your followup is an RFC violation fixed in later versions (I think it was in 6.3.4). -- Kim F. Storm <storm@texas.dk> No news is good news, Texas Instruments A/S, Denmark but nn is better!
Re: Local parsing of junk into news groups.
Author: Edward Vielmetti
Date: Thu, 26 Jul 1990 20:09
Date: Thu, 26 Jul 1990 20:09
25 lines
2127 bytes
2127 bytes
Kim, regarding stuff that's in junk, I think it's useful to consider the case where you want to go through a newsgroup (or a bunch of related newsgroups) and pick out articles which meet a certain set of criteria, and then present them all in one 'virtual newsgroup'. The example of parsing out stuff from junk is only one. Say for instance there's a high volume newsgroup like "comp.sys.sun" that has some embedded structure in the Keywords: field. It'd be mighty nice to be able to construct a "comp.sys.sun.hardware" group that met the criteria "newsgroups includes comp.sys.sun and keywords includes hardware" that had the look and feel of an ordinary group. (Deciding where to direct followups might be the only hard part.) I think that it would be possible to do this at the news transport level; it's a matter of making the proper links, updating the Xref: header, and updating the history and active files properly. But that requires the active cooperation of the news admin; since these virtual groups could be somewhat idiosyncratic, it'd be nice to be able to construct them relatively ad hoc on a per-person basis. --Ed Edward Vielmetti, U of Michigan math dept <emv@math.lsa.umich.edu> comp.archives moderator
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads