next up previous contents
Next: NNRP Commands Up: The Network News Reader Previous: Difference between NNTP and

Subsections

NNTP Commands

The following sections give a short summary of important NNTP commands. Further examples for these commands can be found in RFC 977 [KL86], where NNTP is fully specified. Several extensions have been made to these commands. A comprehensive list of the extensions available can be found in [Bar97].

List

  List returns code 215 along with a list of valid newsgroups and associated information. Each newsgroup is sent as a separate line in the following format: Name Last First F. Name indicates the name of the newsgroup, Last and First the last and first article numbers within the group and F gives the type of the newsgroup, y if posting to the group is allowed, m if it is a moderated newsgroup and n otherwise.

Responses

215 list of newsgroups follows
503 program error, function not performed

Group

This command selects the newsgroup, whose name is given as argument. It returns a summary of the newsgroup in the textual comment. The summary consists of an estimation of the numbers of articles (the estimation has to be at least the number of articles available), the number of the first and the last article within the newsgroup and the name of the newsgroup. The estimation of the number of articles has to be at least the number of available articles.

For each client the server maintains the currently selected newsgroup and an article pointer. This command selects the current newsgroup and resets the article pointer to the first article within this newsgroup.

The name of the newsgroup is case independent. If the newsgroup does not exist, the previously selected newsgroup remains selected.

Responses

211 n f l s group selected
n = estimated number of articles in group,
f = first article number in the group,
l = last article number in the group,
s = name of the group.
411 no such news group

Article

This command has three forms. If a parameter with a valid message identifier is given, then the article with that message identifier is returned. If the argument is a valid article number within the current newsgroup, the internally maintained article pointer is set to that number and that article will be returned. If no argument is given, then the current article will be returned. The last two commands are only valid, when a newsgroup has been selected beforehand.

Responses

220 n <a> article retrieved - head and body follow
n = article number,
<a> = message-id.
412 no newsgroup has been selected
420 no current article has been selected
423 no such article number in this group
430 no such article found

Head, Body, Stat

These commands work like the article command, except that they return the head, the body or only set the article pointer.

Post

If posting is allowed, this command returns 340, and the article as specified in RFC 1036 [HA87] should be sent including header and body. The end of the article is marked by single dot on a line. After the article's header and body have been sent completely sent from the client to the server, a further response code will be returned to indicate success or failure of the posting attempt. A response code of 440 indicates that posting is prohibited for some installation dependent reason.

Responses

240 article posted ok
340 send article to be posted. End with <CR-LF>.<CR-LF>
440 posting not allowed
441 posting failed

Newgroups

The Newgroups command returns those newsgroups that have been newly created since a given time. Time and date are given as the second arguments.

Responses

231 list of new newsgroups follows

Newnews

The Newnews is mainly used for the article distribution between different news servers. It returns the article identifiers for news articles that have been received since a given time. Time and date are given as the second and the third argument. The first argument indicates a comma separated list of newsgroups. The names of newsgroups may include the * wildcard. Newsgroups prefixed with an exclamation mark will be excepted.

Responses

230 list of new articles by message-id follows

Ihave

The Ihave command is mainly used for the article distribution between different news servers. It informs the server of articles available on the client host. The Ihave command takes the article's identifier as argument.

The server informs the client whether it wishes to receive the article. Code 335 indicates that the client should send the article terminated by a single dot on a line. Other return codes neglect the article.

Responses

235 article transferred ok
335 send article to be transferred. End with <CR-LF>.<CR-LF>
435 article not wanted - do not send it
436 transfer failed - try again later
437 article rejected - do not try again


next up previous contents
Next: NNRP Commands Up: The Network News Reader Previous: Difference between NNTP and
gschwind@infosys.tuwien.ac.at