Article View: news.software.nntp
Article #64721Re: Standardization of LIST OVERVIEW.FMT
From: Curt Welch
Date: Thu, 03 Apr 2003 03:52
Date: Thu, 03 Apr 2003 03:52
83 lines
5313 bytes
5313 bytes
Russ Allbery <rra@stanford.edu> wrote:
> Curt Welch <curt@kcwc.com> writes:
>
> > My server accepts articles feed to it with headers like:
>
> > Subject:a test
>
> > I see it also accepts them on post. That is bad. I need to fix that.
>
> Interesting. I didn't think any NNTP software would accept that.
Is it because I didn't follow the RFC when I wrote my code or is it because
the RFC wasn't detailed enough about this point I wonder? I'll have to
re-read the RFCs to get a feel for that, but the way it happened in my code
is that I first wrote a generic article parsing routine which was written
on purpose to accurately parse _any_ byte stream passed to it. I didn't
want an article like this:
Subject: test
O:crap
From: me
etc...
To make the parser fail to find the From: header just because the article
has an O:crap line in the header.
> > But, for fed articles, are you implying it should reject them?
>
> Well, the problem is that such articles don't comply with RFC 1036 in a
> pretty fundamental syntactic way, so they may confuse readers horribly
> when sent to a client. NNTP doesn't really say that you can't accept
> them, but when you send such a thing back in response to an ARTICLE
> command, you're not sending back a news article, which is sort of iffy.
Yeah, at the NNTP level, the problem here is that you can transfer articles
with a header like of "Crap:out" so what should an nntp server do if it
receives an article with a header line like that? If that is not a valid
header line period, should the entire article always be rejected as totaly
invalid? If, like in the Crap:out example, the header is not important,
should it just be ignored?
Because NNTP specifies how data is transfered, and also specifies how to
deal with headers, it seems to me the NNTP RFC should be _very_ precise on
how the dot terminated data is parsed to find the headers and header data,
and for parse errors, I think it should be _very_ precise about how to
react to a basic parse error (this missing space issue, any line length
issues if there are any limits, any max header size after folding issues,
NULLs, lone CRs and LFs) in regards to the header parsing algorithm.
For the missing space issue, I think the RFC should be very precise about
how it should be delt with. Either it causes a header parse error (no
matter what header is missing the space), and is dealt with at that level
(options are it's not an error, or it is an error and the article should
always be rejected), or, only the important headers must always have a
space and the article is rejected if they don't, or, the only something
starting with "subject: " is a "Subject" header and "subject:x" is not a
subject header.
> > Or are you implying that line in the header should not be parsed as the
> > Subject header so the article should be treated as if it had no
> > Subject?
>
> No, the article itself is syntactically invalid.
That's a reasonable approach, and I'm searching my spools and so far have
not found a single article with a missing space after the : for any header
line, so it may be a universial assumption (outside my server). But I
think the NNTP RFC should be very clear about what is and is not a
"syntactially valid" article to the level of how to parse headers so you
can be very precise about how it reacts to these articles and what it will
produce for OVER and HDR data etc.
The NNTP RFC should not try to include the full USEFOR problem, but it
should include enough of this issue to make it precisely clear how the
server finds headers and what is valid and what is not and how it should
react to it. It seems to me that this can be done at this level without
getting tangled up in the USEFOR problems.
--
Curt Welch http://CurtWelch.Com/
curt@kcwc.com Webmaster for http://NewsReader.Com/
Technical Details
Message-ID:
<20030402225212.984$Db@newsreader.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.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed3.newsreader.com!newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mailReferences:
<ylhe9j13ly.fsf@windlord.stanford.edu> <20030401000349.361$y1@newsreader.com> <ylk7eeyex4.fsf@windlord.stanford.edu> <20030401162641.836$2c@newsreader.com> <yl4r5h4d2g.fsf@windlord.stanford.edu> <20030402212438.619$bH@newsreader.com> <ylbrzo1f78.fsf@windlord.stanford.edu> <20030402220449.560$Fb@newsreader.com> <ylbrzo8ee7.fsf@windlord.stanford.edu>Show Full Headers
Complete Article Headers
Message-ID: <20030402225212.984$Db@newsreader.com>
Subject: Re: Standardization of LIST OVERVIEW.FMT
Date: Thu, 03 Apr 2003 03:52:13 +0000
From: curt@kcwc.com (Curt Welch)
References: <ylhe9j13ly.fsf@windlord.stanford.edu> <20030401000349.361$y1@newsreader.com> <ylk7eeyex4.fsf@windlord.stanford.edu> <20030401162641.836$2c@newsreader.com> <yl4r5h4d2g.fsf@windlord.stanford.edu> <20030402212438.619$bH@newsreader.com> <ylbrzo1f78.fsf@windlord.stanford.edu> <20030402220449.560$Fb@newsreader.com> <ylbrzo8ee7.fsf@windlord.stanford.edu>
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!feed3.newsreader.com!newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
Organization: NewsReader.Com
Newsgroups: news.software.nntp
X-Trace: NewsReader.Com 9rBLkVge8fkHlfo+xUrzJ=r7TJz57JVlmcC8jzMsxSs0x/oR6m
X-Face: "p}G*1KH{+F7EYGKLb>ogDguabZ+%,?^epeFB!nzu`)`$=QcvL1KF6<0GH!Tbc!Sqo[|tV5
%IW48mQf3K=Ci&gZ7]]aazx@]Y-nq!r5{yH/#,?@lDdUDvOfByB2hVW0.@OM%{l/{cT'{w
X-Url: http://CurtWelch.Com/
User-Agent: NewsReader.Com
Lines: 82