πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #82539

Re: Injection-Info questions

#82539
From: Steve Crook
Date: Mon, 11 Jan 2010 10:52
29 lines
2085 bytes
On Sun, 10 Jan 2010 15:30:55 +0100, Julien Γ‰LIE wrote in
Message-Id: <hicoat$fun$1@news.trigofacile.com>:

> Injection-Info: news.trigofacile.com; posting-host*0=amontpellier;
>  (test) posting-host*1="-159-1-21-3.w90-57.abo.wanadoo.fr:90.";
>  posting-host*2="57.92.3"; logging-data="3905";
>
> with the first value which is unquoted.
>
> Another one for you:
>
> Injection-Info: news.trigofacile.com;
>  posting-host*0*=utf-8'fr'amontpellier;
>  (test) posting-host*1="-159-1-21-3.w90-57.abo.wanadoo.fr:90.";
>  posting-host*2*="57.92.3"; logging-data="3905";
>
>
> Parsing is fun :)
Hi Julien,
It is indeed.  The complexity of parsing it is reflected in the lack of
sample code available.  At the moment I'm using two functions, one to
strip nested comments and another to unfold the structured fields into
an array.  It appears to handle your evil examples correctly but it's
possible that I'm misinterpreting what is correct handling in some
instances.  :)

Here is my sample code.  If anyone has suggestions for improving it, I'd
be very happy to hear about them.
http://www.mixmin.net/cleanfeed/injectinfo
Technical Details
Message-ID: <slrnhkm0mt.lhj.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: <slrnhjcc9b.u40.steve@news.mixmin.net> <hicoat$fun$1@news.trigofacile.com>

Show Full Headers
Complete Article Headers
Message-ID: <slrnhkm0mt.lhj.steve@news.mixmin.net>
Subject: Re: Injection-Info questions
Date: Mon, 11 Jan 2010 10:52:13 +0000
From: Steve Crook <steve@mixmin.net>
References: <slrnhjcc9b.u40.steve@news.mixmin.net> <hicoat$fun$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!news.mixmin.net!not-for-mail
Newsgroups: news.software.nntp
Organization: Mixmin
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Mon, 11 Jan 2010 10:52:13 +0000 (UTC)
Injection-Info: news.mixmin.net; posting-host="ip6-localhost:::1";
 logging-data="18806"; mail-complaints-to="abuse@mixmin.net"
User-Agent: slrn/pre1.0.0-18 (Linux)
Lines: 28