Article View: news.software.nntp
Article #29332How to seperate header from body?
From: Daniel Hartmeier
Date: Wed, 24 Jun 1998 00:00
Date: Wed, 24 Jun 1998 00:00
47 lines
2444 bytes
2444 bytes
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?).
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.
Yet, my newsreader displays the header separately. So how is this done?
Does it 'guess' what could be a header field? Like, a string containing
no spaces, followed by a ':' and a blank? Or does it have a list of all
possible header field names (which grows every day)?
What if someone posts an article like:
From: foo
Subject: bar
Date: 24 Jun 98 14:20:00 GMT
Question: Foo?
Some question.
Answer: Bar!
Some answer to the question.
What is the newsreader supposed to do? How can it tell whether
'Question: Foo?' is the last line of the header or the first of the
body?
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)?
If this is answered in a FAQ or RFC, I'd be glad if someone could tell
me the reference.
Thanks for your help,
--
Daniel Hartmeier <daniel@reichardt.ch> PGP 6A3A7409 ICQ# 12742482
"The woods are lovely, dark and deep. But I have promises to keep,
And lines to code before I sleep, And lines to code before I sleep."
Technical Details
Message-ID:
<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-mailShow Full Headers
Complete Article Headers
Message-ID: <359207eb.28171678@news.reichardt.ch> Subject: How to seperate header from body? Date: Wed, 24 Jun 1998 00:00:00 +0000 From: daniel@reichardt.ch (Daniel Hartmeier) 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: 365657933 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: Reichardt Informatik AG Newsgroups: news.software.nntp,alt.usenet.offline-reader