Outgoing feed filter (fwd)

Julien ÉLIE julien at trigofacile.com
Tue May 5 20:57:34 UTC 2009

Hi Petr,

> I have the same problem..
> Maybe here someone say something?

Yep, I saw it but did not manage to have a look at it earlier.
I was not at home during the whole week-end but with friends
who live in the countryside (no Internet!).

Besides, it was not that easy to find out where the problem was.

My answer (posted to news.software.nntp) below:

> 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 @@

+    /* 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)

More information about the inn-workers mailing list