🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #29345

Re: How to seperate header from body?

#29345
From: Andrew Still
Date: Wed, 24 Jun 1998 00:00
50 lines
2945 bytes
On Wed, 24 Jun 1998 14:40:37 GMT, Daniel Hartmeier <daniel@reichardt.ch> wrote:
>I have a Usenet article saved in a text file just like I received it
>from my NNTP server using the ARTICLE command (including header lines).
>I could have used the commands HEAD and BODY, but I think the single
>ARTICLE command is faster (is that actually true?).

Depends on what you need, if you want to get all the headers, and then
get the bodies you've selected from there, you'd use HEAD, then BODY,
if you just want to get all the article at once use ARTICLE.  In other
words, a head command, then a body command should be slower (just from
duplication of actions) then just and article command.

>How can a I tell where the header ends and the body begins? RFC977
>states that there should be an empty line between header and body. But
>most articles I get don't have this empty line and the body immediately
>follows the header.

From this very article on our newserver here:
--------------------------------BEGIN---------------------------------
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Newsreader: Forte Agent 1.5/32.451
Xref: news.panix.com news.software.nntp:49890 alt.usenet.offline-reader:33008

I have a Usenet article saved in a text file just like I received it
from my NNTP server using the ARTICLE command (including header lines).
I could have used the commands HEAD and BODY, but I think the single
--------------------------------END--------------------------------------

You server should have that space there too.  as for the actual
snipping... sed, perl, awk, should all be able to do this.

[snip]
>Many articles contain the header 'Lines:' which provides the number of
>lines in the body. Though RFC1036 lists this header as optional, I
>haven't found an article without it. Is this a save way to calculate the
>border between header and body? Is there an faster method (that won't
>require counting the lines of the text file)?
[snip]

I keep hearing from people on various mail and news related groups
that some clients don't follow this header correctly.

-- 
Those who make peaceful revolution impossible will make violent
revolution inevitable.
				-- John F. Kennedy

Technical Details
Message-ID: <6mr6i6$jta@news1.panix.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
References: <359207eb.28171678@news.reichardt.ch>

Show Full Headers
Complete Article Headers
Message-ID: <6mr6i6$jta@news1.panix.com>
Subject: Re: How to seperate header from body?
Date: Wed, 24 Jun 1998 00:00:00 +0000
From: still+news@panix.com (Andrew Still)
References: <359207eb.28171678@news.reichardt.ch>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
X-Deja-AN: 365672256
Reply-To: still+news@panix.com
Distribution: inet
Organization: PANIX Public Access Internet and Unix
Newsgroups: news.software.nntp,alt.usenet.offline-reader