INN commit: branches/2.5 (6 files)

INN Commit rra at isc.org
Fri Jan 22 23:39:07 UTC 2010


    Date: Friday, January 22, 2010 @ 15:39:07
  Author: iulius
Revision: 8927

Add a new parameter to inn.conf:  logtrash, used to add a line in the news
log file to report unwanted newsgroups.

Modified:
  branches/2.5/doc/pod/inn.conf.pod
  branches/2.5/doc/pod/innd.pod
  branches/2.5/include/inn/innconf.h
  branches/2.5/innd/art.c
  branches/2.5/lib/innconf.c
  branches/2.5/samples/inn.conf.in

-----------------------+
 doc/pod/inn.conf.pod  |   10 ++++++++++
 doc/pod/innd.pod      |    4 +++-
 include/inn/innconf.h |    1 +
 innd/art.c            |    9 +++++++--
 lib/innconf.c         |    1 +
 samples/inn.conf.in   |    1 +
 6 files changed, 23 insertions(+), 3 deletions(-)

Modified: doc/pod/inn.conf.pod
===================================================================
--- doc/pod/inn.conf.pod	2010-01-22 23:38:16 UTC (rev 8926)
+++ doc/pod/inn.conf.pod	2010-01-22 23:39:07 UTC (rev 8927)
@@ -341,6 +341,9 @@
 the F<newsfeeds> feed pattern) in all newsgroups regardless if they're
 carried locally.  This is a boolean value and the default is false.
 
+The I<logtrash> parameter specifies whether such articles should be logged
+as posted to unwanted newsgroups in the F<news> log file.
+
 =item I<wipcheck>
 
 If INN is offered an article by a peer on one channel, it will return
@@ -1163,6 +1166,13 @@
 is false.  If set to true, see the I<status> parameter for more details
 on how to enable status reporting.
 
+=item I<logtrash>
+
+Whether B<innd> should add a line in the F<news> log file to report
+unwanted newsgroups (that is to say newsgroups not locally carried by the
+news server).  This is a boolean value and the default is true.  It may
+be useful to set it to false when I<wanttrash> is set to true.
+
 =item I<nnrpdoverstats>
 
 Whether nnrpd overview statistics should be logged via syslog.  This can

Modified: doc/pod/innd.pod
===================================================================
--- doc/pod/innd.pod	2010-01-22 23:38:16 UTC (rev 8926)
+++ doc/pod/innd.pod	2010-01-22 23:39:07 UTC (rev 8927)
@@ -449,7 +449,9 @@
 
 Note that when I<wanttrash> is set to true in F<inn.conf> and an article
 is received that isn't posted to any valid newsgroups, it will be accepted
-and logged with two lines, a C<j> line and a minus sign line.
+and logged with two lines, a C<j> line and a minus sign line, unless the
+I<logtrash> parameter is set to false (in which case only the C<j> line
+is written).
 
 B<innd> also makes extensive reports through syslog(3).  The first word of
 the log message will be the name of the site if the entry is site-specific

Modified: include/inn/innconf.h
===================================================================
--- include/inn/innconf.h	2010-01-22 23:38:16 UTC (rev 8926)
+++ include/inn/innconf.h	2010-01-22 23:39:07 UTC (rev 8927)
@@ -149,6 +149,7 @@
     bool logipaddr;             /* Log by host IP address? */
     bool logsitename;           /* Log outgoing site names? */
     bool logstatus;             /* Send a status report to syslog? */
+    bool logtrash;              /* Log unwanted newsgroups? */
     bool nnrpdoverstats;        /* Log overview statistics? */
     bool nntplinklog;           /* Put storage token into the log? */
     unsigned long status;       /* Status file update interval */

Modified: innd/art.c
===================================================================
--- innd/art.c	2010-01-22 23:38:16 UTC (rev 8926)
+++ innd/art.c	2010-01-22 23:39:07 UTC (rev 8927)
@@ -2373,7 +2373,7 @@
 
   /* If !Accepted, then none of the article's newgroups exist in our
    * active file.  Proper action is to drop the article on the floor.
-   * If ngp == GroupPointers, then all the new articles newsgroups are
+   * If ngptr == GroupPointers, then all the new articles newsgroups are
    * "j" entries in the active file.  In that case, we have to file it
    * under junk so that downstream feeds can get it. */
   if (!Accepted || ngptr == GroupPointers) {
@@ -2390,7 +2390,12 @@
                  MaxLength(data->Newsgroups.List[0],
                            data->Newsgroups.List[0]));
       }
-      ARTlog(data, ART_REJECT, cp->Error);
+
+      if (innconf->logtrash) {
+          /* Log the previous reject. */
+          ARTlog(data, ART_REJECT, cp->Error);
+      }
+
       if (!innconf->wanttrash) {
 	if (innconf->remembertrash && (Mode == OMrunning) &&
 	  !NoHistoryUpdate && !InndHisRemember(HDR(HDR__MESSAGE_ID),

Modified: lib/innconf.c
===================================================================
--- lib/innconf.c	2010-01-22 23:38:16 UTC (rev 8926)
+++ lib/innconf.c	2010-01-22 23:39:07 UTC (rev 8927)
@@ -168,6 +168,7 @@
     { K(logipaddr),               BOOL    (true) },
     { K(logsitename),             BOOL    (true) },
     { K(logstatus),               BOOL   (false) },
+    { K(logtrash),                BOOL    (true) },
     { K(maxartsize),              UNUMBER (1000000) },
     { K(maxconnections),          UNUMBER   (50) },
     { K(mergetogroups),           BOOL   (false) },

Modified: samples/inn.conf.in
===================================================================
--- samples/inn.conf.in	2010-01-22 23:38:16 UTC (rev 8926)
+++ samples/inn.conf.in	2010-01-22 23:39:07 UTC (rev 8927)
@@ -160,6 +160,7 @@
 logipaddr:              true
 logsitename:            true
 logstatus:              false
+logtrash:               true
 nnrpdoverstats:         false
 nntplinklog:            false
 #stathist:




More information about the inn-committers mailing list