Article View: news.software.nntp
Article #44460[NNTP Draft] 9.4 The LIST Keyword (includes OVER & PAT)
From: Andrew Gierth
Date: Sat, 26 Feb 2000 00:00
Date: Sat, 26 Feb 2000 00:00
743 lines
28998 bytes
28998 bytes
[This is one of a series of extracts from draft-ietf-nntpext-base-09.txt
which is available in full from the usual Internet-Draft archives.]
9.4 The LIST Keyword
9.4.1 LIST
LIST [ACTIVE [wildmat]]
The response to the LIST keyword with no parameters returns a
list of valid news groups and associated information. Each
news group is sent as a line of text in the following format:
group first last status
where <group> is the name of the news group, <last> is the
number of the last known article currently in that news group,
<first> is the number of the first article currently in the
news group, and <status> indicates the current status of the
group on this server. Typically, the <status> will be consist
of the US-ASCII character `y' where posting is permitted, `n'
where posting is not permitted and `m' where postings will be
forwarded to the news group moderator by the news server.
Other status strings may exist. The definition of these other
values is covered in other specifications.
The <first> and <last> fields will always be numeric. They
may have leading zeros. The <first> field corresponds to the
"reported low water mark" and the <last> field corresponds to
the "reported high water mark" described in the GROUP command
(see Section 9.1.1.1).
Note that posting may still be prohibited to a client although
the LIST command indicates that posting is permitted to a
particular news group. See the POST command for an explanation
of client prohibitions. The posting flag exists for each news
group because some news groups are moderated or are digests,
and therefore cannot be posted to; that is, articles posted to
them must be mailed to a moderator who will post them for the
original poster. This is independent of the posting
permission granted to a client by the NNTP server.
Please note that an empty list (i.e., the text body returned
by this command consists only of the terminating period) is a
possible valid response, and indicates that there are
currently no valid news groups.
If the optional matching parameter is specified, the list is
limited to only the groups that match the pattern.
Barber [Page 37]
INTERNET DRAFT November 1999
Specifying a single group is usually very efficient for the
server. Multiple groups may be specified by using wildmat
patterns (described in section 5), not regular expressions.
9.4.1.1 Responses
215 list of news groups follows
9.4.1.2 Examples
Example of LIST returning a list of news groups
[S] 200 NNTP Service Ready
[C] LIST
[S] 215 list of news groups follows
misc.test 3000234 3002322 y
alt.fc-writers.recovery 1 4 y
tx.natives.recovery 56 89 y
.
Example of LIST returning no news groups
[S] 200 NNTP Service Ready
[C] LIST
[S] 215 list of news groups follows
.
9.4.2 LIST ACTIVE.TIMES
LIST ACTIVE.TIMES [wildmat]
The active.times file is maintained by some news transport
systems to contain information about when and who created a
particular news group. The format of this file generally
includes three fields. The first field is the name of the news
group. The second is the time when this group was created on
this news server measured in seconds since the start of
January 1, 1970. The third is the email address of the entity
that created the news group. When executed, the information is
displayed following the 215 response. When display is
completed, the server will send a period on a line by itself.
If the information is not available, the server will return
the 503 error response.
Barber [Page 38]
INTERNET DRAFT November 1999
If the optional matching parameter is specified, the list is
limited to only the groups that match the pattern.
Specifying a single group is usually very efficient for the
server. Multiple groups may be specified by using wildmat
patterns (described in section 5), not regular expression
9.4.2.1 Responses
215 information follows
503 program error, function not performed
9.4.2.2 Examples
Example of LIST ACTIVE.TIMES returning a list of news groups
[S] 200 NNTP Service Ready
[C] LIST ACTIVE.TIMES
[S] 215 information follows
misc.test 930445408 <creatme@isc.org>
alt.rfc-writers.recovery 930562309 <m@nowhere.to>
tx.natives.recovery 930678923 <sob@academ.com>
.
Example of LIST ACTIVE.TIMES returning an error
[S] 200 NNTP Service Ready
[C] LIST ACTIVE.TIMES
[S] 503 program error, function not performed
9.4.3 LIST DISTRIBUTIONS
LIST DISTRIBUTIONS
The distributions file is maintained by some news transport
systems to contain information about valid values for the
Distribution: line in a news article header and about what the
values mean. Each line contains two fields, the value and a
short explanation on the meaning of the value. When executed,
the information is displayed following the 215 response. When
display is completed, the server will send a period on a line
by itself. If the information is not available, the server
will return the 503 error response.
Barber [Page 39]
INTERNET DRAFT November 1999
9.4.3.1 Responses
215 information follows
503 program error, function not performed
9.4.3.2 Examples
Example of LIST DISTRIBUTIONS returning a list of news groups
[S] 200 NNTP Service Ready
[C] LIST DISTRIBUTIONS
[S] 215 information follows
usa United States of America
na North America
world All over the World
.
Example of LIST DISTRIBUTIONS returning an error
[S] 200 NNTP Service Ready
[C] LIST DISTRIBUTIONS
[S] 503 program error, function not performed
9.4.4 LIST DISTRIB.PATS
LIST DISTRIB.PATS
The distrib.pats file is maintained by some news transport
systems to contain default values for the Distribution: line
in a news article header when posting to particular news
groups. This information could be used to provide a default
value for the Distribution: line in the header when posting an
article. The information returned contains three fields
separated by colons. The first column is a weight. The second
is a group name or a wildmat pattern that can be used to match
a group name. The third is the value of the Distribution:
line that should be used when the group name matches and the
weight value is the highest. All this processing is done by
the news posting client and not by the server itself. The
server provides this information to the client for it to use
or ignore as it chooses. When executed, the information is
displayed following the 215 response. When display is
completed, the server will send a period on a line by itself.
If the information is not available, the server will return
the 503 error response.
Barber [Page 40]
INTERNET DRAFT November 1999
9.4.4.1 Responses
215 information follows
503 program error, function not performed
9.4.4.2 Examples
Example of LIST DISTRIB.PATS returning a list of news groups
[S] 200 NNTP Service Ready
[C] LIST DISTRIB.PATS
[S] 215 information follows
10:local.*:local
.
Example of LIST DISTRIB.PATS returning an error
[S] 200 NNTP Service Ready
[C] LIST DISTRIB.PATS
[S] 503 program error, function not performed
9.4.5 LIST NEWSGROUPS
LIST NEWSGROUPS [wildmat]
The newsgroups file is maintained by some news transport
systems to contain the name of each news group that is
active on the server and a short description about the
purpose of each news group. Each line in the file contains
two fields, the news group name and a short explanation of
the purpose of that news group. When executed, the
information is displayed following the 215 response. When
display is completed, the server will send a period on a
line by itself. If the information is not available, the
server will return the 503 response. If the optional
matching parameter is specified, the list is limited to only
the groups that match the pattern (no matching is done on
the group descriptions). Specifying a single group is
usually very efficient for the server, and multiple groups
may be specified by using wildmat patterns (see section 5),
not regular expressions. If nothing is matched an empty list
is returned, not an error.
9.4.5.1 Responses
Barber [Page 41]
INTERNET DRAFT November 1999
215 information follows
503 program error, function not performed
9.4.5.2 Examples
Example of LIST NEWSGROUPS returning a list of news groups
[S] 200 NNTP Service Ready
[C] LIST NEWSGROUPS
[S] 215 information follows
misc.test General Usenet testing
alt.rfc-writers.recovery RFC Writers Recovery
tx.natives.recovery Texas Natives Recovery
.
Example of LIST NEWSGROUPS returning an error
[S] 200 NNTP Service Ready
[C] LIST NEWSGROUPS
[S] 503 program error, function not performed
9.4.6 LIST OVERVIEW.FMT
LIST OVERVIEW.FMT
The overview.fmt file is maintained by some news transport
systems to contain the order in which header information is
stored in the overview databases for each news group. When
executed, news article header fields are displayed one line at
a time in the order in which they are stored in the overview
database[7] following the 215 response. When display is
completed, the server will send a period on a line by itself.
If the information is not available, the server will return
the 503 response.
If the header has the word "full" (without quotes) after the
colon, the header's name is prepended to its field in the
output returned by the server.
This is command is part of the optional OVER extension which
includes the OVER command defined in section 9.4.8. If the
OVER extension is not implemented, then this command MUST NOT
be implemented.
Barber [Page 42]
INTERNET DRAFT November 1999
9.4.6.1 Responses
215 information follows
503 program error, function not performed
9.4.6.2 Examples
Example of LIST OVERVIEW.FMT returning a list of news groups
[S] 200 NNTP Service Ready
[C] LIST OVERVIEW.FMT
[S] 215 Order of fields in overview database.
Subject:
From:
Date:
Message-ID:
.
Example of LIST OVERVIEW.FMT returning an error
[S] 200 NNTP Service Ready
[C] LIST OVERVIEW.FMT
[S] 503 program error, function not performed
9.4.7 LISTGROUP
LISTGROUP [ggg]
The LISTGROUP command is used to get a listing of all the
article numbers in a particular news group.
The optional parameter ggg is the name of the news group to
be selected (e.g. "news.software.b"). A list of valid news
groups may be obtained from the LIST command. If no group is
specified, the current group is used as the default
argument.
The successful selection response will be a list of the
article numbers in the group followed by a period on a line
by itself. The list starts on the next line following the
211 response code.
When a valid group is selected by means of this command, the
internally maintained "current article pointer" MUST be set
to the first article in the group. If an invalid group is
specified, the previously selected group and article remain
Barber [Page 43]
INTERNET DRAFT November 1999
selected. If an empty news group is selected, the "current
article pointer" may be in an indeterminate state and should
not be used.
The group name MUST match a news group obtained from the
LIST command or an error will result, else the server will
respond with the 411 error code.
The LISTGROUP command is an optional extension. It MAY be
implemented. If it is not implemented, then the LISTGROUP
label MUST NOT be included in the response to the LIST
EXTENSIONS command.
9.4.7.1 Responses
211 list of article numbers follow
411 No such group
412 Not currently in news group
9.4.7.2 Examples
Example of a successful execution with a group that exists on
the server
[S] 200 NNTP Service Ready
[C] LISTGROUP misc.test
[S] 211 list of article numbers follow
3000234
3000237
3000238
3000239
3002322
.
Example of an unsuccessful execution with a group that does
not exist on the server
[S] 200 NNTP Service Ready
[C] LISTGROUP this.group.is.not.here
[S] 411 no such group
Example of an attempt to retrieve an article when the current
group selected is empty
Barber [Page 44]
INTERNET DRAFT November 1999
[S] 200 NNTP Service Ready
[C] LISTGROUP example.empty.newsgroup
[S] 412 No current article selected
9.4.8 OVER
OVER [range]
The OVER command returns information from the overview
database for the article(s) specified. The information
returned in the response to this command can be used by
clients to follow discussion threads.
The optional range argument 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
If no argument is specified, then information from the current
article is displayed. Successful responses start with a 224
response followed by the overview information for all matched
messages. Once the output is complete, a period is sent on a
line by itself. If no argument is specified, the information
for the current article is returned. A news group must have
been selected earlier, else a 412 error response is returned.
If no articles are in the range specified, the server returns
a 420 error response. A 502 response will be returned if the
client only has permission to transfer articles.
Each line of output MUST be formatted with the article number,
followed by each of the headers in the overview database or
the article itself (when the data is not available in the
overview database) for that article separated by a US-ASCII
tab character. The sequence of fields must be in this order:
subject, author, date, message-id, references, byte count, and
line count. Other optional fields may follow line count. These
fields are specified by examining the response to the LIST
OVERVIEW.FMT command. Where no data exists, a null field must
be provided (i.e. the output will have two tab characters
adjacent to each other). Servers should not output fields for
articles that have been removed since the overview database
was created.
Note that all US-ASCII tab characters in any header data that
is returned will be converted to a single US-ASCII space
character. A contiguous sequence of US-ASCII non-printing
Barber [Page 45]
INTERNET DRAFT November 1999
characters will be compressed to a single US-ASCII space
character in any output response.
The OVER command is part of the OVER extension, which includes
the LIST OVERVIEW.FMT command. The OVER extension is optional.
If it is not implemented, the response to the LIST EXTENSIONS
command must not include the OVER label.
9.4.8.1 Responses
224 Overview information follows
412 No news group current selected
420 No article(s) selected
502 Service Unavailable
9.4.8.2 Examples
Example of a successful retrieval of overview information for
an article (using no article number)
[S] 200 NNTP Service Ready
[C] GROUP misc.test
[S] 211 1234 3000234 3002322 misc.test
[C] OVER
[S] 224 Overview information follows
300234|I am just a test article|nobody@nowhere.to
(Demo User)|6 Oct 1998 04:38:40 -0500|
<45223423@to.to>
.
[Please note that the line that begins with 200234 is all one
line that has been wrapped for readability. A vertical bar has
been inserted to show where the US-ASCII TAB should actually
be.]
Example of an unsuccessful retrieval of overview information
on an article by number
[S] 200 NNTP Service Ready
[C] GROUP misc.test
[S] 211 1234 3000234 3002322 misc.test
[C] OVER 300256
Barber [Page 46]
INTERNET DRAFT November 1999
[S] 420 No such article in this group
Example of an unsuccessful retrieval of overview information
by number because no news group was selected first
[S] 200 NNTP Service Ready
[C] OVER
[S] 412 No news group selected
Example of an attempt to retrieve an article 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] OVER
[S] 420 No current article selected
9.4.9 PAT
PAT header range|<message-id> [wildmat[ wildmat"]]
The PAT command is used to retrieve specific headers from
specific articles, based on pattern matching on the contents
of the header.
The required header parameter is the name of a header line
(e.g. "subject") in a news group article. See RFC-1036 for a
list of valid header lines. The required range argument 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 required message-id argument indicates a specific article.
The range and message-id arguments are mutually exclusive. An
additional argument consisting of one wildmat or two or more
wildmats separated by a space may be specified. If there are
no additional argument, a wildmat "*" is the default.
Successful responses start with a 221 response followed by
article number, an US-ASCII space, and the header from that
message in which the argument pattern matches the contents of
the specified header line. A valid response includes an empty
list (indicating that there were no matches). Once the output
is complete, a period is sent on a line by itself. If the
optional argument is a message-id and no such article exists,
Barber [Page 47]
INTERNET DRAFT November 1999
a 430 error response shall be returned. A 502 response shall
be returned if the client only has permission to transfer
articles.
The PAT command is optional. If it is not implemented, the
response to the LIST EXTENSIONS command must not include the
PAT label.
9.4.9.1 Responses
221 Header follows
412 no newsgroup selected
430 no such article
502 Service Unavailable
9.4.9.2 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] PAT Subject 3000234-300238
[S] 221 Header Follows
3000234 I am just a test article
3000237 Re: I am just a test article
3000238 Ditto
.
Example of a successful retrieval of subject lines from a
range of articles with header pattern matching
[S] 200 NNTP Service Ready
[C] GROUP misc.test
[S] 211 1234 3000234 3002322 misc.test
[C] PAT Subject 3000234-300238 j* ? *est
[S] 221 Header Follows
3000234 I am just a test article
3000237 Re: I am just a test article
Barber [Page 48]
INTERNET DRAFT November 1999
.
Example of a successful retrieval of header from an article by
message-id
[S] 200 NNTP Service Ready
[C] PAT subject <i.am.a.test.article@nowhere.to>
[S] 221 Header information follows
3000345 I am just a test article
.
Example of an unsuccessful retrieval of a header from an
article by message-id
[S] 200 NNTP Service Ready
[C] PAT subject <i.am.not.there@nowhere.to>
[S] 430 No Such Article Found
Example of an unsuccessful retrieval of headers from articles
by number because no news group was selected first
[S] 200 NNTP Service Ready
[C] PAT subject 300256-
[S] 412 No news group 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] PAT subject 0-
[S] 221 Headers follow
.
Example of a failure due to restrictions configured into the
server
[S] 200 NNTP Service Ready
[C] GROUP news.group
Barber [Page 49]
INTERNET DRAFT November 1999
[S] 211 1234 3000234 3002322 misc.test
[C] PAT Subject 3000234-300238
[S] 502 Service Unavailable
--
Andrew.
Technical Details
Message-ID:
<87aeknd2ua.fsf@erlenstar.demon.co.uk>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!not-for-mailShow Full Headers
Complete Article Headers
Message-ID: <87aeknd2ua.fsf@erlenstar.demon.co.uk> Subject: [NNTP Draft] 9.4 The LIST Keyword (includes OVER & PAT) Date: Sat, 26 Feb 2000 00:00:00 +0000 From: Andrew Gierth <andrew@erlenstar.demon.co.uk> 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!not-for-mail X-Deja-AN: 590399829 X-Mayan-Date: Long count = 12.19.6.17.16; tzolkin = 13 Cib; haab = 4 Kayab X-Complaints-To: andrew@erlenstar.demon.co.uk Organization: disorganised X-Attribution: AG X-Pgp-0x0E9FFBE9: 87 25 7F 14 41 24 B3 51 E0 19 8B DE 49 74 0C 29 X-P-Persistent-Headers: are a bad idea. Newsgroups: news.software.nntp X-Post-Filter: postfilter v0.6 alpha