INN commit: trunk (7 files)

INN Commit rra at isc.org
Sat Jan 16 23:29:42 UTC 2010


    Date: Saturday, January 16, 2010 @ 15:29:42
  Author: iulius
Revision: 8889

Add a new parameter to inn.conf:  feedtrash, set to false by default (which
was the historic behaviour of INN), adds the capability to feed articles
accepted and filed in junk (due to wanttrash) to peers based on their feed
patterns (applied to the Newsgroups: header as though the article were
accepted and all those groups were locally carried).  This is useful if
you want to run INN with a minimal active file and propagate all posts.

Thanks to Andrew Gierth for the patch.

Modified:
  trunk/doc/pod/active.pod
  trunk/doc/pod/inn.conf.pod
  trunk/doc/pod/newsfeeds.pod
  trunk/include/inn/innconf.h
  trunk/innd/art.c
  trunk/lib/innconf.c
  trunk/samples/inn.conf.in

-----------------------+
 doc/pod/active.pod    |    6 +++---
 doc/pod/inn.conf.pod  |   17 +++++++++++++++--
 doc/pod/newsfeeds.pod |   10 +++++-----
 include/inn/innconf.h |    1 +
 innd/art.c            |   15 ++++++++++-----
 lib/innconf.c         |    1 +
 samples/inn.conf.in   |    1 +
 7 files changed, 36 insertions(+), 15 deletions(-)

Modified: doc/pod/active.pod
===================================================================
--- doc/pod/active.pod	2010-01-16 16:35:14 UTC (rev 8888)
+++ doc/pod/active.pod	2010-01-16 23:29:42 UTC (rev 8889)
@@ -25,9 +25,9 @@
 
 If none of the newsgroups listed in the Newsgroups: header of an article
 are present in this file, the article is either rejected (if I<wanttrash>
-is false in F<inn.conf>), or is filed into the newsgroup C<junk> and only
-propagated to sites that receive the C<junk> newsgroup (if I<wanttrash> is
-true).
+is false in F<inn.conf>), or is filed into the newsgroup C<junk> and, in
+case I<feedtrash> is false, only propagated to sites that receive the C<junk>
+newsgroup (if I<wanttrash> is true).
 
 Each line of this file consists of four fields separated by a space:
 

Modified: doc/pod/inn.conf.pod
===================================================================
--- doc/pod/inn.conf.pod	2010-01-16 16:35:14 UTC (rev 8888)
+++ doc/pod/inn.conf.pod	2010-01-16 23:29:42 UTC (rev 8889)
@@ -178,6 +178,18 @@
 accepted on the local machine, but articles rejected by the filter will
 I<not> be fed to any peers specified in F<newsfeeds> with the C<Af> flag.
 
+=item I<feedtrash>
+
+Set this to true if you want to feed articles accepted and filed in C<junk>
+(due to I<wanttrash>) to peers based on their F<newsfeeds> feed patterns
+(applied to the Newsgroups: header as though the article were accepted
+and all those groups were locally carried).  This is useful if you want
+to run INN with a minimal F<active> file and propagate all posts.
+
+This is a boolean value and the default is false, that is to say that
+articles are filed in C<junk> and propagated to sites that receive the
+C<junk> newsgroup.
+
 =item I<hiscachesize>
 
 If set to a value other than C<0>, a hash of recently received Message-IDs
@@ -337,8 +349,9 @@
 Set this to true if you want to file articles posted to unknown newsgroups
 (newsgroups not in the F<active> file) into the C<junk> newsgroup rather
 than rejecting them.  This is sometimes useful for a transit news server
-that needs to propagate articles in all newsgroups regardless if they're
-carried locally.  This is a boolean value and the default is false.
+that needs to propagate articles (according to the setting of I<feedtrash>)
+in all newsgroups regardless if they're carried locally.  This is a boolean
+value and the default is false.
 
 =item I<wipcheck>
 

Modified: doc/pod/newsfeeds.pod
===================================================================
--- doc/pod/newsfeeds.pod	2010-01-16 16:35:14 UTC (rev 8888)
+++ doc/pod/newsfeeds.pod	2010-01-16 23:29:42 UTC (rev 8889)
@@ -123,11 +123,11 @@
 
 Control messages follow slightly different propagation rules than normal
 articles; see innd(8) for the details.  Note that most subscriptions
-should have C<!junk,!control,!control.*> in their pattern list due to those
-propagation rules (and since junk is a special internal newsgroup; see
-I<wanttrash> in inn.conf(5) for more details on what it's used for) and
-that the best way to keep control messages local to a site is with a
-distribution.
+should have C<!junk,!control,!control.*> in their pattern list due to
+those propagation rules (and since C<junk> is a special internal newsgroup;
+see I<feedtrash> and I<wanttrash> in inn.conf(5) for more details on what
+it's used for) and that the best way to keep control messages local to a
+site is with a distribution.
 
 A subscription can be further modified by specifying distributions that
 the site should or should not receive.  The default is to send all

Modified: include/inn/innconf.h
===================================================================
--- include/inn/innconf.h	2010-01-16 16:35:14 UTC (rev 8888)
+++ include/inn/innconf.h	2010-01-16 23:29:42 UTC (rev 8889)
@@ -35,6 +35,7 @@
     char *bindaddress;          /* Which interface IP to bind to */
     char *bindaddress6;         /* Which interface IPv6 to bind to */
     bool dontrejectfiltered;    /* Don't reject filtered article? */
+    bool feedtrash;             /* Feed the junk group as though the groups really existed. */
     unsigned long hiscachesize; /* Size of the history cache in kB */
     bool ignorenewsgroups;      /* Propagate cmsgs by affected group? */
     bool immediatecancel;       /* Immediately cancel timecaf messages? */

Modified: innd/art.c
===================================================================
--- innd/art.c	2010-01-16 16:35:14 UTC (rev 8888)
+++ innd/art.c	2010-01-16 23:29:42 UTC (rev 8889)
@@ -1367,17 +1367,17 @@
 }
 
 /*
-**  Send the current article to all sites that would get it if the
-**  group were created.
+**  Send the current article to all sites that would get it (used
+**  for instance to propagate newgroup control articles or junk articles).
 */
 static void
-ARTsendthegroup(char *name)
+ARTsendthegroup(char *name, char *fromgroup)
 {
   SITE		*sp;
   int		i;
   NEWSGROUP	*ngp;
 
-  for (ngp = NGfind(ARTctl), sp = Sites, i = nSites; --i >= 0; sp++) {
+  for (ngp = NGfind(fromgroup), sp = Sites, i = nSites; --i >= 0; sp++) {
     if (sp->Name != NULL && SITEwantsgroup(sp, name)) {
       SITEmark(sp, ngp);
     }
@@ -2232,8 +2232,13 @@
          * removed (or to the admin group to which the checkgroups is posted),
          * and send it to all sites that would or would have had the group
          * if it were created. */
-        ARTsendthegroup(*groups);
+        ARTsendthegroup(*groups, ARTctl);
         Accepted = true;
+      } else if (innconf->wanttrash && innconf->feedtrash && !innconf->verifygroups) {
+        /* Don't set Accepted in this case, because we may still end
+         * up filing the article in the junk group. */
+        ARTsendthegroup(*groups, ARTjnk);
+        NonExist = true;
       } else {
         NonExist = true;
         /* Check if all the newsgroups listed in the Newsgroups: header of

Modified: lib/innconf.c
===================================================================
--- lib/innconf.c	2010-01-16 16:35:14 UTC (rev 8888)
+++ lib/innconf.c	2010-01-16 23:29:42 UTC (rev 8889)
@@ -158,6 +158,7 @@
     { K(chanretrytime),           UNUMBER  (300) },
     { K(datamovethreshold),       UNUMBER (8192) },
     { K(dontrejectfiltered),      BOOL   (false) },
+    { K(feedtrash),               BOOL   (false) },
     { K(hiscachesize),            UNUMBER  (256) },
     { K(icdsynccount),            UNUMBER   (10) },
     { K(ignorenewsgroups),        BOOL   (false) },

Modified: samples/inn.conf.in
===================================================================
--- samples/inn.conf.in	2010-01-16 16:35:14 UTC (rev 8888)
+++ samples/inn.conf.in	2010-01-16 23:29:42 UTC (rev 8889)
@@ -40,6 +40,7 @@
 #bindaddress:
 #bindaddress6:
 dontrejectfiltered:     false
+feedtrash:              false
 hiscachesize:           256
 ignorenewsgroups:       false
 immediatecancel:        false




More information about the inn-committers mailing list