Article View: news.software.nntp
Article #23709Re: ANNOUNCE: Clean Feed 0.95, and new nnrp filter patch
From: Piers Cawley
Date: Wed, 26 Nov 1997 00:00
Date: Wed, 26 Nov 1997 00:00
100 lines
3686 bytes
3686 bytes
23 Nov 1997 09:43:29 GMT Jeremy <jeremy@exit109.com> news.software.nntp
> Version 0.95 of Clean Feed, my spam filter, is available from my webpage:
> http://www.exit109.com/~jeremy/news/antispam.html
>
> Clean Feed is a spam filter in Perl for INN, Cyclone, and Typhoon. It
> also includes an option to block binaries in non-binary groups. I've
> encountered some technical difficulties with the new Cyclone version,
> so that is still at 0.94.4. 0.95 for Cyclone/Typhoon should be available
> soon.
I've been messing with one of the precursors of this and, whilst I'm
sure that the spam detection is reasonably good, I'm more than a
little worried about it catching false positives and wanted to add a
checksum of the message body to make sure.
To that end I've been messing with lib/perl.c and config.data so that
you can now use dynamically loaded modules. As well as applying the
patch you'll also have to fiddle with PERL_LIB in config.data. Check
that it includes something that ends:
/auto/DynaLoader/DynaLoader.a
If you don't know the specific path you need then do
$ perl -MExtUtils::Embed -e ldopts
and paste the results into config.data
Once you have this done you'll be able to do something like:
my $md5;
eval {require MD5; $md5 = new MD5};
And then later on, after your filter has generated $hash1 and $hash2,
but before it's made use of 'em, you just do:
if ((defined $md5) && (exists $hdr{__BODY__})) {
my $hexhash = $md5->hexhash->($hdr{__BODY__});
$hash1 .= " " . $hexhash;
$hash2 .= " " . $hexhash if $hash2;
}
Apart from the extra time spent loading there seems to be no great
overhead associated with generating an MD5 hash. A possible problem is
that every module you load can introduce more possible memory leaks.
If you're worried about this you might want to stick a weekly
'ctlinnd xexec ""' in your crontab.
--patch here
iff -urN inn-1.7.insync/lib/perl.c inn-1.7/lib/perl.c
--- inn-1.7.insync/lib/perl.c Tue Oct 7 16:18:11 1997
+++ inn-1.7/lib/perl.c Wed Nov 26 13:33:36 1997
@@ -31,6 +31,9 @@
#include "macros.h"
+extern void xs_init _((void));
+extern void boot_DynaLoader _((CV* cv));
+
int PerlFilterActive = FALSE;
static PerlInterpreter *PerlCode;
@@ -89,7 +92,7 @@
/* We can't call 'eval' and 'do' directly for some reason, so we define
some wrapper functions to give us access. */
- perl_parse (PerlCode,NULL,5,argv,NULL) ;
+ perl_parse (PerlCode,xs_init,5,argv,NULL) ;
}
@@ -220,6 +223,15 @@
perl_free(PerlCode);
PerlFilterActive = FALSE;
}
+
+extern void xs_init()
+{
+ char * file = __FILE__;
+ dXSUB_SYS;
+
+ newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file);
+}
+
#endif /* defined(DO_PERL) */
--
Piers Cawley -- Systems Genie for Aladdin
If a `religion' is defined to be a system of ideas that contains
unprovable statements, then Godel taught us that mathematics is not
only a religion, it is the only religion that can prove itself to be
one. -- John Barrow
Technical Details
Message-ID:
<54vhxfogq3.fsf@gunnar.aladdin.net>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<658ts1$p47$1@news1.exit109.com>Show Full Headers
Complete Article Headers
Message-ID: <54vhxfogq3.fsf@gunnar.aladdin.net> Subject: Re: ANNOUNCE: Clean Feed 0.95, and new nnrp filter patch Date: Wed, 26 Nov 1997 00:00:00 +0000 From: Piers Cawley <pdcawley@bofh.org.uk> References: <658ts1$p47$1@news1.exit109.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 292862575 Organization: Aladdin Internet Newsgroups: news.software.nntp