🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: rocksolid.nodes
Article #260

Re: hey, what do know ? vichan supports nntp

#260
From: Retro Guy
Date: Sat, 16 May 2020 08:17
37 lines
2224 bytes
anonymous wrote:

> and here is where the hacking starts:
> 
> function nntp_publish($msg, $id) {
>         global $config;
>         $server = $config["nntpchan"]["server"];
>         $s = fsockopen("tcp://$server");
>         fgets($s);
>         fputs($s, "MODE STREAMrn");
>         fgets($s);
>         fputs($s, "TAKETHIS $idrn");
>         fputs($s, $msg);
>         fputs($s, "rn.rn");
>         fgets($s);
>         fputs($s, "QUITrn");
>         fclose($s);
> }

It might help a lot to see exactly how vichan formats a post it wants to 
send via nntp. Maybe if we temporarily change this function to:

function nntp_publish($msg, $id) {
	$save_postfh = fopen("/tmp/vichanpost.txt", 'w');
	fputs($save_postfh, $msg);
	fclose($save_postfh);
}

then we have a saved copy of a post to look at. If we need to modify it to 
post properly to inn, rslight etc., we can modify it right in this function 
before sending it (for example, maybe we need to add a Message-ID or convert 
line breaks, etc.) Maybe adding auth here might be a good place also.

It also looks like this function doesn't return anything so vichan has no 
way of knowing if the posting was successful (looks like that anyway).

Retro Guy
Technical Details
Message-ID: <75cfd107a0bfe9a820be859f6cf8cf23$1@rslight.i2p>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!archive!apf9.newsdeef.eu!i2pn2.org!.POSTED!not-for-mail
References: <d1faafa624cda10417914a17419af431@def4> <a390a213fa3e1af81b3d8c884f62ef13@def4> <a4458e95f3eff77a31ee126a7152c46a$1@z5bqfv5v75kxy7pj.onion>

Show Full Headers
Complete Article Headers
Message-ID: <75cfd107a0bfe9a820be859f6cf8cf23$1@rslight.i2p>
Subject: Re: hey, what do know ? vichan supports nntp
Date: Sat, 16 May 2020 01:17:03 -0700
From: Retro Guy <retroguy@retrobbs.rocksolidbbs.com>
References: <d1faafa624cda10417914a17419af431@def4> <a390a213fa3e1af81b3d8c884f62ef13@def4> <a4458e95f3eff77a31ee126a7152c46a$1@z5bqfv5v75kxy7pj.onion>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!archive!apf9.newsdeef.eu!i2pn2.org!.POSTED!not-for-mail
Newsgroups: rocksolid.nodes
Organization: Rocksolid
Lines: 37
Mime-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 7Bit
Injection-Info: i2pn2.org; posting-account="retrobbs1";
 logging-data="21508"; mail-complaints-to="usenet@i2pn2.org"
User-Agent: KNode/4.14.1
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on novabbs.com