[//000000001]: # (nntp \- Tcl NNTP Client Library) [//000000002]: # (Generated from file 'nntp\.man' by tcllib/doctools with format 'markdown') [//000000003]: # (nntp\(n\) 1\.5\.1 tcllib "Tcl NNTP Client Library")
is either 'y' or 'n'
indicating whether posting to this newsgroup is allowed \('y'\) or prohibited
\('n'\)\.
The is either 'y' or 'n'
indicating whether posting to this newsgroup is allowed \('y'\) or prohibited
\('n'\)\.
- *nntpName* __newnews__
Query the server for a list of new articles posted to the current group in
the last day\.
- *nntpName* __newnews__ *since*
Query the server for a list of new articles posted to the current group
since the time specified by the argument *since*\. The argument *since*
can be any time string that is understood by __clock scan__\.
- *nntpName* __newnews__ *group* ?*since*?
Query the server for a list of new articles posted to the group specified by
the argument *group* since the time specified by the argument *since*
\(or in the past day if no *since* argument is passed\. The argument
*since* can be any time string that is understood by __clock scan__\.
- *nntpName* __next__
Sets the current article pointer to point to the next message \(if there is
one\) and returns the msgid of that message\.
- *nntpName* __post__ *article*
Posts an article of the form specified in RFC 1036
\([http://www\.rfc\-editor\.org/rfc/rfc1036\.txt](http://www\.rfc\-editor\.org/rfc/rfc1036\.txt),
successor to RFC 850\) to the current news group\.
- *nntpName* __slave__
Identifies a connection as being made from a slave nntp server\. This might
be used to indicate that the connection is serving multiple people and
should be given priority\. Actual use is entirely implementation dependent
and may vary from server to server\.
- *nntpName* __stat__ ?*msgid*?
The stat command is similar to the article command except that no text is
returned\. When selecting by message number within a group, the stat command
serves to set the current article pointer without sending text\. The returned
acknowledgment response will contain the message\-id, which may be of some
value\. Using the stat command to select by message\-id is valid but of
questionable value, since a selection by message\-id does NOT alter the
"current article pointer"
- *nntpName* __quit__
Gracefully close the connection after sending a NNTP QUIT command down the
socket\.
- *nntpName* __xgtitle__ ?*group\_pattern*?
Returns a tcl list where each element is of the form:
newsgroup description
If a *group\_pattern* is specified then only newsgroups that match the
pattern will have their name and description returned\.
- *nntpName* __xhdr__ *field* ?*range*?
Returns the specified header field value for the current message or for a
list of messages from the current group\. *field* is the title of a field
in the header such as from, subject, date, etc\. If *range* is not
specified or is "" then the current message is queried\. The command returns
a list of elements where each element has the form of:
msgid value
Where msgid is the number of the message and value is the value set for the
queried field\. The *range* argument can be in any of the following forms:
* __""__
The current message is queried\.
* *msgid1*\-*msgid2*
All messages between *msgid1* and *msgid2* \(including *msgid1* and
*msgid2*\) are queried\.
* *msgid1* *msgid2*
All messages between *msgid1* and *msgid2* \(including *msgid1* and
*msgid2*\) are queried\.
- *nntpName* __xover__ ?*range*?
Returns header information for the current message or for a range of
messages from the current group\. The information is returned in a tcl list
where each element is of the form:
msgid subject from date idstring bodysize headersize xref
If *range* is not specified or is "" then the current message is queried\.
The *range* argument can be in any of the following forms:
* __""__
The current message is queried\.
* *msgid1*\-*msgid2*
All messages between *msgid1* and *msgid2* \(including *msgid1* and
*msgid2*\) are queried\.
* *msgid1* *msgid2*
All messages between *msgid1* and *msgid2* \(including *msgid1* and
*msgid2*\) are queried\.
- *nntpName* __xpat__ *field* *range* ?*pattern\_list*?
Returns the specified header field value for a specified message or for a
list of messages from the current group where the messages match the
pattern\(s\) given in the pattern\_list\. *field* is the title of a field in
the header such as from, subject, date, etc\. The information is returned in
a tcl list where each element is of the form:
msgid value
Where msgid is the number of the message and value is the value set for the
queried field\. The *range* argument can be in any of the following forms:
* *msgid*
The message specified by *msgid* is queried\.
* *msgid1*\-*msgid2*
All messages between *msgid1* and *msgid2* \(including *msgid1* and
*msgid2*\) are queried\.
* *msgid1* *msgid2*
All messages between *msgid1* and *msgid2* \(including *msgid1* and
*msgid2*\) are queried\.
# EXAMPLE
A bigger example for posting a single article\.
package require nntp
set n [nntp::nntp NNTP_SERVER]
$n post "From: USER@DOMAIN.EXT (USER_FULL)
Path: COMPUTERNAME!USERNAME
Newsgroups: alt.test
Subject: Tcl test post -ignore
Message-ID: <[pid][clock seconds]
@COMPUTERNAME>
Date: [clock format [clock seconds] -format "%a, %d %
b %y %H:%M:%S GMT" -gmt true]
Test message body"
# Bugs, Ideas, Feedback
This document, and the package it describes, will undoubtedly contain bugs and
other problems\. Please report such in the category *nntp* of the [Tcllib
Trackers](http://core\.tcl\.tk/tcllib/reportlist)\. Please also report any ideas
for enhancements you may have for either package and/or documentation\.
When proposing code changes, please provide *unified diffs*, i\.e the output of
__diff \-u__\.
Note further that *attachments* are strongly preferred over inlined patches\.
Attachments can be made by going to the __Edit__ form of the ticket
immediately after its creation, and then using the left\-most button in the
secondary navigation bar\.
# KEYWORDS
[news](\.\./\.\./\.\./\.\./index\.md\#news), [nntp](\.\./\.\./\.\./\.\./index\.md\#nntp),
[nntpclient](\.\./\.\./\.\./\.\./index\.md\#nntpclient), [rfc
1036](\.\./\.\./\.\./\.\./index\.md\#rfc\_1036), [rfc
977](\.\./\.\./\.\./\.\./index\.md\#rfc\_977)
# CATEGORY
Networking