🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #80881

Re: filter_nnrpd.pl (maybe a bug)

#80881
From: Julien ÉLIE
Date: Mon, 04 May 2009 18:58
52 lines
2830 bytes
Hi,

> 1. With INN 2.5 and perl 5.10.0, a strange thing happens:
>
> with the following filter_nnrpd.pl
>
> sub filter_post()
> {
>        $modify_headers = 1;
>        delete $hdr{'X-Trace'};
> }
>
> post
>
> 441 aioe-casa.aioe.org 1241420592 7082 127.0.0.1 (4 May 2009 07:03:12 GMT)

According to Perl documentation, delete() returns the value of the last
element deleted.  We are in scalar context here in filter_post(), which
expects a return value.

INN sends 441 followed by the reason of the reject.  Here, it is as
though you wrote:

    $result = delete $hdr{'X-Trace'};
    return $result;

In your case, $result contains
'aioe-casa.aioe.org 1241420592 7082 127.0.0.1 (4 May 2009 07:03:12 GMT)'.



> 2. filter_nnrpd.pl should be able to detect which program is invoking it;
> some user is making confusion between filter_nnrpd.pl and filter_innd.pl and
> each script currently is *not* able to detect whether it is invoked by the
> /right/ program. At the same time - imho - pathfilter should be reorganized
> with separate directories for each program (like this:
>
> /etc/news/filter/innd/filter_innd.pl
> /etc/news/filter/nnrpd/filter_nnrpd.pl
> ...

It is not filter_nnrpd.pl that detects the caller.  It is called by nnrpd.
Only nnrpd calls it.
I do not believe using <pathfilter>/innd/xxx and <pathfilter>/nnrpd/xxx
will help much...

-- 
Julien ÉLIE

« Mais pourquoi courent-ils si vite ? Pour gagner du temps ! Comme le temps,
  c'est de l'argent... plus ils courent vite, plus ils en gagnent. » (Raymond Devos) 
Technical Details
Message-ID: <gtne28$dtv$1@news.trigofacile.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.20141118.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!de-l.enfer-du-nord.net!gegeweb.org!news.trigofacile.com!not-for-mail
References: <gtm4q0$qtg$1@aioe.org>

Show Full Headers
Complete Article Headers
Message-ID: <gtne28$dtv$1@news.trigofacile.com>
Subject: Re: filter_nnrpd.pl (maybe a bug)
Date: Mon, 4 May 2009 20:58:59 +0200
From: Julien ÉLIE <iulius@nom-de-mon-site.com.invalid>
References: <gtm4q0$qtg$1@aioe.org>
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!de-l.enfer-du-nord.net!gegeweb.org!news.trigofacile.com!not-for-mail
Newsgroups: news.software.nntp
Organization: TrigoFACILE -- http://www.trigofacile.com/
Lines: 52
NNTP-Posting-Host: aaubervilliers-151-1-58-234.w83-112.abo.wanadoo.fr
Mime-Version: 1.0
Content-Type: text/plain; format=flowed; charset="iso-8859-1";
 reply-type=original
Content-Transfer-Encoding: 8bit
X-Trace: news.trigofacile.com 1241463688 14271 83.112.31.234 (4 May 2009
X-Complaints-To: abuse@trigofacile.com
NNTP-Posting-Date: Mon, 4 May 2009 19:01:28 +0000 (UTC)
In-Reply-To: <gtm4q0$qtg$1@aioe.org>
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Windows Mail 6.0.6001.18000
X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049