🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
12 messages
12 total messages Started by Geoff Brozny Fri, 01 May 2009 17:13
Outgoing feed filter
#80828
Author: Geoff Brozny
Date: Fri, 01 May 2009 17:13
15 lines
1572 bytes
Hello, I been working on trying to filter misplaced binaries from my 
outgoing feed, so I set up a perl filter, and set dontrejectfiltered to true 
in inn.conf, and added the Af flag to a peer in the newsfeeds file.  While 
doing some testing, nothing appears to ever get filtered, if I post a binary 
it will still get passed to the peer with the Af flag set. To verify the 
filter does work, I set dontrejectfiltered back to false, and the binary was 
properly rejected for being a binary in a non-binary group, but I do not 
want to reject this on incoming, just outgoing. Did I miss some other config 
option I need to set?

thanks,

geoff 

Re: Outgoing feed filter
#80833
Author: D. Stussy
Date: Fri, 01 May 2009 20:09
27 lines
2200 bytes
"Geoff Brozny" <gbrozny@glorb.columbus.oh.us> wrote in message
news:gtfajk$7q8$1@posting2.glorb.com...
> Hello, I been working on trying to filter misplaced binaries from my
> outgoing feed, so I set up a perl filter, and set dontrejectfiltered to
true
> in inn.conf, and added the Af flag to a peer in the newsfeeds file.
While
> doing some testing, nothing appears to ever get filtered, if I post a
binary
> it will still get passed to the peer with the Af flag set. To verify the
> filter does work, I set dontrejectfiltered back to false, and the binary
was
> properly rejected for being a binary in a non-binary group, but I do not
> want to reject this on incoming, just outgoing. Did I miss some other
config
> option I need to set?

I think that the "Af" flag will apply to articles that come in from the
EXTERNAL feeds - not locally originated posts.  Since you have at least two
servers under your control, try setting up a group just for them, post to
one, let it propagate to the other, and see if that then goes out when the
feed is marked with "Af".

If "Af" can also apply to local posts, remember that such goes via a
separate filter.

Re: Outgoing feed filter
#80834
Author: Geoff Brozny
Date: Fri, 01 May 2009 20:18
25 lines
2021 bytes
D. Stussy wrote:

> 
> I think that the "Af" flag will apply to articles that come in from the
> EXTERNAL feeds - not locally originated posts.  Since you have at least two
> servers under your control, try setting up a group just for them, post to
> one, let it propagate to the other, and see if that then goes out when the
> feed is marked with "Af".
> 
> If "Af" can also apply to local posts, remember that such goes via a
> separate filter.
> 


Here is what I was doing, I created a glorb.test group on my systems, 
posted the binary using the newsread box, which then sent it to my 
transit systems, which had the Af flag set on the feed to my other 
reader box, but it sent the binary post along anyway. Both transit 
systems, news, running 2.4.6 and news2 running 2.5.0rc2 both act the 
same way so it looks like either this might be broken, or I have 
something messed up somewhere.

thanks,
geoff
Re: Outgoing feed filter
#80835
Author: D. Stussy
Date: Fri, 01 May 2009 20:31
28 lines
2429 bytes
"Geoff Brozny" <gbrozny@glorb.columbus.oh.us> wrote in message
news:gtflf8$8gj$1@posting2.glorb.com...
> D. Stussy wrote:
> > I think that the "Af" flag will apply to articles that come in from the
> > EXTERNAL feeds - not locally originated posts.  Since you have at least
two
> > servers under your control, try setting up a group just for them, post
to
> > one, let it propagate to the other, and see if that then goes out when
the
> > feed is marked with "Af".
> >
> > If "Af" can also apply to local posts, remember that such goes via a
> > separate filter.
>
> Here is what I was doing, I created a glorb.test group on my systems,
> posted the binary using the newsread box, which then sent it to my
> transit systems, which had the Af flag set on the feed to my other
> reader box, but it sent the binary post along anyway. Both transit
> systems, news, running 2.4.6 and news2 running 2.5.0rc2 both act the
> same way so it looks like either this might be broken, or I have
> something messed up somewhere.

Maybe you should dump the "<newslog>/cleanfeed.stats" (the non-HTML
version) and see what various variables are set to, especially all the
regexes that specify group names.  Beyond that, you have me stumped too.

Re: Outgoing feed filter
#80836
Author: Geoff Brozny
Date: Fri, 01 May 2009 20:49
16 lines
1692 bytes
D. Stussy wrote:
> 
> Maybe you should dump the "<newslog>/cleanfeed.stats" (the non-HTML
> version) and see what various variables are set to, especially all the
> regexes that specify group names.  Beyond that, you have me stumped too.
> 
> 

I'm just using a binary only filter that Steve put together for me, 
which is basically just the cleanfeed binary check section,  so there is 
really is no config for it. It works perfect when dontrejectfiltered is 
set back to false.

thanks,

geoff
Re: Outgoing feed filter
#80837
Author: Steve Crook
Date: Fri, 01 May 2009 21:25
15 lines
1661 bytes
On Fri, 01 May 2009 16:49:07 -0400, Geoff Brozny wrote in
Message-Id: <gtfn8d$8n1$1@posting2.glorb.com>:

> I'm just using a binary only filter that Steve put together for me, 
> which is basically just the cleanfeed binary check section,  so there is 
> really is no config for it. It works perfect when dontrejectfiltered is 
> set back to false.

The filter Geoff is referring to can be viewed here:
http://www.mixmin.net/svn/cleanfeed/branches/binary_only/binfilter

-- 
pub   1024D/228761E7 2003-06-04 Steven Crook
      Key fingerprint = 1CD9 95E1 E9CE 80D6 C885  B7EB B471 80D5 2287 61E7
uid                  Steven Crook <steve@mixmin.net>
Re: Outgoing feed filter
#80908
Author: Julien ÉLIE
Date: Tue, 05 May 2009 20:53
88 lines
4359 bytes
Hi Geoff,

> Hello, I been working on trying to filter misplaced binaries from my
> outgoing feed, so I set up a perl filter, and set dontrejectfiltered to true
> in inn.conf, and added the Af flag to a peer in the newsfeeds file.  While
> doing some testing, nothing appears to ever get filtered, if I post a binary
> it will still get passed to the peer with the Af flag set. To verify the
> filter does work, I set dontrejectfiltered back to false, and the binary was
> properly rejected for being a binary in a non-binary group, but I do not
> want to reject this on incoming, just outgoing. Did I miss some other config
> option I need to set?

No, you did not miss anything.
It is a genuine bug.  Thanks for having spotted it!

The problem is that at some point during the function which determines what
sites will receive the articles, funnels are removed in favour of what they
point at (like innfeed!).  Therefore, if "news.server.org" has the Af flag,
this flag is not transmitted to "innfeed!" (because it handles more than one
site).  And when it is time to send the article, "news.server.org" is no longer
known and the article ends up being transmitted to "innfeed!" which sends it
to "news.server.org".

I fixed the code to check for the Af flag on funnels too.


Here is a patch:

Index: innd/art.c
===================================================================
--- innd/art.c       (révision 8438)
+++ innd/art.c       (copie de travail)
@@ -1685,7 +1685,7 @@
 */
 static void
 ARTpropagate(ARTDATA *data, const char **hops, int hopcount, char **list,
-  bool ControlStore, bool OverviewCreated)
+  bool ControlStore, bool OverviewCreated, bool Filtered)
 {
   HDRCONTENT   *hc = data->HdrContent;
   SITE         *sp, *funnel;
@@ -1775,6 +1775,10 @@
        continue;
     }

+    /* Handle dontrejectfiltered. */
+    if (Filtered && sp->DropFiltered)
+      continue;
+
     /* Write that the site is getting it, and flag to send it. */
     if (innconf->logsitename) {
       if (fprintf(Log, " %s", sp->Name) == EOF || ferror(Log)) {
@@ -2540,7 +2544,7 @@
   }

   ARTpropagate(data, (const char **)hops, hopcount, data->Distribution.List,
-    ControlStore, OverviewCreated);
+    ControlStore, OverviewCreated, Filtered);

   /* Now that it's been written, process the control message.  This has
    * a small window, if we get a new article before the newgroup message
@@ -2559,11 +2563,9 @@
   /* And finally, send to everyone who should get it */
   for (sp = Sites, i = nSites; --i >= 0; sp++) {
     if (sp->Sendit) {
-      if (!Filtered || !sp->DropFiltered) {
-       TMRstart(TMR_SITESEND);
-       SITEsend(sp, data);
-       TMRstop(TMR_SITESEND);
-      }
+      TMRstart(TMR_SITESEND);
+      SITEsend(sp, data);
+      TMRstop(TMR_SITESEND);
     }
   }




I hope I did not break anything.  At least, this article reached your
news server so it was properly propagated from my news server which
has this patch :)

-- 
Julien ÉLIE

« Ira furor breuis est. » (Horace) 
Re: Outgoing feed filter
#80909
Author: Julien ÉLIE
Date: Tue, 05 May 2009 21:06
15 lines
1752 bytes
Hi Geoff,

> it will get passed to the peer with the Af flag set

Though I have not checked yet with real articles (but will soon do),
there are chances that Ac, AC and Ae are also affected.

I will fix it if that is the case with these flags too (easy to do,
now I know what the problem is).

-- 
Julien ÉLIE

« Vti, non abuti. »
Re: Outgoing feed filter
#80913
Author: Geoff Brozny
Date: Wed, 06 May 2009 13:42
98 lines
4380 bytes
"Julien ÉLIE" <iulius@nom-de-mon-site.com.invalid> wrote in message 
news:gtq951$7gp$1@news.trigofacile.com...

>
> The problem is that at some point during the function which determines 
> what
> sites will receive the articles, funnels are removed in favour of what 
> they
> point at (like innfeed!).  Therefore, if "news.server.org" has the Af 
> flag,
> this flag is not transmitted to "innfeed!" (because it handles more than 
> one
> site).  And when it is time to send the article, "news.server.org" is no 
> longer
> known and the article ends up being transmitted to "innfeed!" which sends 
> it
> to "news.server.org".
>
> I fixed the code to check for the Af flag on funnels too.
>
>
> Here is a patch:
>
> Index: innd/art.c
> ===================================================================
> --- innd/art.c       (révision 8438)
> +++ innd/art.c       (copie de travail)
> @@ -1685,7 +1685,7 @@
> */
> static void
> ARTpropagate(ARTDATA *data, const char **hops, int hopcount, char **list,
> -  bool ControlStore, bool OverviewCreated)
> +  bool ControlStore, bool OverviewCreated, bool Filtered)
> {
>   HDRCONTENT   *hc = data->HdrContent;
>   SITE         *sp, *funnel;
> @@ -1775,6 +1775,10 @@
>        continue;
>     }
>
> +    /* Handle dontrejectfiltered. */
> +    if (Filtered && sp->DropFiltered)
> +      continue;
> +
>     /* Write that the site is getting it, and flag to send it. */
>     if (innconf->logsitename) {
>       if (fprintf(Log, " %s", sp->Name) == EOF || ferror(Log)) {
> @@ -2540,7 +2544,7 @@
>   }
>
>   ARTpropagate(data, (const char **)hops, hopcount, 
> data->Distribution.List,
> -    ControlStore, OverviewCreated);
> +    ControlStore, OverviewCreated, Filtered);
>
>   /* Now that it's been written, process the control message.  This has
>    * a small window, if we get a new article before the newgroup message
> @@ -2559,11 +2563,9 @@
>   /* And finally, send to everyone who should get it */
>   for (sp = Sites, i = nSites; --i >= 0; sp++) {
>     if (sp->Sendit) {
> -      if (!Filtered || !sp->DropFiltered) {
> -       TMRstart(TMR_SITESEND);
> -       SITEsend(sp, data);
> -       TMRstop(TMR_SITESEND);
> -      }
> +      TMRstart(TMR_SITESEND);
> +      SITEsend(sp, data);
> +      TMRstop(TMR_SITESEND);
>     }
>   }
>
>
>
>
> I hope I did not break anything.  At least, this article reached your
> news server so it was properly propagated from my news server which
> has this patch :)
>


I did a bunch of testing last night, and it has been running though the 
night with the patch and seems to be working properly. Thank you for fixing 
this, I appreciate it.

Something else that would probably be helpful, is INN is not logging 
anywhere what articles are actually being rejected by the filter with 
dontrejectfiltered set to true, this behavior could make it a bit difficult 
to troubleshoot a filter that might be to aggressive or why a specific post 
did not get offered it to a specific peer. There probably should be some 
indication when the article is received, that it was accepted, but also 
rejected by the filter.

thanks,
geoff 

Re: Outgoing feed filter
#80915
Author: Julien ÉLIE
Date: Wed, 06 May 2009 17:22
58 lines
3550 bytes
Hi Geoff,

> I did a bunch of testing last night, and it has been running though the
> night with the patch and seems to be working properly.

That's pretty fine then.  Thanks for having thoroughly tested.


> Something else that would probably be helpful, is INN is not logging
> anywhere what articles are actually being rejected by the filter with
> dontrejectfiltered set to true, this behavior could make it a bit difficult
> to troubleshoot a filter that might be to aggressive or why a specific post
> did not get offered it to a specific peer. There probably should be some
> indication when the article is received, that it was accepted, but also
> rejected by the filter.

OK, let's use news.notice to say the article was still rejected by the filter,
as it is usually done.
Is something like the following patch what you want?


Index: innd/art.c
===================================================================
--- innd/art.c       (révision 8446)
+++ innd/art.c       (copie de travail)
@@ -2066,6 +2066,10 @@
   if (filterrc != NULL) {
     if (innconf->dontrejectfiltered) {
       Filtered = true;
+      syslog(L_NOTICE, "rejecting[python] %s %d %.200s (with dontrejectfiltered)",
+             HDR(HDR__MESSAGE_ID),
+             ihave ? NNTP_OK_IHAVE : NNTP_OK_TAKETHIS,
+             filterrc);
     } else {
       snprintf(cp->Error, sizeof(cp->Error), "%d %.200s",
                ihave ? NNTP_FAIL_IHAVE_REJECT : NNTP_FAIL_TAKETHIS_REJECT,
@@ -2093,6 +2097,10 @@
   if (filterrc) {
     if (innconf->dontrejectfiltered) {
       Filtered = true;
+      syslog(L_NOTICE, "rejecting[perl] %s %d %.200s (with dontrejectfiltered)",
+             HDR(HDR__MESSAGE_ID),
+             ihave ? NNTP_OK_IHAVE : NNTP_OK_TAKETHIS,
+             filterrc);
     } else {
       snprintf(cp->Error, sizeof(cp->Error), "%d %.200s",
                ihave ? NNTP_FAIL_IHAVE_REJECT : NNTP_FAIL_TAKETHIS_REJECT,


Have a nice day,

-- 
Julien ÉLIE

« -- À trente jours de marche, aussi il vous faudra traverser le désert !
  -- Je ne connais pas encore ce genre de traversée mais
  par Toutatis, je suis certain de m'en sortir très vite ! » (Astérix) 
Re: Outgoing feed filter
#80917
Author: Julien ÉLIE
Date: Wed, 06 May 2009 17:48
15 lines
1743 bytes
Hi,

> Though I have not checked yet with real articles (but will soon do),
> there are chances that Ac, AC and Ae are also affected.

It appears that these flags work well.  That's great!
They are handled in a different way (control articles and junk groups),
so they are not affected like other articles.

-- 
Julien ÉLIE

« Et nunc reges, intelligite, erudimini, qui iudicatis terram. »
  (Livre des Psaumes cité par Bossuet)
Re: Outgoing feed filter
#80920
Author: Geoff Brozny
Date: Wed, 06 May 2009 19:36
67 lines
3362 bytes
Julien ÉLIE wrote:
> Hi Geoff,
> 
>> I did a bunch of testing last night, and it has been running though the
>> night with the patch and seems to be working properly.
> 
> That's pretty fine then.  Thanks for having thoroughly tested.

Your wlcome.

> 
> 
>> Something else that would probably be helpful, is INN is not logging
>> anywhere what articles are actually being rejected by the filter with
>> dontrejectfiltered set to true, this behavior could make it a bit 
>> difficult
>> to troubleshoot a filter that might be to aggressive or why a specific 
>> post
>> did not get offered it to a specific peer. There probably should be some
>> indication when the article is received, that it was accepted, but also
>> rejected by the filter.
> 
> OK, let's use news.notice to say the article was still rejected by the 
> filter,
> as it is usually done.
> Is something like the following patch what you want?
> 
> 
> Index: innd/art.c
> ===================================================================
> --- innd/art.c       (révision 8446)
> +++ innd/art.c       (copie de travail)
> @@ -2066,6 +2066,10 @@
>   if (filterrc != NULL) {
>     if (innconf->dontrejectfiltered) {
>       Filtered = true;
> +      syslog(L_NOTICE, "rejecting[python] %s %d %.200s (with 
> dontrejectfiltered)",
> +             HDR(HDR__MESSAGE_ID),
> +             ihave ? NNTP_OK_IHAVE : NNTP_OK_TAKETHIS,
> +             filterrc);
>     } else {
>       snprintf(cp->Error, sizeof(cp->Error), "%d %.200s",
>                ihave ? NNTP_FAIL_IHAVE_REJECT : NNTP_FAIL_TAKETHIS_REJECT,
> @@ -2093,6 +2097,10 @@
>   if (filterrc) {
>     if (innconf->dontrejectfiltered) {
>       Filtered = true;
> +      syslog(L_NOTICE, "rejecting[perl] %s %d %.200s (with 
> dontrejectfiltered)",
> +             HDR(HDR__MESSAGE_ID),
> +             ihave ? NNTP_OK_IHAVE : NNTP_OK_TAKETHIS,
> +             filterrc);
>     } else {
>       snprintf(cp->Error, sizeof(cp->Error), "%d %.200s",
>                ihave ? NNTP_FAIL_IHAVE_REJECT : NNTP_FAIL_TAKETHIS_REJECT,
> 
> 
> Have a nice day,
> 


That should be perfect.

thanks,

geoff
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