rfc-977

Network News Transfer Protocol

B. Kantor, P. Lapsley
date1986-02 streamLegacy statusPROPOSED STANDARD pages27 canonicalhttps://www.rfc-editor.org/rfc/rfc977 doi10.17487/RFC0977
NNTP specifies a protocol for the distribution, inquiry, retrieval, and posting of news articles using a reliable stream-based transmission of news among the ARPA-Internet community. NNTP is designed so that news articles are stored in a central database allowing a subscriber to select only those items he wishes to read. Indexing, cross-referencing, and expiration of aged messages are also provided. This RFC suggests a proposed protocol for the ARPA-Internet community, and requests discussion and suggestions for improvements.

obsoleted by

Extracted elements (28)

design-rationale §1.4

NNTP is modelled on RFC 850 (USENET news article format) but makes few demands on article structure, content, or storage, so it can be adapted to non-USENET news systems. The server is a pure database interface; user-friendly functions are left to client programs which better understand their operating environment.

tcp

design-rationale §1.6

NNTP uses an interactive IHAVE/NEWNEWS mechanism for inter-server news distribution rather than flooding (sending all articles unconditionally). This allows hosts to first check which articles the remote already has, transferring only new, non-duplicate articles and eliminating redundant transfers common in UUCP-based flooding.

tcp

design-rationale §1.3

NNTP was designed so that news articles need only be stored on one central host, with subscribers on other hosts reading via stream connections. This avoids the inefficiency of mailing list distribution where a separate copy is sent to each subscriber, consuming large quantities of bandwidth, CPU, and disk at each destination.

tcp

interoperability-note §3.6.1

The posting flag in the LIST response indicates whether a newsgroup is moderated or a digest (posting prohibited), independently of whether the NNTP server permits posting for the connected client. Both restrictions may apply simultaneously.

tcp

normative-requirement §3.4 MAY

Because host news software may not immediately determine article appropriateness, a server is permitted to acknowledge successful transfer (235) and later silently discard the article. This allows asynchronous validation by the underlying news posting software.

tcp

normative-requirement §3.10.1 SHOULD

Client programs should check the server greeting (200 vs 201) to determine whether posting is permitted before allowing users to compose messages, to avoid wasted effort composing articles that cannot be posted.

tcp

normative-requirement §2.3 MUST NOT

Commands and command parameters are not case sensitive. Each command line must be terminated by a CR-LF pair and shall not exceed 512 characters.

tcp

normative-requirement §3 MUST

Every command described in Section 3 must be implemented by all NNTP servers. The 3-digit numeric response code (not the associated text) must be used by clients to determine what response was sent, as response text may vary across implementations.

tcp

normative-requirement §3 RECOMMENDED

Non-standard extension commands should begin with the letter 'X' to avoid conflict with future revisions of this specification. Extension commands may not redefine specified status response codes, and using unspecified responses for standard commands is prohibited.

tcp

normative-requirement §3.1.1 MUST NOT

Selection by message-id (ARTICLE <message-id>) does NOT alter the internally-maintained current article pointer, to facilitate reading cross-referenced articles without disrupting sequential reading state.

tcp

normative-requirement §3.10.1 MUST

When posting is attempted, the article must be presented in RFC 850 format with all required header lines. The server must make no attempt to filter characters, fold or limit lines, or otherwise process incoming text; it passes the message to the installation's news posting software.

tcp

protocol-element §2.1

NNTP servers listen for TCP connections on port 119. The protocol uses an SMTP-like command/response model over a reliable stream connection.

tcp

protocol-element §3.1

The ARTICLE command has two forms: ARTICLE <message-id> retrieves by message-id (does not alter the current article pointer), and ARTICLE [nnn] retrieves by number within the current newsgroup (sets the current article pointer). Related commands HEAD, BODY, and STAT return only headers, only body, or no text respectively.

tcp

protocol-element §3.4

The IHAVE command is used for article transfer between servers. The client sends IHAVE <messageid>; if the server wants the article it replies 335, and the client transmits the full article terminated by CR-LF.CR-LF. The server replies 235 on success, 435 if not wanted, 436 for transient failure (retry later), or 437 for permanent rejection.

tcp

protocol-element §3.8.1

The NEWNEWS command accepts wildcard newsgroup patterns using '*' (matches any substring) and '!' prefix for negation. Multiple newsgroup names and patterns may be combined with commas. An optional distributions parameter in angle brackets filters by the distribution prefix of newsgroup names.

tcp

protocol-element §3.11

The QUIT command causes the server to acknowledge and close the connection. If a client disconnects without QUIT, or if a timeout or fault occurs, the server should gracefully cease service to that client.

tcp

protocol-element §3.12

The SLAVE command indicates that the client connection is from a subsidiary server rather than a user. Servers may use this to prioritize slave connections or to preferentially retain them when shedding load. Every server must recognize and acknowledge the SLAVE command even if it gives no special treatment.

tcp

protocol-element §2.4.3

Upon initial connection the server sends either 200 (server ready, posting allowed) or 201 (server ready, no posting allowed). Code 400 indicates service discontinued; 5xx codes indicate command errors.

tcp

security-consideration §3.10.1

Access control for posting is implementation-dependent: the server signals posting permission via the initial greeting (200 vs 201) and may return 502 (access restriction or permission denied) for restricted operations. The determination of which clients and hosts may post is not specified by NNTP and is left to installation policy.

security, tcp

state-machine §3.5

NEXT advances the current article pointer to the next article in the current newsgroup; LAST moves it to the previous article. If already at the last or first article respectively, an error is returned and the pointer remains unchanged. Both commands require a newsgroup to have been selected first.

tcp

state-machine §3.2.1

The GROUP command sets the internally-maintained current article pointer to the first article of the selected newsgroup. If an invalid group is specified, the previously selected group and article remain selected. If an empty newsgroup is selected, the pointer is in an indeterminate state and should not be used.

tcp

wire-format §2.3

Command lines consist of a command word optionally followed by parameters, separated by spaces or tabs, terminated by CR-LF. Command lines must not exceed 512 characters total (including CR-LF), leaving 510 characters for the command and parameters.

tcp

wire-format §2.4.2

Status responses begin with a 3-digit numeric code. First digit indicates success/failure category: 1xx informative, 2xx ok, 3xx ok-continue, 4xx command correct but failed, 5xx unimplemented or error. Second digit indicates function category: x0x connection/misc, x1x newsgroup selection, x2x article selection, x3x distribution, x4x posting, x8x nonstandard extensions, x9x debugging.

tcp

wire-format §2.4.1

Text responses are sent as successive CR-LF-terminated lines, ended by a single period (.) on a line by itself followed by CR-LF. Lines in the original text beginning with a period have that period doubled during transmission (dot-stuffing).

tcp

wire-format §3.1.2

The ARTICLE response includes article number n and message-id <a> enclosed in angle brackets, derived from the article's Message-ID header (required by RFC 850). If the Message-ID header is missing, a single digit '0' should be supplied within the angle brackets.

tcp

wire-format §3.2

The GROUP success response (211) carries four parameters: n (estimated article count), f (first article number), l (last article number), s (newsgroup name). The estimate need not be exact but must be greater than or equal to the actual count.

tcp

wire-format §3.6

The LIST command response provides one line per newsgroup in the format: 'group last first p', where group is the newsgroup name, last and last are numeric article numbers (possibly with leading zeros), and p is 'y' (posting allowed) or 'n' (posting prohibited). If last < first, there are no current articles.

tcp

wire-format §3.7.1

The NEWGROUPS and NEWNEWS commands use a date parameter formatted as 6 digits YYMMDD and a time parameter as 6 digits HHMMSS (24-hour clock). The optional token GMT specifies UTC; otherwise the server's local timezone is assumed. Century is inferred from the 2-digit year (86→1986, 30→2030).

tcp