# 17. Internet Services

Chapter Contents | Prev | Next
Keyword Search:
www.openlinksw.com
docs.openlinksw.com
Book Home
Contents
Preface
Internet Services
WebDAV Server
URIQA Semantic Web Enabler
Mail Delivery & Storage
NNTP Newsgroups
NNTP Client NNTP Server
MIME & Internet Messages
FTP Services
VSP Guide
LDAP

## 17.4. NNTP Newsgroups

### 17.4.1. NNTP Client

array nntp_get (in server varchar, in command varchar, in group varchar, [in first_message integer], [in last_message integer]);

Returns information about an NNTP server.

#### 17.4.1.1. Commands and Examples

If the requested messages don't exist, nttp_get() returns NULL.

Get a list of all groups from the server 'news.openlinksw.com', port 119:

    nntp_get ('news.openlinksw.com:119', 'list');

This call returns an array of the form Array ((<group 1> varchar, <last message> integer, <first message> integer, <posting allowed> varchar ) (<group 2> . . . . ) . . . )

ARTICLE, HEAD, BODY, STAT To get the bodies of all messages in the group 'openlink.public.virtuoso':

    nntp_get ('news.openlinksw.com:119', 'body', 'openlink.public.virtuoso');

This call returns an array of the form Array ((<message number> integer, <body of message> blob) . . . )

To get the article (head + body) of messages numbered from 5 to 10 in the group 'openlink.public.virtuoso':

    nntp_get ('news.openlinksw.com:119', 'article', 'openlink.public.virtuoso', 5, 10);

This call returns an array of the form Array ((<message number> integer, <body of message> blob) . . . )

To get the headers of messages numbered from 7 to the end of the 'openlink.public.virtuoso' group:

    nntp_get ('news.openlinksw.com:119', 'head', 'openlink.public.virtuoso', 7);

To get the status of all messages in the group 'openlink.public.virtuoso':

    nntp_get ('news.openlinksw.com:119', 'stat', 'openlink.public.virtuoso',);

This call returns an array of the form Array ((<message number> integer, <message ID> varchar) . . . )

To get the status of the 'openlink.public.virtuoso' group:

    nntp_get ('news.openlinksw.com:119', 'group', 'openlink.public.virtuoso');

This call returns an array of the form Array (<number of messages> integer, <first message> integer, <last message> integer)

### 17.4.2. NNTP Server

#### 17.4.2.1. Enabling the NNTP Server

The Virtuoso News Server listening port is configured in the HTTP section of the virtuoso.ini file.

    [HTTPServer]
    NewsServerPort   = 119

If the port is not defined Virtuoso will disable the News Server subsystem.

#### 17.4.2.2. NNTP Server Commands

The server supports the following commands:

- article [MessageID|Number]
- body [Number]
- group newsgroup
- head [Number]
- help
- last
- list
- mode reader
- newgroups yymmdd hhmmss
- next
- post
- xover [range]
- stat [MessageID|Number]

See Also:

News System Tables

#### 17.4.2.3. Add Groups to NNTP Server

To add a new newsgroup you must insert a row into the table DB.DBA.NEWS_GROUPS. Below is an example of an insert statement that you could use to do this:

    insert into DB.DBA.NEWS_GROUPS (NG_NAME, NG_DESC, NG_UP_INT, NG_CLEAR_INT,
    	NG_POST, NG_UP_TIME, NG_OUT_GROUP, NG_NUM, NG_FIRST, NG_LAST,
    	NG_SERVER, NG_SERV_PORT, NG_CREAT, NG_UP_MESS, NG_PASS)
    values ('openlink.public.virtuoso', 'virtuoso news group' ,
    	update interval, clear interval, 1, now(), 'openlink.public.virtuoso',
    	0, 0, 0, 'news.openlinksw.com', 110, now(), 0, 0);

If the group you want to add is local, change news.openlinksw.com to localhost, change the port to 0, and the external name to '' (that is, two single quotes).

See also the Newsgroups Administration section of the Visual Server Administration Interface.

Previous Mail Delivery & Storage | Chapter Contents | Next MIME & Internet Messages