INN commit: branches/2.4 (7 files)

INN Commit Russ_Allbery at isc.org
Sun Apr 6 09:51:48 UTC 2008


    Date: Sunday, April 6, 2008 @ 02:51:47
  Author: iulius
Revision: 7741

* Checkgroups are now properly propagated even though the
  news server does not carry the groups they are posted to.
* Improve documentation as for the use of "!control,!control.*"
  regarding the propagation of control articles.
* Expand "control*" to "control,control.*" in documentation
  and samples for more accuracy.
* control.cancel is mandatory for innd to start so cancel
  messages are not fed to control.

Modified:
  branches/2.4/doc/man/innd.8
  branches/2.4/doc/man/newsfeeds.5
  branches/2.4/doc/pod/innd.pod
  branches/2.4/doc/pod/newsfeeds.pod
  branches/2.4/frontends/sys2nf.c
  branches/2.4/innd/art.c
  branches/2.4/samples/newsfeeds.in

-----------------------+
 doc/man/innd.8        |   39 +++++++++++++++++++++++++++++++--------
 doc/man/newsfeeds.5   |   29 +++++++++++++++--------------
 doc/pod/innd.pod      |   35 +++++++++++++++++++++++++++--------
 doc/pod/newsfeeds.pod |   29 +++++++++++++++--------------
 frontends/sys2nf.c    |    2 +-
 innd/art.c            |   26 +++++++++++++++++---------
 samples/newsfeeds.in  |   12 ++++++++----
 7 files changed, 114 insertions(+), 58 deletions(-)

Modified: doc/man/innd.8
===================================================================
--- doc/man/innd.8	2008-04-06 09:42:16 UTC (rev 7740)
+++ doc/man/innd.8	2008-04-06 09:51:47 UTC (rev 7741)
@@ -333,13 +333,16 @@
 is normally buffered.  This option changes the log to be unbuffered.
 .SH "CONTROL MESSAGES"
 .IX Header "CONTROL MESSAGES"
-Arriving articles that have a Control header are called \*(L"control
+Arriving articles that have a Control: header are called \*(L"control
 messages\*(R".  Except for cancel messages, these messages are handled by
 \&\fIcontrolchan\fR\|(8) via a feed set up in \fInewsfeeds\fR.
 .PP
 (Cancel messages update the history database, so they must be handled
 internally; the cost of syncing, locking, then unlocking would be too high
-given the number of cancel messages that are received.)
+given the number of cancel messages that are received.  Note that if an
+article is cancelled before it is received by the news server, it will
+be rejected when it arrives since the history database has been updated;
+it is useful for rejecting spam before it arrives.)
 .PP
 The distribution of control messages is different than that of standard
 articles.  Control messages are normally filed into the pseudo-newsgroup
@@ -357,11 +360,14 @@
 given remote site (normally a bad idea), add \f(CW\*(C`control.cancel\*(C'\fR to its
 subscription list.  Normally it's best to exclude the control newsgroups
 from feeds to keep from sending your peers more control messages than they
-care about.
+care about.  That's why the \fInewsfeeds\fR pattern \f(CW\*(C`!control,!control.*\*(C'\fR
+is as often as not specified (adding this pattern do not prevent control
+messages which affect the newsgroups fed to a site from being sent to it).
 .PP
-newgroup and rmgroup control messages receive additional special
+checkgroups, newgroup and rmgroup control messages receive additional special
 treatment.  If one of these control messages is approved and posted to the
-newsgroup being created or removed, the message will be sent to all sites
+newsgroup being created or removed (or to the admin group to which the
+checkgroups is posted), the message will be sent to all sites
 whose subscription patterns would cause them to receive articles posted to
 that group.  For example, if a newgroup control message for a nonexistent
 newsgroup \f(CW\*(C`news.admin.meow\*(C'\fR is received, it will be sent to any site
@@ -372,8 +378,25 @@
 newgroup messages to some \*(L"well\-propagated\*(R" newsgroup; not only will this
 not actually improve their propagation to sites that want such control
 messages, but it will also cause sites that do not want those control
-messages to receive them.
+messages to receive them.  Therefore, assuming that a newgroup control
+message is sent to the group \f(CW\*(C`news.admin.meow\*(C'\fR (specified in the
+Newsgroups: header) in order to create the group \f(CW\*(C`news.admin.meow\*(C'\fR,
+the sites with the following subscription patterns will receive it:
 .PP
+.Vb 4
+\&    *, at news.*
+\&    news.*
+\&    news.*,!control,!control.*
+\&    control,control.*
+.Ve
+.PP
+but the sites with the following subscription patterns will not receive it:
+.PP
+.Vb 2
+\&    *, at news.*,!control,!control.*
+\&    comp.*, at news.*
+.Ve
+.PP
 If a control message is posted to a group whose name ends with the four
 characters \f(CW\*(C`.ctl\*(C'\fR, this suffix is stripped off and the control message is
 propagated as if it were posted to the base group.  For example, a cancel
@@ -384,11 +407,11 @@
 \&\f(CW\*(C`.ctl\*(C'\fR suffix may be removed in a future version of \s-1INN\s0.
 .PP
 Finally, articles posted to newsgroups beginning with \f(CW\*(C`to.\*(C'\fR are treated
-specially.  Provided that either that newsgroup exists in the active file
+specially.  Provided that either that newsgroup exists in the \fIactive\fR file
 or \fImergetogroups\fR is set in \fIinn.conf\fR, the remainder of the newsgroup
 is taken to be a site name, as configured in \fInewsfeeds\fR, and the article
 is sent to that site.  If \fImergetogroups\fR is set, the article will be
-filed in the group named \f(CW\*(C`to\*(C'\fR (which must exist in the active file).  For
+filed in the group named \f(CW\*(C`to\*(C'\fR (which must exist in the \fIactive\fR file).  For
 example, with \fImergetogroups\fR set, an article posted to \f(CW\*(C`to.uunet\*(C'\fR will
 be filed in \f(CW\*(C`to\*(C'\fR and sent to the site \f(CW\*(C`uunet\*(C'\fR.
 .SH "PROTOCOL DIFFERENCES"

Modified: doc/man/newsfeeds.5
===================================================================
--- doc/man/newsfeeds.5	2008-04-06 09:42:16 UTC (rev 7740)
+++ doc/man/newsfeeds.5	2008-04-06 09:51:47 UTC (rev 7741)
@@ -259,9 +259,11 @@
 .PP
 Control messages follow slightly different propagation rules than normal
 articles; see \fIinnd\fR\|(8) for the details.  Note that most subscriptions
-should have \f(CW\*(C`!junk,!control*\*(C'\fR in their pattern list due to those
+should have \f(CW\*(C`!junk,!control,!control.*\*(C'\fR in their pattern list due to those
 propagation rules (and since junk is a special internal newsgroup; see
-\&\fIwanttrash\fR in \fIinn.conf\fR\|(5) for more details on what it's used for).
+\&\fIwanttrash\fR in \fIinn.conf\fR\|(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.
 .PP
 A subscription can be further modified by specifying distributions that
 the site should or should not receive.  The default is to send all
@@ -306,7 +308,7 @@
 the names specified in that exclusion sub-field appear in their Path:
 headers.  If the \f(CW\*(C`ME\*(C'\fR entry has a subscription list, that list is
 prepended to the subscription list of all other entries.  For example,
-\&\f(CW\*(C`*,!control*,!junk,!foo.*\*(C'\fR could be used to set the default subscription
+\&\f(CW\*(C`*,!control,!control.*,!junk,!foo.*\*(C'\fR could be used to set the default subscription
 list for all other feeds so that local postings are not propagated unless
 \&\f(CW\*(C`foo.*\*(C'\fR explicitly appears in the site's subscription list.  This feature
 tends to be somewhat confusing since the default subscription is prepended
@@ -590,7 +592,7 @@
 The newsgroup the article is in; if cross\-posted, then the first of the
 groups to which the article was posted that this site gets.  (The
 difference from \f(CW\*(C`G\*(C'\fR is that this sends the newsgroup to which the article
-was posted even if it's a control message.)
+was posted even if it is a control message.)
 .IP "h" 3
 .IX Item "h"
 The history hash key of the article (derived from the message \s-1ID\s0).
@@ -785,7 +787,7 @@
 The former look like this:
 .PP
 .Vb 1
-\&    feed.example.com:*,!control*,!junk:Tf,Wnm:
+\&    feed.example.com:*,!control,!control.*,!junk:Tf,Wnm:
 .Ve
 .PP
 which generates a file named \fIpathoutgoing\fR/feed.example.com containing
@@ -795,14 +797,14 @@
 The latter look like this:
 .PP
 .Vb 1
-\&    feed.example.com:*,!control*,!junk:Tm:innfeed!
+\&    feed.example.com:*,!control,!control.*,!junk:Tm:innfeed!
 .Ve
 .PP
 Very similar, except that this is the input to a funnel feed named
 \&\f(CW\*(C`innfeed!\*(C'\fR.  One could also write this as:
 .PP
 .Vb 1
-\&    example/feed.example.com:*,!control*,!junk:Ap,Tm:innfeed!
+\&    example/feed.example.com:*,!control,!control.*,!junk:Ap,Tm:innfeed!
 .Ve
 .PP
 (note the \fBAp\fR so that articles that contain just \f(CW\*(C`example\*(C'\fR in the Path:
@@ -887,15 +889,14 @@
 This program only wants information about articles posted to a control
 newsgroup other than control.cancel, which due to the sorting of control
 messages described in \fIinnd\fR\|(8) will send it all control messages except for
-cancel messages provided that control.cancel exists.  In this case, we
-also exclude any article with a distribution of \f(CW\*(C`collabra\-internal\*(C'\fR.
-\&\fBcontrolchan\fR gets the storage \s-1API\s0 token, the name of the sending site
-(for processing old-style ihave and sendme control messages, be sure to
-read about \fIlogipaddr\fR in \fIcontrolchan\fR\|(8)), and the message \s-1ID\s0 for each
-article.
+cancel messages.  In this case, we also exclude any article with a
+distribution of \f(CW\*(C`collabra\-internal\*(C'\fR.  \fBcontrolchan\fR gets the storage
+\&\s-1API\s0 token, the name of the sending site (for processing old-style ihave
+and sendme control messages, be sure to read about \fIlogipaddr\fR in
+\&\fIcontrolchan\fR\|(8)), and the message \s-1ID\s0 for each article.
 .PP
 For many other examples, including examples of the special \f(CW\*(C`ME\*(C'\fR site
-entry, see the example newsfeeds file distributed with \s-1INN\s0.  Also see the
+entry, see the example \fInewsfeeds\fR file distributed with \s-1INN\s0.  Also see the
 install documentation that comes with \s-1INN\s0 for information about setting up
 the standard newsfeeds entries used by most sites.
 .SH "HISTORY"

Modified: doc/pod/innd.pod
===================================================================
--- doc/pod/innd.pod	2008-04-06 09:42:16 UTC (rev 7740)
+++ doc/pod/innd.pod	2008-04-06 09:51:47 UTC (rev 7741)
@@ -228,13 +228,16 @@
 
 =head1 CONTROL MESSAGES
 
-Arriving articles that have a Control header are called "control
+Arriving articles that have a Control: header are called "control
 messages".  Except for cancel messages, these messages are handled by
 controlchan(8) via a feed set up in F<newsfeeds>.
 
 (Cancel messages update the history database, so they must be handled
 internally; the cost of syncing, locking, then unlocking would be too high
-given the number of cancel messages that are received.)
+given the number of cancel messages that are received.  Note that if an
+article is cancelled before it is received by the news server, it will
+be rejected when it arrives since the history database has been updated;
+it is useful for rejecting spam before it arrives.)
 
 The distribution of control messages is different than that of standard
 articles.  Control messages are normally filed into the pseudo-newsgroup
@@ -252,11 +255,14 @@
 given remote site (normally a bad idea), add C<control.cancel> to its
 subscription list.  Normally it's best to exclude the control newsgroups
 from feeds to keep from sending your peers more control messages than they
-care about.
+care about.  That's why the F<newsfeeds> pattern C<!control,!control.*>
+is as often as not specified (adding this pattern do not prevent control
+messages which affect the newsgroups fed to a site from being sent to it).
 
-newgroup and rmgroup control messages receive additional special
+checkgroups, newgroup and rmgroup control messages receive additional special
 treatment.  If one of these control messages is approved and posted to the
-newsgroup being created or removed, the message will be sent to all sites
+newsgroup being created or removed (or to the admin group to which the
+checkgroups is posted), the message will be sent to all sites
 whose subscription patterns would cause them to receive articles posted to
 that group.  For example, if a newgroup control message for a nonexistent
 newsgroup C<news.admin.meow> is received, it will be sent to any site
@@ -267,8 +273,21 @@
 newgroup messages to some "well-propagated" newsgroup; not only will this
 not actually improve their propagation to sites that want such control
 messages, but it will also cause sites that do not want those control
-messages to receive them.
+messages to receive them.  Therefore, assuming that a newgroup control
+message is sent to the group C<news.admin.meow> (specified in the
+Newsgroups: header) in order to create the group C<news.admin.meow>,
+the sites with the following subscription patterns will receive it:
 
+    *, at news.*
+    news.*
+    news.*,!control,!control.*
+    control,control.*
+
+but the sites with the following subscription patterns will not receive it:
+
+    *, at news.*,!control,!control.*
+    comp.*, at news.*
+
 If a control message is posted to a group whose name ends with the four
 characters C<.ctl>, this suffix is stripped off and the control message is
 propagated as if it were posted to the base group.  For example, a cancel
@@ -279,11 +298,11 @@
 C<.ctl> suffix may be removed in a future version of INN.
 
 Finally, articles posted to newsgroups beginning with C<to.> are treated
-specially.  Provided that either that newsgroup exists in the active file
+specially.  Provided that either that newsgroup exists in the F<active> file
 or I<mergetogroups> is set in F<inn.conf>, the remainder of the newsgroup
 is taken to be a site name, as configured in F<newsfeeds>, and the article
 is sent to that site.  If I<mergetogroups> is set, the article will be
-filed in the group named C<to> (which must exist in the active file).  For
+filed in the group named C<to> (which must exist in the F<active> file).  For
 example, with I<mergetogroups> set, an article posted to C<to.uunet> will
 be filed in C<to> and sent to the site C<uunet>.
 

Modified: doc/pod/newsfeeds.pod
===================================================================
--- doc/pod/newsfeeds.pod	2008-04-06 09:42:16 UTC (rev 7740)
+++ doc/pod/newsfeeds.pod	2008-04-06 09:51:47 UTC (rev 7741)
@@ -123,9 +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*> in their pattern list due to those
+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).
+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
@@ -182,7 +184,7 @@
 the names specified in that exclusion sub-field appear in their Path:
 headers.  If the C<ME> entry has a subscription list, that list is
 prepended to the subscription list of all other entries.  For example,
-C<*,!control*,!junk,!foo.*> could be used to set the default subscription
+C<*,!control,!control.*,!junk,!foo.*> could be used to set the default subscription
 list for all other feeds so that local postings are not propagated unless
 C<foo.*> explicitly appears in the site's subscription list.  This feature
 tends to be somewhat confusing since the default subscription is prepended
@@ -484,7 +486,7 @@
 The newsgroup the article is in; if cross-posted, then the first of the
 groups to which the article was posted that this site gets.  (The
 difference from C<G> is that this sends the newsgroup to which the article
-was posted even if it's a control message.)
+was posted even if it is a control message.)
 
 =item h
 
@@ -694,7 +696,7 @@
 
 The former look like this:
 
-    feed.example.com:*,!control*,!junk:Tf,Wnm:
+    feed.example.com:*,!control,!control.*,!junk:Tf,Wnm:
 
 which generates a file named I<pathoutgoing>/feed.example.com containing
 one line per article consisting of the storage API token, a space, and the
@@ -702,12 +704,12 @@
 
 The latter look like this:
 
-    feed.example.com:*,!control*,!junk:Tm:innfeed!
+    feed.example.com:*,!control,!control.*,!junk:Tm:innfeed!
 
 Very similar, except that this is the input to a funnel feed named
 C<innfeed!>.  One could also write this as:
 
-    example/feed.example.com:*,!control*,!junk:Ap,Tm:innfeed!
+    example/feed.example.com:*,!control,!control.*,!junk:Ap,Tm:innfeed!
 
 (note the B<Ap> so that articles that contain just C<example> in the Path:
 header will still be sent), which is completely equivalent except that
@@ -777,15 +779,14 @@
 This program only wants information about articles posted to a control
 newsgroup other than control.cancel, which due to the sorting of control
 messages described in innd(8) will send it all control messages except for
-cancel messages provided that control.cancel exists.  In this case, we
-also exclude any article with a distribution of C<collabra-internal>.
-B<controlchan> gets the storage API token, the name of the sending site
-(for processing old-style ihave and sendme control messages, be sure to
-read about I<logipaddr> in controlchan(8)), and the message ID for each
-article.
+cancel messages.  In this case, we also exclude any article with a
+distribution of C<collabra-internal>.  B<controlchan> gets the storage
+API token, the name of the sending site (for processing old-style ihave
+and sendme control messages, be sure to read about I<logipaddr> in
+controlchan(8)), and the message ID for each article.
 
 For many other examples, including examples of the special C<ME> site
-entry, see the example newsfeeds file distributed with INN.  Also see the
+entry, see the example F<newsfeeds> file distributed with INN.  Also see the
 install documentation that comes with INN for information about setting up
 the standard newsfeeds entries used by most sites.
 

Modified: frontends/sys2nf.c
===================================================================
--- frontends/sys2nf.c	2008-04-06 09:42:16 UTC (rev 7740)
+++ frontends/sys2nf.c	2008-04-06 09:51:47 UTC (rev 7741)
@@ -211,7 +211,7 @@
 
 	SawAll = (strcmp(s, "all") == 0);
 	if (SawAll)
-	    s = SawBang ? "*" : "*,!control";
+	    s = SawBang ? "*" : "*,!control,!control.*";
 	len += strlen(s);
 	fprintf(F, "%s", s);
 

Modified: innd/art.c
===================================================================
--- innd/art.c	2008-04-06 09:42:16 UTC (rev 7740)
+++ innd/art.c	2008-04-06 09:51:47 UTC (rev 7741)
@@ -2166,6 +2166,9 @@
       if (data->Followcount == 0)
 	data->Followcount = data->Groupcount;
     }
+    
+    LikeNewgroup = (LikeNewgroup || strcmp(ControlWord, "checkgroups") == 0);
+    
     /* Control messages to "foo.ctl" are treated as if they were
      * posted to "foo".  I should probably apologize for all the
      * side-effects in the if. */
@@ -2187,14 +2190,15 @@
     if ((ngp = NGfind(p)) == NULL) {
       GroupMissing = true;
       if (LikeNewgroup && Approved) {
-	/* Newgroup/rmgroup being sent to a group that doesn't exist.  Assume
-	 * it is being sent to the group being created or removed, nd send the
-	 * group to all sites that would or would have had the group if it were
-	 * created. */
-	ARTsendthegroup(*groups);
-	Accepted = true;
+        /* Checkgroups/newgroup/rmgroup being sent to a group that doesn't
+         * exist.  Assume it is being sent to the group being created or
+         * 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);
+        Accepted = true;
       } else
-	NonExist = true;
+        NonExist = true;
       ARTpoisongroup(*groups);
 
       if (innconf->mergetogroups) {
@@ -2298,8 +2302,12 @@
     *ngptr++ = ngp;
     for (isp = ngp->Sites, i = ngp->nSites; --i >= 0; isp++) {
       if (*isp >= 0) {
-	sp = &Sites[*isp];
-	SITEmark(sp, ngp);
+        /* Checkgroups/newgroup/rmgroup posted to local.example
+         * will still be sent with the newsfeeds patterns
+         * "*,!local.*" and "*, at local.*".  So as not to propagate
+         * them, "!control,!control.*" should be added. */
+        sp = &Sites[*isp];
+        SITEmark(sp, ngp);
       }
     }
   }

Modified: samples/newsfeeds.in
===================================================================
--- samples/newsfeeds.in	2008-04-06 09:42:16 UTC (rev 7740)
+++ samples/newsfeeds.in	2008-04-06 09:51:47 UTC (rev 7741)
@@ -82,8 +82,11 @@
 
 # A real-time feed through innfeed.  Don't send articles with a distribution
 # of "foo", since those articles are internal.
+# Note that control messages will be sent even though "!control,!control.*"
+# is specified.  It is useful not to forget that pattern since control
+# messages for local.* would still be sent with "*, at local.*" only.
 #news.uu.net/uunet\
-#	:*,!junk,!control*/!foo\
+#	:*,!junk,!control,!control.*/!foo\
 #	:Tm:innfeed!
 
 # Create a batch file in @SPOOLDIR@/outgoing for all articles
@@ -91,12 +94,13 @@
 # be named nic.near.net, the default file name, and either nntpsend or
 # send-nntp can send articles from that spool file.
 #nic.near.net\
-#	:*,!junk,!control*/!foo\
+#	:*,!junk,!control,!control.*/!foo\
 #	:Tf,Wnm:
 
-# A UUCP feed, where we try to keep the "batching" between 4K and 1K.
+# A UUCP feed, where we try to keep the "batching" between 4 KB and 1 KB.
+# You can use send-uucp(8) to process these batch files.
 #ihnp4\
-#	:*,!junk,!control/!foo\
+#	:*,!junk,!control,!control.*/!foo\
 #	:Tf,Wnb,B4096/1024:
 
 



More information about the inn-committers mailing list