Thread View: news.software.nntp
8 messages
8 total messages
Started by Steve Crook
Sun, 04 Jun 2017 17:23
New version of PyClean
Author: Steve Crook
Date: Sun, 04 Jun 2017 17:23
Date: Sun, 04 Jun 2017 17:23
46 lines
2664 bytes
2664 bytes
Hi all, It's been a while since I've done a new release of PyClean, an innd filter written in Python. Below is a summary of the changes introduced since the last release:- * Add a new EMP filter seeded by Posting-Host and Newsgroups. Previously the same PHN filter was applied to all articles, both locally and remotely posted. The new filter matches against only locally posted articles. This grants the administrator more granular control over how to treat articles posted to their service. * Add a local_bad_subject file Allow matching of Regular Expressions against the subjects of locally posted articles. If the local_bad_subject file doesn't exist, this change will have no effect. * Add "short reasons" to reject messages Previously the user and the logfile saw the same reject messages. Sometimes this is undesirable as too much info tells an (ab)user exactly how to circumvent a reject. This change provides for two reject messages, one logged and the other reported to the user. * Avoid some false positives in binary filters The binary filters were matching files containing very long numbers, spanning multiple lines. They also matched against signature content. This change adds conditions to prevent these false positives. Thanks to Julian Élie for reporting this issue. * Add a log message for locally posted articles Previously there was no log message for locally injected articles. This can provide some useful fodder for the likes of grep. To install the update, please download the Python filter from Github: https://github.com/crooks/PyClean Overwrite INN's bin/filter/filter_innd.py with pyclean.py. Configure as desired and then reload the filter. Enjoy! -- What shall we use To fill the empty spaces Where we used to talk?
Re: New version of PyClean
Author: Julien ÉLIE
Date: Sun, 04 Jun 2017 20:32
Date: Sun, 04 Jun 2017 20:32
43 lines
2779 bytes
2779 bytes
Hi Steve,
> To install the update, please download the Python filter from
> Github: https://github.com/crooks/PyClean
> Overwrite INN's
> bin/filter/filter_innd.py with pyclean.py. Configure as desired and
> then reload the filter.
Thanks for the update!
I've just downloaded the new version and am facing the following error
after reloading the filter.
Is there something to do besides updating filter_innd.py?
Traceback (most recent call last):
File "/home/news/bin/filter/filter_innd.py", line 220, in __init__
self.pyfilter = Filter()
File "/home/news/bin/filter/filter_innd.py", line 515, in __init__
threshold=config.getint('emp', 'lphn_threshold'),
File "/usr/lib/python2.7/ConfigParser.py", line 359, in getint
return self._get(section, int, option)
File "/usr/lib/python2.7/ConfigParser.py", line 356, in _get
return conv(self.get(section, option))
File "/usr/lib/python2.7/ConfigParser.py", line 340, in get
raise NoOptionError(option, section)
NoOptionError: No option 'lphn_threshold' in section: 'emp'
> * Avoid some false positives in binary filters
> The binary filters were matching files containing very long numbers,
> spanning multiple lines. They also matched against signature content.
> This change adds conditions to prevent these false positives. Thanks to
> Julian Élie for reporting this issue.
Greatly appreciated.
--
Julien ÉLIE
« Avez-vous remarqué qu'à table les mets que l'on vous sert vous
mettent les mots à la bouche ? » (Raymond Devos)
Re: New version of PyClean
Author: Steve Crook
Date: Mon, 05 Jun 2017 10:50
Date: Mon, 05 Jun 2017 10:50
44 lines
2702 bytes
2702 bytes
On Sun, 4 Jun 2017 22:32:13 +0200, Julien ÉLIE wrote in
Message-Id: <oh1qod$ld6$1@news.trigofacile.com>:
> Hi Steve,
>
>> To install the update, please download the Python filter from
>> Github: https://github.com/crooks/PyClean
>> Overwrite INN's
>> bin/filter/filter_innd.py with pyclean.py. Configure as desired and
>> then reload the filter.
>
> Thanks for the update!
> I've just downloaded the new version and am facing the following error
> after reloading the filter.
> Is there something to do besides updating filter_innd.py?
>
> Traceback (most recent call last):
> File "/home/news/bin/filter/filter_innd.py", line 220, in __init__
> self.pyfilter = Filter()
> File "/home/news/bin/filter/filter_innd.py", line 515, in __init__
> threshold=config.getint('emp', 'lphn_threshold'),
> File "/usr/lib/python2.7/ConfigParser.py", line 359, in getint
> return self._get(section, int, option)
> File "/usr/lib/python2.7/ConfigParser.py", line 356, in _get
> return conv(self.get(section, option))
> File "/usr/lib/python2.7/ConfigParser.py", line 340, in get
> raise NoOptionError(option, section)
> NoOptionError: No option 'lphn_threshold' in section: 'emp'
Hi Julian,
Thanks, I see what's happened. The new version includes new config
options but the config is only read on filter startup, not reload. I've
made a change now to reload the config in the filter_before_reload
function. Unfortunately that too will require a restart as the code
isn't refreshed by a 'ctlinnd reload filter.python'. I'm not sure if
there's a way to reinitialize the filter without stopping/starting inn.
--
What shall we use
To fill the empty spaces
Where we used to talk?
Re: New version of PyClean
Author: Julien ÉLIE
Date: Mon, 05 Jun 2017 11:55
Date: Mon, 05 Jun 2017 11:55
23 lines
2202 bytes
2202 bytes
Hi Steve, > Thanks, I see what's happened. The new version includes new config > options but the config is only read on filter startup, not reload. I've > made a change now to reload the config in the filter_before_reload > function. Unfortunately that too will require a restart as the code > isn't refreshed by a 'ctlinnd reload filter.python'. I'm not sure if > there's a way to reinitialize the filter without stopping/starting inn. OK, thanks for having added a config reload in filter_before_reload(). Neither "clinnd python n" and then "y", nor "ctlinnd xexec all" worked to reload the filter. Indeed, only stopping/starting INN permitted to take the new version into account. Now in use. I'll let you know if I find again false positives. -- Julien ÉLIE « Avez-vous remarqué qu'à table les mets que l'on vous sert vous mettent les mots à la bouche ? » (Raymond Devos)
Re: New version of PyClean
Author: Julien ÉLIE
Date: Tue, 06 Jun 2017 19:54
Date: Tue, 06 Jun 2017 19:54
16 lines
1728 bytes
1728 bytes
Hi Steve, > Now in use. I'll let you know if I find again false positives. bin_suspect for <oh5pk3$ma0$1@nemo.pasdenom.info> You can find the article in <http://al.howardknight.net/>. It contains several lines of "ha!ha!ha!ha!ha!ha!ha!ha!". Maybe repetitive sequences like that should not be considered as binaries? -- Julien ÉLIE « Sentir de l'argent ? Mais ça n'a pas d'odeur ! » (Obélix)
Re: New version of PyClean
Author: Steve Crook
Date: Wed, 07 Jun 2017 09:15
Date: Wed, 07 Jun 2017 09:15
40 lines
2331 bytes
2331 bytes
On Tue, 6 Jun 2017 21:54:30 +0200, Julien ÉLIE wrote in Message-Id: <oh719s$398$1@news.trigofacile.com>: > Hi Steve, > >> Now in use. I'll let you know if I find again false positives. > > bin_suspect for <oh5pk3$ma0$1@nemo.pasdenom.info> > You can find the article in <http://al.howardknight.net/>. > > It contains several lines of "ha!ha!ha!ha!ha!ha!ha!ha!". > Maybe repetitive sequences like that should not be considered as binaries? Hi Julian, Articles in bin_suspect aren't rejected unless reject_suspected is turned on in the config. By default it's off. On my server, this article was rejected by EMP(Posting-host/Newsgroup) because the posting-host sent so many articles to a single group in a short period. The defaults for emp-phn are: phn_threshold: 100 phn_ceiling: 150 phn_maxentries: 5000 phn_timed_trim: 1800 I think this should be modified to be more tolerant of high volume posters. The difference between the threshold and the ceiling means up to 50 periods (of 1800 seconds) have to pass before the hash drops back under the threshold. I'll change my phn_timed_trim to 900 and monitor the rejects. If it looks good, I'll change the default in Pyclean. -- What shall we use To fill the empty spaces Where we used to talk?
Re: New version of PyClean
Author: Steve Crook
Date: Wed, 07 Jun 2017 09:32
Date: Wed, 07 Jun 2017 09:32
22 lines
1725 bytes
1725 bytes
On Wed, 7 Jun 2017 09:15:46 -0000 (UTC), Steve Crook wrote in Message-Id: <slrnojfh22.6h1.steve@fleegle.mixmin.net>: > I'll change my phn_timed_trim to 900 and monitor the rejects. If it > looks good, I'll change the default in Pyclean. Just for info, the recent change to re-read the config on filter reload worked nicely. 2017-06-07 10:27:49 INFO Re-reading config file 2017-06-07 10:27:49 INFO Running shutdown tasks 2017-06-07 10:27:49 INFO Attempting restore of emp_phn dump 2017-06-07 10:27:49 INFO Restored 351 records to emp_phn 2017-06-07 10:27:49 INFO emp_phn initialized. threshold=100, ceiling=150, maxentries=5000, timedtrim=900 -- What shall we use To fill the empty spaces Where we used to talk?
Re: New version of PyClean
Author: Julien ÉLIE
Date: Wed, 07 Jun 2017 19:00
Date: Wed, 07 Jun 2017 19:00
25 lines
2153 bytes
2153 bytes
Hi Steve, >> I'll change my phn_timed_trim to 900 and monitor the rejects. If it >> looks good, I'll change the default in Pyclean. I think lowering the value (currently 1800) would be useful. I also saw rejects of valid articles with the previous version of PyClean (I've cleaned the logs to better see how the new version performs). > Just for info, the recent change to re-read the config on filter reload > worked nicely. > > 2017-06-07 10:27:49 INFO Re-reading config file > 2017-06-07 10:27:49 INFO emp_phn initialized. threshold=100, > ceiling=150, maxentries=5000, timedtrim=900 Good to hear! -- Julien ÉLIE « Sentir de l'argent ? Mais ça n'a pas d'odeur ! » (Obélix)
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