🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #59915

Re: Extracting info from a NNTP

#59915
From: Klaas
Date: Sat, 17 Aug 2002 00:54
31 lines
2290 bytes
After careful consideration, Dhaval Shah muttered:

> Hi all,
> I'm developing a software in Delphi6 that "sniffs" the NNTP session on
> a PC and want to report the newsgroup name, contents that the user
> sent. I've got the logic of getting the dump of the session but it
> contains lot of "junk".
> Could anybody pls. help me identifying the positions of the newsgroup 
> headers (where it was sent) and the contents (message body) only??
> Best regards

Sounds like an app to allow an employer to track usenet activity of
employees during work hours. 

Anyway, what you're looking for is this:

client sends "POST<CrLf>"
server responds with "340 <some message><crlf>" if posting is okay
client then sends headers separated by <crlf>'s, ending with a double
<crlf> to signify the start of the body.  "<crlf>.<crlf>" signifies the
end of the body. 

The header you are looking for is (unsurprisingly) "Newsgroups:", which
contains a comma-separated list of newsgroups to which the article was
posted.  From:, Sender: and Subject: headers will be useful if you are
logging this activity (you should log Message-ID: too). 

<crlf> is a carriage-return linefeed combo (0x0D 0x0A)

-Mike
Technical Details
Message-ID: <Xns926C5B26C43F8nothing@209.98.50.131>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!upp1.onvoy!onvoy.com!news-out.visi.com!hermes.visi.com!blue.readfreenews.net!news.readfreenews.net!authen.yellow.readfreenews.net.POSTED!not-for-mail
References: <3D5C4F5E.1010105@phonecontrol.com.au>

Show Full Headers
Complete Article Headers
Message-ID: <Xns926C5B26C43F8nothing@209.98.50.131>
Subject: Re: Extracting info from a NNTP
Date: Sat, 17 Aug 2002 00:54:50 +0000
From: Klaas <spamhole@klaas.ca>
References: <3D5C4F5E.1010105@phonecontrol.com.au>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!upp1.onvoy!onvoy.com!news-out.visi.com!hermes.visi.com!blue.readfreenews.net!news.readfreenews.net!authen.yellow.readfreenews.net.POSTED!not-for-mail
Newsgroups: news.software.nntp
Organization: This is a valid email address
User-Agent: Xnews/5.04.25
Lines: 30
NNTP-Posting-Date: 16 Aug 2002 19:54:50 CDT
NNTP-Posting-Host: 2c8d8195.authen.yellow.readfreenews.net
X-Trace: DXC=iAMJcJE1XeZ1XP4GAIVjLRbQ9W<K20`3RO6Gh9bA988^4aI2=\m\df^KMS1<B]L;mXd8n[UmG4K4P:`;Dh:@G<[P81gYI`?JB>V
X-Complaints-To: abuse@readfreenews.com