INN commit: trunk (doc/pod/hook-perl.pod nnrpd/post.c)

INN Commit Russ_Allbery at isc.org
Wed Feb 18 21:19:45 UTC 2009


    Date: Wednesday, February 18, 2009 @ 13:19:45
  Author: iulius
Revision: 8321

Add the possibility to close a connection via filter_nnrpd.pl
(Perl nnrpd filter hook).  The returned string should begin
with "CLOSE" to do that.

Modified:
  trunk/doc/pod/hook-perl.pod
  trunk/nnrpd/post.c

-----------------------+
 doc/pod/hook-perl.pod |   30 +++++++++++++++++++++++-------
 nnrpd/post.c          |    6 ++++++
 2 files changed, 29 insertions(+), 7 deletions(-)

Modified: doc/pod/hook-perl.pod
===================================================================
--- doc/pod/hook-perl.pod	2009-02-18 20:08:11 UTC (rev 8320)
+++ doc/pod/hook-perl.pod	2009-02-18 21:19:45 UTC (rev 8321)
@@ -337,18 +337,34 @@
 the %hdr hash is taken to be article headers and added to the article.
 
 If filter_post() returns something other than the empty string, this
-message is normally returned to the client as an error.  There are two
-exceptions:  If the string returned begins with "DROP", the post will be
-silently discarded and success returned to the client.  If the string
-begins with "SPOOL", success is returned to the client, but the post is
-saved in a directory named "spam" under the directory specified by
-pathincoming in F<inn.conf> (in a directory named "spam/mod" if the post
+message is normally returned to the client as an error.  There are three
+exceptions:
+
+=over 4
+
+=item *
+
+If the string returned begins with C<CLOSE>, the post will be discarded
+and the connection closed with a C<400> response code.
+
+=item *
+
+If the string returned begins with C<DROP>, the post will be
+silently discarded and success returned to the client.
+
+=item *
+
+If the string begins with C<SPOOL>, success is returned to the client, but
+the post is saved in a directory named F<spam> under the directory specified by
+I<pathincoming> in F<inn.conf> (in a directory named F<spam/mod> if the post
 is to a moderated group).  This is intended to allow manual inspection of
 the suspect messages; if they should be posted, they can be manually moved
-out of the subdirectory to the directory specified by pathincoming in
+out of the subdirectory to the directory specified by I<pathincoming> in
 F<inn.conf>, where they can be posted by running C<rnews -U>.  If you use
 this functionality, make sure those directories exist.
 
+=back
+
 =head1 Changes to Perl Authentication Support for nnrpd
 
 The old authentication functionality has been combined with the new

Modified: nnrpd/post.c
===================================================================
--- nnrpd/post.c	2009-02-18 20:08:11 UTC (rev 8320)
+++ nnrpd/post.c	2009-02-18 21:19:45 UTC (rev 8321)
@@ -1056,6 +1056,12 @@
 		return SpoolitTo(article, p, SDir);
             }
 	}
+        else if (strncmp(p, "CLOSE", 5) == 0) {
+            syslog(L_NOTICE, "%s post %s", Client.host, p);
+            Reply("%d NNTP server unavailable; no posting\r\n",
+                  NNTP_FAIL_TERMINATING);
+            ExitWithStats(1, true);
+        }
 	else
 	{
 	    if (modgroup)




More information about the inn-committers mailing list