Article View: news.software.nntp
Article #58269Re: A better way to post binaries
From: Russ Allbery
Date: Thu, 18 Apr 2002 22:37
Date: Thu, 18 Apr 2002 22:37
175 lines
7722 bytes
7722 bytes
Juergen Helbing <archiver@i3w.com> writes:
> We come back to a new set of NNTP commands again and again. We have
> contact to programmers of INN, Diablo, DNews, MyNews, Hamster. How many
> more would we need to start this finally ?
Contacting more people doesn't help. Having a specification helps. For
example, here's the current writeup for the HDR command, complete with
extension label, that's being debated on the NNTP list. If someone wants
to propose a new command, start by writing a formal specification like
this. Otherwise, how does anyone know what to implement?
9.5.3 The HDR Extension
This extension provides one new command, HDR. The label for this
extension is HDR.
9.5.3.1 HDR
9.5.3.1.1 Usage
Syntax
HDR header
HDR header range
HDR header <message-id>
Responses
225 Headers follow (multiline response)
412 No newsgroup selected
430 No such article
This command is streamable.
9.5.3.1.2 Description
The HDR command retrieves specific headers from a specified range of
articles in the currently selected group or an article specified by
message-id.
The required header parameter is the name of a header (e.g. "subject")
in an article and is case-insensitive. The range parameter of the
second form of the HDR command may be any of the following:
* an article number
* an article number followed by a dash to indicate all following
* an article number followed by a dash followed by another article
number.
The message-id parameter of the third form of the HDR command indicates
a specific article. The range and message-id arguments are mutually
exclusive. If neither are specified, information from the current
article is displayed.
A successful response consists of a 225 response followed by the
requested list of headers. This list is returned as a multiline
response, with each line consisting of the article number, a US-ASCII
space, and the contents of the header (without the header name or the
colon and space that follow it). The contents are modified as follows:
all US-ASCII CRLF pairs are removed, and then each remaining US-ASCII
NUL, TAB, CR, or LF character is replaced with a single US-ASCII space.
(Note that this is the same transformation as is performed by the OVER
extension.)
The header content is in all cases taken from the article. This means
that, for example, a request for the header "Lines" returns the contents
of the "Lines" header of the specified articles, not the Lines field
returned by the OVER extension or any other server-generated value.
If the header occurs in a given article multiple times, only the value
of the first occurrence is returned by HDR.
If the article is specified by message-id rather than by article range,
the article number is given as "0". If the requested header is present
but empty in a given article, a line for that article is included in the
output but the header content portion of the line is empty. If the
requested header is not present in a given article, no line for that
article is given in the output. An empty response is therefore valid,
indicating that the requested header is not present in any of the
specified articles.
If the optional argument is a message-id and no such article exists, a
430 error response shall be returned.
A server MAY only allow HDR commands for a limited set of headers (such
as those present in the overview database). If it does so, it MUST
respond with a 503 error response to attempts to request other headers
rather than returning erroneous results such as a successful empty
response.
9.5.3.1.3 Examples
Example of a successful retrieval of subject lines from a range of
articles:
[S] 200 NNTP Service Ready
[C] GROUP misc.test
[S] 211 1234 3000234 3002322 misc.test
[C] HDR Subject 3000234-300238
[S] 225 Headers follow
[S] 3000234 I am just a test article
[S] 3000237 Re: I am just a test article
[S] 3000238 Ditto
[S] .
Example of a successful retrieval of the subject line from an article by
message-id:
[S] 200 NNTP Service Ready
[C] GROUP misc.test
[S] 211 1234 3000234 3002322 misc.test
[C] HDR subject <i.am.a.test.article@example.com>
[S] 225 Header information follows
[S] 0 I am just a test article
[S] .
Example of a successful retrieval of the subject line from the current
article:
[S] 200 NNTP Service Ready
[C] GROUP misc.test
[S] 211 1234 3000234 3002322 misc.test
[C] HDR subject
[S] 225 Header information follows
[S] 3000234 I am just a test article
[S] .
Example of an unsuccessful retrieval of a header from an article by
message-id:
[S] 200 NNTP Service Ready
[C] HDR subject <i.am.not.there@example.com>
[S] 430 No Such Article Found
Example of an unsuccessful retrieval of headers from articles by number
because no newsgroup was selected first:
[S] 200 NNTP Service Ready
[C] HDR subject 300256-
[S] 412 No newsgroup selected
Example of retrieving header information when the current group selected
is empty:
[S] 200 NNTP Service Ready
[C] GROUP example.empty.newsgroup
[S] 211 0 0 0 example.empty.newsgroup
[C] HDR subject 1-
[S] 225 Headers follow
[S] .
Example of an unsuccessful retrieval of headers because the server does
not allow HDR commands for that header:
[S] 200 NNTP Service Ready
[C] GROUP misc.test
[S] 211 1234 3000234 3002322 misc.test
[C] HDR Content-Type 3000234-300238
[S] 503 HDR not permitted on "Content-Type"
Example of a failure due to restrictions configured into the server:
[S] 200 NNTP Service Ready
[C] GROUP news.group
[S] 211 1234 3000234 3002322 misc.test
[C] HDR Subject 3000234-300238
[S] 502 Service Unavailable
--
Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>
Please post questions rather than mailing me directly.
<http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Technical Details
Message-ID:
<ylads0vdjj.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!nntp.stanford.edu!not-for-mailReferences:
<1017777829.201228@ok-corral.gunslinger.net> <Xns91EEA9020645Avegasedvegasedvegase@64.152.100.164> <3cbb8c69$0$71294$39de8f09@news.sol.net> <Xns91F1CC216E9C5vegasedvegasedvegase@64.152.100.164> <3cbcdb62$0$71293$39de8f09@news.sol.net> <20020416222708.535$rF@newsreader.com> <14596.h42202@archiver.winews.net> <20020417150401.443$B4@newsreader.com> <3321a.i42201@archiver.winews.net>Show Full Headers
Complete Article Headers
Message-ID: <ylads0vdjj.fsf@windlord.stanford.edu> Subject: Re: A better way to post binaries Date: Thu, 18 Apr 2002 15:37:36 -0700 From: Russ Allbery <rra@stanford.edu> References: <1017777829.201228@ok-corral.gunslinger.net> <Xns91EEA9020645Avegasedvegasedvegase@64.152.100.164> <3cbb8c69$0$71294$39de8f09@news.sol.net> <Xns91F1CC216E9C5vegasedvegasedvegase@64.152.100.164> <3cbcdb62$0$71293$39de8f09@news.sol.net> <20020416222708.535$rF@newsreader.com> <14596.h42202@archiver.winews.net> <20020417150401.443$B4@newsreader.com> <3321a.i42201@archiver.winews.net> 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!nntp.stanford.edu!not-for-mail Newsgroups: news.software.nntp Organization: The Eyrie Lines: 174 NNTP-Posting-Host: windlord.stanford.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.Stanford.EDU 1019169456 26242 171.64.13.23 (18 Apr 2002 22:37:36 GMT) X-Complaints-To: news@news.stanford.edu User-Agent: Gnus/5.090005 (Oort Gnus v0.05) XEmacs/21.4 (Common Lisp, sparc-sun-solaris2.6) Cancel-Lock: sha1:eBsZGyUGQj06LISP5ow6YLUtc2U=