Pushing a News Article onto a Server
We mentioned the IHAVE command when we talked about pushing news articles onto a news server. Let's now have a look at how the IHAVE command actually works:
ihave ‹[email protected]›
335
From: [email protected]
Subject: test message sent with ihave
Newsgroups: junk
Distribution: world
Path: gw.vk2ktj.ampr.org
Date: 26 April 1999
Message-ID: ‹[email protected]›
Body:
This is a test message sent using the NNTP IHAVE command.
.
235
All NNTP commands are case insensitive, so you may enter them in either upper- or lowercase. The IHAVE command takes one mandatory argument, it being the Message ID of the article that is being pushed. Every news article is assigned a unique message ID when it is created. The IHAVE command provides a way of the NNTP server to say which articles it has when it wants to push articles to another server. The sending server will issue an IHAVE command for each article it wishes to push. If the command response code generated by the receiving NNTP server is in the '3xx' range, the sending NNTP server will transmit the complete article, including it's full header, terminating the article with a period on a line by itself. If the response code was in the '4xx' range, the receiving server has chosen not to accept this article, possibly because it already has it, or because of some problem, such as running out of disk space.
When the article has been transmitted, the receiving serve issues another response code indicating whether the article transmission was successful.
Changing to NNRP Reader Mode
Newsreaders use their own set of commands when talking to a news server. To activate these commands, the news server has to be operating in
mode reader
200 news.vbrew.com InterNetNews NNRP server INN 1.7.2 08-Dec-1997 ready/
(posting ok).
help
100 Legal commands
authinfo user Name|pass Password|generic <prog> <args>
article [MessageID|Number]
body [MessageID|Number]
date
group newsgroup
head [MessageID|Number]
help
ihave
last
list [active|active.times|newsgroups|distributions|distrib.pats|/
overview.fmt|subscriptions]
listgroup newsgroup
mode reader
newgroups yymmdd hhmmss ['GMT'] [<distributions>]
newnews newsgroups yymmddhhmmss ['GMT'] [<distributions>]
next
post
slave
stat [MessageID|Number]
xgtitle [group_pattern]
xhdr header [range|MessageID]
xover [range]
xpat header range|MessageID pat [morepat...]
xpath MessageID
Report problems to <[email protected]>
.
NNTP reader mode has a lot of commands. Many of these are designed to make the life of a newsreader easier. We mentioned earlier that there are commands that instruct the server to send the head and the body of articles separately. There are also commands that list the available groups and articles, and others that allow posting, an alternate means of sending news articles to the server.
Listing Available Groups
The list command lists a number of different types of information; notably the groups supported by the server:
list newsgroups
215 Descriptions in form 'group description'.
control News server internal group
junk News server internal group
local.general General local stuff
local.test Local test group
.
Listing Active Groups