🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #81327

Re: Can someone write a nnrpd perl filter ?

#81327
From: Etian
Date: Mon, 08 Jun 2009 10:25
61 lines
3417 bytes
Anonymous wrote:
> Hi!
> I have tried many filter_nnrpd.pl , but none of them has all the features i need.
> I'm a person concerned about privacy for my users i sustain free speech and i want to make me sure 
> for their non-persecution .
> I would like to cover by md5 (sha1) the NNTP-Posting-Host,NNTP-Posting-Date and X-Trace headers and also some 
> rbl checks will be appreciated .
> This is a sample i wrote , maybe we can start from here:
> 
> use strict;
> use Digest;
> use Digest::MD5;
> use Digest::SHA1;
> use Net::DNS;
> our (%hdr, $modify_headers);
> 
> sub filter_post {
> 
>     # Hash the NNTP-Posting-Host header
>     my $ctx = Digest::SHA1->new;
>     $ctx->add($hdr{'NNTP-Posting-Host'});
>     $ctx->add("Would you like some salt with that?");
>     $hdr{'NNTP-Posting-Host'} = $ctx->hexdigest;
> #    undef $hdr{'X-Trace'};
>     # Date
>     my $atx = Digest::SHA1->new;
>     $atx->add($hdr{'NNTP-Posting-Date'});
>     $atx->add("Would you like some salt with that?");
>     $hdr{'NNTP-Posting-Date'} = $atx->hexdigest;
> #    undef $hdr{'X-Trace'};
>     #
>     my $btx = Digest::SHA1->new;
>     $btx->add($hdr{'X-Trace'});
>     $btx->add("Would you like some salt with that?");
>     $hdr{'X-Trace'} = $btx->hexdigest;
>     #
>     $modify_headers = 1;
>     return '';
> }
> 
> Compilation for the above filter is OK,but i don't know yet how to
> go on for the rbl checks. 
> I have just started up with perl and basically i need some help for this.
> Thank you. 
While you are developing it, you need it to work by itself.  So in the 
main body, you store some data to the parts of %hdr that you want to 
test, and you call the functions to test them, and run it from the 
command line.  After its working by itself, then you strip that stuff 
from the body.

A big concern with INN, is that if the filter dies, then the x-trace and 
host are exposed to the world.  Since this seems to be a concern shared 
by most of us, we could hope that in a future release the maintainers 
might allow these to be set in the authentication script rather than 
covering them up in the filter.

I'm curious though--why are you hiding the date?


Etian
sonic-news
Technical Details
Message-ID: <eG5Xl.2637$f36.524@newsfe19.iad>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.dca.giganews.com!nntp.giganews.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!newsfe19.iad.POSTED!e38f14da!not-for-mail
References: <a8ffa297001db143e2eae760ca3c05cd@mixmaster.nymu.eu>

Show Full Headers
Complete Article Headers
Message-ID: <eG5Xl.2637$f36.524@newsfe19.iad>
Subject: Re: Can someone write a nnrpd perl filter ?
Date: Mon, 08 Jun 2009 04:25:13 -0600
From: Etian <54698212@sonic-news.com>
References: <a8ffa297001db143e2eae760ca3c05cd@mixmaster.nymu.eu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.dca.giganews.com!nntp.giganews.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!newsfe19.iad.POSTED!e38f14da!not-for-mail
User-Agent: Thunderbird 2.0.0.21 (X11/20090318)
MIME-Version: 1.0
Newsgroups: news.software.nntp
In-Reply-To: <a8ffa297001db143e2eae760ca3c05cd@mixmaster.nymu.eu>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 61
X-Complaints-To: abuse@Sonic-News.com--send only the headers and the reason
 for your complaint
NNTP-Posting-Date: Mon, 08 Jun 2009 10:25:14 UTC
Organization: Sonic-News.com--complete, high-retention, from $3.99/month