🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #80792

Re: INND NNTP-Posting-Host

#80792
From: Steve Crook
Date: Tue, 28 Apr 2009 17:21
51 lines
2332 bytes
On Tue, 28 Apr 2009 01:11:20 +0000 (UTC), Gab wrote in
Message-Id: <100a1ed66b4e677671a2a84aaedd6c70$1@www.gabrix.ath.cx>:

> Hi all!
> I'm trying this script taken here 
> https://www.autistici.org/it/stuff/network_howto/newsserver/filter_nnrpd 
> which should anonymize users server.
> I don't know perl and innd refuses to load the script

I use this little script.  It doesn't remove the NNTP-Posting-Host
header but does a one-way hash with some added salt.  I prefer this to
completely removing the header as it maintains linkability and hence
filterability.

use strict;
use Digest::MD5;
our (%hdr, $modify_headers);

sub filter_post {

    # Hash the NNTP-Posting-Host header
    my $ctx = Digest::MD5->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'};

    # Refuse these From addresses
    if ($hdr{From} =~ /(
        \@darkshado\.ca
    |   arcturianone\@earthlink\.net
    )/ix) {
        return "Sender address ($1) is blacklisted";
    };

    # Blacklist these groups
    if ($hdr{Newsgroups} =~ /(
        rec\.radio\.amateur\.policy
    |   hr\.alt\.trash
    )/x) {
        return "Posting to $1 is currently blocked";
    };

    $modify_headers = 1;
    return '';
}

-- 
pub   1024D/228761E7 2003-06-04 Steven Crook
      Key fingerprint = 1CD9 95E1 E9CE 80D6 C885  B7EB B471 80D5 2287 61E7
uid                  Steven Crook <steve@mixmin.net>
Technical Details
Message-ID: <slrngveep8.99p.steve@news.mixmin.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.20141118.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!news.mixmin.net!not-for-mail
References: <100a1ed66b4e677671a2a84aaedd6c70$1@www.gabrix.ath.cx>

Show Full Headers
Complete Article Headers
Message-ID: <slrngveep8.99p.steve@news.mixmin.net>
Subject: Re: INND NNTP-Posting-Host
Date: Tue, 28 Apr 2009 17:21:44 +0000
From: Steve Crook <steve@mixmin.net>
References: <100a1ed66b4e677671a2a84aaedd6c70$1@www.gabrix.ath.cx>
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.ams.giganews.com!nntp.giganews.com!news.mixmin.net!not-for-mail
Newsgroups: news.software.nntp
Organization: Mixmin
Lines: 51
NNTP-Posting-Host: b421ff0445b5e915dcbceaec1788b827
X-Complaints-To: abuse@mixmin.net
NNTP-Posting-Date: Tue, 28 Apr 2009 17:21:44 +0000 (UTC)
User-Agent: slrn/pre1.0.0-11 (Linux)