🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
17 messages
17 total messages Started by Brian Edmonds Wed, 29 Apr 1998 00:00
cancelling from the perl filter (was Spam Cancel Moratorium, where next?)
#27895
Author: Brian Edmonds
Date: Wed, 29 Apr 1998 00:00
20 lines
2320 bytes
Chris Lewis <clewis@ferret.ocunix.on.ca> writes:
> Whenever the filter recognizes a spam, it could launch something to
> retroactively nuke anything in the file with the same MD5 signature.

I can see in my head trivially how to implement this in my filter,
except for the part about nuking.  At present all I can imagine is some
hack involving logging msgids to a file and having a cron job deal with
it externally.

What I'd really love is some way to do callbacks from the filter to innd
so I can just call whatever C function does the cancelling and feed it
the msgids to zap.

-- 
 o         Brian Edmonds <bedmonds@cs.ubc.ca>, Team Jubal Mech Labs
 \\_/\_,   Moderator: rec.arts.anime.creative, rec.music.info/reviews
(*)   (*)  Are you tired of spam?  Visit http://www.spam.abuse.net/spam/

Re: cancelling from the perl filter (was Spam Cancel Moratorium, where next?)
#27888
Author: Chris Lewis
Date: Wed, 29 Apr 1998 00:00
33 lines
1930 bytes
In article <37pvi0e6dt.fsf_-_@cascade.cs.ubc.ca>,
Brian Edmonds  <bedmonds@cs.ubc.ca> wrote:
>Chris Lewis <clewis@ferret.ocunix.on.ca> writes:
>> Whenever the filter recognizes a spam, it could launch something to
>> retroactively nuke anything in the file with the same MD5 signature.

>I can see in my head trivially how to implement this in my filter,
>except for the part about nuking.  At present all I can imagine is some
>hack involving logging msgids to a file and having a cron job deal with
>it externally.

That was my first cut... ;-)

>What I'd really love is some way to do callbacks from the filter to innd
>so I can just call whatever C function does the cancelling and feed it
>the msgids to zap.

If you remembered the messageids in-core, t'would be nice if the
filter could access the history file...

Mind you, the in-core messageid list would get humungous.
Use another dbm.

Not another dbm! ;-)

How about storing the MD5 hash in the history file as a pseudo group
reference?
-- 
For more information on spam, see http://spam.abuse.net/spam
Fight spam, support Rep. Chris Smith's TCPA extension: http://www.cauce.org

Re: cancelling from the perl filter (was Spam Cancel Moratorium, where next?)
#27901
Author: Brian Edmonds
Date: Thu, 30 Apr 1998 00:00
22 lines
2419 bytes
Chris Lewis <clewis@ferret.ocunix.on.ca> writes:
> Mind you, the in-core messageid list would get humungous.

Well, I'd just stuff them into the hash cache, as that expires
automagically.  I already do a bit of processing when removing old
entries, so all I need to do is add a check to see if the hash is in the
EMP cache, and if so, cancel the message.  This could still miss a few,
but I bet it would get over 95% of pre-BI spam articles, which would be
enough to keep me happy

Even better if I could tell innd to put the cancel. msgid into the
history file too.  Both for these cancels, and for normal rejects.  I
suppose with the external logging approach I could do this with a
special reject in the filter for a bogus pseudosite.

-- 
 o         Brian Edmonds <bedmonds@cs.ubc.ca>, Team Jubal Mech Labs
 \\_/\_,   Moderator: rec.arts.anime.creative, rec.music.info/reviews
(*)   (*)  Are you tired of spam?  Visit http://www.spam.abuse.net/spam/

Re: Proof of Concept (was cancelling from the perl filter)
#27902
Author: Brian Edmonds
Date: Thu, 30 Apr 1998 00:00
16 lines
2092 bytes
Silas Dunsmore <silasd@user.psyber.com> writes:
> It uses the "ICC" interface to INN.  This is basically a socket that
> innd watches for commands on.  It's actually the mechanism that
> ctlinnd itself uses to talk to innd.

Hmm, how does that work?  I thought the perl filter blocks innd.  If
this is a safe method, it sounds pretty cool to me.  Are there ways of
using this channel to insert dummy articles into the history file?

-- 
 o         Brian Edmonds <bedmonds@cs.ubc.ca>, Team Jubal Mech Labs
 \\_/\_,   Moderator: rec.arts.anime.creative, rec.music.info/reviews
(*)   (*)  Are you tired of spam?  Visit http://www.spam.abuse.net/spam/

Re: cancelling from the perl filter (was Spam Cancel Moratorium, where next?)
#27905
Author: Silas Dunsmore
Date: Thu, 30 Apr 1998 00:00
47 lines
2601 bytes
In article <6i8868$vf@bcarh8ab.bnr.ca>,
Chris Lewis <clewis@ferret.ocunix.on.ca> wrote:
>In article <37pvi0e6dt.fsf_-_@cascade.cs.ubc.ca>,
>
>>What I'd really love is some way to do callbacks from the filter to innd
>>so I can just call whatever C function does the cancelling and feed it
>>the msgids to zap.
>
>If you remembered the messageids in-core, t'would be nice if the
>filter could access the history file...
>
>Mind you, the in-core messageid list would get humungous.
>Use another dbm.

I don't think it'd get that huge.  Each hash entry already uses somewhere
around a hundred bytes.  (32 for the MD5 hash in hex, 8 or 12 or so for
Perl's hash of that hash value, and 60-odd for the hit-counter anonymous
variable.  Yes, Perl variables are really that big.)

Converting the hit-counter to something like

	$md5history{$md5hash} = "<message-id1><message-id2><...>"

would use maybe three hundred bytes for a filled-up hash entry.
Remember that there will be at most four message-ids under the default
settings, because it becomes EMP at the fifth identical message body.

Hit-counting could still be done relatively quickly, by scanning the
string for the "<" character.

The big problem, as Brian said, is telling INND what to do about these
message-ids.  Perhaps the filter could just unlink() them itself?
They'd still be in the overview data, though.

-- 
Later, eh?    Silas

Computer sounds as camera moves in to closeup on lasagna's convolutions.

Narrator(voice over): To duplicate your brain with state-of-the-art technology
               would require a computer one hundred stories high ... and as big
               around as the State of Texas.  And it is the last taboo organ of
               the body.  In an age of sexual freedom, the Mind Police arrest
               anyone suspected of enjoying their brains.

Re: cancelling from the perl filter (was Spam Cancel Moratorium, where next?)
#27909
Author: Jeff Garzik
Date: Thu, 30 Apr 1998 00:00
22 lines
1527 bytes
Brian Edmonds (bedmonds@cs.ubc.ca) wrote:
: Chris Lewis <clewis@ferret.ocunix.on.ca> writes:
: > Whenever the filter recognizes a spam, it could launch something to
: > retroactively nuke anything in the file with the same MD5 signature.

: What I'd really love is some way to do callbacks from the filter to innd
: so I can just call whatever C function does the cancelling and feed it
: the msgids to zap.

That's pretty easy, just suck the information out of the Perl
environment once filter_art() returns.  Pore through the embedded
Perl docs and XS stuff; it's not as yucky as it seems, once you get
past the syntax.

-- 
Jeff Garzik			    Typhoon, Cyclone, Diablo, and INN
http://www.spinne.com/usenet/	           News tuning and consulting



Proof of Concept (was cancelling from the perl filter)
#27910
Author: Silas Dunsmore
Date: Thu, 30 Apr 1998 00:00
270 lines
9647 bytes
In article <37pvi0e6dt.fsf_-_@cascade.cs.ubc.ca>,
Brian Edmonds  <bedmonds@cs.ubc.ca> wrote:
>
>I can see in my head trivially how to implement this in my filter,
>except for the part about nuking.  At present all I can imagine is some
>hack involving logging msgids to a file and having a cron job deal with
>it externally.
>
>What I'd really love is some way to do callbacks from the filter to innd
>so I can just call whatever C function does the cancelling and feed it
>the msgids to zap.

I had extreme insomnia tonight, so I gutted a local canceller I'd written
a few months ago, and inserted the pieces into cleanfeed.

It uses the "ICC" interface to INN.  This is basically a socket that
innd watches for commands on.  It's actually the mechanism that ctlinnd
itself uses to talk to innd.

I've appended diffs against a stock cleanfeed-0.95.5a.

Be warned!  This is rough code.  It has hardcoded stuff all through it, 
and it's not thouroughly tested.  Don't run it on a production machine!

On the other hand, it ran for over an hour with no major problems.
It was slow, because of the extra debugging logging I inserted, but
it was functional.

Somebody take this and make it better, please.

Me for bed.

-- 
Later, eh?    Silas

CUT TO:        The Mercator map, with animation.

Narrator(voice over): The so-called Norway rat actually originated in Southeast
               Asia.

A dot appears in Cambodia.




=== This is a patch against cleanfeed-0.95.5a/cleanfeed
--- cleanfeed	Fri Apr  3 13:40:23 1998
+++ cleanfeed.work	Thu Apr 30 02:27:51 1998
@@ -505,14 +505,29 @@
             # MD5 checksums
 	    if (defined $md5hash) {
 		push @md5history, $md5hash;
-		$md5history{$md5hash}++;
+		##$md5history{$md5hash}++;
+
+                # this has been changed to keep track of the actual
+                # message-ids involved.
+                $md5history{$md5hash} .= $hdr{'Message-ID'};
+
+ICCnote("Added ${hdr{'Message-ID'}} to $md5hash");
 	    }
 
 	    # if post appears more than high limit, save for
 	    # continual rejection, outside of history window
-	    if ((defined $md5hash) and ($md5history{$md5hash} > $config{'md5maxmultiposts'})) {
+	    ##if ((defined $md5hash) and ($md5history{$md5hash} > $config{'md5maxmultiposts'})) {
+	    if ((defined $md5hash) and
+                    (( $md5history{$md5hash} =~ tr/<// )
+                     > $config{'md5maxmultiposts'})) {
 	        md5savehist ($md5hash);
 	        $empreturn = "New EMP detected (md5)";
+
+ICCnote("Scanning $md5hash for saved IDs");
+                while ( $md5history{$md5hash} =~ /(<[^>]+>)/g ) {
+                    cancel_mid( $1 );
+                }
+
 	    } elsif ((defined $hash2) and ($history{$hash2} > $config{'maxmultiposts'})) {
 		savehist ($hash2);
 		$empreturn = "New EMP detected (ph/l)";
@@ -531,7 +546,26 @@
 	    while (scalar @md5history > $config{'MD5History'}) {
 		$tmp_hist = shift @md5history;
 		next unless (exists $md5history{$tmp_hist});
-		delete $md5history{$tmp_hist} if ($md5history{$tmp_hist}-- < 2);
+		##delete $md5history{$tmp_hist} if ($md5history{$tmp_hist}-- < 2);
+
+ICCnote("Cleaning MD5 $tmp_hist");
+ICCnote("Old value is ${md5history{$tmp_hist}}");
+
+                # chop out the first message-id
+                ( $md5history{$tmp_hist} ) = 
+                        ( $md5history{$tmp_hist} =~ /^<[^>]+>(.*)$/ );
+
+ICCnote("New value is ${md5history{$tmp_hist}}");
+
+                # delete the entry if there's nothing left
+                delete $md5history{$tmp_hist} if $md5history{$tmp_hist} eq '';
+
+                # delete the entry if there's only one message-id left
+                delete $md5history{$tmp_hist} if 
+                       $md5history{$tmp_hist} =~ /^<[^>]+>$/;
+
+ICCnote("Deleted entry for $tmp_hist") if not exists $md5history{$tmp_hist};
+
 	    }
 
 	    return reject ($empreturn) unless ($empreturn eq "");
@@ -754,3 +788,158 @@
     close FILE;
 }
 
+
+
+# from here on down is routines modified from a standalone local canceller
+require 5.003;
+use integer;
+use strict 'subs', 'refs';
+
+use Socket;
+use Fcntl;
+
+
+$ICCdir = "/var/run/news";
+$ICCservername = "$ICCdir/control";             # belongs to INND
+$ICCclientname = "$ICCdir/cleanfeed-out";       # belongs to us
+
+$ICClogfile = "/tmp/cleanfeed-ICC-logfile";     # logging for debugging
+
+sub ICCerror(@) {
+    $ICCokay = 0;                       # remember that we have had a problem.
+
+    return if not defined $ICClogfile;
+
+    # turn autoflush on, since something abnormal has occured.
+    select( (select(ICCLOG), $| = 1)[0] );
+    
+    # log the error message.
+    print ICCLOG @_, "\n";
+
+}
+
+
+sub ICCnote(@) {
+    return if not defined $ICClogfile;
+
+    # log the note
+    print ICCLOG @_, "\n";
+}
+
+
+# this ought to be rewritten to handle the named-pipe variant of the
+# interface as well as the unix datagram socket variant.
+#
+# it should also be rewritten to gracefully handle multiple calls to
+# the setup and/or close routines.
+sub setup_cancel_socket() {
+
+    open( ICCLOG, ">>$ICClogfile" ) or undef $ICClogfile
+        if defined $ICClogfile;
+
+    $ICCokay = 1;                       # assume okay until something fails.
+
+    ICCnote( "Opening socket at GMT ", scalar gmtime() );
+
+    $ICCserver = pack_sockaddr_un( $ICCservername );
+
+    $ICCclient = pack_sockaddr_un( $ICCclientname );
+
+    socket( ICCSOCKET, AF_UNIX, SOCK_DGRAM, 0 ) or 
+        ICCerror( "failed to create local socket $ICCclientname" )
+            if $ICCokay;
+
+    bind( ICCSOCKET, $ICCclient ) or
+        ICCerror( "failed to bind local socket $ICCclientname" )
+            if $ICCokay;
+
+    # fcntl() returns "0 but true" for 0, isn't that convenient?
+    fcntl( ICCSOCKET, F_SETFL, O_NONBLOCK ) or
+        ICCerror( "failed to set local socket to nonblocking" )
+            if $ICCokay;
+
+    ICCnote( "Opened the socket, everything okay so far" ) if $ICCokay;
+}
+
+
+sub close_cancel_socket() {
+    ICCnote( "Closing socket at GMT ", scalar gmtime() );
+
+    close( ICCSOCKET ) or
+        ICCerror( "Problem closing socket's file descriptor!" );
+
+    unlink( $ICCclientname ) or
+        ICCerror( "Problem removing socket's control file!" );
+
+    close( ICCLOG ) if defined $ICClogfile;
+}
+
+
+# Warning!  This routine should only be used to cancel Message-IDs that
+# are KNOWN TO EXIST in the history file.  See the ncmspcancel.c source
+# for details on a workaround for a bug involving cancels of never-seen
+# articles.
+#
+# This routine is currently coded asynchronously -- it may not get a
+# response from the server, or it may get several.  Further, there isn't
+# a mapping between commands and responses.
+#
+# Note that most of the error-handling code has not been tested.
+#
+# Note the HORRIBLE hardcoded ctlinnd/ICC interface!
+# This was a quick hack.  It would be much better to convert inndcomm.h
+# to a .ph file and use the symbolic names.  Probably.
+sub cancel_mid($) {
+    my($mid) = @_;
+    my($msg, $rsp);
+
+    ICCnote( "ICC not okay, skipping cancel of $mid" ) if not $ICCokay;
+    return if not $ICCokay;
+
+    ICCnote( "Issuing local cancel for $mid" );
+
+    # \x01 is the seperator between commands & parameters.
+    # \x00 is the terminator for the command.
+    # c is the constant for cancels.
+    # $mid is the Message-ID to cancel.
+    # $ICCclientname is the socket that we want responses sent to.
+    $msg = $ICCclientname . "\x01" . "c" . "\x01" . $mid . "\x00";
+
+    # ana* is a pack command-string: asciichar, networkshort, asciichars.
+    # a is the protocol version.
+    # length of the (entire) message.
+    # the message itself.
+    $msg = pack( 'ana*', 'a', length($msg) + 3, $msg );        
+
+    send( ICCSOCKET, $msg, 0, $ICCserver ) or
+        ICCerror( "Couldn't send() to $ICCservername !" );
+
+    # this could be used to check if something's out of control.
+    $ICCpending++;
+
+    # paranoia -- ensure that the variable exists with valid data
+    $rsp = '';
+
+    # are there any responses waiting yet?
+    # the socket is non-blocking & asynchronous, so a response might
+    # not be here yet... or there could be several!
+    while( recv( ICCSOCKET, $rsp, 4096, 0) ) {
+        # ought to check for problems here...
+        if( $rsp ne pack( 'ana*', 'a', 7, "0 Ok" ) ) {
+            ICCnote( "recv(): unexpected INND ICC response: $rsp" );
+        }
+        $ICCpending--;
+    }
+
+}
+
+
+# at startup
+setup_cancel_socket();
+
+# at shutdown -- does this work?
+sub filter_end () {
+    close_cancel_socket();
+}
+
+# close/open using the before/after reload hooks as well?

Re: Proof of Concept (was cancelling from the perl filter)
#27911
Author: Silas Dunsmore
Date: Thu, 30 Apr 1998 00:00
37 lines
2140 bytes
In article <373eevwd9e.fsf@cascade.cs.ubc.ca>,
Brian Edmonds  <bedmonds@cs.ubc.ca> wrote:
>Silas Dunsmore <silasd@user.psyber.com> writes:
>> It uses the "ICC" interface to INN.  This is basically a socket that
>> innd watches for commands on.  It's actually the mechanism that
>> ctlinnd itself uses to talk to innd.
>
>Hmm, how does that work?  I thought the perl filter blocks innd.  If

I think you're right about the blocking.  But the socket is used
asynchronously here.  The message(s) will just sit in the socket's
queue until innd has a chance to process them... then the responses
will sit in the local-socket until the perl filter checks them.

>this is a safe method, it sounds pretty cool to me.  Are there ways of
>using this channel to insert dummy articles into the history file?

Not at present, not as written.  It could be done, mind.  But there is
some issue about inserting new history entries via the ctlinnd cancel
mechanism.

IIRC, you try to add a new history entry, and if that _fails_, issue
the cancel command.  It's been months since I looked into it, so the
details have faded on me.  Consult ncmspcancel.c from the ncmsp package
for details on this.

To do all this asynchronously, you'd have to keep a _lot_ of state
information around.

-- 
Later, eh?    Silas

Dobbs:         I stole it from Dr. Frankenstein's laboratory myself.  Highest-
               quality human brain available.

Re: Proof of Concept (was cancelling from the perl filter)
#27915
Author: Jeff Garzik
Date: Thu, 30 Apr 1998 00:00
24 lines
1604 bytes
Andrew Gierth (andrew@erlenstar.demon.co.uk) wrote:
: >>>>> "Brian" == Brian Edmonds <bedmonds@cs.ubc.ca> writes:
: 
:  > Silas Dunsmore <silasd@user.psyber.com> writes:
:  >> It uses the "ICC" interface to INN.  This is basically a socket that
:  >> innd watches for commands on.  It's actually the mechanism that
:  >> ctlinnd itself uses to talk to innd.
: 
:  Brian> Hmm, how does that work?  I thought the perl filter blocks innd.
: 
: It does, but if the perl filter sends a message to the control channel
: without waiting for an answer....

Bad assumption that fails whenever you have too much data for the
internal buffer to handle.

-- 
Jeff Garzik			    Typhoon, Cyclone, Diablo, and INN
http://www.spinne.com/usenet/	           News tuning and consulting



Re: cancelling from the perl filter (was Spam Cancel Moratorium, where next?)
#27917
Author: greg
Date: Thu, 30 Apr 1998 00:00
43 lines
2371 bytes
clewis@ferret.ocunix.on.ca (Chris Lewis) writes:

> In article <37pvi0e6dt.fsf_-_@cascade.cs.ubc.ca>,
> Brian Edmonds  <bedmonds@cs.ubc.ca> wrote:
> >I can see in my head trivially how to implement this in my filter,
> >except for the part about nuking.  At present all I can imagine is some
> >hack involving logging msgids to a file and having a cron job deal with
> >it externally.
> 
> That was my first cut... ;-)

Just steal the fastcancel program from c-nocem.  That's especially
convenient if you're already filling in the gaps with it anyway.

> >What I'd really love is some way to do callbacks from the filter to innd
> >so I can just call whatever C function does the cancelling and feed it
> >the msgids to zap.
> 
> If you remembered the messageids in-core, t'would be nice if the
> filter could access the history file...

Has anyone been crazy enough to try using the DBZ_File module on
history from within the perl filter?

> Mind you, the in-core messageid list would get humungous.
> Use another dbm.
> 
> Not another dbm! ;-)

Could be kind of slow, maybe not so bad if the ID/hash pairs are
logged or piped to a separate cleaner-upper process thingy to handle.
That also conveniently avoids having to figure out the callback
problem =)

> How about storing the MD5 hash in the history file as a pseudo group
> reference?

Still ugly if you want to go back and get something that hit a
different threshold than MD5.  Big problem, since those are the ones
that trigger on higher counts =(

Re: cancelling from the perl filter (was Spam Cancel Moratorium, where next?)
#27919
Author: Jeff Garzik
Date: Thu, 30 Apr 1998 00:00
23 lines
1554 bytes
greg (greg@meow.org) wrote:
: clewis@ferret.ocunix.on.ca (Chris Lewis) writes:
: > >What I'd really love is some way to do callbacks from the filter to innd
: > >so I can just call whatever C function does the cancelling and feed it
: > >the msgids to zap.
: > 
: > If you remembered the messageids in-core, t'would be nice if the
: > filter could access the history file...
: 
: Has anyone been crazy enough to try using the DBZ_File module on
: history from within the perl filter?

In all but the latest innd, module support requires a patch.  (Is the
patch available on jeremy@exit109's site?)

-- 
Jeff Garzik			    Typhoon, Cyclone, Diablo, and INN
http://www.spinne.com/usenet/	           News tuning and consulting



Re: cancelling from the perl filter (was Spam Cancel Moratorium, where next?)
#27920
Author: Chris Lewis
Date: Thu, 30 Apr 1998 00:00
36 lines
2084 bytes
In article <37pvi0e6dt.fsf_-_@cascade.cs.ubc.ca>,
Brian Edmonds  <bedmonds@cs.ubc.ca> wrote:
>Chris Lewis <clewis@ferret.ocunix.on.ca> writes:
>> Whenever the filter recognizes a spam, it could launch something to
>> retroactively nuke anything in the file with the same MD5 signature.

>I can see in my head trivially how to implement this in my filter,
>except for the part about nuking.  At present all I can imagine is some
>hack involving logging msgids to a file and having a cron job deal with
>it externally.

Some ideas:

If this is a INN perl filter, access the history file (can you
do this inside a filter?), and there you go.

If the messageids are incore, but history is inaccessible, you could
call out to grephistory to find the file name[s], and nuke that way.

>What I'd really love is some way to do callbacks from the filter to innd
>so I can just call whatever C function does the cancelling and feed it
>the msgids to zap.

You may be able to do this with cleanfeed if you add in stubs in
the perl to advertise the C function interfaces.

[Oooh, perl dynamically linked into INN, doing call backs into INN.
Makes my head hurt. ;-)]
-- 
Chris Lewis, CyberSheriff (CBC says I am, so it must be true!)

For more information on spam, see http://spam.abuse.net/spam
Fight spam, support Rep. Chris Smith's TCPA extension: http://www.cauce.org

Re: Proof of Concept (was cancelling from the perl filter)
#27921
Author: Andrew Gierth
Date: Thu, 30 Apr 1998 00:00
23 lines
1639 bytes
>>>>> "Brian" == Brian Edmonds <bedmonds@cs.ubc.ca> writes:

 > Silas Dunsmore <silasd@user.psyber.com> writes:
 >> It uses the "ICC" interface to INN.  This is basically a socket that
 >> innd watches for commands on.  It's actually the mechanism that
 >> ctlinnd itself uses to talk to innd.

 Brian> Hmm, how does that work?  I thought the perl filter blocks innd.

It does, but if the perl filter sends a message to the control channel
without waiting for an answer....

 Brian> If this is a safe method, it sounds pretty cool to me.  Are
 Brian> there ways of using this channel to insert dummy articles into
 Brian> the history file?

Yup. (As used by, for example, ctlinnd addhist)

-- 
Andrew.

Re: Proof of Concept (was cancelling from the perl filter)
#27923
Author: Jeff Garzik
Date: Thu, 30 Apr 1998 00:00
23 lines
1644 bytes
Brian Edmonds (bedmonds@cs.ubc.ca) wrote:
: Silas Dunsmore <silasd@user.psyber.com> writes:
: > It uses the "ICC" interface to INN.  This is basically a socket that
: > innd watches for commands on.  It's actually the mechanism that
: > ctlinnd itself uses to talk to innd.

: Hmm, how does that work?  I thought the perl filter blocks innd.  If
: this is a safe method, it sounds pretty cool to me.  Are there ways of
: using this channel to insert dummy articles into the history file?

My question exactly.  Has this code been tested, even in the roughest
sense?  IMHO callbacks and data returns via the embedded Perl interface
are going to be the best way to go, until innd becomes multithreaded or
something similar.

-- 
Jeff Garzik			    Typhoon, Cyclone, Diablo, and INN
http://www.spinne.com/usenet/	           News tuning and consulting



Re: cancelling from the perl filter (was Spam Cancel Moratorium, where next?)
#27924
Author: greg
Date: Thu, 30 Apr 1998 00:00
14 lines
1397 bytes
jgarzik@normnet.org (Jeff Garzik) writes:
> greg (greg@meow.org) wrote:
> : Has anyone been crazy enough to try using the DBZ_File module on
> : history from within the perl filter?
> 
> In all but the latest innd, module support requires a patch.  (Is the
> patch available on jeremy@exit109's site?)

The dynaloader patch is in the Cleanfeed tarball, since it's needed
for MD5.  My worry is about how INN would react to having this rude
little script messing with its favorite file.

Re: Proof of Concept (was cancelling from the perl filter)
#27927
Author: Silas Dunsmore
Date: Thu, 30 Apr 1998 00:00
31 lines
1811 bytes
In article <fo121.5129$Fu5.4163157@news2.teleport.com>,
Jeff Garzik <jgarzik@normnet.org> wrote:
>
>My question exactly.  Has this code been tested, even in the roughest
>sense?  IMHO callbacks and data returns via the embedded Perl interface
>are going to be the best way to go, until innd becomes multithreaded or
>something similar.

Well, I ran it for an hour last night.  :)  But no, many parts of this
haven't been properly tested.  It's a quick hack, proof-of-concept, done
because I couldn't sleep.  There are definate issues with buffering,
error handling, and whatnot.  Putting this code on a production machine
would be a foolish thing.

I would also prefer to have a callback mechanism or an explicit Perl
interface that does the same thing as the ctlinnd ICC interface.

But this was the code I had at hand.  And it does demonstrate one
possible way for the filter to affect the spool itself.

-- 
Later, eh?    Silas

Voice #1:      It's hot as hell under all these carpets.

Voice #2:      Christ, I think our sneakers are showing.

Voice #3:      Any you guys got any ludes?

Re: cancelling from the perl filter (was Spam Cancel Moratorium, where next?)
#28032
Author: USENET news
Date: Wed, 06 May 1998 00:00
30 lines
2121 bytes
In article <87wwc7k69j.meow@fluffy.meow.org>, greg  <greg@meow.org> wrote:
>clewis@ferret.ocunix.on.ca (Chris Lewis) writes:
>
>> In article <37pvi0e6dt.fsf_-_@cascade.cs.ubc.ca>,
>> Brian Edmonds  <bedmonds@cs.ubc.ca> wrote:
>> If you remembered the messageids in-core, t'would be nice if the
>> filter could access the history file...
>
>Has anyone been crazy enough to try using the DBZ_File module on
>history from within the perl filter?

Which flavour of DBZ file... given that the file format seems to have 
evolved somewhat in recent INN versions (and patches). Or putting that 
another way, I'd be worried about the filter's DBZ code getting not matching
whichever flavour INN was using, and causing mayhem in consequence. [I'm 
similarly worried that I'll upgrade INN one day and forget to rebuild 
C-NoCeM to use the latest-and-greatest (well, as used by INN, anyway) dbz.
Thinking about it now doesn't guarantee remembering it under pressure at a 
critical moment...]

A Perl DBZ module which could recognise all the DBZ variants that have been 
unleashed on the unwary world and handle them, and reliably recognise new 
variants that it couldn't handle, would be very useful for miscellaneous 
analysis and maintenance scripts, even if it couldn't be used within 
filters. A non-trivial job though! 

                                John Line

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads