🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #80908

Re: Outgoing feed filter

#80908
From: 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) 
Technical Details
Message-ID: <gtq951$7gp$1@news.trigofacile.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!de-l.enfer-du-nord.net!gegeweb.org!news.trigofacile.com!not-for-mail
References: <gtfajk$7q8$1@posting2.glorb.com>

Show Full Headers
Complete Article Headers
Message-ID: <gtq951$7gp$1@news.trigofacile.com>
Subject: Re: Outgoing feed filter
Date: Tue, 5 May 2009 22:53:32 +0200
From: Julien ÉLIE <iulius@nom-de-mon-site.com.invalid>
References: <gtfajk$7q8$1@posting2.glorb.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!de-l.enfer-du-nord.net!gegeweb.org!news.trigofacile.com!not-for-mail
Newsgroups: news.software.nntp
Organization: TrigoFACILE -- http://www.trigofacile.com/
Lines: 88
NNTP-Posting-Host: aaubervilliers-151-1-58-234.w83-112.abo.wanadoo.fr
Mime-Version: 1.0
Content-Type: text/plain; format=flowed; charset="Windows-1252";
 reply-type=original
Content-Transfer-Encoding: 8bit
X-Trace: news.trigofacile.com 1241556961 7705 83.112.31.234 (5 May 2009
X-Complaints-To: abuse@trigofacile.com
NNTP-Posting-Date: Tue, 5 May 2009 20:56:01 +0000 (UTC)
In-Reply-To: <gtfajk$7q8$1@posting2.glorb.com>
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Windows Mail 6.0.6001.18000
X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049