🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
11 messages
11 total messages Started by Avon Kerr Sun, 30 Aug 2015 02:07
unwanted.log
#86930
Author: Avon Kerr
Date: Sun, 30 Aug 2015 02:07
6 lines
1234 bytes
Is there a way to easily take the contents (or some of the contents) of 
this log file and run a process to add them to active? Something along the 
lines as actsync does when creating newsgroups and by calling ctlinnd ?


Re: unwanted.log
#86923
Author: Julien ÉLIE
Date: Sun, 30 Aug 2015 12:53
27 lines
2134 bytes
Hi Paul,

> Is there a way to easily take the contents (or some of the contents) of
> this log file and run a process to add them to active? Something along the
> lines as actsync does when creating newsgroups and by calling ctlinnd ?

Not that I am aware of.

You should first ask you the question of your really having the need to 
add these newsgroups to your active file.  Are there "official" 
newsgroups in managed hierarchies?  Do you have users that read or post 
to these newsgroups? ...

If you really want to add these newsgroups to your active file, I 
suggest to write a simple script that parses the unwanted.log file and 
runs a "ctlinnd newgroup" command on the second field of each line. 
Note that you do not have any means to know whether the newsgroup is 
moderated!

-- 
Julien ÉLIE

« Utiliser vi n'est pas un péché, c'est une punition. Car souvenez-
   vous que vi-vi-vi est l'éditeur de la Bête. » (Stallman, Church of
   Emacs)

Re: unwanted.log
#86925
Author: dunno
Date: Sun, 30 Aug 2015 13:07
27 lines
2017 bytes
Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> wrote:
> Hi Paul,
> 
>> Is there a way to easily take the contents (or some of the contents) of
>> this log file and run a process to add them to active? Something along the
>> lines as actsync does when creating newsgroups and by calling ctlinnd ?
> 
> Not that I am aware of.
> 
> You should first ask you the question of your really having the need to
> add these newsgroups to your active file.  Are there "official"
> newsgroups in managed hierarchies?  Do you have users that read or post
> to these newsgroups? ...
> 
> If you really want to add these newsgroups to your active file, I suggest
> to write a simple script that parses the unwanted.log file and runs a
> "ctlinnd newgroup" command on the second field of each line. Note that
> you do not have any means to know whether the newsgroup is moderated!

If I have moderated groups on my server, which supports no moderation, what
will happen when article is posted to that group and propagated to other
server, which do support moderation?

-- 
dunno

Re: unwanted.log
#86926
Author: Julien ÉLIE
Date: Sun, 30 Aug 2015 13:21
27 lines
2206 bytes
> If I have moderated groups on my server, which supports no moderation, what
> will happen when article is posted to that group and propagated to other
> server, which do support moderation?

It depends on the implementation of the other news server.  The 
standards (RFC 5537) only says:

3.6.  Duties of a Relaying Agent

    6.  It MAY reject any article without an Approved header field posted
        to a newsgroup known to be moderated.  This practice is strongly
        encouraged, but the information necessary to do so is not
        required to be maintained by a relaying agent.


As far as INN is concerned, the message is rejected because of the lack 
of the Approved: header field.  (The message could also be filled into 
the junk newsgroup, depending on the configuration.)

-- 
Julien ÉLIE

« Utiliser vi n'est pas un péché, c'est une punition. Car souvenez-
   vous que vi-vi-vi est l'éditeur de la Bête. » (Stallman, Church of
   Emacs)

Re: unwanted.log
#86932
Author: Avon Kerr
Date: Mon, 31 Aug 2015 08:13
25 lines
1807 bytes
Hi Julien.

On Sun, 30 Aug 2015 14:53:06 +0200, Julien ÉLIE wrote:

> Not that I am aware of.

OK thanks for that.
 
> If you really want to add these newsgroups to your active file, I
> suggest to write a simple script that parses the unwanted.log file and
> runs a "ctlinnd newgroup" command on the second field of each line. Note
> that you do not have any means to know whether the newsgroup is
> moderated!

Yes that question of moderation is one I am unsure how best to address as 
I would need to find some authoritative list of the newsgroups in question 
to determine if they were moderated prior to adding them to the news 
server.

Best, Paul

-- 
Agency News | news.bbs.geek.nz

Re: unwanted.log
#86934
Author: Julien ÉLIE
Date: Mon, 31 Aug 2015 19:39
19 lines
1716 bytes
Hi Paul,

> Yes that question of moderation is one I am unsure how best to address as
> I would need to find some authoritative list of the newsgroups in question
> to determine if they were moderated prior to adding them to the news
> server.

Maybe the one from ftp.isc.org?
     ftp://ftp.isc.org/pub/usenet/CONFIG/

Also viewable via a web interface:
     http://usenet.trigofacile.com/hierarchies/

-- 
Julien ÉLIE

« Tout est dans tout, et réciproquement. » (Pierre Dac)

Re: unwanted.log
#86936
Author: Avon Kerr
Date: Tue, 01 Sep 2015 08:08
19 lines
1453 bytes
Hi Julien.

On Mon, 31 Aug 2015 21:39:15 +0200, Julien ÉLIE wrote:

> Maybe the one from ftp.isc.org?
>      ftp://ftp.isc.org/pub/usenet/CONFIG/
> 
> Also viewable via a web interface:
>      http://usenet.trigofacile.com/hierarchies/


Thanks I should have thought of those. Will take a look.

Best, Paul

-- 
Agency News | news.bbs.geek.nz

Re: unwanted.log
#86940
Author: D. Stussy
Date: Wed, 02 Sep 2015 05:14
22 lines
2386 bytes
"Avon Kerr"  wrote in message news:mrtoh9$rj1$1@news.bbs.geek.nz...
Is there a way to easily take the contents (or some of the contents) of
this log file and run a process to add them to active? Something along the
lines as actsync does when creating newsgroups and by calling ctlinnd ?
-----------
Yes.  I have a script on my system that does just that, and it runs every 3 
days.  Note that it first filters the newsgroups to exclude certain 
hierarchies (which are checkgrouped), certain types (binaries), and will set 
the "m" flag for groups ending ".moderated" and the "n" flag for certain 
hierarchies and test groups.  The script does some other things too, such as 
remove "bork"{3} groups, long names, etc., and places all the aliases for 
groups at the end of my active file.

Of course, one will have missed the posts that came through that caused the 
group to be recorded in the "unwanted.log" file in the first place, but it 
will generally pick up subsequent posts.  As the "newsgroups" file remains 
unchanged, there will be no matching description for these added groups - 
until a checkgroups or newgroup message subsequently comes along.



Re: unwanted.log
#86941
Author: Avon Kerr
Date: Wed, 02 Sep 2015 08:48
37 lines
2527 bytes
Hi there :)


On Tue, 01 Sep 2015 22:14:28 -0700, D. Stussy wrote:

> Yes.  I have a script on my system that does just that, and it runs
> every 3 days.  Note that it first filters the newsgroups to exclude
> certain hierarchies (which are checkgrouped), certain types (binaries),
> and will set the "m" flag for groups ending ".moderated" and the "n"
> flag for certain hierarchies and test groups.  The script does some
> other things too, such as remove "bork"{3} groups, long names, etc., and
> places all the aliases for groups at the end of my active file.
> 
> Of course, one will have missed the posts that came through that caused
> the group to be recorded in the "unwanted.log" file in the first place,
> but it will generally pick up subsequent posts.  As the "newsgroups"
> file remains unchanged, there will be no matching description for these
> added groups - until a checkgroups or newgroup message subsequently
> comes along.

Thanks for the reply and the information about your script. I guess in 
the end so long as it does what you want it to then it's all good. I'm 
not (as I was mentioning to Julien) much of a coder (but I think I should 
start to learn!) so at this stage such a thing is beyond me.

I imagine you would have spent some time on this to tweak things etc.

For now I have manually added 2-3 groups (mozilla.*) that seem like they 
are of interest and contain on-topic / valid content.

Best, Paul.


-- 
Agency News | news.bbs.geek.nz

Re: unwanted.log
#86942
Author: D. Stussy
Date: Thu, 03 Sep 2015 00:24
130 lines
6929 bytes
"Avon Kerr"  wrote in message news:ms6d5k$n73$1@news.bbs.geek.nz...
Hi there :)

On Tue, 01 Sep 2015 22:14:28 -0700, D. Stussy wrote:
> Yes.  I have a script on my system that does just that, and it runs
> every 3 days.  Note that it first filters the newsgroups to exclude
> certain hierarchies (which are checkgrouped), certain types (binaries),
> and will set the "m" flag for groups ending ".moderated" and the "n"
> flag for certain hierarchies and test groups.  The script does some
> other things too, such as remove "bork"{3} groups, long names, etc., and
> places all the aliases for groups at the end of my active file.
>
> Of course, one will have missed the posts that came through that caused
> the group to be recorded in the "unwanted.log" file in the first place,
> but it will generally pick up subsequent posts.  As the "newsgroups"
> file remains unchanged, there will be no matching description for these
> added groups - until a checkgroups or newgroup message subsequently
> comes along.

Thanks for the reply and the information about your script. I guess in
the end so long as it does what you want it to then it's all good. I'm
not (as I was mentioning to Julien) much of a coder (but I think I should
start to learn!) so at this stage such a thing is beyond me.

I imagine you would have spent some time on this to tweak things etc.

For now I have manually added 2-3 groups (mozilla.*) that seem like they
are of interest and contain on-topic / valid content.

Best, Paul.
===================

Here is my script - it is initiated by CRON once every 3 days.  Feel free to 
modify it as you see fit (and to adjust for your directory paths).

By default, all groups are set to "j"  (the "sed" lines)
- ".test" groups and certain public hierarchies set to "n" (read-only)
- Groups ending ".moderated" set to "m"
- Groups ending ".unmoderated" set to "y"
Therefore, most groups still go to the "junk" group unless specifically 
overridden.

/usr/local/bin/add-unwanted-newsgroups:

#!/bin/sh
if [ ! -r /news/log/unwanted.log ]; then exit 1; fi
grep = /news/index/active|cut -d = -f 2|sed "s/^/0 /" 
 >>/news/log/unwanted.log
egrep " [a-z][-a-z0-9_+]+(\.[a-z0-9][-a-z0-9_+]*)+$" /news/log/unwanted.log 
|\
        egrep -v " (all|control|ctl|example|fa|general|lo[ck]al|private)\." 
|\
        egrep -v " (ba|belwue|ch|cl|comp|de|eternal-september|ffm|fido7)\." 
|\
        egrep -v " (fr|grisbi|hacktic|hr|humanities|hun|it|ka|kgk|linux)\." 
|\
        egrep -v " (luebeck|misc|news|nippon|nl|nntpworld|no|openwatcom)\." 
|\
        egrep -v " (opennews|pnx|rec|sci|scout|soc|sub|szaf|talk|z-netz)\." 
|\
        egrep -v " (sdnet|to|uk|us|www|x-privat|.*(google|yahoo)groups?)\." 
|\
        egrep -v " (alive|bofh|hiv|islam|mod|snarked|(alt\.)?test(ing)?)\." 
|\
        egrep -v " (air|courts|god|ieee|info|pubnet|t-netz|tnn|uiuc|zer)\." 
|\
        egrep -v " ((alt|free)\.[a-z]|aalt|allt|earth|foad|gay-net|meow)\." 
|\
        egrep -v " 
(alt\.anonymous|alt\..+\.test(ing)?|binar(ie|y)s?)(\.|$)"|\
        egrep -v " (http|poster$|(alot|america|deja|dejanews|ifdef|um)\.)" 
|\
        egrep -v "( |\.)(alt|bin|free|jobs|sex|sesso)\.(.+\.)*\\2(\.|$)" 
|\
        egrep -v "\.(h[0-9a-z]pc[1lr][0-9a-z][mn]e|cr[0-9a-z]meh[0-9a-z]p)" 
|\
        egrep -v "\.(beastial|cock.*suck|fetich|masterbat|moron|testeless)" 
|\
        egrep -v "\.(bin[eir]|bain|bian|binair|binary|pa?edo|pictue|warez)" 
|\
        egrep -v "\.([0-9]*|all|ctl|dowap|emircpih|flonk|froup|snuh)(\.|$)" 
|\
        egrep -v "\.(bin|binaries|dateien|meow|netflow|gay|bi|motss)(\.|$)" 
|\
        egrep -v "(mail|yahoo)\.(com|net|org|info|biz|(com?\.)?[a-z]{2})$" 
|\
        egrep -v "(fuck|eijk|fred.hall|montgomery.wood|phuck|bailie)"  |\
        sed "s/^[0-9]* /ctlinnd newgroup /" | sed "s/$/ j unwanted-groups/" 
|\
        sed -r "s/ ((clari|gmane|google|[^.]*\.public)\..+) . / \\1 n /" 
|\
        sed "s/\.test . /.test n /" | sed "s/\.moderated . /.moderated m /" 
|\
        sed "s/\.unmoderated . /.unmoderated y /" | ~news/bin/mod-active
grep = /news/index/active | cut -d " " -f 1 | sed "s/^/ctlinnd rmgroup /" \
        >/var/tmp/changes-$$
grep = /news/index/active | cut -d " " -f 1,4 | sed "s/^/ctlinnd newgroup /" 
|\
        sed "s/\$/ alias-groups/" >>/var/tmp/changes-$$
~news/bin/actsync -p0 -m /news/index/active /news/index/active.master |\
        grep " changegroup " >>/var/tmp/changes-$$
~news/bin/actsync -p0 -b2 -d2 -t2 -g9 -q12 -s80 /news/index/active \
        /news/index/active | cat - /var/tmp/changes-$$ | 
~news/bin/mod-active
exec rm /news/log/unwanted.log /var/tmp/changes-$$


Explanation:
Line 1)  It's a shell script.  I use BASH.
Line 2)  Aborts if there's no "unwanted.log" file to process.
Line 3)  Auto-adds any aliased group destination.
Lines 4-24) Filters and adds acceptable groups.  Discards the rest.
Lines 25-28)  Identifies group aliases and commands them to be placed at the 
end.
Lines 29-30)  Compares groups against a master override list and applies 
changes.
Lines 31-32)  Posts changes.  Removes "bork"{3} groups and overly-long 
groups.
Line 33)  Clean-up.

The group filter goes after reserved words, groups, and hierarchies, 
actively-checkgrouped hierarches, bogus and defunct hierarchies, certain 
misspellings, the "hipcrime" hack, abbreviated newsgroup names (namely 
"alt.?.*"), and some revenge groups.  Also goes after misplaced Yahoo/Google 
group names, which aren't really Usenet.  Lastly, note that I also filter 
binary groups because I run a text-only server.



Re: unwanted.log
#86943
Author: Avon Kerr
Date: Thu, 03 Sep 2015 06:33
18 lines
1550 bytes
On Wed, 02 Sep 2015 17:24:10 -0700, D. Stussy wrote:

> 
> Here is my script - it is initiated by CRON once every 3 days.  Feel
> free to modify it as you see fit (and to adjust for your directory
> paths).

Thank you that's very kind of you to share that with me. I will take a 
look at it this weekend when I have some more time to focus on it and 
perhaps ask the odd strange question as a result ;)

Best, Paul


-- 
Agency News | news.bbs.geek.nz

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