INN commit: trunk/control (perl-nocem.in)

INN Commit Russ_Allbery at isc.org
Sun Nov 4 18:36:43 UTC 2007


    Date: Sunday, November 4, 2007 @ 10:36:42
  Author: iulius
Revision: 7699

* Typos.
* Fix the count of the time spent in do_nocem():  the $start and $diff
  variables were consecutive.
* Use "%d" instead of "$nr" in sprintf.
* Documentation fixes:
    * perl-nocem does not expect a message but a token.
    * Add "--no-default-keyring" because gpg otherwise uses the one
      in ~/.gnupg (strange).
    * It is news.lists.filters and not news.lists.filter.

Modified:
  trunk/control/perl-nocem.in

---------------+
 perl-nocem.in |   43 +++++++++++++++++++++++++------------------
 1 file changed, 25 insertions(+), 18 deletions(-)

Modified: perl-nocem.in
===================================================================
--- perl-nocem.in	2007-10-05 11:18:57 UTC (rev 7698)
+++ perl-nocem.in	2007-11-04 18:36:42 UTC (rev 7699)
@@ -39,7 +39,7 @@
 #    return 1;
 #}
 
-# no user servicable parts below this line ###################################
+# no user serviceable parts below this line ###################################
 
 # global variables
 my ($working, $got_sighup, $got_sigterm, @ncmperm, $cancel);
@@ -102,6 +102,7 @@
 # Process one NoCeM notice.
 sub do_nocem {
     my $token = shift;
+    my $start = time;
 
     # open the article and verify the notice
     my $artfh = open_article($token);
@@ -112,11 +113,10 @@
 
     &$cancel($nocems);
     logmsg("Articles cancelled: " . join(' ', @$nocems), 'debug');
-    my $start = time;
     my $diff = (time - $start) || 0.01;
     my $nr = scalar @$nocems;
-    logmsg(sprintf("processed notice %s by %s ($nr ids, %.5f s, %.1f/s)",
-        $nid, $issuer, $diff, $nr / $diff));
+    logmsg(sprintf("processed notice %s by %s (%d ids, %.5f s, %.1f/s)",
+        $nid, $issuer, $nr, $diff, $nr / $diff));
 }
 
 # - Check if it is a PGP signed NoCeM notice
@@ -191,7 +191,7 @@
 #        return;
 #    }
 
-    # we do want it, so read the entire article. Also copy it to
+    # We do want it, so read the entire article.  Also copy it to
     # a temp file so that we can check the PGP signature when done.
     my $tmpfile = "$INN::Config::pathtmp/nocem.$$";
     if (not open(OFD, ">$tmpfile")) {
@@ -299,7 +299,8 @@
             return 0;
         }
     }
-#    logmsg("Command line was: $INN::Config::gpg $pgpargs $art", 'debug');
+#    logmsg("Command line was: $INN::Config::gpgv --status-fd=1"
+#         . ($keyring ? ' --keyring=' . $keyring : '') . " $art", 'debug');
 #    logmsg("Full PGP output: >>>$_<<<", 'debug');
 
     if (/^\[GNUPG:\]\s+GOODSIG\s+\S+\s+(.*)/m) {
@@ -347,7 +348,7 @@
     return undef;
 }
 
-# Cancel a number of message-ids. We use ctlinnd to do this,
+# Cancel a number of Message-IDs.  We use ctlinnd to do this,
 # and we run up to 15 of them at the same time (10 usually).
 sub cancel_ctlinnd {
     my @ids = @{$_[0]};
@@ -488,7 +489,7 @@
 
 =head1 SYNOPSIS
 
-perl-nocem < I<message>
+perl-nocem
 
 =head1 DESCRIPTION
 
@@ -501,7 +502,7 @@
 messages.
 
 B<perl-nocem> processes third-party, PGP-signed article cancellation
-notices. It is possible not to honour all NoCeM notices but only those
+notices.  It is possible not to honour all NoCeM notices but only those
 which are sent by people whom you trust (that is to say if you trust
 the PGP key they use to sign their NoCeM notices).  Indeed, it is up
 to you to decide whether you wish to honour their notices, depending
@@ -516,7 +517,7 @@
 Import the keys of the NoCeM issuers you trust in order to check
 the authenticity of their notices.  You can do:
 
-    gpg --primary-keyring <pathetc>/pgp/ncmring.gpg --import <key-file>
+    gpg --no-default-keyring --primary-keyring <pathetc>/pgp/ncmring.gpg --import <key-file>
 
 where <pathetc> is the value of the I<pathetc> parameter set in F<inn.conf>
 and <key-file> the file containing the key(s) to import.  The keyring
@@ -550,16 +551,17 @@
 
 Add to the F<newsfeeds> file an entry like this one in order to feed
 B<perl-nocem> the NoCeM notices posted to alt.nocem.misc and
-news.lists.filter:
+news.lists.filters:
 
-    nocem!:!*,alt.nocem.misc,news.lists.filter\
+    nocem!\
+        :!*,alt.nocem.misc,news.lists.filters\
         :Tc,Wf,Ap:<pathbin>/perl-nocem
 
 with the correct path to B<perl-nocem>, located in <pathbin>.  Then, reload
 the F<newsfeeds> file (C<ctlinnd reload newsfeeds 'NoCeM channel feed'>).
 
 Note that you should at least carry news.lists.filters on your news
-server or other newsgroups where NoCeM notices are sent if you wish
+server (or other newsgroups where NoCeM notices are sent) if you wish
 to process them.
 
 =item 4.
@@ -567,14 +569,19 @@
 Everything should now work.  However, do not hesitate to manually test
 B<perl-nocem> with a NoCeM notice, using:
 
-    perl-nocem < /path/to/a/notice
+    grephistory '<Message-ID>' | perl-nocem
 
+Indeed, B<perl-nocem> expects tokens on its standard input, and
+B<grephistory> can easily give it the token of a known article,
+thanks to its Message-ID.
+
+=back
+
 When you have verified that everything works, you can eventually turn
 off regular spam cancels, if you want, not processing any longer
-cancels containing C<cyberspam> in the Path: header.
+cancels containing C<cyberspam> in the Path: header (see the
+I<refusecybercancels> parameter in F<inn.conf>).
 
-=back
-
 =head1 FILES
 
 =over 4
@@ -613,6 +620,6 @@
 
 =head1 SEE ALSO
 
-gpgv(1), newsfeeds(5), pgp(1).
+gpgv(1), grephistory(1), inn.conf(5), newsfeeds(5), pgp(1).
 
 =cut



More information about the inn-committers mailing list