draft-ietf-nntpext-base-27.txt   rfc3977.txt 
NNTP C. Feather Network Working Group C. Feather
Internet-Draft Thus plc Request for Comments: 3977 THUS plc
Updates: 2980 (if approved) June 8, 2005 Obsoletes: 977 October 2006
Obsoletes: 977 (if approved) Updates: 2980
Expires: December 10, 2005 Category: Standards Track
Network News Transfer Protocol
draft-ietf-nntpext-base-27
Status of this Memo
By submitting this Internet-Draft, each author represents that any
applicable patent or other IPR claims of which he or she is aware
have been or will be disclosed, and any of which he or she becomes
aware will be disclosed, in accordance with Section 6 of BCP 79.
Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that
other groups may also distribute working documents as Internet-
Drafts.
Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress."
The list of current Internet-Drafts can be accessed at Network News Transfer Protocol (NNTP)
http://www.ietf.org/ietf/1id-abstracts.txt.
The list of Internet-Draft Shadow Directories can be accessed at Status of This Memo
http://www.ietf.org/shadow.html.
This Internet-Draft will expire on December 10, 2005. This document specifies an Internet standards track protocol for the
Internet community, and requests discussion and suggestions for
improvements. Please refer to the current edition of the "Internet
Official Protocol Standards" (STD 1) for the standardization state
and status of this protocol. Distribution of this memo is unlimited.
Copyright Notice Copyright Notice
Copyright (C) The Internet Society (2005). Copyright (C) The Internet Society (2006).
Abstract Abstract
The Network News Transfer Protocol (NNTP) has been in use in the The Network News Transfer Protocol (NNTP) has been in use in the
Internet for a decade and remains one of the most popular protocols Internet for a decade, and remains one of the most popular protocols
(by volume) in use today. This document is a replacement for RFC 977 (by volume) in use today. This document is a replacement for
and officially updates the protocol specification. It clarifies some RFC 977, and officially updates the protocol specification. It
vagueness in RFC 977, includes some new base functionality, and clarifies some vagueness in RFC 977, includes some new base
provides a specific mechanism to add standardized extensions to NNTP. functionality, and provides a specific mechanism to add standardized
extensions to NNTP.
Administration
This document is a product of the NNTP Working Group, chaired by Russ
Allbery and Ned Freed.
Author's Note
This document is written in XML using an NNTP-specific DTD. Custom
software is used to convert this to RFC 2629 [RFC2629] format, and
then the public "xml2rfc" package to further reduce this to text,
nroff source, and HTML.
No perl was used in producing this document.
Rights
UNIX is a registered trademark of The Open Group.
Note to the RFC Editor
The normative reference to RFC 2234 [RFC2234] and the informative
reference to RFC 2629 [RFC2629] may be replaced by
draft-crocker-abnf-rfc2234bis and draft-mrose-writing-rfcs
respectively should either or both of those documents reach RFC
status before this one.
The informative references to [NNTP-AUTH], [NNTP-STREAM], and [NNTP-
TLS] are documents which are expected to be published simultaneously
with this one and so can be replaced by references to the resulting
RFCs.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 6 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
2. Notation . . . . . . . . . . . . . . . . . . . . . . . . . . 7 1.1. Author's Note . . . . . . . . . . . . . . . . . . . . . . 4
3. Basic Concepts . . . . . . . . . . . . . . . . . . . . . . . 9 2. Notation . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.1. Commands and Responses . . . . . . . . . . . . . . . . . 9 3. Basic Concepts . . . . . . . . . . . . . . . . . . . . . . . 6
3.1.1. Multi-line data blocks . . . . . . . . . . . . . . . 10 3.1. Commands and Responses . . . . . . . . . . . . . . . . . 6
3.2. Response Codes . . . . . . . . . . . . . . . . . . . . . 11 3.1.1. Multi-line Data Blocks . . . . . . . . . . . . . . . . 8
3.2.1. Generic Response Codes . . . . . . . . . . . . . . . 13 3.2. Response Codes . . . . . . . . . . . . . . . . . . . . . 9
3.2.1.1. Examples . . . . . . . . . . . . . . . . . . . . 14 3.2.1. Generic Response Codes . . . . . . . . . . . . . . . 10
3.3. Capabilities and Extensions . . . . . . . . . . . . . . . 16 3.2.1.1. Examples . . . . . . . . . . . . . . . . . . . . 12
3.3.1. Capability descriptions . . . . . . . . . . . . . . . 17 3.3. Capabilities and Extensions . . . . . . . . . . . . . . . 14
3.3.2. Standard capabilities . . . . . . . . . . . . . . . . 17 3.3.1. Capability Descriptions . . . . . . . . . . . . . . . 14
3.3.3. Extensions . . . . . . . . . . . . . . . . . . . . . 19 3.3.2. Standard Capabilities . . . . . . . . . . . . . . . . 15
3.3.4. Initial IANA register . . . . . . . . . . . . . . . . 20 3.3.3. Extensions . . . . . . . . . . . . . . . . . . . . . 16
3.4. Mandatory and Optional Commands . . . . . . . . . . . . . 22 3.3.4. Initial IANA Register . . . . . . . . . . . . . . . . 18
3.4.1. Reading and Transit Servers . . . . . . . . . . . . . 22 3.4. Mandatory and Optional Commands . . . . . . . . . . . . . 20
3.4.2. Mode switching . . . . . . . . . . . . . . . . . . . 23 3.4.1. Reading and Transit Servers . . . . . . . . . . . . . 21
3.5. Pipelining . . . . . . . . . . . . . . . . . . . . . . . 24 3.4.2. Mode Switching . . . . . . . . . . . . . . . . . . . 21
3.5.1. Examples . . . . . . . . . . . . . . . . . . . . . . 25 3.5. Pipelining . . . . . . . . . . . . . . . . . . . . . . . 22
3.6. Articles . . . . . . . . . . . . . . . . . . . . . . . . 25 3.5.1. Examples . . . . . . . . . . . . . . . . . . . . . . 23
4. The WILDMAT format . . . . . . . . . . . . . . . . . . . . . 28 3.6. Articles . . . . . . . . . . . . . . . . . . . . . . . . 24
4.1. Wildmat syntax . . . . . . . . . . . . . . . . . . . . . 28 4. The WILDMAT Format . . . . . . . . . . . . . . . . . . . . . 25
4.2. Wildmat semantics . . . . . . . . . . . . . . . . . . . . 28 4.1. Wildmat Syntax . . . . . . . . . . . . . . . . . . . . . 26
4.3. Extensions . . . . . . . . . . . . . . . . . . . . . . . 29 4.2. Wildmat Semantics . . . . . . . . . . . . . . . . . . . . 26
4.4. Examples . . . . . . . . . . . . . . . . . . . . . . . . 30 4.3. Extensions . . . . . . . . . . . . . . . . . . . . . . . 27
5. Session administration commands . . . . . . . . . . . . . . . 31 4.4. Examples . . . . . . . . . . . . . . . . . . . . . . . . 27
5.1. Initial Connection . . . . . . . . . . . . . . . . . . . 31 5. Session Administration Commands . . . . . . . . . . . . . . . 28
5.2. CAPABILITIES . . . . . . . . . . . . . . . . . . . . . . 32 5.1. Initial Connection . . . . . . . . . . . . . . . . . . . 28
5.3. MODE READER . . . . . . . . . . . . . . . . . . . . . . . 35 5.2. CAPABILITIES . . . . . . . . . . . . . . . . . . . . . . 29
5.4. QUIT . . . . . . . . . . . . . . . . . . . . . . . . . . 37 5.3. MODE READER . . . . . . . . . . . . . . . . . . . . . . . 32
6. Article posting and retrieval . . . . . . . . . . . . . . . . 38 5.4. QUIT . . . . . . . . . . . . . . . . . . . . . . . . . . 34
6.1. Group and article selection . . . . . . . . . . . . . . . 38 6. Article Posting and Retrieval . . . . . . . . . . . . . . . . 35
6.1.1. GROUP . . . . . . . . . . . . . . . . . . . . . . . . 39 6.1. Group and Article Selection . . . . . . . . . . . . . . . 36
6.1.2. LISTGROUP . . . . . . . . . . . . . . . . . . . . . . 42 6.1.1. GROUP . . . . . . . . . . . . . . . . . . . . . . . . 36
6.1.3. LAST . . . . . . . . . . . . . . . . . . . . . . . . 44 6.1.2. LISTGROUP . . . . . . . . . . . . . . . . . . . . . . 39
6.1.4. NEXT . . . . . . . . . . . . . . . . . . . . . . . . 46 6.1.3. LAST . . . . . . . . . . . . . . . . . . . . . . . . 42
6.2. Retrieval of articles and article sections . . . . . . . 47 6.1.4. NEXT . . . . . . . . . . . . . . . . . . . . . . . . 44
6.2.1. ARTICLE . . . . . . . . . . . . . . . . . . . . . . . 48 6.2. Retrieval of Articles and Article Sections . . . . . . . 45
6.2.2. HEAD . . . . . . . . . . . . . . . . . . . . . . . . 51 6.2.1. ARTICLE . . . . . . . . . . . . . . . . . . . . . . . 46
6.2.3. BODY . . . . . . . . . . . . . . . . . . . . . . . . 53 6.2.2. HEAD . . . . . . . . . . . . . . . . . . . . . . . . 49
6.2.4. STAT . . . . . . . . . . . . . . . . . . . . . . . . 55 6.2.3. BODY . . . . . . . . . . . . . . . . . . . . . . . . 51
6.3. Article posting . . . . . . . . . . . . . . . . . . . . . 58 6.2.4. STAT . . . . . . . . . . . . . . . . . . . . . . . . 53
6.3.1. POST . . . . . . . . . . . . . . . . . . . . . . . . 58 6.3. Article Posting . . . . . . . . . . . . . . . . . . . . . 56
6.3.2. IHAVE . . . . . . . . . . . . . . . . . . . . . . . . 60 6.3.1. POST . . . . . . . . . . . . . . . . . . . . . . . . 56
7. Information commands . . . . . . . . . . . . . . . . . . . . 64 6.3.2. IHAVE . . . . . . . . . . . . . . . . . . . . . . . . 58
7.1. DATE . . . . . . . . . . . . . . . . . . . . . . . . . . 64 7. Information Commands . . . . . . . . . . . . . . . . . . . . 61
7.2. HELP . . . . . . . . . . . . . . . . . . . . . . . . . . 65 7.1. DATE . . . . . . . . . . . . . . . . . . . . . . . . . . 61
7.3. NEWGROUPS . . . . . . . . . . . . . . . . . . . . . . . . 65 7.2. HELP . . . . . . . . . . . . . . . . . . . . . . . . . . 62
7.4. NEWNEWS . . . . . . . . . . . . . . . . . . . . . . . . . 67 7.3. NEWGROUPS . . . . . . . . . . . . . . . . . . . . . . . . 63
7.5. Time . . . . . . . . . . . . . . . . . . . . . . . . . . 68 7.4. NEWNEWS . . . . . . . . . . . . . . . . . . . . . . . . . 64
7.5.1. Examples . . . . . . . . . . . . . . . . . . . . . . 68 7.5. Time . . . . . . . . . . . . . . . . . . . . . . . . . . 65
7.6. The LIST commands . . . . . . . . . . . . . . . . . . . . 69 7.5.1. Examples . . . . . . . . . . . . . . . . . . . . . . 66
7.6.1. LIST . . . . . . . . . . . . . . . . . . . . . . . . 69 7.6. The LIST Commands . . . . . . . . . . . . . . . . . . . . 66
7.6.2. Standard LIST keywords . . . . . . . . . . . . . . . 72 7.6.1. LIST . . . . . . . . . . . . . . . . . . . . . . . . 67
7.6.3. LIST ACTIVE . . . . . . . . . . . . . . . . . . . . . 73 7.6.2. Standard LIST Keywords . . . . . . . . . . . . . . . 69
7.6.4. LIST ACTIVE.TIMES . . . . . . . . . . . . . . . . . . 74 7.6.3. LIST ACTIVE . . . . . . . . . . . . . . . . . . . . . 70
7.6.5. LIST DISTRIB.PATS . . . . . . . . . . . . . . . . . . 75 7.6.4. LIST ACTIVE.TIMES . . . . . . . . . . . . . . . . . . 71
7.6.6. LIST NEWSGROUPS . . . . . . . . . . . . . . . . . . . 75 7.6.5. LIST DISTRIB.PATS . . . . . . . . . . . . . . . . . . 72
8. Article field access commands . . . . . . . . . . . . . . . . 77 7.6.6. LIST NEWSGROUPS . . . . . . . . . . . . . . . . . . . 73
8.1. Article metadata . . . . . . . . . . . . . . . . . . . . 77 8. Article Field Access Commands . . . . . . . . . . . . . . . . 73
8.1.1. The :bytes metadata item . . . . . . . . . . . . . . 77 8.1. Article Metadata . . . . . . . . . . . . . . . . . . . . 74
8.1.2. The :lines metadata item . . . . . . . . . . . . . . 78 8.1.1. The :bytes Metadata Item . . . . . . . . . . . . . . 74
8.2. Database consistency . . . . . . . . . . . . . . . . . . 78 8.1.2. The :lines Metadata Item . . . . . . . . . . . . . . 75
8.3. OVER . . . . . . . . . . . . . . . . . . . . . . . . . . 79 8.2. Database Consistency . . . . . . . . . . . . . . . . . . 75
8.4. LIST OVERVIEW.FMT . . . . . . . . . . . . . . . . . . . . 83 8.3. OVER . . . . . . . . . . . . . . . . . . . . . . . . . . 76
8.5. HDR . . . . . . . . . . . . . . . . . . . . . . . . . . . 85 8.4. LIST OVERVIEW.FMT . . . . . . . . . . . . . . . . . . . . 81
8.6. LIST HEADERS . . . . . . . . . . . . . . . . . . . . . . 90 8.5. HDR . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
9. Augmented BNF Syntax for NNTP . . . . . . . . . . . . . . . . 93 8.6. LIST HEADERS . . . . . . . . . . . . . . . . . . . . . . 87
9.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 93 9. Augmented BNF Syntax for NNTP . . . . . . . . . . . . . . . . 90
9.2. Commands . . . . . . . . . . . . . . . . . . . . . . . . 93 9.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 90
9.3. Command continuation . . . . . . . . . . . . . . . . . . 95 9.2. Commands . . . . . . . . . . . . . . . . . . . . . . . . 92
9.4. Responses . . . . . . . . . . . . . . . . . . . . . . . . 95 9.3. Command Continuation . . . . . . . . . . . . . . . . . . 93
9.4.1. Generic responses . . . . . . . . . . . . . . . . . . 95 9.4. Responses . . . . . . . . . . . . . . . . . . . . . . . . 93
9.4.2. Initial response line contents . . . . . . . . . . . 96 9.4.1. Generic Responses . . . . . . . . . . . . . . . . . . 93
9.4.3. Multi-line response contents . . . . . . . . . . . . 97 9.4.2. Initial Response Line Contents . . . . . . . . . . . 94
9.5. Capability lines . . . . . . . . . . . . . . . . . . . . 98 9.4.3. Multi-line Response Contents . . . . . . . . . . . . 94
9.6. LIST variants . . . . . . . . . . . . . . . . . . . . . . 99 9.5. Capability Lines . . . . . . . . . . . . . . . . . . . . 95
9.7. Articles . . . . . . . . . . . . . . . . . . . . . . . . 100 9.6. LIST Variants . . . . . . . . . . . . . . . . . . . . . . 96
9.8. General non-terminals . . . . . . . . . . . . . . . . . . 100 9.7. Articles . . . . . . . . . . . . . . . . . . . . . . . . 97
9.9. Extensions and Validation . . . . . . . . . . . . . . . . 102 9.8. General Non-terminals . . . . . . . . . . . . . . . . . . 97
10. Internationalisation Considerations . . . . . . . . . . . . . 104 9.9. Extensions and Validation . . . . . . . . . . . . . . . . 99
10.1. Introduction and historical situation . . . . . . . . . . 104 10. Internationalisation Considerations . . . . . . . . . . . . .100
10.2. This specification . . . . . . . . . . . . . . . . . . . 104 10.1. Introduction and Historical Situation . . . . . . . . . .100
10.3. Outstanding issues . . . . . . . . . . . . . . . . . . . 106 10.2. This Specification . . . . . . . . . . . . . . . . . . .101
11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 107 10.3. Outstanding Issues . . . . . . . . . . . . . . . . . . .102
12. Security Considerations . . . . . . . . . . . . . . . . . . . 108 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . .103
12.1. Personal and Proprietary Information . . . . . . . . . . 108 12. Security Considerations . . . . . . . . . . . . . . . . . . .103
12.2. Abuse of Server Log Information . . . . . . . . . . . . . 108 12.1. Personal and Proprietary Information . . . . . . . . . .104
12.3. Weak Authentication and Access Control . . . . . . . . . 108 12.2. Abuse of Server Log Information . . . . . . . . . . . . .104
12.4. DNS Spoofing . . . . . . . . . . . . . . . . . . . . . . 109 12.3. Weak Authentication and Access Control . . . . . . . . .104
12.5. UTF-8 issues . . . . . . . . . . . . . . . . . . . . . . 109 12.4. DNS Spoofing . . . . . . . . . . . . . . . . . . . . . .104
12.6. Caching of capability lists . . . . . . . . . . . . . . . 110 12.5. UTF-8 Issues . . . . . . . . . . . . . . . . . . . . . .105
13. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 112 12.6. Caching of Capability Lists . . . . . . . . . . . . . . .106
14. References . . . . . . . . . . . . . . . . . . . . . . . . . 115 13. Acknowledgements . . . . . . . . . . . . . . . . . . . . . .107
14.1. Normative References . . . . . . . . . . . . . . . . . . 115 14. References . . . . . . . . . . . . . . . . . . . . . . . . .110
14.2. Informative References . . . . . . . . . . . . . . . . . 115 14.1. Normative References . . . . . . . . . . . . . . . . . .110
A. Interaction with other specifications . . . . . . . . . . . . 117 14.2. Informative References . . . . . . . . . . . . . . . . .110
A.1. Header folding . . . . . . . . . . . . . . . . . . . . . 117 A. Interaction with Other Specifications . . . . . . . . . . . .112
A.2. Message-IDs . . . . . . . . . . . . . . . . . . . . . . . 117 A.1. Header Folding . . . . . . . . . . . . . . . . . . . . .112
A.3. Article posting . . . . . . . . . . . . . . . . . . . . . 119 A.2. Message-IDs . . . . . . . . . . . . . . . . . . . . . . .112
B. Summary of Commands . . . . . . . . . . . . . . . . . . . . . 120 A.3. Article Posting . . . . . . . . . . . . . . . . . . . . .114
C. Summary of Response Codes . . . . . . . . . . . . . . . . . . 122 B. Summary of Commands . . . . . . . . . . . . . . . . . . . . .115
D. Changes from RFC 977 . . . . . . . . . . . . . . . . . . . . 127 C. Summary of Response Codes . . . . . . . . . . . . . . . . . .117
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 129 D. Changes from RFC 977 . . . . . . . . . . . . . . . . . . . .121
Intellectual Property and Copyright Statements . . . . . . . . . 130
1. Introduction 1. Introduction
This document specifies the Network News Transfer Protocol (NNTP), This document specifies the Network News Transfer Protocol (NNTP),
which is used for the distribution, inquiry, retrieval, and posting which is used for the distribution, inquiry, retrieval, and posting
of Netnews articles using a reliable stream-based mechanism. For of Netnews articles using a reliable stream-based mechanism. For
news reading clients, NNTP enables retrieval of news articles that news-reading clients, NNTP enables retrieval of news articles that
are stored in a central database, giving subscribers the ability to are stored in a central database, giving subscribers the ability to
select only those articles they wish to read. select only those articles they wish to read.
The Netnews model provides for indexing, cross-referencing, and The Netnews model provides for indexing, cross-referencing, and
expiration of aged messages. NNTP is designed for efficient expiration of aged messages. NNTP is designed for efficient
transmission of Netnews articles over a reliable full duplex transmission of Netnews articles over a reliable full duplex
communication channel. communication channel.
While the protocol specification in this document is largely Although the protocol specification in this document is largely
compatible with the version specified in RFC 977 [RFC977], there are compatible with the version specified in RFC 977 [RFC977], a number
a number of changes which are summarised in Appendix D. In of changes are summarised in Appendix D. In particular:
particular:
o the default character set is changed from US-ASCII [ANSI1986] to o the default character set is changed from US-ASCII [ANSI1986] to
UTF-8 [RFC3629] (note that US-ASCII is a subset of UTF-8); UTF-8 [RFC3629] (note that US-ASCII is a subset of UTF-8);
o a number of commands that were optional in RFC 977 or have been
taken from RFC 2980 [RFC2980] are now mandatory; o a number of commands that were optional in RFC 977 or that have
been taken from RFC 2980 [RFC2980] are now mandatory; and
o a CAPABILITIES command has been added to allow clients to o a CAPABILITIES command has been added to allow clients to
determine what functionality is available from a server. determine what functionality is available from a server.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in RFC 2119 [RFC2119]. document are to be interpreted as described in RFC 2119 [RFC2119].
An implementation is not compliant if it fails to satisfy one or more An implementation is not compliant if it fails to satisfy one or more
of the MUST requirements for this protocol. An implementation that of the MUST requirements for this protocol. An implementation that
satisfies all the MUST and all the SHOULD requirements for its satisfies all the MUST and all the SHOULD requirements for its
protocols is said to be "unconditionally compliant"; one that protocols is said to be "unconditionally compliant"; one that
satisfies all the MUST requirements but not all the SHOULD satisfies all the MUST requirements but not all the SHOULD
requirements for NNTP is said to be "conditionally compliant". requirements for NNTP is said to be "conditionally compliant".
For the remainder of this document, the term "client" or "client For the remainder of this document, the terms "client" and "client
host" refers to a host making use of the NNTP service, while the term host" refer to a host making use of the NNTP service, while the terms
"server" or "server host" refers to a host that offers the NNTP "server" and "server host" refer to a host that offers the NNTP
service. service.
1.1. Author's Note
This document is written in XML using an NNTP-specific DTD. Custom
software is used to convert this to RFC 2629 [RFC2629] format, and
then the public "xml2rfc" package to further reduce this to text,
nroff source, and HTML.
No perl was used in producing this document.
2. Notation 2. Notation
The following notational conventions are used in this document. The following notational conventions are used in this document.
UPPERCASE indicates literal text to be included in the UPPERCASE indicates literal text to be included in the
command; command.
lowercase indicates a token described elsewhere;
[brackets] indicate that the argument is optional; lowercase indicates a token described elsewhere.
ellipsis... indicates that the argument may be repeated any
number of times (it must occur at least once); [brackets] indicate that the enclosed material is optional.
elliptical indicates that the argument may be repeated any
... marks number of times (it must occur at least once).
vertical|bar indicates a choice of two mutually exclusive vertical|bar indicates a choice of two mutually exclusive
arguments (exactly one must be provided). arguments (exactly one must be provided).
The name "message-id" for a command or response argument indicates The name "message-id" for a command or response argument indicates
that it is the message-id of an article as described in Section 3.6, that it is the message-id of an article as described in Section 3.6,
including the angle brackets. including the angle brackets.
The name "wildmat" for an argument indicates that it is a wildmat as The name "wildmat" for an argument indicates that it is a wildmat as
defined in Section 4. If the argument does not meet the requirements defined in Section 4. If the argument does not meet the requirements
of that section (for example, if it does not fit the grammar of of that section (for example, if it does not fit the grammar of
Section 4.1) the NNTP server MAY place some interpretation on it (not Section 4.1), the NNTP server MAY place some interpretation on it
specified by this document) or otherwise MUST treat it as a syntax (not specified by this document) or otherwise MUST treat it as a
error. syntax error.
Responses for each command will be described in tables listing the Responses for each command will be described in tables listing the
required format of a response followed by the meaning that should be required format of a response followed by the meaning that should be
ascribed to that response. ascribed to that response.
The terms "NUL", "TAB", "LF", "CR, and "space" refer to the octets The terms "NUL", "TAB", "LF", "CR, and "space" refer to the octets
%x00, %x09, %x0A, %x0D, and %x20 respectively (that is, the octets %x00, %x09, %x0A, %x0D, and %x20, respectively (that is, the octets
with those codes in US-ASCII [ANSI1986] and thus UTF-8 [RFC3629]). with those codes in US-ASCII [ANSI1986] and thus in UTF-8 [RFC3629]).
The term "CRLF" or "CRLF pair" means the sequence CR immediately The term "CRLF" or "CRLF pair" means the sequence CR immediately
followed by LF (that is, %x0D.0A). A "printable US-ASCII character" followed by LF (that is, %x0D.0A). A "printable US-ASCII character"
is an octet in the range %x21-7E. Quoted characters refer to the is an octet in the range %x21-7E. Quoted characters refer to the
octets with those codes in US-ASCII (so "." and "<" refer to %x2E and octets with those codes in US-ASCII (so "." and "<" refer to %x2E and
%x3C) and will always be printable US-ASCII characters; similarly, %x3C) and will always be printable US-ASCII characters; similarly,
"digit" refers to the octets %x30-39. "digit" refers to the octets %x30-39.
A "keyword" MUST consist only of US-ASCII letters, digits, and the A "keyword" MUST consist only of US-ASCII letters, digits, and the
characters dot (".") and dash ("-"), and MUST begin with a letter. characters dot (".") and dash ("-") and MUST begin with a letter.
Keywords MUST be at least three characters and MUST NOT exceed 12 Keywords MUST be at least three characters in length.
characters.
Examples in this document are not normative but serve to illustrate Examples in this document are not normative but serve to illustrate
usages, arguments, and responses. In the examples, a "[C]" will be usages, arguments, and responses. In the examples, a "[C]" will be
used to represent the client host and a "[S]" will be used to used to represent the client host and an "[S]" will be used to
represent the server host. Most of the examples do not rely on a represent the server host. Most of the examples do not rely on a
particular server state. In some cases, however, they do assume that particular server state. In some cases, however, they do assume that
the currently selected newsgroup (see the GROUP command the currently selected newsgroup (see the GROUP command,
(Section 6.1.1)) is invalid; when so, this is indicated at the start Section 6.1.1) is invalid; when so, this is indicated at the start of
of the example. Examples may use commands or other keywords not the example. Examples may use commands or other keywords not defined
defined in this specification (such as an XENCRYPT command). These in this specification (such as an XENCRYPT command). These will be
will be used to illustrate some point and do not imply that any such used to illustrate some point and do not imply that any such command
command is defined elsewhere or needs to exist in any particular is defined elsewhere or needs to exist in any particular
implementation. implementation.
Terms which might be read as specifying details of a client or server Terms that might be read as specifying details of a client or server
implementation, such as "database", are used simply to ease implementation, such as "database", are used simply to ease
description. Providing that implementations conform to the protocol description. Provided that implementations conform to the protocol
and format specifications in this document, no specific technique is and format specifications in this document, no specific technique is
mandated. mandated.
3. Basic Concepts 3. Basic Concepts
3.1. Commands and Responses 3.1. Commands and Responses
NNTP operates over any reliable bidirectional 8-bit-wide data stream NNTP operates over any reliable bi-directional 8-bit-wide data stream
channel. When the connection is established, the NNTP server host channel. When the connection is established, the NNTP server host
MUST send a greeting. The client host and server host then exchange MUST send a greeting. The client host and server host then exchange
commands and responses (respectively) until the connection is closed commands and responses (respectively) until the connection is closed
or aborted. If the connection used is TCP, then the server host or aborted. If the connection used is TCP, then the server host
starts the NNTP service by listening on a TCP port. When a client starts the NNTP service by listening on a TCP port. When a client
host wishes to make use of the service, it MUST establish a TCP host wishes to make use of the service, it MUST establish a TCP
connection with the server host by connecting to that host on the connection with the server host by connecting to that host on the
same port on which the server is listening. same port on which the server is listening.
The character set for all NNTP commands is UTF-8 [RFC3629]. Commands The character set for all NNTP commands is UTF-8 [RFC3629]. Commands
in NNTP MUST consist of a keyword, which MAY be followed by one or in NNTP MUST consist of a keyword, which MAY be followed by one or
more arguments. A CRLF pair MUST terminate all commands. Multiple more arguments. A CRLF pair MUST terminate all commands. Multiple
commands MUST NOT be on the same line. Unless otherwise noted commands MUST NOT be on the same line. Unless otherwise noted
elsewhere in this document, arguments SHOULD consist of printable US- elsewhere in this document, arguments SHOULD consist of printable US-
ASCII characters. Keywords and arguments MUST be each separated by ASCII characters. Keywords and arguments MUST each be separated by
one or more space or TAB characters. Command lines MUST NOT exceed one or more space or TAB characters. Command lines MUST NOT exceed
512 octets, which includes the terminating CRLF pair. The arguments 512 octets, which includes the terminating CRLF pair. The arguments
MUST NOT exceed 497 octets. A server MAY relax these limits for MUST NOT exceed 497 octets. A server MAY relax these limits for
commands defined in an extension. commands defined in an extension.
Where this specification permits UTF-8 characters outside the range Where this specification permits UTF-8 characters outside the range
U+0000 to U+007F, implementations MUST NOT use the Byte Order Mark of U+0000 to U+007F, implementations MUST NOT use the Byte Order Mark
(U+FEFF, encoding %xEF.BB.BF), and MUST use the Word Joiner (U+2060, (U+FEFF, encoding %xEF.BB.BF) and MUST use the Word Joiner (U+2060,
encoding %xE2.91.A0) for the meaning Zero Width No-Break Space, in encoding %xE2.91.A0) for the meaning Zero Width No-Break Space in
command lines and the initial lines of responses, and SHOULD apply command lines and the initial lines of responses. Implementations
these same principles throughout. SHOULD apply these same principles throughout.
The term "character" means a single Unicode code point and The term "character" means a single Unicode code point.
implementations are not required to carry out normalisation. Thus Implementations are not required to carry out Unicode normalisation.
U+0084 (A-dieresis) is one character while U+0041 U+0308 (A composed Thus, U+0084 (A-dieresis) is one character, while U+0041 U+0308 (A
with dieresis) is two; the two need not be treated as equivalent. composed with dieresis) is two; the two need not be treated as
equivalent.
Commands may have variants, using a second keyword immediately after Commands may have variants; if so, they use a second keyword
the first to indicate which variant is required. The only such immediately after the first to indicate which variant is required.
commands in this specification are LIST and MODE. Note that such The only such commands in this specification are LIST and MODE. Note
variants are sometimes referred to as if they were commands in their that such variants are sometimes referred to as if they were commands
own right: "the LIST ACTIVE" command should be read as shorthand for in their own right: "the LIST ACTIVE" command should be read as
"the ACTIVE variant of the LIST command". shorthand for "the ACTIVE variant of the LIST command".
Keywords are case-insensitive; the case of keywords for commands MUST Keywords are case insensitive; the case of keywords for commands MUST
be ignored by the server. Command and response arguments are case- be ignored by the server. Command and response arguments are case or
or language-specific only when stated, either in this document or in language specific only when stated, either in this document or in
other relevant specifications. other relevant specifications.
In some cases a command involves more data than just a single line. In some cases, a command involves more data than just a single line.
The further data may be sent either immediately after the command The further data may be sent either immediately after the command
line (there are no instances of this in this specification, but there line (there are no instances of this in this specification, but there
are in extensions such as [NNTP-STREAM]) or following a request from are in extensions such as [NNTP-STREAM]) or following a request from
the server (indicated by a 3xx response). the server (indicated by a 3xx response).
Each response MUST start with a three-digit response code that is Each response MUST start with a three-digit response code that is
sufficient to distinguish all responses. Certain valid responses are sufficient to distinguish all responses. Certain valid responses are
defined to be multi-line; for all others, the response is contained defined to be multi-line; for all others, the response is contained
in a single line. The initial line of the response MUST NOT exceed in a single line. The initial line of the response MUST NOT exceed
512 octets, which includes the response code and the terminating CRLF 512 octets, which includes the response code and the terminating CRLF
pair; an extension MAY specify a greater maximum for commands that it pair; an extension MAY specify a greater maximum for commands that it
defines, but not for any other command. Single-line responses defines, but not for any other command. Single-line responses
consist of an initial line only. Multi-line responses consist of an consist of an initial line only. Multi-line responses consist of an
initial line followed by a multi-line data block. initial line followed by a multi-line data block.
An NNTP server MAY have an inactivity autologout timer. Such a timer An NNTP server MAY have an inactivity autologout timer. Such a timer
SHOULD be of at least three minutes duration, with the exception that SHOULD be of at least three minutes' duration, with the exception
there MAY be a shorter limit on how long the server is willing to that there MAY be a shorter limit on how long the server is willing
wait for the first command from the client. The receipt of any to wait for the first command from the client. The receipt of any
command from the client during the timer interval SHOULD suffice to command from the client during the timer interval SHOULD suffice to
reset the autologout timer. Similarly, the receipt of any reset the autologout timer. Similarly, the receipt of any
significant amount of data from a client that is sending a multi-line significant amount of data from a client that is sending a multi-line
data block (such as during a POST or IHAVE command) SHOULD suffice to data block (such as during a POST or IHAVE command) SHOULD suffice to
reset the autologout timer. When the timer expires, the server reset the autologout timer. When the timer expires, the server
SHOULD close the connection without sending any response to the SHOULD close the connection without sending any response to the
client. client.
3.1.1. Multi-line data blocks 3.1.1. Multi-line Data Blocks
A multi-line data block is used in certain commands and responses. A multi-line data block is used in certain commands and responses.
It MUST adhere to the following rules: It MUST adhere to the following rules:
1. The block consists of a sequence of zero or more "lines", each 1. The block consists of a sequence of zero or more "lines", each
being a stream of octets ending with a CRLF pair. Apart from being a stream of octets ending with a CRLF pair. Apart from
those line endings, the stream MUST NOT include the octets NUL, those line endings, the stream MUST NOT include the octets NUL,
LF, or CR. LF, or CR.
2. In a multi-line response, the block immediately follows the CRLF 2. In a multi-line response, the block immediately follows the CRLF
at the end of the initial line of the response. When used in any at the end of the initial line of the response. When used in any
other context, the specific command will define when the block is other context, the specific command will define when the block is
sent. sent.
3. If any line of the data block begins with the "termination octet" 3. If any line of the data block begins with the "termination octet"
("." or %x2E), that line MUST be "dot-stuffed" by pre-pending an ("." or %x2E), that line MUST be "dot-stuffed" by prepending an
additional termination octet to that line of the block. additional termination octet to that line of the block.
4. The lines of the block MUST be followed by a terminating line 4. The lines of the block MUST be followed by a terminating line
consisting of a single termination octet followed by a CRLF pair consisting of a single termination octet followed by a CRLF pair
in the normal way. Thus, unless it is empty, a multi-line block in the normal way. Thus, unless it is empty, a multi-line block
is always terminated with the five octets CRLF "." CRLF is always terminated with the five octets CRLF "." CRLF
(%x0D.0A.2E.0D.0A). (%x0D.0A.2E.0D.0A).
5. When interpreting a multi-line block, the "dot-stuffing" MUST be 5. When a multi-line block is interpreted, the "dot-stuffing" MUST
undone; i.e. the recipient MUST ensure that, in any line be undone; i.e., the recipient MUST ensure that, in any line
beginning with the termination octet followed by octets other beginning with the termination octet followed by octets other
than a CRLF pair, that initial termination octet is disregarded. than a CRLF pair, that initial termination octet is disregarded.
6. Likewise, the terminating line ("." CRLF or %x2E.0D.0A) MUST NOT 6. Likewise, the terminating line ("." CRLF or %x2E.0D.0A) MUST NOT
be considered part of the multi-line block; i.e. the recipient be considered part of the multi-line block; i.e., the recipient
MUST ensure that any line beginning with the termination octet MUST ensure that any line beginning with the termination octet
followed immediately by a CRLF pair is disregarded; (the first followed immediately by a CRLF pair is disregarded. (The first
CRLF pair of the terminating CRLF "." CRLF of a non-empty block CRLF pair of the terminating CRLF "." CRLF of a non-empty block
is, of course, part of the last line of the block). is, of course, part of the last line of the block.)
Note that texts using an encoding (such as UTF-16 or UTF-32) that may Note that texts using an encoding (such as UTF-16 or UTF-32) that may
contain the octets NUL, LF, or CR other than a CRLF pair cannot be contain the octets NUL, LF, or CR other than a CRLF pair cannot be
reliably conveyed in the above format (that is, they violate the MUST reliably conveyed in the above format (that is, they violate the MUST
requirement above). However, except when stated otherwise, this requirement above). However, except when stated otherwise, this
specification does not require the content to be UTF-8 and therefore specification does not require the content to be UTF-8, and therefore
(subject to that same requirement) it MAY include octets above and (subject to that same requirement) it MAY include octets above and
below 128 mixed arbitrarily. below 128 mixed arbitrarily.
This document does not place any limit on the length of a line in a This document does not place any limit on the length of a line in a
multi-line block. However, the standards that define the format of multi-line block. However, the standards that define the format of
articles may do so. articles may do so.
3.2. Response Codes 3.2. Response Codes
Each response MUST begin with a three-digit status indicator. These Each response MUST begin with a three-digit status indicator. These
are status reports from the server and indicate the response to the are status reports from the server and indicate the response to the
last command received from the client. last command received from the client.
The first digit of the response broadly indicates the success, The first digit of the response broadly indicates the success,
failure, or progress of the previous command: failure, or progress of the previous command:
1xx - Informative message. 1xx - Informative message
2xx - Command completed OK. 2xx - Command completed OK
3xx - Command OK so far; send the rest of it. 3xx - Command OK so far; send the rest of it
4xx - Command was syntactically correct but failed for some 4xx - Command was syntactically correct but failed for some reason
reason. 5xx - Command unknown, unsupported, unavailable, or syntax error
5xx - Command unknown, unsupported, unavailable, or syntax error.
The next digit in the code indicates the function response category: The next digit in the code indicates the function response category:
x0x - Connection, set-up, and miscellaneous messages x0x - Connection, setup, and miscellaneous messages
x1x - Newsgroup selection x1x - Newsgroup selection
x2x - Article selection x2x - Article selection
x3x - Distribution functions x3x - Distribution functions
x4x - Posting x4x - Posting
x8x - Reserved for authentication and privacy extensions x8x - Reserved for authentication and privacy extensions
x9x - Reserved for private use (non-standard extensions) x9x - Reserved for private use (non-standard extensions)
Certain responses contain arguments such as numbers and names in Certain responses contain arguments such as numbers and names in
addition to the status indicator. In those cases, to simplify addition to the status indicator. In those cases, to simplify
interpretation by the client the number and type of such arguments is interpretation by the client, the number and type of such arguments
fixed for each response code, as is whether or not the code is is fixed for each response code, as is whether the code is
single-line or multi-line. Any extension MUST follow this principle single-line or multi-line. Any extension MUST follow this principle
as well. Note that, for historical reasons, the 211 response code is as well. Note that, for historical reasons, the 211 response code is
an exception to this in that the response may be single-line or an exception to this in that the response may be single-line or
multi-line depending on the command (GROUP or LISTGROUP) that multi-line depending on the command (GROUP or LISTGROUP) that
generated it. In all other cases, the client MUST only use the generated it. In all other cases, the client MUST only use the
status indicator itself to determine the nature of the response. The status indicator itself to determine the nature of the response. The
exact response codes that can be returned by any given command are exact response codes that can be returned by any given command are
detailed in the description of that command. detailed in the description of that command.
Arguments MUST be separated from the numeric status indicator and Arguments MUST be separated from the numeric status indicator and
from each other by a single space. All numeric arguments MUST be in from each other by a single space. All numeric arguments MUST be in
base 10 (decimal) format, and MAY have leading zeros. String base 10 (decimal) format and MAY have leading zeros. String
arguments MUST contain at least one character and MUST NOT contain arguments MUST contain at least one character and MUST NOT contain
TAB, LF, CR, or space. The server MAY add any text after the TAB, LF, CR, or space. The server MAY add any text after the
response code or last argument as appropriate, and the client MUST response code or last argument, as appropriate, and the client MUST
NOT make decisions based on this text. Such text MUST be separated NOT make decisions based on this text. Such text MUST be separated
from the numeric status indicator or the last argument by at least from the numeric status indicator or the last argument by at least
one space. one space.
The server MUST respond to any command with the appropriate generic The server MUST respond to any command with the appropriate generic
response (given in Section 3.2.1) if it represents the situation. response (given in Section 3.2.1) if it represents the situation.
Otherwise, each recognized command MUST return one of the response Otherwise, each recognized command MUST return one of the response
codes specifically listed in its description or in an extension. A codes specifically listed in its description or in an extension. A
server MAY provide extensions to this specification, including new server MAY provide extensions to this specification, including new
commands, new variants or features of existing commands, and other commands, new variants or features of existing commands, and other
ways of changing the internal state of the server. However, the ways of changing the internal state of the server. However, the
server MUST NOT produce any other responses to a client that does not server MUST NOT produce any other responses to a client that does not
invoke any of the additional features. (Therefore a client that invoke any of the additional features. (Therefore, a client that
restricts itself to this specification will only receive the restricts itself to this specification will only receive the
responses that are listed.) responses that are listed.)
If a client receives an unexpected response, it SHOULD use the first If a client receives an unexpected response, it SHOULD use the first
digit of the response to determine the result. For example, an digit of the response to determine the result. For example, an
unexpected 2xx should be taken as success and an unexpected 4xx or unexpected 2xx should be taken as success, and an unexpected 4xx or
5xx as failure. 5xx as failure.
Response codes not specified in this document MAY be used for any Response codes not specified in this document MAY be used for any
installation-specific additional commands also not specified. These installation-specific additional commands also not specified. These
SHOULD be chosen to fit the pattern of x9x specified above. SHOULD be chosen to fit the pattern of x9x specified above.
Neither this document nor any registered extension (see Neither this document nor any registered extension (see
Section 3.3.3) will specify any response codes of the x9x pattern. Section 3.3.3) will specify any response codes of the x9x pattern.
(Implementers of extensions are accordingly cautioned not to use such (Implementers of extensions are accordingly cautioned not to use such
responses for extensions that may subsequently be submitted for responses for extensions that may subsequently be submitted for
registration.) registration.)
3.2.1. Generic Response Codes 3.2.1. Generic Response Codes
The server MUST respond to any command with the appropriate one of The server MUST respond to any command with the appropriate one of
the following generic responses if it represents the situation. the following generic responses if it represents the situation.
If the command is not recognized, or it is an optional command that If the command is not recognized, or if it is an optional command
is not implemented by the server, the response code 500 MUST be that is not implemented by the server, the response code 500 MUST be
returned. returned.
If there is a syntax error in the arguments of a recognized command, If there is a syntax error in the arguments of a recognized command,
including the case where more arguments are provided than the command including the case where more arguments are provided than the command
specifies or the command line is longer than the server accepts, the specifies or the command line is longer than the server accepts, the
response code 501 MUST be returned. The line MUST NOT be truncated response code 501 MUST be returned. The line MUST NOT be truncated
or split and then interpreted. Note that where a command has or split and then interpreted. Note that where a command has
variants depending on a second keyword (e.g. LIST ACTIVE and LIST variants depending on a second keyword (e.g., LIST ACTIVE and LIST
NEWSGROUPS), then 501 MUST be used when the base command is NEWSGROUPS), 501 MUST be used when the base command is implemented
implemented but the requested variant is not, and 500 MUST be used but the requested variant is not, and 500 MUST be used only when the
only when the base command itself is not implemented. base command itself is not implemented.
As a special case, if an argument is required to be a base64-encoded If an argument is required to be a base64-encoded string [RFC4648]
string [RFC3548] (there are no such arguments in this specification, (there are no such arguments in this specification, but there may be
but there may be in extensions) and is not validly encoded, the in extensions) and is not validly encoded, the response code 504 MUST
response code 504 MUST be returned. be returned.
If the server experiences an internal fault or problem that means it If the server experiences an internal fault or problem that means it
is unable to carry out the command (for example, a necessary file is is unable to carry out the command (for example, a necessary file is
missing or a necessary service could not be contacted), the response missing or a necessary service could not be contacted), the response
code 403 MUST be returned. If the server recognizes the command but code 403 MUST be returned. If the server recognizes the command but
does not provide an optional feature (for example because it does not does not provide an optional feature (for example, because it does
store the required information), or only handles a subset of not store the required information), or if it only handles a subset
legitimate cases (see the HDR command (Section 8.5) for an example), of legitimate cases (see the HDR command, Section 8.5, for an
the response code 503 MUST be returned. example), the response code 503 MUST be returned.
If the client is not authorized to use the specified facility when If the client is not authorized to use the specified facility when
the server is in its current state, then the appropriate one of the the server is in its current state, then the appropriate one of the
following response codes MUST be used. following response codes MUST be used.
502: it is necessary to terminate the connection and start a new one 502: It is necessary to terminate the connection and to start a new
with the appropriate authority before the command can be used. one with the appropriate authority before the command can be used.
Historically, some mode-switching servers (see Section 3.4.1) have Historically, some mode-switching servers (see Section 3.4.1) used
used this response to indicate that this command will become this response to indicate that this command will become available
available after the MODE READER (Section 5.3) command is used, but after the MODE READER command (Section 5.3) is used, but this
this usage is not conforming to this specification and MUST NOT be usage does not conform to this specification and MUST NOT be used.
used. Note that the server MUST NOT close the connection Note that the server MUST NOT close the connection immediately
immediately after a 502 response except at the initial connection after a 502 response except at the initial connection
(Section 5.1) and with the MODE READER command. (Section 5.1) and with the MODE READER command.
480: the client must authenticate itself to the server (that is, 480: The client must authenticate itself to the server (that is, it
provide information as to the identity of the client) before the must provide information as to the identity of the client) before
facility can be used on this connection. This will involve the the facility can be used on this connection. This will involve
use of an authentication extension such as [NNTP-AUTH]. the use of an authentication extension such as [NNTP-AUTH].
483: the client must negotiate appropriate privacy protection on the 483: The client must negotiate appropriate privacy protection on the
connection. This will involve the use of a privacy extension such connection. This will involve the use of a privacy extension such
as [NNTP-TLS]. as [NNTP-TLS].
401: the client must change the state of the connection in some other 401: The client must change the state of the connection in some other
manner. The first argument of the response MUST be the capability manner. The first argument of the response MUST be the capability
label (see Section 5.2) of the facility (usually an extension, label (see Section 5.2) of the facility that provides the
which may be a private extension) that provides the necessary necessary mechanism (usually an extension, which may be a private
mechanism. The server MUST NOT use this response code except as extension). The server MUST NOT use this response code except as
specified by the definition of the capability in question. specified by the definition of the capability in question.
If the server has to terminate the connection for some reason, it If the server has to terminate the connection for some reason, it
MUST give a 400 response code to the next command and then MUST give a 400 response code to the next command and then
immediately close the connection. Following a 400 response, clients immediately close the connection. Following a 400 response, clients
SHOULD NOT simply reconnect immediately and retry the same actions. SHOULD NOT simply reconnect immediately and retry the same actions.
Rather, a client SHOULD either use an exponentially increasing delay Rather, a client SHOULD either use an exponentially increasing delay
between retries (e.g. double the waiting time after each 400 between retries (e.g., double the waiting time after each 400
response) or present any associated text to the user for them to response) or present any associated text to the user for them to
decide whether and when to retry. decide whether and when to retry.
The client MUST be prepared to receive any of these responses for any The client MUST be prepared to receive any of these responses for any
command (except, of course, that the server MUST NOT generate a 500 command (except, of course, that the server MUST NOT generate a 500
response code for mandatory commands). response code for mandatory commands).
3.2.1.1. Examples 3.2.1.1. Examples
Example of an unknown command: Example of an unknown command:
skipping to change at page 15, line 36 skipping to change at page 13, line 6
[C] HEAD 53 54 55 [C] HEAD 53 54 55
[S] 501 Too many arguments [S] 501 Too many arguments
Example of a bad wildmat: Example of a bad wildmat:
[C] LIST ACTIVE u[ks].* [C] LIST ACTIVE u[ks].*
[S] 501 Syntax error [S] 501 Syntax error
Example of a base64-encoding error (the second argument is meant to Example of a base64-encoding error (the second argument is meant to
be base64-encoded): be base64 encoded):
[C] XENCRYPT RSA abcd=efg [C] XENCRYPT RSA abcd=efg
[S] 504 Base64 encoding error [S] 504 Base64 encoding error
Example of an attempt to access a facility not available to this Example of an attempt to access a facility not available to this
connection: connection:
[C] MODE READER [C] MODE READER
[S] 200 Reader mode, posting permitted [S] 200 Reader mode, posting permitted
[C] IHAVE <i.am.an.article.you.will.want@example.com> [C] IHAVE <i.am.an.article.you.will.want@example.com>
[S] 500 Permission denied [S] 500 Permission denied
Example of an attempt to access a facility requiring authentication: Example of an attempt to access a facility requiring authentication:
[C] GROUP secret.group [C] GROUP secret.group
[S] 480 Permission denied [S] 480 Permission denied
followed by a successful attempt following such authentication: Example of a successful attempt following such authentication:
[C] XSECRET fred flintstone [C] XSECRET fred flintstone
[S] 290 Password for fred accepted [S] 290 Password for fred accepted
[C] GROUP secret.group [C] GROUP secret.group
[S] 211 5 1 20 secret.group selected [S] 211 5 1 20 secret.group selected
Example of an attempt to access a facility requiring privacy: Example of an attempt to access a facility requiring privacy:
[C] GROUP secret.group [C] GROUP secret.group
[S] 483 Secure connection required [S] 483 Secure connection required
[C] XENCRYPT [C] XENCRYPT
[Client and server negotiate encryption on the link] [Client and server negotiate encryption on the link]
[S] 283 Encrypted link established [S] 283 Encrypted link established
[C] GROUP secret.group [C] GROUP secret.group
[S] 211 5 1 20 secret.group selected [S] 211 5 1 20 secret.group selected
Example of a need to change mode before using a facility: Example of a need to change mode before a facility is used:
[C] GROUP binary.group [C] GROUP binary.group
[S] 401 XHOST Not on this virtual host [S] 401 XHOST Not on this virtual host
[C] XHOST binary.news.example.org [C] XHOST binary.news.example.org
[S] 290 binary.news.example.org virtual host selected [S] 290 binary.news.example.org virtual host selected
[C] GROUP binary.group [C] GROUP binary.group
[S] 211 5 1 77 binary.group selected [S] 211 5 1 77 binary.group selected
Example of a temporary failure: Example of a temporary failure:
skipping to change at page 17, line 5 skipping to change at page 14, line 26
3.3. Capabilities and Extensions 3.3. Capabilities and Extensions
Not all NNTP servers provide exactly the same facilities, both Not all NNTP servers provide exactly the same facilities, both
because this specification allows variation and because servers may because this specification allows variation and because servers may
provide extensions. A set of facilities that are related are called provide extensions. A set of facilities that are related are called
a "capability". This specification provides a way to determine what a "capability". This specification provides a way to determine what
capabilities are available, includes a list of standard capabilities, capabilities are available, includes a list of standard capabilities,
and includes a mechanism (the extension mechanism) for defining new and includes a mechanism (the extension mechanism) for defining new
capabilities. capabilities.
3.3.1. Capability descriptions 3.3.1. Capability Descriptions
A client can determine the available capabilities of the server by A client can determine the available capabilities of the server by
using the CAPABILITIES command (Section 5.2). This returns a using the CAPABILITIES command (Section 5.2). This returns a
capability list, which is a list of capability lines. Each line capability list, which is a list of capability lines. Each line
describes one available capability. describes one available capability.
Each capability line consists of one or more tokens, which MUST be Each capability line consists of one or more tokens, which MUST be
separated by one or more space or TAB characters. A token is a separated by one or more space or TAB characters. A token is a
string of 1 or more printable UTF-8 characters (that is, either string of 1 or more printable UTF-8 characters (that is, either
printable US-ASCII characters or any UTF-8 sequence outside the US- printable US-ASCII characters or any UTF-8 sequence outside the US-
ASCII range, but not space or TAB). Unless stated otherwise, tokens ASCII range, but not space or TAB). Unless stated otherwise, tokens
are case-insensitive. Each capability line consists of: are case insensitive. Each capability line consists of the
following:
o The capability label, which is a keyword indicating the o The capability label, which is a keyword indicating the
capability. A capability label may be defined by this capability. A capability label may be defined by this
specification or a successor, or may be defined by an extension. specification or a successor, or by an extension.
o The label is then followed by zero or more tokens, which are o The label is then followed by zero or more tokens, which are
arguments of the capability. The form and meaning of these tokens arguments of the capability. The form and meaning of these tokens
is specific to each capability. is specific to each capability.
The server MUST ensure that the capability list accurately reflects The server MUST ensure that the capability list accurately reflects
the capabilities (including extensions) currently available. If a the capabilities (including extensions) currently available. If a
capability is only available with the server in a certain state (for capability is only available with the server in a certain state (for
example, only after authentication), the list MUST only include the example, only after authentication), the list MUST only include the
capability label when in that state. Similarly, if only some of the capability label when the server is in that state. Similarly, if
commands in an extension will be available, or if the behaviour of only some of the commands in an extension will be available, or if
the extension will change in some other manner, according to the the behaviour of the extension will change in some other manner,
state of the server, this MUST be indicated by different arguments in according to the state of the server, this MUST be indicated by
the capability line. different arguments in the capability line.
Note that a capability line can only begin with a letter. Lines Note that a capability line can only begin with a letter. Lines
beginning with other characters are reserved for future versions of beginning with other characters are reserved for future versions of
this specification. In order to interoperate with such versions, this specification. In order to interoperate with such versions,
clients MUST be prepared to receive lines beginning with other clients MUST be prepared to receive lines beginning with other
characters and MUST ignore any they do not understand. characters and MUST ignore any they do not understand.
3.3.2. Standard capabilities 3.3.2. Standard Capabilities
The following capabilities are defined by this specification. The following capabilities are defined by this specification.
VERSION VERSION
This capability MUST be advertised by all servers and MUST be the This capability MUST be advertised by all servers and MUST be the
first capability in the capability list; it indicates the first capability in the capability list; it indicates the
version(s) of NNTP that the server supports. There must be at version(s) of NNTP that the server supports. There must be at
least one argument; each argument is a decimal number and MUST NOT least one argument; each argument is a decimal number and MUST NOT
have a leading zero. Version numbers are assigned only in RFCs have a leading zero. Version numbers are assigned only in RFCs
which update or replace this specification; servers MUST NOT that update or replace this specification; servers MUST NOT create
create their own version numbers. their own version numbers.
The version number of this specification is 2. The version number of this specification is 2.
READER READER
This capability indicates that the server implements the various This capability indicates that the server implements the various
commands useful for reading clients. commands useful for reading clients.
IHAVE IHAVE
This capability indicates that the server implements the IHAVE This capability indicates that the server implements the IHAVE
command. command.
skipping to change at page 18, line 50 skipping to change at page 16, line 28
This capability MAY be provided by a server. If so, the arguments This capability MAY be provided by a server. If so, the arguments
SHOULD be used to provide information such as the server software SHOULD be used to provide information such as the server software
name and version number. The client MUST NOT use this line to name and version number. The client MUST NOT use this line to
determine capabilities of the server. (While servers often determine capabilities of the server. (While servers often
provide this information in the initial greeting, clients need to provide this information in the initial greeting, clients need to
guess whether this is the case; this capability makes it clear guess whether this is the case; this capability makes it clear
what the information is.) what the information is.)
MODE-READER MODE-READER
This capability indicates that the server is mode-switching This capability indicates that the server is mode-switching
(Section 3.4.2) and the MODE READER command needs to be used to (Section 3.4.2) and that the MODE READER command needs to be used
enable the READER capability. to enable the READER capability.
3.3.3. Extensions 3.3.3. Extensions
Although NNTP is widely and robustly deployed, some parts of the Although NNTP is widely and robustly deployed, some parts of the
Internet community might wish to extend the NNTP service. It must be Internet community might wish to extend the NNTP service. It must be
emphasized that any extension to NNTP should not be considered emphasized that any extension to NNTP should not be considered
lightly. NNTP's strength comes primarily from its simplicity. lightly. NNTP's strength comes primarily from its simplicity.
Experience with many protocols has shown that: Experience with many protocols has shown that:
Protocols with few options tend towards ubiquity, whilst protocols Protocols with few options tend towards ubiquity, whilst protocols
skipping to change at page 19, line 29 skipping to change at page 17, line 7
extending the NNTP service will likely outweigh the benefit. extending the NNTP service will likely outweigh the benefit.
An extension is a package of associated facilities, often but not An extension is a package of associated facilities, often but not
always including one or more new commands. Each extension MUST always including one or more new commands. Each extension MUST
define at least one new capability label (this will often, but need define at least one new capability label (this will often, but need
not, be the name of one of these new commands). While any additional not, be the name of one of these new commands). While any additional
capability information can normally be specified using arguments to capability information can normally be specified using arguments to
that label, an extension MAY define more than one capability label. that label, an extension MAY define more than one capability label.
However, this SHOULD be limited to exceptional circumstances. However, this SHOULD be limited to exceptional circumstances.
An extension is either a private extension or else its capabilities An extension is either a private extension, or its capabilities are
are included in the IANA registry of capabilities (see Section 3.3.4) included in the IANA registry of capabilities (see Section 3.3.4) and
and it is defined in an RFC (in which case it is a "registered it is defined in an RFC (in which case it is a "registered
extension"). Such RFCs either must be on the standards track or must extension"). Such RFCs either must be on the standards track or must
define an IESG-approved experimental protocol. define an IESG-approved experimental protocol.
The definition of an extension must include: The definition of an extension must include the following:
o a descriptive name for the extension;
o the capability label or labels defined by the extension; the o a descriptive name for the extension.
o the capability label or labels defined by the extension (the
capability label of a registered extension MUST NOT begin with capability label of a registered extension MUST NOT begin with
"X"; "X").
o the syntax, values, and meanings of any arguments for each
capability label defined by the extension; o The syntax, values, and meanings of any arguments for each
o any new NNTP commands associated with the extension - the names of capability label defined by the extension.
o Any new NNTP commands associated with the extension (the names of
commands associated with registered extensions MUST NOT begin with commands associated with registered extensions MUST NOT begin with
"X"; "X").
o the syntax and possible values of arguments associated with the
new NNTP commands;
o the response codes and possible values of arguments for the
responses of the new NNTP commands;
o any new arguments the extension associates with any other pre-
existing NNTP commands;
o any increase in the maximum length of commands and initial o The syntax and possible values of arguments associated with the
response lines over the value specified in this document; new NNTP commands.
o a specific statement about the effect on pipelining this extension
may have (if any); o The response codes and possible values of arguments for the
o a specific statement about the circumstances when use of this responses of the new NNTP commands.
o Any new arguments the extension associates with any other
pre-existing NNTP commands.
o Any increase in the maximum length of commands and initial
response lines over the value specified in this document.
o A specific statement about the effect on pipelining that this
extension may have (if any).
o A specific statement about the circumstances when use of this
extension can alter the contents of the capabilities list (other extension can alter the contents of the capabilities list (other
than the new capability labels it defines); than the new capability labels it defines).
o the circumstances under which the extension can cause any pre-
existing command to produce a 401, 480, or 483 response; o A specific statement about the circumstances under which the
o how the use of MODE READER on a mode-switching server interacts extension can cause any pre-existing command to produce a 401,
with the extension; 480, or 483 response.
o how support for the extension affects the behaviour of a server
and NNTP client in any other manner not outlined above; o A description of how the use of MODE READER on a mode-switching
o formal syntax as described in Section 9.9. server interacts with the extension.
o A description of how support for the extension affects the
behaviour of a server and NNTP client in any other manner not
outlined above.
o Formal syntax as described in Section 9.9.
A private extension MAY or MAY NOT be included in the capabilities A private extension MAY or MAY NOT be included in the capabilities
list. If it is, the capability label MUST begin with "X". A server list. If it is, the capability label MUST begin with "X". A server
MAY provide additional keywords - for new commands and also for new MAY provide additional keywords (for new commands and also for new
variants of existing commands - as part of a private extension. To variants of existing commands) as part of a private extension. To
avoid the risk of a clash with a future registered extension, these avoid the risk of a clash with a future registered extension, these
keywords SHOULD begin with "X". keywords SHOULD begin with "X".
If the server advertises a capability defined by a registered If the server advertises a capability defined by a registered
extension, it MUST implement the extension so as to fully conform extension, it MUST implement the extension so as to fully conform
with the specification (for example, it MUST implement all of the with the specification (for example, it MUST implement all the
commands that the extension describes as mandatory). If it does not commands that the extension describes as mandatory). If it does not
implement the extension as specified, it MUST NOT list the extension implement the extension as specified, it MUST NOT list the extension
in the capabilities list under its registered name; in this case it in the capabilities list under its registered name. In that case, it
MAY, but SHOULD NOT, provide a private extension (not listed, or MAY, but SHOULD NOT, provide a private extension (not listed, or
listed with a different name) that implements part of the extension listed with a different name) that implements part of the extension
or implements the commands of the extension with a different meaning. or implements the commands of the extension with a different meaning.
A server MUST NOT send different response codes to basic NNTP A server MUST NOT send different response codes to basic NNTP
commands documented here or commands documented in registered commands documented here or to commands documented in registered
extensions in response to the availability or use of a private extensions in response to the availability or use of a private
extension. extension.
3.3.4. Initial IANA register 3.3.4. Initial IANA Register
IANA is requested to maintain a registry of NNTP capability labels. IANA will maintain a registry of NNTP capability labels. All
All capability labels in the registry MUST be keywords and MUST NOT capability labels in the registry MUST be keywords and MUST NOT begin
begin with X. with X.
The initial contents of the registry consists of these entries: The initial content of the registry consists of these entries:
+--------------------+-------------------------+--------------------+ +-------------------+--------------------------+--------------------+
| Label | Meaning | Definition | | Label | Meaning | Definition |
+--------------------+-------------------------+--------------------+ +-------------------+--------------------------+--------------------+
| AUTHINFO | Authentication | [NNTP-AUTH] | | AUTHINFO | Authentication | [NNTP-AUTH] |
| | | | | | | |
| HDR | Batched header | Section 3.3.2, | | HDR | Batched header retrieval | Section 3.3.2, |
| | retrieval | Section 8.5, and | | | | Section 8.5, and |
| | | Section 8.6 | | | | Section 8.6 |
| | | | | | | |
| IHAVE | IHAVE command available | Section 3.3.2 and | | IHAVE | IHAVE command available | Section 3.3.2 and |
| | | Section 6.3.2 | | | | Section 6.3.2 |
| | | | | | | |
| IMPLEMENTATION | Server | Section 3.3.2 | | IMPLEMENTATION | Server | Section 3.3.2 |
| | implementation-specific | | | | implementation-specific | |
| | information | | | | information | |
| | | | | | | |
| LIST | LIST command variants | Section 3.3.2 and | | LIST | LIST command variants | Section 3.3.2 and |
| | | Section 7.6.1 | | | | Section 7.6.1 |
| | | | | | | |
| MODE-READER | Mode-switching server | Section 3.4.2 | | MODE-READER | Mode-switching server | Section 3.4.2 |
| | and MODE READER command | | | | and MODE READER command | |
| | available | | | | available | |
| | | | | | | |
| NEWNEWS | NEWNEWS command | Section 3.3.2 and | | NEWNEWS | NEWNEWS command | Section 3.3.2 and |
| | available | Section 7.4 | | | available | Section 7.4 |
| | | | | | | |
| OVER | Overview support | Section 3.3.2, | | OVER | Overview support | Section 3.3.2, |
| | | Section 8.3, and | | | | Section 8.3, and |
| | | Section 8.4 | | | | Section 8.4 |
| | | | | | | |
| POST | POST command available | Section 3.3.2 and | | POST | POST command available | Section 3.3.2 and |
| | | Section 6.3.1 | | | | Section 6.3.1 |
| | | | | | | |
| READER | Reader commands | Section 3.3.2 | | READER | Reader commands | Section 3.3.2 |
| | available | | | | available | |
| | | | | | | |
| SASL | Supported SASL | [NNTP-AUTH] | | SASL | Supported SASL | [NNTP-AUTH] |
| | mechanisms | | | | mechanisms | |
| | | | | | | |
| STARTTLS | Transport layer | [NNTP-TLS] | | STARTTLS | Transport layer security | [NNTP-TLS] |
| | security | | | | | |
| | | | | STREAMING | Streaming feeds | [NNTP-STREAM] |
| STREAMING | Streaming feeds | [NNTP-STREAM] | | | | |
| | | | | VERSION | Supported NNTP versions | Section 3.3.2 |
| VERSION | Supported NNTP versions | Section 3.3.2 | +-------------------+--------------------------+--------------------+
+--------------------+-------------------------+--------------------+
3.4. Mandatory and Optional Commands 3.4. Mandatory and Optional Commands
For a number of reasons, not all the commands in this specification For a number of reasons, not all the commands in this specification
are mandatory. However, it is equally undesirable for every command are mandatory. However, it is equally undesirable for every command
to be optional, since this means that a client will have no idea what to be optional, since this means that a client will have no idea what
facilities are available. Therefore, as a compromise, some of the facilities are available. Therefore, as a compromise, some of the
commands in this specification are mandatory - they must be supported commands in this specification are mandatory (they must be supported
by all servers - while the remainder are not. The latter are then by all servers) while the remainder are not. The latter are then
subdivided into bundles, each indicated by a single capability label. subdivided into bundles, each indicated by a single capability label.
o If the label is included in the capability list returned by the o If the label is included in the capability list returned by the
server, the server MUST support all commands in that bundle. server, the server MUST support all commands in that bundle.
o If the label is not included, the server MAY support none or some o If the label is not included, the server MAY support none or some
of the commands, but SHOULD NOT support all of them. In general, of the commands but SHOULD NOT support all of them. In general,
there will be no way for a client to determine which commands are there will be no way for a client to determine which commands are
supported without trying them. supported without trying them.
The bundles have been chosen to provide useful functionality, and The bundles have been chosen to provide useful functionality, and
therefore server authors are discouraged from implementing only part therefore server authors are discouraged from implementing only part
of a bundle. of a bundle.
The description of each command will either indicate that it is The description of each command will either indicate that it is
mandatory, or will give, using the term "indicating capability", the mandatory, or will give, using the term "indicating capability", the
capability label indicating whether or not the bundle including this capability label indicating whether the bundle including this command
command is available. is available.
Where a server does not implement a command, it MUST always generate Where a server does not implement a command, it MUST always generate
a 500 generic response code (or a 501 generic response code in the a 500 generic response code (or a 501 generic response code in the
case of a variant of a command depending on a second keyword where case of a variant of a command depending on a second keyword where
the base command is recognised). Otherwise the command MUST be fully the base command is recognised). Otherwise, the command MUST be
implemented as specified; a server MUST NOT only partially implement fully implemented as specified; a server MUST NOT only partially
any of the commands in this specification. (Client authors should implement any of the commands in this specification. (Client authors
note that some servers, not conforming to this specification, will should note that some servers not conforming to this specification
return a 502 generic response code to some commands that are not will return a 502 generic response code to some commands that are not
implemented.) implemented.)
Note: some commands have cases that require other commands to be used Note: some commands have cases that require other commands to be used
first. If the former command is implemented but the latter is not, first. If the former command is implemented but the latter is not,
the former MUST still generate the relevant specific response code. the former MUST still generate the relevant specific response code.
For example, if ARTICLE (Section 6.2.1) is implemented but GROUP For example, if ARTICLE (Section 6.2.1) is implemented but GROUP
(Section 6.1.1) is not, the correct response to "ARTICLE 1234" (Section 6.1.1) is not, the correct response to "ARTICLE 1234"
remains 412. remains 412.
3.4.1. Reading and Transit Servers 3.4.1. Reading and Transit Servers
NNTP is traditionally used in two different ways. The first use is NNTP is traditionally used in two different ways. The first use is
"reading", where the client fetches articles from a large store "reading", where the client fetches articles from a large store
maintained by the server for immediate or later presentation to a maintained by the server for immediate or later presentation to a
user, and sends articles created by that user back to the server (an user and sends articles created by that user back to the server (an
action called "posting") to be stored and distributed to other stores action called "posting") to be stored and distributed to other stores
and users. The second use is for the bulk transfer of articles from and users. The second use is for the bulk transfer of articles from
one store to another. Since the hosts doing this transfer tend to be one store to another. Since the hosts making this transfer tend to
peers in a network that transmit articles among one another, rather be peers in a network that transmit articles among one another, and
than end-user systems, this process is called "peering" or "transit" not end-user systems, this process is called "peering" or "transit".
(even so, one host is still the client and the other is the server). (Even so, one host is still the client and the other is the server).
In practice these two uses are so different that some server In practice, these two uses are so different that some server
implementations are optimised for reading or for transit and, as a implementations are optimised for reading or for transit and, as a
result, do not offer the other facility or only offer limited result, do not offer the other facility or only offer limited
features. Other implementations are more general and offer both. features. Other implementations are more general and offer both.
This specification allows for this by bundling the relevant commands This specification allows for this by bundling the relevant commands
accordingly: the IHAVE command is designed for transit, while the accordingly: the IHAVE command is designed for transit, while the
commands indicated by the READER capability are designed for reading commands indicated by the READER capability are designed for reading
clients. clients.
Except as an effect of the MODE READER (Section 5.3) command on a Except as an effect of the MODE READER command (Section 5.3) on a
mode-switching server, once a server advertises either or both of the mode-switching server, once a server advertises either or both of the
IHAVE or READER capabilities, it MUST continue to advertise them for IHAVE or READER capabilities, it MUST continue to advertise them for
the entire session. the entire session.
A server MAY provide different modes of behaviour (transit, reader, A server MAY provide different modes of behaviour (transit, reader,
or a combination) to different client connections and MAY use or a combination) to different client connections and MAY use
external information, such as the IP address of the client, to external information, such as the IP address of the client, to
determine which mode to provide to any given connection. determine which mode to provide to any given connection.
The official TCP port for the NNTP service is 119. However, if a The official TCP port for the NNTP service is 119. However, if a
host wishes to offer separate servers for transit and reading host wishes to offer separate servers for transit and reading
clients, port 433 SHOULD be used for the transit server and 119 for clients, port 433 SHOULD be used for the transit server and 119 for
the reading server. the reading server.
3.4.2. Mode switching 3.4.2. Mode Switching
An implementation MAY, but SHOULD NOT, provide both transit and An implementation MAY, but SHOULD NOT, provide both transit and
reader facilities on the same server but require the client to select reader facilities on the same server but require the client to select
which it wishes to use. Such an arrangement is called a "mode- which it wishes to use. Such an arrangement is called a
switching" server. "mode-switching" server.
A mode-switching server has two modes: A mode-switching server has two modes:
o Transit mode, which applies after the initial connection:
* it MUST advertise the MODE-READER capability; o Transit mode, which applies after the initial connection.
* it MUST NOT advertise the READER capability.
* It MUST advertise the MODE-READER capability.
* It MUST NOT advertise the READER capability.
However, the server MAY cease to advertise the MODE-READER However, the server MAY cease to advertise the MODE-READER
capability after the client uses any command except CAPABILITIES. capability after the client uses any command except CAPABILITIES.
o Reading mode, after a successful MODE READER (Section 5.3)
command: o Reading mode, after a successful MODE READER command (see Section
* it MUST NOT advertise the MODE-READER capability; 5.3).
* it MUST advertise the READER capability;
* it MAY NOT advertise the IHAVE capability even if it was * It MUST NOT advertise the MODE-READER capability.
* It MUST advertise the READER capability.
* It MAY NOT advertise the IHAVE capability, even if it was
advertising it in transit mode. advertising it in transit mode.
A client SHOULD only issue a MODE READER command to a server if it is A client SHOULD only issue a MODE READER command to a server if it is
advertising the MODE-READER capability. If the server does not advertising the MODE-READER capability. If the server does not
support CAPABILITIES (and therefore does not conform to this support CAPABILITIES (and therefore does not conform to this
specification), the client MAY use the following heuristic: specification), the client MAY use the following heuristic:
o if the client wishes to use any "reader" commands, it SHOULD use
the MODE READER command immediately after the initial connection; o If the client wishes to use any "reader" commands, it SHOULD use
o otherwise it SHOULD NOT use the MODE READER command. the MODE READER command immediately after the initial connection.
In each case it should be prepared for some commands to be
o Otherwise, it SHOULD NOT use the MODE READER command.
In each case, it should be prepared for some commands to be
unavailable that would have been available if it had made the other unavailable that would have been available if it had made the other
choice. choice.
3.5. Pipelining 3.5. Pipelining
NNTP is designed to operate over a reliable bi-directional connection NNTP is designed to operate over a reliable bi-directional
such as TCP. Therefore, if a command does not depend on the response connection, such as TCP. Therefore, if a command does not depend on
to the previous one, it should not matter if it is sent before that the response to the previous one, it should not matter if it is sent
response is received. Doing this is called "pipelining". However, before that response is received. Doing this is called "pipelining".
certain server implementations throw away all text received from the However, certain server implementations throw away all text received
client following certain commands before sending their response. If from the client following certain commands before sending their
this happens, pipelining will be affected because one or more response. If this happens, pipelining will be affected because one
commands will have been ignored or misinterpreted, and the client or more commands will have been ignored or misinterpreted, and the
will be matching the wrong responses to each command. Since there client will be matching the wrong responses to each command. Since
are significant benefits to pipelining, but also circumstances where there are significant benefits to pipelining, but also circumstances
it is reasonable or common for servers to behave in the above manner, where it is reasonable or common for servers to behave in the above
this document puts certain requirements on both clients and servers. manner, this document puts certain requirements on both clients and
servers.
Except where stated otherwise, a client MAY use pipelining. That is, Except where stated otherwise, a client MAY use pipelining. That is,
it may send a command before receiving the response for the previous it may send a command before receiving the response for the previous
command. The server MUST allow pipelining and MUST NOT throw away command. The server MUST allow pipelining and MUST NOT throw away
any text received after a command. Irrespective of whether or not any text received after a command. Irrespective of whether
pipelining is used, the server MUST process commands in the order pipelining is used, the server MUST process commands in the order
they are sent. they are sent.
If the specific description of a command says it "MUST NOT be If the specific description of a command says it "MUST NOT be
pipelined", that command MUST end any pipeline of commands. That is, pipelined", that command MUST end any pipeline of commands. That is,
the client MUST NOT send any following command until receiving the the client MUST NOT send any following command until it receives the
CRLF at the end of the response from the command. The server MAY CRLF at the end of the response from the command. The server MAY
ignore any data received after the command and before the CRLF at the ignore any data received after the command and before the CRLF at the
end of the response is sent to the client. end of the response is sent to the client.
The initial connection must not be part of a pipeline; that is, the The initial connection must not be part of a pipeline; that is, the
client MUST NOT send any command until receiving the CRLF at the end client MUST NOT send any command until it receives the CRLF at the
of the greeting. end of the greeting.
If the client uses blocking system calls to send commands, it MUST If the client uses blocking system calls to send commands, it MUST
ensure that the amount of text sent in pipelining does not cause a ensure that the amount of text sent in pipelining does not cause a
deadlock between transmission and reception. The amount of text deadlock between transmission and reception. The amount of text
involved will depend on window sizes in the transmission layer, and involved will depend on window sizes in the transmission layer;
is typically 4k octets for TCP. (Since the server only sends data in typically, it is 4k octets for TCP. (Since the server only sends
response to commands from the client, the converse problem does not data in response to commands from the client, the converse problem
occur.) does not occur.)
3.5.1. Examples 3.5.1. Examples
Example of correct use of pipelining: Example of correct use of pipelining:
[C] GROUP misc.test [C] GROUP misc.test
[C] STAT [C] STAT
[C] NEXT [C] NEXT
[S] 211 1234 3000234 3002322 misc.test [S] 211 1234 3000234 3002322 misc.test
[S] 223 3000234 <45223423@example.com> retrieved [S] 223 3000234 <45223423@example.com> retrieved
skipping to change at page 25, line 33 skipping to change at page 24, line 5
Example of incorrect use of pipelining (the MODE READER command may Example of incorrect use of pipelining (the MODE READER command may
not be pipelined): not be pipelined):
[C] MODE READER [C] MODE READER
[C] DATE [C] DATE
[C] NEXT [C] NEXT
[S] 200 Server ready, posting allowed [S] 200 Server ready, posting allowed
[S] 223 3000237 <668929@example.org> retrieved [S] 223 3000237 <668929@example.org> retrieved
The DATE command has been thrown away by the server and so there is The DATE command has been thrown away by the server, so there is no
no 111 response to match it. 111 response to match it.
3.6. Articles 3.6. Articles
NNTP is intended to transfer articles between clients and servers. NNTP is intended to transfer articles between clients and servers.
For the purposes of this specification, articles are required to For the purposes of this specification, articles are required to
conform to the rules in this section and clients and servers MUST conform to the rules in this section, and clients and servers MUST
correctly process any article received from the other that does so. correctly process any article received from the other that does so.
Note that this requirement applies only to the contents of Note that this requirement applies only to the contents of
communications over NNTP; it does not prevent the client or server communications over NNTP; it does not prevent the client or server
from subsequently rejecting an article for reasons of local policy. from subsequently rejecting an article for reasons of local policy.
Also see Appendix A for further restrictions on the format of Also see Appendix A for further restrictions on the format of
articles in some uses of NNTP. articles in some uses of NNTP.
An article consists of two parts: the headers and the body. They are An article consists of two parts: the headers and the body. They are
separated by a single empty line, or in other words by two separated by a single empty line, or in other words by two
consecutive CRLF pairs (if there is more than one empty line, the consecutive CRLF pairs (if there is more than one empty line, the
second and subsequent ones are part of the body). In order to meet second and subsequent ones are part of the body). In order to meet
the general requirements of NNTP, an article MUST NOT include the the general requirements of NNTP, an article MUST NOT include the
octet NUL, MUST NOT contain the octets LF and CR other than as part octet NUL, MUST NOT contain the octets LF and CR other than as part
of a CRLF pair, and MUST end with a CRLF pair. This specification of a CRLF pair, and MUST end with a CRLF pair. This specification
puts no further restrictions on the body; in particular, it MAY be puts no further restrictions on the body; in particular, it MAY be
empty. empty.
The headers of an article consist of one or more header lines. Each The headers of an article consist of one or more header lines. Each
header line consists of a header name, a colon, a space, the header header line consists of a header name, a colon, a space, the header
content, and a CRLF in that order. The name consists of one or more content, and a CRLF, in that order. The name consists of one or more
printable US-ASCII characters other than colon and, for the purposes printable US-ASCII characters other than colon and, for the purposes
of this specification, is not case-sensitive. There MAY be more than of this specification, is not case sensitive. There MAY be more than
one header line with the same name. The content MUST NOT contain one header line with the same name. The content MUST NOT contain
CRLF; it MAY be empty. A header may be "folded"; that is, a CRLF CRLF; it MAY be empty. A header may be "folded"; that is, a CRLF
pair may be placed before any TAB or space in the line; there MUST pair may be placed before any TAB or space in the line. There MUST
still be some other octet between any two CRLF pairs in a header still be some other octet between any two CRLF pairs in a header
line. (Note that folding means that the header line occupies more line. (Note that folding means that the header line occupies more
than one line when displayed or transmitted; nevertheless it is still than one line when displayed or transmitted; nevertheless, it is
referred to as "a" header line.) The presence or absence of folding still referred to as "a" header line.) The presence or absence of
does not affect the meaning of the header line; that is, the CRLF folding does not affect the meaning of the header line; that is, the
pairs introduced by folding are not considered part of the header CRLF pairs introduced by folding are not considered part of the
content. Header lines SHOULD NOT be folded before the space after header content. Header lines SHOULD NOT be folded before the space
the colon that follows the header name, and SHOULD include at least after the colon that follows the header name and SHOULD include at
one octet other than %x09 or %x20 between CRLF pairs. However, if an least one octet other than %x09 or %x20 between CRLF pairs. However,
article has been received from elsewhere with one of these, clients if an article that fails to satisfy this requirement has been
and servers MAY transfer it to the other without re-folding it. received from elsewhere, clients and servers MAY transfer it to each
other without re-folding it.
The content of a header SHOULD be in UTF-8. However, if an The content of a header SHOULD be in UTF-8. However, if an
implementation receives an article from elsewhere that uses octets in implementation receives an article from elsewhere that uses octets in
the range 128 to 255 in some other manner, it MAY pass it to a client the range 128 to 255 in some other manner, it MAY pass it to a client
or server without modification. Therefore implementations MUST be or server without modification. Therefore, implementations MUST be
prepared to receive such headers and also data derived from them prepared to receive such headers, and data derived from them (e.g.,
(e.g. in the responses from the OVER (Section 8.3) command) and MUST in the responses from the OVER command, Section 8.3), and MUST NOT
NOT assume that they are always UTF-8. Any external processing of assume that they are always UTF-8. Any external processing of those
those headers, including identifying the encoding used, is outside headers, including identifying the encoding used, is outside the
the scope of this document. scope of this document.
Each article MUST have a unique message-id; two articles offered by Each article MUST have a unique message-id; two articles offered by
an NNTP server MUST NOT have the same message-id. For the purposes an NNTP server MUST NOT have the same message-id. For the purposes
of this specification, message-ids are opaque strings that MUST meet of this specification, message-ids are opaque strings that MUST meet
the following requirements: the following requirements:
o A message-id MUST begin with "<" and end with ">", and MUST NOT
o A message-id MUST begin with "<", end with ">", and MUST NOT
contain the latter except at the end. contain the latter except at the end.
o A message-id MUST be between 3 and 250 octets in length. o A message-id MUST be between 3 and 250 octets in length.
o A message-id MUST NOT contain octets other than printable US-ASCII o A message-id MUST NOT contain octets other than printable US-ASCII
characters. characters.
Two message-ids are the same if and only if they consist of the same Two message-ids are the same if and only if they consist of the same
sequence of octets. sequence of octets.
This specification does not describe how the message-id of an article This specification does not describe how the message-id of an article
is determined. If the server does not have any way to determine a is determined. If the server does not have any way to determine a
message-id from the article itself, it MUST synthesize one (this message-id from the article itself, it MUST synthesize one (this
specification does not require the article to be changed as a specification does not require that the article be changed as a
result). See also Appendix A.2. result). See also Appendix A.2.
4. The WILDMAT format 4. The WILDMAT Format
The WILDMAT format described here is based on the version first The WILDMAT format described here is based on the version first
developed by Rich Salz [SALZ1992], which in turn was derived from the developed by Rich Salz [SALZ1992], which was in turn derived from the
format used in the UNIX "find" command to articulate file names. It format used in the UNIX "find" command to articulate file names. It
was developed to provide a uniform mechanism for matching patterns in was developed to provide a uniform mechanism for matching patterns in
the same manner that the UNIX shell matches filenames. the same manner that the UNIX shell matches filenames.
4.1. Wildmat syntax 4.1. Wildmat Syntax
A wildmat is described by the following ABNF [RFC2234] syntax, which A wildmat is described by the following ABNF [RFC4234] syntax, which
is an extract of that in Section 9.8. is an extract of that in Section 9.8.
wildmat = wildmat-pattern *("," ["!"] wildmat-pattern) wildmat = wildmat-pattern *("," ["!"] wildmat-pattern)
wildmat-pattern = 1*wildmat-item wildmat-pattern = 1*wildmat-item
wildmat-item = wildmat-exact / wildmat-wild wildmat-item = wildmat-exact / wildmat-wild
wildmat-exact = %x22-29 / %x2B / %x2D-3E / %x40-5A / %x5E-7E / wildmat-exact = %x22-29 / %x2B / %x2D-3E / %x40-5A / %x5E-7E /
UTF8-non-ascii ; exclude ! * , ? [ \ ] UTF8-non-ascii ; exclude ! * , ? [ \ ]
wildmat-wild = "*" / "?" wildmat-wild = "*" / "?"
Note: the characters \ , [ and ] are not allowed in wildmats, while * Note: the characters ",", "\", "[", and "]" are not allowed in
and ? are always wildcards. This should not be a problem since these wildmats, while * and ? are always wildcards. This should not be a
characters cannot occur in newsgroup names, which is the only current problem, since these characters cannot occur in newsgroup names,
use of wildmats. Backslash is commonly used to suppress the special which is the only current use of wildmats. Backslash is commonly
meaning of characters while brackets are used to introduce sets. used to suppress the special meaning of characters, whereas brackets
However, these usages are not universal and interpretation of these are used to introduce sets. However, these usages are not universal,
characters in the context of UTF-8 strings is both potentially and interpretation of these characters in the context of UTF-8
complex and differs from existing practice, so they were omitted from strings is potentially complex and differs from existing practice, so
this specification. A future extension to this specification may they were omitted from this specification. A future extension to
provide semantics for these characters. this specification may provide semantics for these characters.
4.2. Wildmat semantics 4.2. Wildmat Semantics
A wildmat is tested against a string, and either matches or does not A wildmat is tested against a string and either matches or does not
match. To do this, each constituent <wildmat-pattern> is matched match. To do this, each constituent <wildmat-pattern> is matched
against the string and the rightmost pattern that matches is against the string, and the rightmost pattern that matches is
identified. If that <wildmat-pattern> is not preceded with "!", the identified. If that <wildmat-pattern> is not preceded with "!", the
whole wildmat matches. If it is preceded by "!", or if no <wildmat- whole wildmat matches. If it is preceded by "!", or if no <wildmat-
pattern> matches, the whole wildmat does not match. pattern> matches, the whole wildmat does not match.
For example, consider the wildmat "a*,!*b,*c*": For example, consider the wildmat "a*,!*b,*c*":
o the string "aaa" matches because the rightmost match is with "a*"
o the string "abb" does not match because the rightmost match is
with "*b"
o the string "ccb" matches because the rightmost match is with "*c*" o The string "aaa" matches because the rightmost match is with "a*".
o the string "xxx" does not match because no <wildmat-pattern>
matches o The string "abb" does not match because the rightmost match is
with "*b".
o The string "ccb" matches because the rightmost match is with
"*c*".
o The string "xxx" does not match because no <wildmat-pattern>
matches.
A <wildmat-pattern> matches a string if the string can be broken into A <wildmat-pattern> matches a string if the string can be broken into
components, each of which matches the corresponding <wildmat-item> in components, each of which matches the corresponding <wildmat-item> in
the pattern; the matches must be in the same order, and the whole the pattern. The matches must be in the same order, and the whole
string must be used in the match. The pattern is "anchored"; that string must be used in the match. The pattern is "anchored"; that
is, the first and last characters in the string must match the first is, the first and last characters in the string must match the first
and last item respectively (unless that item is an asterisk matching and last item, respectively (unless that item is an asterisk matching
zero characters). zero characters).
A <wildmat-exact> matches the same character (which may be more than A <wildmat-exact> matches the same character (which may be more than
one octet in UTF-8). one octet in UTF-8).
"?" matches exactly one character (which may be more than one octet). "?" matches exactly one character (which may be more than one octet).
"*" matches zero or more characters. It can match an empty string, "*" matches zero or more characters. It can match an empty string,
but it cannot match a subsequence of a UTF-8 sequence that is not but it cannot match a subsequence of a UTF-8 sequence that is not
aligned to the character boundaries. aligned to the character boundaries.
skipping to change at page 30, line 8 skipping to change at page 27, line 28
4.3. Extensions 4.3. Extensions
An NNTP server or extension MAY extend the syntax or semantics of An NNTP server or extension MAY extend the syntax or semantics of
wildmats provided that all wildmats that meet the requirements of wildmats provided that all wildmats that meet the requirements of
Section 4.1 have the meaning ascribed to them by Section 4.2. Future Section 4.1 have the meaning ascribed to them by Section 4.2. Future
editions of this document may also extend wildmats. editions of this document may also extend wildmats.
4.4. Examples 4.4. Examples
In these examples, $ and @ are used to represent the two octets %xC2 In these examples, $ and @ are used to represent the two octets %xC2
and %xA3 respectively; $@ is thus the UTF-8 encoding for the pound and %xA3, respectively; $@ is thus the UTF-8 encoding for the pound
sterling symbol, shown as # in the descriptions. sterling symbol, shown as # in the descriptions.
Wildmat Description of strings that match Wildmat Description of strings that match
abc the one string "abc" abc The one string "abc"
abc,def the two strings "abc" and "def" abc,def The two strings "abc" and "def"
$@ the one character string "#" $@ The one character string "#"
a* any string that begins with "a" a* Any string that begins with "a"
a*b any string that begins with "a" and ends with "b" a*b Any string that begins with "a" and ends with "b"
a*,*b any string that begins with "a" or ends with "b" a*,*b Any string that begins with "a" or ends with "b"
a*,!*b any string that begins with "a" and does not end with a*,!*b Any string that begins with "a" and does not end with
"b" "b"
a*,!*b,c* any string that begins with "a" and does not end with a*,!*b,c* Any string that begins with "a" and does not end with
"b", and any string that begins with "c" no matter "b", and any string that begins with "c" no matter
what it ends with what it ends with
a*,c*,!*b any string that begins with "a" or "c" and does not a*,c*,!*b Any string that begins with "a" or "c" and does not
end with "b" end with "b"
?a* any string with "a" as its second character ?a* Any string with "a" as its second character
??a* any string with "a" as its third character ??a* Any string with "a" as its third character
*a? any string with "a" as its penultimate character *a? Any string with "a" as its penultimate character
*a?? any string with "a" as its antepenultimate character *a?? Any string with "a" as its antepenultimate character
5. Session administration commands 5. Session Administration Commands
5.1. Initial Connection 5.1. Initial Connection
5.1.1. Usage 5.1.1. Usage
This command MUST NOT be pipelined. This command MUST NOT be pipelined.
Responses Responses [1]
200 Service available, posting allowed
201 Service available, posting prohibited
400 Service temporarily unavailable [2]
502 Service permanently unavailable [2]
200 Service available, posting allowed [1] [1] These are the only valid response codes for the initial greeting;
201 Service available, posting prohibited [1] the server MUST not return any other generic response code.
400 Service temporarily unavailable [1][2]
502 Service permanently unavailable [1][2]
[1] These are the only valid response codes for the initial [2] Following a 400 or 502 response, the server MUST immediately
greeting; the server MUST not return any other generic close the connection.
response code.
[2] Following a 400 or 502 response the server MUST
immediately close the connection.
5.1.2. Description 5.1.2. Description
There is no command presented by the client upon initial connection There is no command presented by the client upon initial connection
to the server. The server MUST present an appropriate response code to the server. The server MUST present an appropriate response code
as a greeting to the client. This response informs the client as a greeting to the client. This response informs the client
whether service is available and whether the client is permitted to whether service is available and whether the client is permitted to
post. post.
If the server will accept further commands from the client including If the server will accept further commands from the client including
POST, the server MUST present a 200 greeting code. If the server POST, the server MUST present a 200 greeting code. If the server
will accept further commands from the client, but it is not will accept further commands from the client, but the client is not
authorized to post articles using the POST command, the server MUST authorized to post articles using the POST command, the server MUST
present a 201 greeting code. present a 201 greeting code.
Otherwise the server MUST present a 400 or 502 greeting code and then Otherwise, the server MUST present a 400 or 502 greeting code and
immediately close the connection. 400 SHOULD be used if the issue is then immediately close the connection. 400 SHOULD be used if the
only temporary (for example, because of load) and the client can issue is only temporary (for example, because of load) and the client
expect to be able to connect successfully at some point in the future can expect to be able to connect successfully at some point in the
without making any changes. 502 MUST be used if the client is not future without making any changes. 502 MUST be used if the client is
permitted under any circumstances to interact with the server, and not permitted under any circumstances to interact with the server,
MAY be used if the server has insufficient information to determine and MAY be used if the server has insufficient information to
whether the issue is temporary or permanent. determine whether the issue is temporary or permanent.
Note: the distinction between the 200 and 201 response codes has Note: the distinction between the 200 and 201 response codes has
turned out in practice to be insufficient; for example, some servers turned out in practice to be insufficient; for example, some servers
do not allow posting until the client has authenticated, while other do not allow posting until the client has authenticated, while other
clients assume that a 201 response means that posting will never be clients assume that a 201 response means that posting will never be
possible even after authentication. Therefore clients SHOULD use the possible even after authentication. Therefore, clients SHOULD use
CAPABILITIES command (Section 5.2) rather than rely on this response. the CAPABILITIES command (Section 5.2) rather than rely on this
response.
5.1.3. Examples 5.1.3. Examples
Example of a normal connection from an authorized client which then Example of a normal connection from an authorized client that then
terminates the session (see Section 5.4): terminates the session (see Section 5.4):
[Initial connection set-up completed.] [Initial connection set-up completed.]
[S] 200 NNTP Service Ready, posting permitted [S] 200 NNTP Service Ready, posting permitted
[C] QUIT [C] QUIT
[S] 205 NNTP Service exits normally [S] 205 NNTP Service exits normally
[Server closes connection.] [Server closes connection.]
Example of a normal connection from an authorized client that is not Example of a normal connection from an authorized client that is not
permitted to post; it also immediately terminates the session: permitted to post, which also immediately terminates the session:
[Initial connection set-up completed.] [Initial connection set-up completed.]
[S] 201 NNTP Service Ready, posting prohibited [S] 201 NNTP Service Ready, posting prohibited
[C] QUIT [C] QUIT
[S] 205 NNTP Service exits normally [S] 205 NNTP Service exits normally
[Server closes connection.] [Server closes connection.]
Example of a normal connection from an unauthorized client: Example of a normal connection from an unauthorized client:
[Initial connection set-up completed.] [Initial connection set-up completed.]
[S] 502 NNTP Service permanently unavailable [S] 502 NNTP Service permanently unavailable
[Server closes connection.] [Server closes connection.]
Example of a connection from a client where the server is unable to Example of a connection from a client if the server is unable to
provide service: provide service:
[Initial connection set-up completed.] [Initial connection set-up completed.]
[S] 400 NNTP Service temporarily unavailable [S] 400 NNTP Service temporarily unavailable
[Server closes connection.] [Server closes connection.]
5.2. CAPABILITIES 5.2. CAPABILITIES
5.2.1. Usage 5.2.1. Usage
skipping to change at page 33, line 6 skipping to change at page 29, line 47
[S] 400 NNTP Service temporarily unavailable [S] 400 NNTP Service temporarily unavailable
[Server closes connection.] [Server closes connection.]
5.2. CAPABILITIES 5.2. CAPABILITIES
5.2.1. Usage 5.2.1. Usage
This command is mandatory. This command is mandatory.
Syntax Syntax
CAPABILITIES [keyword] CAPABILITIES [keyword]
Responses Responses
101 Capability list follows (multi-line) 101 Capability list follows (multi-line)
Parameters Parameters
keyword additional feature, see description
keyword additional feature, see description
5.2.2. Description 5.2.2. Description
The CAPABILITIES command allows a client to determine the The CAPABILITIES command allows a client to determine the
capabilities of the server at any given time. capabilities of the server at any given time.
This command MAY be issued at any time; the server MUST NOT require This command MAY be issued at any time; the server MUST NOT require
it to be issued in order to make use of any capability. The response it to be issued in order to make use of any capability. The response
generated by this command MAY change during a session because of generated by this command MAY change during a session because of
other state information (which in turn may be changed by the effects other state information (which, in turn, may be changed by the
of other commands or by external events). An NNTP client is only effects of other commands or by external events). An NNTP client is
able to get the current and correct information concerning available only able to get the current and correct information concerning
capabilities at any point during a session by issuing a CAPABILITIES available capabilities at any point during a session by issuing a
command at that point of that session and processing the response. CAPABILITIES command at that point of that session and processing the
response.
The capability list is returned as a multi-line data block following The capability list is returned as a multi-line data block following
the 101 response code. Each capability is described by a separate the 101 response code. Each capability is described by a separate
capability line. The server MUST NOT list the same capability twice capability line. The server MUST NOT list the same capability twice
in the response, even with different arguments. Except that the in the response, even with different arguments. Except that the
VERSION capability MUST be the first line, the order in which the VERSION capability MUST be the first line, the order in which the
capability lines appears is not significant; the server need not even capability lines appears is not significant; the server need not even
consistently return the same order. consistently return the same order.
While some capabilities are likely to be always available or never While some capabilities are likely to be always available or never
available, others - notably extensions - will appear and disappear available, others (notably extensions) will appear and disappear
depending on server state changes within the session or external depending on server state changes within the session or on external
events between sessions. An NNTP client MAY cache the results of events between sessions. An NNTP client MAY cache the results of
this command, but MUST NOT rely on the correctness of any cached this command, but MUST NOT rely on the correctness of any cached
results, whether from earlier in this session or from a previous results, whether from earlier in this session or from a previous
session, MUST cope gracefully with the cached status being out of session, MUST cope gracefully with the cached status being out of
date, and SHOULD (if caching results) provide a way to force the date, and SHOULD (if caching results) provide a way to force the
cached information to be refreshed. Furthermore, a client MUST NOT cached information to be refreshed. Furthermore, a client MUST NOT
use cached results in relation to security, privacy, and use cached results in relation to security, privacy, and
authentication extensions. See Section 12.6 for further discussion authentication extensions. See Section 12.6 for further discussion
of this topic. of this topic.
The keyword argument is not used by this specification. It is The keyword argument is not used by this specification. It is
provided so that extensions or revisions to this specification can provided so that extensions or revisions to this specification can
include extra features for this command without requiring the include extra features for this command without requiring the
CAPABILITIES command to be used twice (once to determine if the extra CAPABILITIES command to be used twice (once to determine if the extra
features are available and a second time to make use of them). If features are available, and a second time to make use of them). If
the server does not recognise the argument (and it is a keyword), it the server does not recognise the argument (and it is a keyword), it
MUST respond with the 101 response code as if the argument had been MUST respond with the 101 response code as if the argument had been
omitted. If an argument is provided that the server does recognise, omitted. If an argument is provided that the server does recognise,
it MAY use the 101 response code or MAY use some other response code it MAY use the 101 response code or MAY use some other response code
(which will be defined in the specification of that feature). If the (which will be defined in the specification of that feature). If the
argument is not a keyword, the 501 generic response code MUST be argument is not a keyword, the 501 generic response code MUST be
returned. The server MUST NOT generate any other response code to returned. The server MUST NOT generate any other response code to
the CAPABILITIES command. the CAPABILITIES command.
5.2.3. Examples 5.2.3. Examples
skipping to change at page 34, line 29 skipping to change at page 31, line 21
Example of a minimal response (a read-only server): Example of a minimal response (a read-only server):
[C] CAPABILITIES [C] CAPABILITIES
[S] 101 Capability list: [S] 101 Capability list:
[S] VERSION 2 [S] VERSION 2
[S] READER [S] READER
[S] LIST ACTIVE NEWSGROUPS [S] LIST ACTIVE NEWSGROUPS
[S] . [S] .
Example of a response from a server that has a range of facilities Example of a response from a server that has a range of facilities
and also describes itself: and that also describes itself:
[C] CAPABILITIES [C] CAPABILITIES
[S] 101 Capability list: [S] 101 Capability list:
[S] VERSION 2 [S] VERSION 2
[S] READER [S] READER
[S] IHAVE [S] IHAVE
[S] POST [S] POST
[S] NEWNEWS [S] NEWNEWS
[S] LIST ACTIVE NEWSGROUPS ACTIVE.TIMES OVERVIEW.FMT [S] LIST ACTIVE NEWSGROUPS ACTIVE.TIMES OVERVIEW.FMT
[S] IMPLEMENTATION INN 4.2 2004-12-25 [S] IMPLEMENTATION INN 4.2 2004-12-25
skipping to change at page 35, line 30 skipping to change at page 32, line 28
5.3. MODE READER 5.3. MODE READER
5.3.1. Usage 5.3.1. Usage
Indicating capability: MODE-READER Indicating capability: MODE-READER
This command MUST NOT be pipelined. This command MUST NOT be pipelined.
Syntax Syntax
MODE READER MODE READER
Responses Responses
200 Posting allowed 200 Posting allowed
201 Posting prohibited 201 Posting prohibited
502 Reading service permanently unavailable [1] 502 Reading service permanently unavailable [1]
[1] Following a 502 response the server MUST immediately close [1] Following a 502 response the server MUST immediately close the
the connection. connection.
5.3.2. Description 5.3.2. Description
The MODE READER command instructs a mode-switching server to switch The MODE READER command instructs a mode-switching server to switch
modes, as described in Section 3.4.2. modes, as described in Section 3.4.2.
If the server is mode-switching, it switches from its transit mode to If the server is mode-switching, it switches from its transit mode to
its reader mode, indicating the fact by changing the capability list its reader mode, indicating this by changing the capability list
accordingly, and then MUST return a 200 or 201 response with the same accordingly. It MUST then return a 200 or 201 response with the same
meaning as for the initial greeting (as described in Section 5.1.1); meaning as for the initial greeting (as described in Section 5.1.1).
note that the response need not be the same as the one presented Note that the response need not be the same as that presented during
during the initial greeting. The client MUST NOT issue MODE READER the initial greeting. The client MUST NOT issue MODE READER more
more than once in a session or after any security or privacy commands than once in a session or after any security or privacy commands are
are issued. When the MODE READER command is issued, the server MAY issued. When the MODE READER command is issued, the server MAY reset
reset its state to that immediately after the initial connection its state to that immediately after the initial connection before
before switching mode. switching mode.
If the server is not mode-switching, then the following apply:
If the server is not mode-switching, then:
o If it advertises the READER capability, it MUST return a 200 or o If it advertises the READER capability, it MUST return a 200 or
201 response with the same meaning as for the initial greeting; in 201 response with the same meaning as for the initial greeting; in
this case the command MUST NOT affect the server state in any way. this case, the command MUST NOT affect the server state in any
way.
o If it does not advertise the READER capability, it MUST return a o If it does not advertise the READER capability, it MUST return a
502 response and then immediately close the connection. 502 response and then immediately close the connection.
5.3.3. Examples 5.3.3. Examples
Example of use of the MODE READER command on a transit-only server Example of use of the MODE READER command on a transit-only server
(which therefore does not providing reading facilities): (which therefore does not providing reading facilities):
[C] CAPABILITIES [C] CAPABILITIES
[S] 101 Capability list: [S] 101 Capability list:
skipping to change at page 36, line 46 skipping to change at page 33, line 45
[S] READER [S] READER
[S] LIST ACTIVE NEWSGROUPS [S] LIST ACTIVE NEWSGROUPS
[S] . [S] .
[C] MODE READER [C] MODE READER
[S] 200 Reader mode, posting permitted [S] 200 Reader mode, posting permitted
[C] IHAVE <i.am.an.article.you.have@example.com> [C] IHAVE <i.am.an.article.you.have@example.com>
[S] 500 Permission denied [S] 500 Permission denied
[C] GROUP misc.test [C] GROUP misc.test
[S] 211 1234 3000234 3002322 misc.test [S] 211 1234 3000234 3002322 misc.test
Note that in both these situations the client SHOULD NOT use MODE Note that in both of these situations, the client SHOULD NOT use MODE
READER. READER.
Example of use of the MODE READER command on a mode-switching server: Example of use of the MODE READER command on a mode-switching server:
[C] CAPABILITIES [C] CAPABILITIES
[S] 101 Capability list: [S] 101 Capability list:
[S] VERSION 2 [S] VERSION 2
[S] IHAVE [S] IHAVE
[S] MODE-READER [S] MODE-READER
[S] . [S] .
skipping to change at page 37, line 22 skipping to change at page 34, line 24
[S] 200 Reader mode, posting permitted [S] 200 Reader mode, posting permitted
[C] CAPABILITIES [C] CAPABILITIES
[S] 101 Capability list: [S] 101 Capability list:
[S] VERSION 2 [S] VERSION 2
[S] READER [S] READER
[S] NEWNEWS [S] NEWNEWS
[S] LIST ACTIVE NEWSGROUPS [S] LIST ACTIVE NEWSGROUPS
[S] STARTTLS [S] STARTTLS
[S] . [S] .
In this case the server offers (but does not require) TLS privacy in In this case, the server offers (but does not require) TLS privacy in
its reading mode but not its transit mode. its reading mode but not in its transit mode.
Example of use of the MODE READER command where the client is not Example of use of the MODE READER command where the client is not
permitted to post: permitted to post:
[C] MODE READER [C] MODE READER
[S] 201 NNTP Service Ready, posting prohibited [S] 201 NNTP Service Ready, posting prohibited
5.4. QUIT 5.4. QUIT
5.4.1. Usage 5.4.1. Usage
skipping to change at page 37, line 38 skipping to change at page 34, line 40
[C] MODE READER [C] MODE READER
[S] 201 NNTP Service Ready, posting prohibited [S] 201 NNTP Service Ready, posting prohibited
5.4. QUIT 5.4. QUIT
5.4.1. Usage 5.4.1. Usage
This command is mandatory. This command is mandatory.
Syntax Syntax
QUIT QUIT
Responses Responses
205 Connection closing 205 Connection closing
5.4.2. Description 5.4.2. Description
The client uses the QUIT command to terminate the session. The The client uses the QUIT command to terminate the session. The
server MUST acknowledge the QUIT command and then close the server MUST acknowledge the QUIT command and then close the
connection to the client. This is the preferred method for a client connection to the client. This is the preferred method for a client
to indicate that it has finished all its transactions with the NNTP to indicate that it has finished all of its transactions with the
server. NNTP server.
If a client simply disconnects (or the connection times out or some If a client simply disconnects (or if the connection times out or
other fault occurs), the server MUST gracefully cease its attempts to some other fault occurs), the server MUST gracefully cease its
service the client, disconnecting from its end if necessary. attempts to service the client, disconnecting from its end if
necessary.
The server MUST NOT generate any response code to the QUIT command The server MUST NOT generate any response code to the QUIT command
other than 205 or, if any arguments are provided, 501. other than 205 or, if any arguments are provided, 501.
5.4.3. Examples 5.4.3. Examples
[C] QUIT [C] QUIT
[S] 205 closing connection [S] 205 closing connection
[Server closes connection.] [Server closes connection.]
6. Article posting and retrieval 6. Article Posting and Retrieval
News reading clients have available a variety of mechanisms to News-reading clients have available a variety of mechanisms to
retrieve articles via NNTP. The news articles are stored and indexed retrieve articles via NNTP. The news articles are stored and indexed
using three types of keys. The first type of key is the message-id using three types of keys. The first type of key is the message-id
of an article and is globally unique. The second type of key is of an article and is globally unique. The second type of key is
composed of a newsgroup name and an article number within that composed of a newsgroup name and an article number within that
newsgroup. On a particular server there MUST be only one article newsgroup. On a particular server, there MUST only be one article
with a given number within any newsgroup and an article MUST NOT have with a given number within any newsgroup, and an article MUST NOT
two different numbers in the same newsgroup. An article can be have two different numbers in the same newsgroup. An article can be
cross-posted to multiple newsgroups, so there may be multiple keys cross-posted to multiple newsgroups, so there may be multiple keys
that point to the same article on the same server; these MAY have that point to the same article on the same server; these MAY have
different numbers in each newsgroup. However, this type of key is different numbers in each newsgroup. However, this type of key is
not required to be globally unique and so the same key MAY refer to not required to be globally unique, so the same key MAY refer to
different articles on different servers. (Note that the terms different articles on different servers. (Note that the terms
"group" and "newsgroup" are equivalent.) "group" and "newsgroup" are equivalent.)
The final type of key is the arrival timestamp, giving the time that The final type of key is the arrival timestamp, giving the time that
the article arrived at the server. The server MUST ensure that the article arrived at the server. The server MUST ensure that
article numbers are issued in order of arrival timestamp; that is, article numbers are issued in order of arrival timestamp; that is,
articles arriving later MUST have higher numbers than those that articles arriving later MUST have higher numbers than those that
arrive earlier. The server SHOULD allocate the next sequential arrive earlier. The server SHOULD allocate the next sequential
unused number to each new article. unused number to each new article.
Article numbers MUST lie between 1 and 4,294,967,295 inclusive. The Article numbers MUST lie between 1 and 2,147,483,647, inclusive. The
client and server MAY use leading zeroes in specifying article client and server MAY use leading zeroes in specifying article
numbers, but MUST NOT use more than 16 digits. In some situations, numbers but MUST NOT use more than 16 digits. In some situations,
the value zero replaces an article number to show some special the value zero replaces an article number to show some special
situation. situation.
6.1. Group and article selection Note that it is likely that the article number limit of 2,147,483,647
will be increased by a future revision or extension to this
specification. While servers MUST NOT send article numbers greater
than this current limit, client and server developers are advised to
use internal structures and datatypes capable of handling larger
values in anticipation of such a change.
6.1. Group and Article Selection
The following commands are used to set the "currently selected The following commands are used to set the "currently selected
newsgroup" and the "current article number", which are used by newsgroup" and the "current article number", which are used by
various commands. At the start of an NNTP session, both of these various commands. At the start of an NNTP session, both of these
values are set to the special value "invalid". values are set to the special value "invalid".
6.1.1. GROUP 6.1.1. GROUP
6.1.1.1. Usage 6.1.1.1. Usage
skipping to change at page 39, line 14 skipping to change at page 36, line 21
various commands. At the start of an NNTP session, both of these various commands. At the start of an NNTP session, both of these
values are set to the special value "invalid". values are set to the special value "invalid".
6.1.1. GROUP 6.1.1. GROUP
6.1.1.1. Usage 6.1.1.1. Usage
Indicating capability: READER Indicating capability: READER
Syntax Syntax
GROUP group GROUP group
Responses Responses
211 number low high group Group successfully selected
211 number low high group Group successfully selected 411 No such newsgroup
411 No such newsgroup
Parameters Parameters
group Name of newsgroup
group name of newsgroup number Estimated number of articles in the group
number estimated number of articles in the group low Reported low water mark
low reported low water mark high Reported high water mark
high reported high water mark
6.1.1.2. Description 6.1.1.2. Description
The GROUP command selects a newsgroup as the currently selected The GROUP command selects a newsgroup as the currently selected
newsgroup and returns summary information about it. newsgroup and returns summary information about it.
The required argument is the name of the newsgroup to be selected The required argument is the name of the newsgroup to be selected
(e.g. "news.software.nntp"). A list of valid newsgroups may be (e.g., "news.software.nntp"). A list of valid newsgroups may be
obtained by using the LIST ACTIVE command (see Section 7.6.3). obtained by using the LIST ACTIVE command (see Section 7.6.3).
The successful selection response will return the article numbers of The successful selection response will return the article numbers of
the first and last articles in the group at the moment of selection the first and last articles in the group at the moment of selection
(these numbers are referred to as the "reported low water mark" and (these numbers are referred to as the "reported low water mark" and
the "reported high water mark"), and an estimate of the number of the "reported high water mark") and an estimate of the number of
articles in the group currently available. articles in the group currently available.
If the group is not empty, the estimate MUST be at least the actual If the group is not empty, the estimate MUST be at least the actual
number of articles available, and MUST be no greater than one more number of articles available and MUST be no greater than one more
than the difference between the reported low and high water marks. than the difference between the reported low and high water marks.
(Some implementations will actually count the number of articles (Some implementations will actually count the number of articles
currently stored. Others will just subtract the low water mark from currently stored. Others will just subtract the low water mark from
the high water mark and add one to get an estimate.) the high water mark and add one to get an estimate.)
If the group is empty, one of the following three situations will If the group is empty, one of the following three situations will
occur. Clients MUST accept all three cases; servers MUST NOT occur. Clients MUST accept all three cases; servers MUST NOT
represent an empty group in any other way. represent an empty group in any other way.
o The high water mark will be one less than the low water mark, and o The high water mark will be one less than the low water mark, and
the estimated article count will be zero. Servers SHOULD use this the estimated article count will be zero. Servers SHOULD use this
method to show an empty group. This is the only time that the method to show an empty group. This is the only time that the
high water mark can be less than the low water mark. high water mark can be less than the low water mark.
o All three numbers will be zero. o All three numbers will be zero.
o The high water mark is greater than or equal to the low water o The high water mark is greater than or equal to the low water
mark. The estimated article count might be zero or non-zero; if mark. The estimated article count might be zero or non-zero; if
non-zero, the same requirements apply as for a non-empty group. it is non-zero, the same requirements apply as for a non-empty
group.
The set of articles in a group may change after the GROUP command is The set of articles in a group may change after the GROUP command is
carried out. That is: carried out:
o articles may be removed from the group
o articles may be reinstated in the group with the same article o Articles may be removed from the group.
o Articles may be reinstated in the group with the same article
number, but those articles MUST have numbers no less than the number, but those articles MUST have numbers no less than the
reported low water mark (note that this is a reinstatement of the reported low water mark (note that this is a reinstatement of the
previous article, not a new article reusing the number) previous article, not a new article reusing the number).
o new articles may be added with article numbers greater than the
reported high water mark (if an article that was the one with the o New articles may be added with article numbers greater than the
highest number has been removed and the high water mark adjusted reported high water mark. (If an article that was the one with
accordingly, the next new article will not have the number one the highest number has been removed and the high water mark has
greater than the reported high water mark) been adjusted accordingly, the next new article will not have the
number one greater than the reported high water mark.)
Except when the group is empty and all three numbers are zero, Except when the group is empty and all three numbers are zero,
whenever a subsequent GROUP command for the same newsgroup is issued, whenever a subsequent GROUP command for the same newsgroup is issued,
either by the same client or a different client, the reported low either by the same client or a different client, the reported low
water mark in the response MUST be no less than that in any previous water mark in the response MUST be no less than that in any previous
response for that newsgroup in any session, and SHOULD be no less response for that newsgroup in this session, and it SHOULD be no less
than that in any previous response for that newsgroup ever sent to than that in any previous response for that newsgroup ever sent to
any client. Any failure to meet the latter condition SHOULD be any client. Any failure to meet the latter condition SHOULD be
transient only. The client may make use of the low water mark to transient only. The client may make use of the low water mark to
remove all remembered information about articles with lower numbers, remove all remembered information about articles with lower numbers,
as these will never recur. This includes the situation when the high as these will never recur. This includes the situation when the high
water mark is one less than the low water mark. No similar water mark is one less than the low water mark. No similar
assumption can be made about the high water mark, as this can assumption can be made about the high water mark, as this can
decrease if an article is removed, and then increase again if it is decrease if an article is removed and then increase again if it is
reinstated or if new articles arrive. reinstated or if new articles arrive.
When a valid group is selected by means of this command, the When a valid group is selected by means of this command, the
currently selected newsgroup MUST be set to that group and the currently selected newsgroup MUST be set to that group, and the
current article number MUST be set to the first article in the group current article number MUST be set to the first article in the group
(this applies even if the group is already the currently selected (this applies even if the group is already the currently selected
newsgroup). If an empty newsgroup is selected, the current article newsgroup). If an empty newsgroup is selected, the current article
number is made invalid. If an invalid group is specified, the number is made invalid. If an invalid group is specified, the
currently selected newsgroup and current article number MUST NOT be currently selected newsgroup and current article number MUST NOT be
changed. changed.
The GROUP or LISTGROUP command (see Section 6.1.2) MUST be used by a The GROUP or LISTGROUP command (see Section 6.1.2) MUST be used by a
client and a successful response received before any other command is client, and a successful response received, before any other command
used that depends on the value of the currently selected newsgroup or is used that depends on the value of the currently selected newsgroup
current article number. or current article number.
If the group specified is not available on the server, a 411 response If the group specified is not available on the server, a 411 response
MUST be returned. MUST be returned.
6.1.1.3. Examples 6.1.1.3. Examples
Example for a group known to the server: Example for a group known to the server:
[C] GROUP misc.test [C] GROUP misc.test
[S] 211 1234 3000234 3002322 misc.test [S] 211 1234 3000234 3002322 misc.test
skipping to change at page 42, line 12 skipping to change at page 39, line 23
[C] STAT [C] STAT
[S] 223 234 <different@example.net> retrieved [S] 223 234 <different@example.net> retrieved
6.1.2. LISTGROUP 6.1.2. LISTGROUP
6.1.2.1. Usage 6.1.2.1. Usage
Indicating capability: READER Indicating capability: READER
Syntax Syntax
LISTGROUP [group [range]] LISTGROUP [group [range]]
Responses Responses
211 number low high group Article numbers follow (multi-line)
211 number low high group Article numbers follow (multi-line) 411 No such newsgroup
411 No such newsgroup 412 No newsgroup selected [1]
412 No newsgroup selected [1]
Parameters Parameters
group Name of newsgroup
range Range of articles to report
number Estimated number of articles in the group
low Reported low water mark
high Reported high water mark
group name of newsgroup [1] The 412 response can only occur if no group has been specified.
range range of articles to report
number estimated number of articles in the group
low reported low water mark
high reported high water mark
[1] The 412 response can only occur if no group has been
specified.
6.1.2.2. Description 6.1.2.2. Description
The LISTGROUP command selects a newsgroup in the same manner as the The LISTGROUP command selects a newsgroup in the same manner as the
the GROUP command (see Section 6.1.1) but also provides a list of GROUP command (see Section 6.1.1) but also provides a list of article
article numbers in the newsgroup. If no group is specified, the numbers in the newsgroup. If no group is specified, the currently
currently selected newsgroup is used. selected newsgroup is used.
On success, a list of article numbers is returned as a multi-line On success, a list of article numbers is returned as a multi-line
data block following the 211 response code (the arguments on the data block following the 211 response code (the arguments on the
initial response line are the same as for the GROUP command). The initial response line are the same as for the GROUP command). The
list contains one number per line and is in numerical order. It list contains one number per line and is in numerical order. It
lists precisely those articles that exist in the group at the moment lists precisely those articles that exist in the group at the moment
of selection (therefore an empty group produces an empty list); if of selection (therefore, an empty group produces an empty list). If
the optional range argument is specified, only those articles that the optional range argument is specified, only articles within the
are within the range are included in the list (therefore the list MAY range are included in the list (therefore, the list MAY be empty even
be empty even if the group is not). if the group is not).
The range argument may be any of the following: The range argument may be any of the following:
o an article number
o an article number followed by a dash to indicate all following o An article number.
o an article number followed by a dash followed by another article
number o An article number followed by a dash to indicate all following.
In the last case, if the second number is less than the first number
o An article number followed by a dash followed by another article
number.
In the last case, if the second number is less than the first number,
then the range contains no articles. Omitting the range is then the range contains no articles. Omitting the range is
equivalent to the range 1- being specified. equivalent to the range 1- being specified.
If the group specified is not available on the server, a 411 response If the group specified is not available on the server, a 411 response
MUST be returned. If no group is specified and the currently MUST be returned. If no group is specified and the currently
selected newsgroup is invalid, a 412 response MUST be returned. selected newsgroup is invalid, a 412 response MUST be returned.
Except that the group argument is optional, a range argument can be Except that the group argument is optional, that a range argument can
specified, and that a multi-line data block follows the 211 response be specified, and that a multi-line data block follows the 211
code, the LISTGROUP command is identical to the GROUP command. In response code, the LISTGROUP command is identical to the GROUP
particular, when successful, the command sets the current article command. In particular, when successful, the command sets the
number to the first article in the group, if any, even if this is not current article number to the first article in the group, if any,
within the range specified by the second argument. even if this is not within the range specified by the second
argument.
Note that the range argument is a new feature in this specification Note that the range argument is a new feature in this specification
and servers that do not support CAPABILITIES (and therefore do not and servers that do not support CAPABILITIES (and therefore do not
conform to this specification) are unlikely to support it. conform to this specification) are unlikely to support it.
6.1.2.3. Examples 6.1.2.3. Examples
Example of LISTGROUP being used to select a group: Example of LISTGROUP being used to select a group:
[C] LISTGROUP misc.test [C] LISTGROUP misc.test
skipping to change at page 43, line 45 skipping to change at page 41, line 11
[S] 3000239 [S] 3000239
[S] 3002322 [S] 3002322
[S] . [S] .
Example of LISTGROUP on an empty group: Example of LISTGROUP on an empty group:
[C] LISTGROUP example.empty.newsgroup [C] LISTGROUP example.empty.newsgroup
[S] 211 0 0 0 example.empty.newsgroup list follows [S] 211 0 0 0 example.empty.newsgroup list follows
[S] . [S] .
Example of LISTGROUP on a valid currently selected newsgroup: Example of LISTGROUP on a valid, currently selected newsgroup:
[C] GROUP misc.test [C] GROUP misc.test
[S] 211 2000 3000234 3002322 misc.test [S] 211 2000 3000234 3002322 misc.test
[C] LISTGROUP [C] LISTGROUP
[S] 211 2000 3000234 3002322 misc.test list follows [S] 211 2000 3000234 3002322 misc.test list follows
[S] 3000234 [S] 3000234
[S] 3000237 [S] 3000237
[S] 3000238 [S] 3000238
[S] 3000239 [S] 3000239
[S] 3002322 [S] 3002322
[S] . [S] .
Example of LISTGROUP with a range: Example of LISTGROUP with a range:
[C] LISTGROUP misc.test 3000238-3000248 [C] LISTGROUP misc.test 3000238-3000248
[S] 211 2000 3000234 3002322 misc.test list follows [S] 211 2000 3000234 3002322 misc.test list follows
skipping to change at page 44, line 38 skipping to change at page 42, line 12
[S] 211 2000 3000234 3002322 misc.test list follows [S] 211 2000 3000234 3002322 misc.test list follows
[S] . [S] .
6.1.3. LAST 6.1.3. LAST
6.1.3.1. Usage 6.1.3.1. Usage
Indicating capability: READER Indicating capability: READER
Syntax Syntax
LAST LAST
Responses Responses
223 n message-id Article found 223 n message-id Article found
412 No newsgroup selected 412 No newsgroup selected
420 Current article number is invalid 420 Current article number is invalid
422 No previous article in this group 422 No previous article in this group
Parameters Parameters
n Article number
n article number message-id Article message-id
message-id article message-id
6.1.3.2. Description 6.1.3.2. Description
If the currently selected newsgroup is valid, the current article If the currently selected newsgroup is valid, the current article
number MUST be set to the previous article in that newsgroup (that number MUST be set to the previous article in that newsgroup (that
is, the highest existing article number less than the current article is, the highest existing article number less than the current article
number). If successful, a response indicating the new current number). If successful, a response indicating the new current
article number and the message-id of that article MUST be returned. article number and the message-id of that article MUST be returned.
No article text is sent in response to this command. No article text is sent in response to this command.
skipping to change at page 45, line 32 skipping to change at page 42, line 46
low water mark. low water mark.
Because articles can be removed and added, the results of multiple Because articles can be removed and added, the results of multiple
LAST and NEXT commands MAY not be consistent over the life of a LAST and NEXT commands MAY not be consistent over the life of a
particular NNTP session. particular NNTP session.
If the current article number is already the first article of the If the current article number is already the first article of the
newsgroup, a 422 response MUST be returned. If the current article newsgroup, a 422 response MUST be returned. If the current article
number is invalid, a 420 response MUST be returned. If the currently number is invalid, a 420 response MUST be returned. If the currently
selected newsgroup is invalid, a 412 response MUST be returned. In selected newsgroup is invalid, a 412 response MUST be returned. In
all three cases the currently selected newsgroup and current article all three cases, the currently selected newsgroup and current article
number MUST NOT be altered. number MUST NOT be altered.
6.1.3.3. Examples 6.1.3.3. Examples
Example of a successful article retrieval using LAST: Example of a successful article retrieval using LAST:
[C] GROUP misc.test [C] GROUP misc.test
[S] 211 1234 3000234 3002322 misc.test [S] 211 1234 3000234 3002322 misc.test
[C] NEXT [C] NEXT
[S] 223 3000237 <668929@example.org> retrieved [S] 223 3000237 <668929@example.org> retrieved
skipping to change at page 46, line 29 skipping to change at page 44, line 12
[C] LAST [C] LAST
[S] 420 No current article selected [S] 420 No current article selected
6.1.4. NEXT 6.1.4. NEXT
6.1.4.1. Usage 6.1.4.1. Usage
Indicating capability: READER Indicating capability: READER
Syntax Syntax
NEXT NEXT
Responses Responses
223 n message-id Article found 223 n message-id Article found
412 No newsgroup selected 412 No newsgroup selected
420 Current article number is invalid 420 Current article number is invalid
421 No next article in this group 421 No next article in this group
Parameters Parameters
n Article number
n article number message-id Article message-id
message-id article message-id
6.1.4.2. Description 6.1.4.2. Description
If the currently selected newsgroup is valid, the current article If the currently selected newsgroup is valid, the current article
number MUST be set to the next article in that newsgroup (that is, number MUST be set to the next article in that newsgroup (that is,
the lowest existing article number greater than the current article the lowest existing article number greater than the current article
number). If successful, a response indicating the new current number). If successful, a response indicating the new current
article number and the message-id of that article MUST be returned. article number and the message-id of that article MUST be returned.
No article text is sent in response to this command. No article text is sent in response to this command.
If the current article number is already the last article of the If the current article number is already the last article of the
newsgroup, a 421 response MUST be returned. In all other aspects newsgroup, a 421 response MUST be returned. In all other aspects
(apart, of course, from the lack of 422 response) this command is (apart, of course, from the lack of 422 response), this command is
identical to the LAST command (Section 6.1.3). identical to the LAST command (Section 6.1.3).
6.1.4.3. Examples 6.1.4.3. Examples
Example of a successful article retrieval using NEXT: Example of a successful article retrieval using NEXT:
[C] GROUP misc.test [C] GROUP misc.test
[S] 211 1234 3000234 3002322 misc.test [S] 211 1234 3000234 3002322 misc.test
[C] NEXT [C] NEXT
[S] 223 3000237 <668929@example.org> retrieved [S] 223 3000237 <668929@example.org> retrieved
skipping to change at page 47, line 45 skipping to change at page 45, line 31
[S] 421 No next article to retrieve [S] 421 No next article to retrieve
Example of an attempt to retrieve an article using the NEXT command Example of an attempt to retrieve an article using the NEXT command
when the currently selected newsgroup is empty: when the currently selected newsgroup is empty:
[C] GROUP example.empty.newsgroup [C] GROUP example.empty.newsgroup
[S] 211 0 0 0 example.empty.newsgroup [S] 211 0 0 0 example.empty.newsgroup
[C] NEXT [C] NEXT
[S] 420 No current article selected [S] 420 No current article selected
6.2. Retrieval of articles and article sections 6.2. Retrieval of Articles and Article Sections
The ARTICLE, BODY, HEAD, and STAT commands are very similar. They The ARTICLE, BODY, HEAD, and STAT commands are very similar. They
differ only in the parts of the article that are presented to the differ only in the parts of the article that are presented to the
client and in the successful response code. The ARTICLE command is client and in the successful response code. The ARTICLE command is
described here in full, while the other commands are described in described here in full, while the other three commands are described
terms of the differences. As specified in Section 3.6, an article in terms of the differences. As specified in Section 3.6, an article
consists of two parts: the article headers and the article body. consists of two parts: the article headers and the article body.
When responding to one of these commands, the server MUST present the When responding to one of these commands, the server MUST present the
entire article or appropriate part and MUST NOT attempt to alter or entire article or appropriate part and MUST NOT attempt to alter or
translate it in any way. translate it in any way.
6.2.1. ARTICLE 6.2.1. ARTICLE
6.2.1.1. Usage 6.2.1.1. Usage
skipping to change at page 48, line 16 skipping to change at page 46, line 12
entire article or appropriate part and MUST NOT attempt to alter or entire article or appropriate part and MUST NOT attempt to alter or
translate it in any way. translate it in any way.
6.2.1. ARTICLE 6.2.1. ARTICLE
6.2.1.1. Usage 6.2.1.1. Usage
Indicating capability: READER Indicating capability: READER
Syntax Syntax
ARTICLE message-id ARTICLE message-id
ARTICLE number ARTICLE number
ARTICLE ARTICLE
Responses Responses
First form (message-id specified) First form (message-id specified)
220 0|n message-id Article follows (multi-line) 220 0|n message-id Article follows (multi-line)
430 No article with that message-id 430 No article with that message-id
Second form (article number specified) Second form (article number specified)
220 n message-id Article follows (multi-line) 220 n message-id Article follows (multi-line)
412 No newsgroup selected 412 No newsgroup selected
423 No article with that number 423 No article with that number
Third form (current article number used) Third form (current article number used)
220 n message-id Article follows (multi-line) 220 n message-id Article follows (multi-line)
412 No newsgroup selected 412 No newsgroup selected
420 Current article number is invalid 420 Current article number is invalid
Parameters Parameters
number Requested article number number Requested article number
n Returned article number n Returned article number
message-id Article message-id message-id Article message-id
6.2.1.2. Description 6.2.1.2. Description
The ARTICLE command selects an article based on the arguments and The ARTICLE command selects an article according to the arguments and
presents the entire article (that is, the headers, an empty line, and presents the entire article (that is, the headers, an empty line, and
the body in that order). The command has three forms. the body, in that order) to the client. The command has three forms.
In the first form, a message-id is specified and the server presents In the first form, a message-id is specified, and the server presents
the article with that message-id. In this case, the server MUST NOT the article with that message-id. In this case, the server MUST NOT
alter the currently selected newsgroup or current article number. alter the currently selected newsgroup or current article number.
This is both to facilitate the presentation of articles that may be This is both to facilitate the presentation of articles that may be
referenced within another article being read, and because of the referenced within another article being read, and because of the
semantic difficulties of determining the proper sequence and semantic difficulties of determining the proper sequence and
membership of an article that may have been cross-posted to more than membership of an article that may have been cross-posted to more than
one newsgroup. one newsgroup.
In the response, the article number MUST be replaced with zero, In the response, the article number MUST be replaced with zero,
except that if there is a currently selected newsgroup and the unless there is a currently selected newsgroup and the article is
article is present in that group, the server MAY use that article present in that group, in which case the server MAY use the article's
number. (The server is not required to determine whether the article number in that group. (The server is not required to determine
is in the currently selected newsgroup or, if so, what article number whether the article is in the currently selected newsgroup or, if so,
it has; the client MUST always be prepared for zero to be specified.) what article number it has; the client MUST always be prepared for
The server MUST NOT provide an article number unless use of that zero to be specified.) The server MUST NOT provide an article number
number in a second ARTICLE command immediately following this one unless use of that number in a second ARTICLE command immediately
would return the same article. Even if the server chooses to return following this one would return the same article. Even if the server
article numbers in these circumstances, it need not do so chooses to return article numbers in these circumstances, it need not
consistently; it MAY return zero to any such command (also see the do so consistently; it MAY return zero to any such command (also see
STAT examples (Section 6.2.4.3)). the STAT examples, Section 6.2.4.3).
In the second form, an article number is specified. If there is an In the second form, an article number is specified. If there is an
article with that number in the currently selected newsgroup, the article with that number in the currently selected newsgroup, the
server MUST set the current article number to that number. server MUST set the current article number to that number.
In the third form, the article indicated by the current article In the third form, the article indicated by the current article
number in the currently selected newsgroup is used. number in the currently selected newsgroup is used.
Note that a previously valid article number MAY become invalid if the Note that a previously valid article number MAY become invalid if the
article has been removed. A previously invalid article number MAY article has been removed. A previously invalid article number MAY
become valid if the article has been reinstated, but such an article become valid if the article has been reinstated, but this article
number MUST be no less than the reported low water mark for that number MUST be no less than the reported low water mark for that
group. group.
The server MUST NOT change the currently selected newsgroup as a The server MUST NOT change the currently selected newsgroup as a
result of this command. The server MUST NOT change the current result of this command. The server MUST NOT change the current
article number except when an article number argument was provided article number except when an article number argument was provided
and the article exists; in particular, it MUST NOT change it and the article exists; in particular, it MUST NOT change it
following an unsuccessful response. following an unsuccessful response.
Since the message-id is unique for each article, it may be used by a Since the message-id is unique for each article, it may be used by a
skipping to change at page 50, line 13 skipping to change at page 48, line 7
If the argument is a message-id and no such article exists, a 430 If the argument is a message-id and no such article exists, a 430
response MUST be returned. If the argument is a number or is omitted response MUST be returned. If the argument is a number or is omitted
and the currently selected newsgroup is invalid, a 412 response MUST and the currently selected newsgroup is invalid, a 412 response MUST
be returned. If the argument is a number and that article does not be returned. If the argument is a number and that article does not
exist in the currently selected newsgroup, a 423 response MUST be exist in the currently selected newsgroup, a 423 response MUST be
returned. If the argument is omitted and the current article number returned. If the argument is omitted and the current article number
is invalid, a 420 response MUST be returned. is invalid, a 420 response MUST be returned.
6.2.1.3. Examples 6.2.1.3. Examples
Example of a successful retrieval of an article (using no article Example of a successful retrieval of an article (explicitly not using
number): an article number):
[C] GROUP misc.test [C] GROUP misc.test
[S] 211 1234 3000234 3002322 misc.test [S] 211 1234 3000234 3002322 misc.test
[C] ARTICLE [C] ARTICLE
[S] 220 3000234 <45223423@example.com> [S] 220 3000234 <45223423@example.com>
[S] Path: pathost!demo!whitehouse!not-for-mail [S] Path: pathost!demo!whitehouse!not-for-mail
[S] From: "Demo User" <nobody@example.net> [S] From: "Demo User" <nobody@example.net>
[S] Newsgroups: misc.test [S] Newsgroups: misc.test
[S] Subject: I am just a test article [S] Subject: I am just a test article
[S] Date: 6 Oct 1998 04:38:40 -0500 [S] Date: 6 Oct 1998 04:38:40 -0500
skipping to change at page 52, line 32 skipping to change at page 50, line 14
6.2.2.2. Description 6.2.2.2. Description
The HEAD command behaves identically to the ARTICLE command except The HEAD command behaves identically to the ARTICLE command except
that, if the article exists, the response code is 221 instead of 220 that, if the article exists, the response code is 221 instead of 220
and only the headers are presented (the empty line separating the and only the headers are presented (the empty line separating the
headers and body MUST NOT be included). headers and body MUST NOT be included).
6.2.2.3. Examples 6.2.2.3. Examples
Example of a successful retrieval of the headers of an article (using Example of a successful retrieval of the headers of an article
no article number): (explicitly not using an article number):
[C] GROUP misc.test [C] GROUP misc.test
[S] 211 1234 3000234 3002322 misc.test [S] 211 1234 3000234 3002322 misc.test
[C] HEAD [C] HEAD
[S] 221 3000234 <45223423@example.com> [S] 221 3000234 <45223423@example.com>
[S] Path: pathost!demo!whitehouse!not-for-mail [S] Path: pathost!demo!whitehouse!not-for-mail
[S] From: "Demo User" <nobody@example.net> [S] From: "Demo User" <nobody@example.net>
[S] Newsgroups: misc.test [S] Newsgroups: misc.test
[S] Subject: I am just a test article [S] Subject: I am just a test article
[S] Date: 6 Oct 1998 04:38:40 -0500 [S] Date: 6 Oct 1998 04:38:40 -0500
skipping to change at page 54, line 4 skipping to change at page 51, line 33
[C] GROUP example.empty.newsgroup [C] GROUP example.empty.newsgroup
[S] 211 0 0 0 example.empty.newsgroup [S] 211 0 0 0 example.empty.newsgroup
[C] HEAD [C] HEAD
[S] 420 No current article selected [S] 420 No current article selected
6.2.3. BODY 6.2.3. BODY
6.2.3.1. Usage 6.2.3.1. Usage
Indicating capability: READER Indicating capability: READER
Syntax
Syntax
BODY message-id BODY message-id
BODY number BODY number
BODY BODY
Responses Responses
First form (message-id specified) First form (message-id specified)
222 0|n message-id Body follows (multi-line) 222 0|n message-id Body follows (multi-line)
430 No article with that message-id 430 No article with that message-id
Second form (article number specified) Second form (article number specified)
222 n message-id Body follows (multi-line) 222 n message-id Body follows (multi-line)
412 No newsgroup selected 412 No newsgroup selected
423 No article with that number 423 No article with that number
Third form (current article number used) Third form (current article number used)
222 n message-id Body follows (multi-line) 222 n message-id Body follows (multi-line)
412 No newsgroup selected 412 No newsgroup selected
420 Current article number is invalid 420 Current article number is invalid
Parameters Parameters
number Requested article number number Requested article number
n Returned article number n Returned article number
message-id Article message-id message-id Article message-id
6.2.3.2. Description 6.2.3.2. Description
The BODY command behaves identically to the ARTICLE command except The BODY command behaves identically to the ARTICLE command except
that, if the article exists, the response code is 222 instead of 220 that, if the article exists, the response code is 222 instead of 220
and only the body is presented (the empty line separating the headers and only the body is presented (the empty line separating the headers
and body MUST NOT be included). and body MUST NOT be included).
skipping to change at page 54, line 44 skipping to change at page 52, line 24
6.2.3.2. Description 6.2.3.2. Description
The BODY command behaves identically to the ARTICLE command except The BODY command behaves identically to the ARTICLE command except
that, if the article exists, the response code is 222 instead of 220 that, if the article exists, the response code is 222 instead of 220
and only the body is presented (the empty line separating the headers and only the body is presented (the empty line separating the headers
and body MUST NOT be included). and body MUST NOT be included).
6.2.3.3. Examples 6.2.3.3. Examples
Example of a successful retrieval of the body of an article (using no Example of a successful retrieval of the body of an article
article number): (explicitly not using an article number):
[C] GROUP misc.test [C] GROUP misc.test
[S] 211 1234 3000234 3002322 misc.test [S] 211 1234 3000234 3002322 misc.test
[C] BODY [C] BODY
[S] 222 3000234 <45223423@example.com> [S] 222 3000234 <45223423@example.com>
[S] This is just a test article. [S] This is just a test article.
[S] . [S] .
Example of a successful retrieval of the body of an article by Example of a successful retrieval of the body of an article by
message-id: message-id:
[C] BODY <45223423@example.com> [C] BODY <45223423@example.com>
[S] 222 0 <45223423@example.com> [S] 222 0 <45223423@example.com>
[S] This is just a test article. [S] This is just a test article.
[S] . [S] .
skipping to change at page 56, line 43 skipping to change at page 54, line 22
n Returned article number n Returned article number
message-id Article message-id message-id Article message-id
6.2.4.2. Description 6.2.4.2. Description
The STAT command behaves identically to the ARTICLE command except The STAT command behaves identically to the ARTICLE command except
that, if the article exists, it is NOT presented to the client and that, if the article exists, it is NOT presented to the client and
the response code is 223 instead of 220. Note that the response is the response code is 223 instead of 220. Note that the response is
NOT multi-line. NOT multi-line.
This command allows the client to determine whether an article This command allows the client to determine whether an article exists
exists, and in the second and third forms what its message-id is, and, in the second and third forms, what its message-id is, without
without having to process an arbitrary amount of text. having to process an arbitrary amount of text.
6.2.4.3. Examples 6.2.4.3. Examples
Example of STAT on an existing article (using no article number): Example of STAT on an existing article (explicitly not using an
article number):
[C] GROUP misc.test [C] GROUP misc.test
[S] 211 1234 3000234 3002322 misc.test [S] 211 1234 3000234 3002322 misc.test
[C] STAT [C] STAT
[S] 223 3000234 <45223423@example.com> [S] 223 3000234 <45223423@example.com>
Example of STAT on an existing article by message-id: Example of STAT on an existing article by message-id:
[C] STAT <45223423@example.com> [C] STAT <45223423@example.com>
[S] 223 0 <45223423@example.com> [S] 223 0 <45223423@example.com>
Example of STAT on an article not on the server by message-id: Example of STAT on an article not on the server by message-id:
skipping to change at page 57, line 40 skipping to change at page 55, line 20
[S] 412 No newsgroup selected [S] 412 No newsgroup selected
Example of STAT on an article when the currently selected newsgroup Example of STAT on an article when the currently selected newsgroup
is empty: is empty:
[C] GROUP example.empty.newsgroup [C] GROUP example.empty.newsgroup
[S] 211 0 0 0 example.empty.newsgroup [S] 211 0 0 0 example.empty.newsgroup
[C] STAT [C] STAT
[S] 420 No current article selected [S] 420 No current article selected
Example of STAT by message-id on a server which sometimes reports the Example of STAT by message-id on a server that sometimes reports the
actual article number: actual article number:
[C] GROUP misc.test [C] GROUP misc.test
[S] 211 1234 3000234 3002322 misc.test [S] 211 1234 3000234 3002322 misc.test
[C] STAT [C] STAT
[S] 223 3000234 <45223423@example.com> [S] 223 3000234 <45223423@example.com>
[C] STAT <45223423@example.com> [C] STAT <45223423@example.com>
[S] 223 0 <45223423@example.com> [S] 223 0 <45223423@example.com>
[C] STAT <45223423@example.com> [C] STAT <45223423@example.com>
[S] 223 3000234 <45223423@example.com> [S] 223 3000234 <45223423@example.com>
skipping to change at page 58, line 18 skipping to change at page 55, line 46
[S] 211 9999 111111 222222 alt.crossposts [S] 211 9999 111111 222222 alt.crossposts
[C] STAT <45223423@example.com> [C] STAT <45223423@example.com>
[S] 223 123456 <45223423@example.com> [S] 223 123456 <45223423@example.com>
[C] STAT [C] STAT
[S] 223 111111 <23894720@example.com> [S] 223 111111 <23894720@example.com>
The first STAT command establishes the identity of an article in the The first STAT command establishes the identity of an article in the
group. The second and third show that the server may, but need not, group. The second and third show that the server may, but need not,
give the article number when the message-id is specified. The fourth give the article number when the message-id is specified. The fourth
STAT command shows that zero must be specified if the article isn't STAT command shows that zero must be specified if the article isn't
in the currently selected newsgroup, the fifth shows that the number, in the currently selected newsgroup. The fifth shows that the
if provided, must be that relating to the currently selected number, if provided, must be that relating to the currently selected
newsgroup, and the last one shows that the current article number is newsgroup. The last one shows that the current article number is
still not changed by the use of STAT with a message-id even if it still not changed by the use of STAT with a message-id even if it
returns an article number. returns an article number.
6.3. Article posting 6.3. Article Posting
Article posting is done in one of two ways: individual article Article posting is done in one of two ways: individual article
posting from news reading clients using POST, and article transfer posting from news-reading clients using POST, and article transfer
from other news servers using IHAVE. from other news servers using IHAVE.
6.3.1. POST 6.3.1. POST
6.3.1.1. Usage 6.3.1.1. Usage
Indicating capability: POST Indicating capability: POST
This command MUST NOT be pipelined. This command MUST NOT be pipelined.
skipping to change at page 59, line 26 skipping to change at page 56, line 48
If posting is permitted, the article MUST be in the format specified If posting is permitted, the article MUST be in the format specified
in Section 3.6 and MUST be sent by the client to the server as a in Section 3.6 and MUST be sent by the client to the server as a
multi-line data block (see Section 3.1.1). Thus a single dot (".") multi-line data block (see Section 3.1.1). Thus a single dot (".")
on a line indicates the end of the text, and lines starting with a on a line indicates the end of the text, and lines starting with a
dot in the original text have that dot doubled during transmission. dot in the original text have that dot doubled during transmission.
Following the presentation of the termination sequence by the client, Following the presentation of the termination sequence by the client,
the server MUST return a response indicating success or failure of the server MUST return a response indicating success or failure of
the article transfer. Note that response codes 340 and 440 are used the article transfer. Note that response codes 340 and 440 are used
in direct response to the POST command. Others are returned in direct response to the POST command while 240 and 441 are returned
following the sending of the article. after the article is sent.
A response of 240 SHOULD indicate that, barring unforeseen server A response of 240 SHOULD indicate that, barring unforeseen server
errors, the posted article will be made available on the server errors, the posted article will be made available on the server
and/or transferred to other servers as appropriate, possibly and/or transferred to other servers, as appropriate, possibly
following further processing. In other words, articles not wanted by following further processing. In other words, articles not wanted by
the server SHOULD be rejected with a 441 response and not accepted the server SHOULD be rejected with a 441 response, rather than being
and silently discarded. However, the client SHOULD NOT assume that accepted and then discarded silently. However, the client SHOULD NOT
the article has been successfully transferred unless it receives an assume that the article has been successfully transferred unless it
affirmative response from the server, and SHOULD NOT assume that it receives an affirmative response from the server and SHOULD NOT
is being made available to other clients without explicitly checking assume that it is being made available to other clients without
(for example using the STAT command). explicitly checking (for example, using the STAT command).
If the session is interrupted before the response is received, it is If the session is interrupted before the response is received, it is
possible that an affirmative response was sent but has been lost. possible that an affirmative response was sent but has been lost.
Therefore, in any subsequent session, the client SHOULD either check Therefore, in any subsequent session, the client SHOULD either check
whether the article was successfully posted before resending or whether the article was successfully posted before resending or
ensure that the server will allocate the same message-id to the new ensure that the server will allocate the same message-id to the new
attempt (see Appendix A.2) - the latter approach is preferred since attempt (see Appendix A.2). The latter approach is preferred since
the article might not have been made available for reading yet (for the article might not have been made available for reading yet (for
example, it may have to go through a moderation process). example, it may have to go through a moderation process).
6.3.1.3. Examples 6.3.1.3. Examples
Example of a successful posting: Example of a successful posting:
[C] POST [C] POST
[S] 340 Input article; end with <CR-LF>.<CR-LF> [S] 340 Input article; end with <CR-LF>.<CR-LF>
[C] From: "Demo User" <nobody@example.net> [C] From: "Demo User" <nobody@example.net>
skipping to change at page 60, line 45 skipping to change at page 58, line 21
6.3.2. IHAVE 6.3.2. IHAVE
6.3.2.1. Usage 6.3.2.1. Usage
Indicating capability: IHAVE Indicating capability: IHAVE
This command MUST NOT be pipelined. This command MUST NOT be pipelined.
Syntax Syntax
IHAVE message-id IHAVE message-id
Responses Responses
Initial responses
Initial responses
335 Send article to be transferred 335 Send article to be transferred
435 Article not wanted 435 Article not wanted
436 Transfer not possible; try again later 436 Transfer not possible; try again later
Subsequent responses Subsequent responses
235 Article transferred OK 235 Article transferred OK
436 Transfer failed; try again later 436 Transfer failed; try again later
437 Transfer rejected; do not retry 437 Transfer rejected; do not retry
Parameters Parameters
message-id Article message-id message-id Article message-id
6.3.2.2. Description 6.3.2.2. Description
The IHAVE command informs the server that the client has an article The IHAVE command informs the server that the client has an article
with the specified message-id. If the server desires a copy of that with the specified message-id. If the server desires a copy of that
article a 335 response MUST be returned, instructing the client to article, a 335 response MUST be returned, instructing the client to
send the entire article. If the server does not want the article send the entire article. If the server does not want the article
(if, for example, the server already has a copy of it), a 435 (if, for example, the server already has a copy of it), a 435
response MUST be returned, indicating that the article is not wanted. response MUST be returned, indicating that the article is not wanted.
Finally, if the article isn't wanted immediately but the client Finally, if the article isn't wanted immediately but the client
should retry later if possible (if, for example, another client is in should retry later if possible (if, for example, another client is in
the process of sending the same article to the server), a 436 the process of sending the same article to the server), a 436
response MUST be returned. response MUST be returned.
If transmission of the article is requested, the client MUST send the If transmission of the article is requested, the client MUST send the
entire article, including headers and body, to the server as a multi- entire article, including headers and body, to the server as a
line data block (see Section 3.1.1). Thus a single dot (".") on a multi-line data block (see Section 3.1.1). Thus, a single dot (".")
line indicates the end of the text, and lines starting with a dot in on a line indicates the end of the text, and lines starting with a
the original text have that dot doubled during transmission. The dot in the original text have that dot doubled during transmission.
server MUST return either a 235 response, indicating that the article The server MUST return a 235 response, indicating that the article
was successfully transferred, a 436 response, indicating that the was successfully transferred; a 436 response, indicating that the
transfer failed but should be tried again later, or a 437 response, transfer failed but should be tried again later; or a 437 response,
indicating that the article was rejected. indicating that the article was rejected.
This function differs from the POST command in that it is intended This function differs from the POST command in that it is intended
for use in transferring already-posted articles between hosts. It for use in transferring already-posted articles between hosts. It
SHOULD NOT be used when the client is a personal news reading SHOULD NOT be used when the client is a personal news-reading
program, since use of this command indicates that the article has program, since use of this command indicates that the article has
already been posted at another site and is simply being forwarded already been posted at another site and is simply being forwarded
from another host. However, despite this, the server MAY elect not from another host. However, despite this, the server MAY elect not
to post or forward the article if, after further examination of the to post or forward the article if, after further examination of the
article, it deems it inappropriate to do so. Reasons for such article, it deems it inappropriate to do so. Reasons for such
subsequent rejection of an article may include such problems as subsequent rejection of an article may include problems such as
inappropriate newsgroups or distributions, disc space limitations, inappropriate newsgroups or distributions, disc space limitations,
article lengths, garbled headers, and the like. These are typically article lengths, garbled headers, and the like. These are typically
restrictions enforced by the server host's news software and not restrictions enforced by the server host's news software and not
necessarily the NNTP server itself. necessarily by the NNTP server itself.
The client SHOULD NOT assume that the article has been successfully The client SHOULD NOT assume that the article has been successfully
transferred unless it receives an affirmative response from the transferred unless it receives an affirmative response from the
server. A lack of response (such as a dropped network connection or server. A lack of response (such as a dropped network connection or
a network timeout) SHOULD be treated the same as a 436 response. a network timeout) SHOULD be treated the same as a 436 response.
Because some news server software may not be able immediately to Because some news server software may not immediately be able to
determine whether or not an article is suitable for posting or determine whether an article is suitable for posting or forwarding,
forwarding, an NNTP server MAY acknowledge the successful transfer of an NNTP server MAY acknowledge the successful transfer of the article
the article (with a 235 response) but later silently discard it. (with a 235 response) but later silently discard it.
6.3.2.3. Examples 6.3.2.3. Examples
Example of successfully sending an article to another site: Example of successfully sending an article to another site:
[C] IHAVE <i.am.an.article.you.will.want@example.com> [C] IHAVE <i.am.an.article.you.will.want@example.com>
[S] 335 Send it; end with <CR-LF>.<CR-LF> [S] 335 Send it; end with <CR-LF>.<CR-LF>
[C] Path: pathost!demo!somewhere!not-for-mail [C] Path: pathost!demo!somewhere!not-for-mail
[C] From: "Demo User" <nobody@example.com> [C] From: "Demo User" <nobody@example.com>
[C] Newsgroups: misc.test [C] Newsgroups: misc.test
skipping to change at page 63, line 31 skipping to change at page 61, line 27
[C] [C]
[C] This is just a test article. [C] This is just a test article.
[C] . [C] .
[S] 436 Transfer failed [S] 436 Transfer failed
Example of sending an article to a site that already has it: Example of sending an article to a site that already has it:
[C] IHAVE <i.am.an.article.you.have@example.com> [C] IHAVE <i.am.an.article.you.have@example.com>
[S] 435 Duplicate [S] 435 Duplicate
Example of sending an article to a site that requests the article be Example of sending an article to a site that requests that the
tried again later: article be tried again later:
[C] IHAVE <i.am.an.article.you.defer@example.com> [C] IHAVE <i.am.an.article.you.defer@example.com>
[S] 436 Retry later [S] 436 Retry later
7. Information commands 7. Information Commands
This section lists other commands that may be used at any time This section lists other commands that may be used at any time
between the beginning of a session and its termination. Using these between the beginning of a session and its termination. Using these
commands does not alter any state information, but the response commands does not alter any state information, but the response
generated from their use may provide useful information to clients. generated from their use may provide useful information to clients.
7.1. DATE 7.1. DATE
7.1.1. Usage 7.1.1. Usage
skipping to change at page 64, line 19 skipping to change at page 61, line 47
commands does not alter any state information, but the response commands does not alter any state information, but the response
generated from their use may provide useful information to clients. generated from their use may provide useful information to clients.
7.1. DATE 7.1. DATE
7.1.1. Usage 7.1.1. Usage
Indicating capability: READER Indicating capability: READER
Syntax Syntax
DATE DATE
Responses Responses
111 yyyymmddhhmmss Server date and time
111 yyyymmddhhmmss server date and time
Parameters Parameters
yyyymmddhhmmss Current UTC date and time on server
yyyymmddHHmmss Current UTC date and time on server
7.1.2. Description 7.1.2. Description
This command exists to help clients find out the current Coordinated This command exists to help clients find out the current Coordinated
Universal Time [TF.686-1] from the server's perspective. This Universal Time [TF.686-1] from the server's perspective. This
command SHOULD NOT be used as a substitute for NTP [RFC1305] but to command SHOULD NOT be used as a substitute for NTP [RFC1305] but to
provide information that might be useful when using the NEWNEWS provide information that might be useful when using the NEWNEWS
command (see Section 7.4). command (see Section 7.4).
The DATE command MUST return a timestamp from the same clock as is The DATE command MUST return a timestamp from the same clock as is
skipping to change at page 65, line 40 skipping to change at page 63, line 16
be UTF-8) and MUST NOT be used by clients as a replacement for the be UTF-8) and MUST NOT be used by clients as a replacement for the
CAPABILITIES command described in Section 5.2. CAPABILITIES command described in Section 5.2.
7.2.3. Examples 7.2.3. Examples
[C] HELP [C] HELP
[S] 100 Help text follows [S] 100 Help text follows
[S] This is some help text. There is no specific [S] This is some help text. There is no specific
[S] formatting requirement for this test, though [S] formatting requirement for this test, though
[S] it is customary for it to list the valid commands [S] it is customary for it to list the valid commands
[S] and give a brief definition of what they do [S] and give a brief definition of what they do.
[S] . [S] .
7.3. NEWGROUPS 7.3. NEWGROUPS
7.3.1. Usage 7.3.1. Usage
Indicating capability: READER Indicating capability: READER
Syntax
Syntax
NEWGROUPS date time [GMT] NEWGROUPS date time [GMT]
Responses Responses
231 List of new newsgroups follows (multi-line) 231 List of new newsgroups follows (multi-line)
Parameters Parameters
date Date in yymmdd or yyyymmdd format
date Date in yymmdd or yyyymmdd format time Time in hhmmss format
time Time in hhmmss format
7.3.2. Description 7.3.2. Description
This command returns a list of newsgroups created on the server since This command returns a list of newsgroups created on the server since
the specified date and time. The results are in the same format as the specified date and time. The results are in the same format as
the LIST ACTIVE command (see Section 7.6.3). However, they MAY the LIST ACTIVE command (see Section 7.6.3). However, they MAY
include groups not available on the server (and so not returned by include groups not available on the server (and so not returned by
LIST ACTIVE) and MAY omit groups for which the creation date is not LIST ACTIVE) and MAY omit groups for which the creation date is not
available. available.
The date is specified as 6 or 8 digits in the format [xx]yymmdd, The date is specified as 6 or 8 digits in the format [xx]yymmdd,
where xx is the first two digits of the year (19-99), yy is the last where xx is the first two digits of the year (19-99), yy is the last
two digits of the year (00-99), mm is the month (01-12), and dd is two digits of the year (00-99), mm is the month (01-12), and dd is
the day of the month (01-31). Clients SHOULD specify all four digits the day of the month (01-31). Clients SHOULD specify all four digits
of the year. If the first two digits of the year are not specified of the year. If the first two digits of the year are not specified
(this is supported only for backwards compatibility), the year is to (this is supported only for backward compatibility), the year is to
be taken from the current century if yy is smaller than or equal to be taken from the current century if yy is smaller than or equal to
the current year, otherwise the year is from the previous century. the current year, and the previous century otherwise.
The time is specified as 6 digits in the format hhmmss, where hh is The time is specified as 6 digits in the format hhmmss, where hh is
the hours in the 24-hour clock (00-23), mm is the minutes (00-59), the hours in the 24-hour clock (00-23), mm is the minutes (00-59),
and ss is the seconds (00-60, to allow for leap seconds). The token and ss is the seconds (00-60, to allow for leap seconds). The token
"GMT" specifies that the date and time are given in Coordinated "GMT" specifies that the date and time are given in Coordinated
Universal Time [TF.686-1]; if it is omitted then the date and time Universal Time [TF.686-1]; if it is omitted, then the date and time
are specified in the server's local timezone. Note that there is no are specified in the server's local timezone. Note that there is no
way using the protocol specified in this document to establish the way of using the protocol specified in this document to establish the
server's local timezone. server's local timezone.
Note that an empty list is a possible valid response and indicates Note that an empty list is a possible valid response and indicates
that there are no new newsgroups since that date-time. that there are no new newsgroups since that date-time.
Clients SHOULD make all queries using Coordinated Universal Time Clients SHOULD make all queries using Coordinated Universal Time
(i.e. by including the "GMT" argument) when possible. (i.e., by including the "GMT" argument) when possible.
7.3.3. Examples 7.3.3. Examples
Example where there are new groups: Example where there are new groups:
[C] NEWGROUPS 19990624 000000 GMT [C] NEWGROUPS 19990624 000000 GMT
[S] 231 list of new newsgroups follows [S] 231 list of new newsgroups follows
[S] alt.rfc-writers.recovery 4 1 y [S] alt.rfc-writers.recovery 4 1 y
[S] tx.natives.recovery 89 56 y [S] tx.natives.recovery 89 56 y
[S] . [S] .
skipping to change at page 67, line 28 skipping to change at page 64, line 43
[S] 231 list of new newsgroups follows [S] 231 list of new newsgroups follows
[S] . [S] .
7.4. NEWNEWS 7.4. NEWNEWS
7.4.1. Usage 7.4.1. Usage
Indicating capability: NEWNEWS Indicating capability: NEWNEWS
Syntax Syntax
NEWNEWS wildmat date time [GMT] NEWNEWS wildmat date time [GMT]
Responses Responses
230 List of new articles follows (multi-line) 230 List of new articles follows (multi-line)
Parameters Parameters
wildmat Newsgroups of interest
wildmat Newsgroups of interest date Date in yymmdd or yyyymmdd format
date Date in yymmdd or yyyymmdd format time Time in hhmmss format
time Time in hhmmss format
7.4.2. Description 7.4.2. Description
This command returns a list of message-ids of articles posted or This command returns a list of message-ids of articles posted or
received on the server, in the newsgroups whose names match the received on the server, in the newsgroups whose names match the
wildmat, since the specified date and time. One message-id is sent wildmat, since the specified date and time. One message-id is sent
on each line; the order of the response has no specific significance on each line; the order of the response has no specific significance
and may vary from response to response in the same session. A and may vary from response to response in the same session. A
message-id MAY appear more than once; if it does so, it has the same message-id MAY appear more than once; if it does, it has the same
meaning as if it appeared only once. meaning as if it appeared only once.
Date and time are in the same format as the NEWGROUPS command (see Date and time are in the same format as the NEWGROUPS command (see
Section 7.3). Section 7.3).
Note that an empty list is a possible valid response and indicates Note that an empty list is a possible valid response and indicates
that there is currently no new news in the relevant groups. that there is currently no new news in the relevant groups.
Clients SHOULD make all queries in Coordinated Universal Time (i.e. Clients SHOULD make all queries in Coordinated Universal Time (i.e.,
by using the "GMT" argument) when possible. by using the "GMT" argument) when possible.
7.4.3. Examples 7.4.3. Examples
Example where there are new articles: Example where there are new articles:
[C] NEWNEWS news.*,sci.* 19990624 000000 GMT [C] NEWNEWS news.*,sci.* 19990624 000000 GMT
[S] 230 list of new articles by message-id follows [S] 230 list of new articles by message-id follows
[S] <i.am.a.new.article@example.com> [S] <i.am.a.new.article@example.com>
[S] <i.am.another.new.article@example.com> [S] <i.am.another.new.article@example.com>
skipping to change at page 68, line 38 skipping to change at page 65, line 51
As described in Section 6, each article has an arrival timestamp. As described in Section 6, each article has an arrival timestamp.
Each newsgroup also has a creation timestamp. These timestamps are Each newsgroup also has a creation timestamp. These timestamps are
used by the NEWNEWS and NEWGROUP commands to construct their used by the NEWNEWS and NEWGROUP commands to construct their
responses. responses.
Clients can ensure that they do not have gaps in lists of articles or Clients can ensure that they do not have gaps in lists of articles or
groups by using the DATE command in the following manner: groups by using the DATE command in the following manner:
First session: First session:
Issue DATE command and record result Issue DATE command and record result.
Issue NEWNEWS command using a previously chosen timestamp Issue NEWNEWS command using a previously chosen timestamp.
Subsequent sessions: Subsequent sessions:
Issue DATE command and hold result in temporary storage Issue DATE command and hold result in temporary storage.
Issue NEWNEWS command using timestamp saved from previous session Issue NEWNEWS command using timestamp saved from previous session.
Overwrite saved timestamp with that currently in temporary storage Overwrite saved timestamp with that currently in temporary
storage.
In order to allow for minor errors, clients MAY want to adjust the In order to allow for minor errors, clients MAY want to adjust the
timestamp back by two or three minutes before using it in NEWNEWS. timestamp back by two or three minutes before using it in NEWNEWS.
7.5.1. Examples 7.5.1. Examples
First session: First session:
[C] DATE [C] DATE
[S] 111 20010203112233 [S] 111 20010203112233
skipping to change at page 69, line 29 skipping to change at page 66, line 42
[C] NEWNEWS local.chat 20010203 111933 GMT [C] NEWNEWS local.chat 20010203 111933 GMT
[S] 230 list follows [S] 230 list follows
[S] <article.3@local.service> [S] <article.3@local.service>
[S] <article.4@local.service> [S] <article.4@local.service>
[S] <article.5@local.service> [S] <article.5@local.service>
[S] . [S] .
Note how <article.3@local.service> arrived in the 3 minute gap and so Note how <article.3@local.service> arrived in the 3 minute gap and so
is listed in both responses. is listed in both responses.
7.6. The LIST commands 7.6. The LIST Commands
The LIST family of commands all return information that is multi-line The LIST family of commands all return information that is multi-line
and, in general, can be expected not to change during the session. and that can, in general, be expected not to change during the
Often the information is related to newsgroups, in which case the session. Often the information is related to newsgroups, in which
response has one line per newsgroup and a wildmat MAY be provided to case the response has one line per newsgroup and a wildmat MAY be
restrict the groups for which information is returned. provided to restrict the groups for which information is returned.
The set of available keywords (including those provided by The set of available keywords (including those provided by
extensions) is given in the capability list with capability label extensions) is given in the capability list with capability label
LIST. LIST.
7.6.1. LIST 7.6.1. LIST
7.6.1.1. Usage 7.6.1.1. Usage
Indicating capability: LIST Indicating capability: LIST
Syntax
Syntax
LIST [keyword [wildmat|argument]] LIST [keyword [wildmat|argument]]
Responses Responses
215 Information follows (multi-line) 215 Information follows (multi-line)
Parameters Parameters
keyword Information requested [1]
argument Specific to keyword
wildmat Groups of interest
keyword information requested [1] [1] If no keyword is provided, it defaults to ACTIVE.
argument specific to keyword
wildmat groups of interest
[1] If no keyword is provided, it defaults to ACTIVE.
7.6.1.2. Description 7.6.1.2. Description
The LIST command allows the server to provide blocks of information The LIST command allows the server to provide blocks of information
to the client. This information may be global or may be related to to the client. This information may be global or may be related to
newsgroups; in the latter case, the information may be returned newsgroups; in the latter case, the information may be returned
either for all groups or only for those matching a wildmat. Each either for all groups or only for those matching a wildmat. Each
block of information is represented by a different keyword. The block of information is represented by a different keyword. The
command returns the specific information identified by the keyword. command returns the specific information identified by the keyword.
skipping to change at page 70, line 50 skipping to change at page 68, line 7
newsgroup-based keyword, it indicates that there are no groups newsgroup-based keyword, it indicates that there are no groups
meeting the above criteria. meeting the above criteria.
If the keyword is not recognised, or if an argument is specified and If the keyword is not recognised, or if an argument is specified and
the keyword does not expect one, a 501 response code MUST BE the keyword does not expect one, a 501 response code MUST BE
returned. If the keyword is recognised but the server does not returned. If the keyword is recognised but the server does not
maintain the information, a 503 response code MUST BE returned. maintain the information, a 503 response code MUST BE returned.
The LIST command MUST NOT change the visible state of the server in The LIST command MUST NOT change the visible state of the server in
any way; that is, the behaviour of subsequent commands MUST NOT be any way; that is, the behaviour of subsequent commands MUST NOT be
affected by whether the LIST command was issued or not. For example, affected by whether the LIST command was issued. For example, it
it MUST NOT make groups available that otherwise would not have been. MUST NOT make groups available that otherwise would not have been.
7.6.1.3. Examples 7.6.1.3. Examples
Example of LIST with the ACTIVE keyword: Example of LIST with the ACTIVE keyword:
[C] LIST ACTIVE [C] LIST ACTIVE
[S] 215 list of newsgroups follows [S] 215 list of newsgroups follows
[S] misc.test 3002322 3000234 y [S] misc.test 3002322 3000234 y
[S] comp.risks 442001 441099 m [S] comp.risks 442001 441099 m
[S] alt.rfc-writers.recovery 4 1 y [S] alt.rfc-writers.recovery 4 1 y
skipping to change at page 72, line 20 skipping to change at page 69, line 28
[C] CAPABILITIES [C] CAPABILITIES
[S] 101 Capability list: [S] 101 Capability list:
[S] VERSION 2 [S] VERSION 2
[S] READER [S] READER
[S] LIST ACTIVE NEWSGROUPS ACTIVE.TIMES XTRA.DATA [S] LIST ACTIVE NEWSGROUPS ACTIVE.TIMES XTRA.DATA
[S] . [S] .
[C] LIST DISTRIB.PATS [C] LIST DISTRIB.PATS
[S] 501 Syntax Error [S] 501 Syntax Error
7.6.2. Standard LIST keywords 7.6.2. Standard LIST Keywords
This specification defines the following LIST keywords: This specification defines the following LIST keywords:
+----------------------+----------------------+---------------------+ +--------------+---------------+------------------------------------+
| Keyword | Definition | Status | | Keyword | Definition | Status |
+----------------------+----------------------+---------------------+ +--------------+---------------+------------------------------------+
| ACTIVE | Section 7.6.3 | Mandatory if the | | ACTIVE | Section 7.6.3 | Mandatory if the READER capability |
| | | READER capability | | | | is advertised |
| | | is advertised | | | | |
| | | | | ACTIVE.TIMES | Section 7.6.4 | Optional |
| ACTIVE.TIMES | Section 7.6.4 | Optional | | | | |
| | | | | DISTRIB.PATS | Section 7.6.5 | Optional |
| DISTRIB.PATS | Section 7.6.5 | Optional | | | | |
| | | | | HEADERS | Section 8.6 | Mandatory if the HDR capability is |
| HEADERS | Section 8.6 | Mandatory if the | | | | advertised |
| | | HDR capability is | | | | |
| | | advertised | | NEWSGROUPS | Section 7.6.6 | Mandatory if the READER capability |
| | | | | | | is advertised |
| NEWSGROUPS | Section 7.6.6 | Mandatory if the | | | | |
| | | READER capability | | OVERVIEW.FMT | Section 8.4 | Mandatory if the OVER capability |
| | | is advertised | | | | is advertised |
| | | | +--------------+---------------+------------------------------------+
| OVERVIEW.FMT | Section 8.4 | Mandatory if the |
| | | OVER capability is |
| | | advertised |
+----------------------+----------------------+---------------------+
Where one of these LIST keywords is supported by a server, it MUST Where one of these LIST keywords is supported by a server, it MUST
have the meaning given in the following sub-sections. have the meaning given in the relevant sub-section.
7.6.3. LIST ACTIVE 7.6.3. LIST ACTIVE
This keyword MUST be supported by servers advertising the READER This keyword MUST be supported by servers advertising the READER
capability. capability.
LIST ACTIVE returns a list of valid newsgroups and associated LIST ACTIVE returns a list of valid newsgroups and associated
information. If no wildmat is specified, the server MUST include information. If no wildmat is specified, the server MUST include
every group that the client is permitted to select with the GROUP every group that the client is permitted to select with the GROUP
(Section 6.1.1) command. Each line of this list consists of four command (Section 6.1.1). Each line of this list consists of four
fields separated from each other by one or more spaces: fields separated from each other by one or more spaces:
o the name of the newsgroup;
o the reported high water mark for the group; o The name of the newsgroup.
o the reported low water mark for the group; o The reported high water mark for the group.
o the current status of the group on this server. o The reported low water mark for the group.
o The current status of the group on this server.
The reported high and low water marks are as described in the GROUP The reported high and low water marks are as described in the GROUP
command (see Section 6.1.1). command (see Section 6.1.1), but note that they are in the opposite
order to the 211 response to that command.
The status field is typically one of: The status field is typically one of the following:
"y" posting is permitted "y" Posting is permitted.
"n" posting is not permitted "n" Posting is not permitted.
"m" postings will be forwarded to the newsgroup moderator "m" Postings will be forwarded to the newsgroup moderator.
The server SHOULD use these values when these meanings are required The server SHOULD use these values when these meanings are required
and MUST NOT use them with any other meaning. Other values for the and MUST NOT use them with any other meaning. Other values for the
status may exist; the definition of these other values and the status may exist; the definition of these other values and the
circumstances under which they are returned may be specified in an circumstances under which they are returned may be specified in an
extension or may be private to the server. A client SHOULD treat an extension or may be private to the server. A client SHOULD treat an
unrecognized status as giving no information. unrecognized status as giving no information.
The status of a newsgroup only indicates how posts to that newsgroup The status of a newsgroup only indicates how posts to that newsgroup
are normally processed and is not necessarily customised to the are normally processed and is not necessarily customised to the
skipping to change at page 74, line 19 skipping to change at page 71, line 27
[C] LIST ACTIVE [C] LIST ACTIVE
[S] 215 list of newsgroups follows [S] 215 list of newsgroups follows
[S] misc.test 0003002322 0003000234 y [S] misc.test 0003002322 0003000234 y
[S] comp.risks 0000442001 0000441099 m [S] comp.risks 0000442001 0000441099 m
[S] alt.rfc-writers.recovery 0000000004 0000000001 y [S] alt.rfc-writers.recovery 0000000004 0000000001 y
[S] tx.natives.recovery 0000000089 0000000056 y [S] tx.natives.recovery 0000000089 0000000056 y
[S] tx.natives.recovery.d 0000000011 0000000009 n [S] tx.natives.recovery.d 0000000011 0000000009 n
[S] . [S] .
The information is newsgroup-based and a wildmat MAY be specified, in The information is newsgroup based, and a wildmat MAY be specified,
which case the response is limited to only the groups (if any) whose in which case the response is limited to only the groups (if any)
names match the wildmat. For example: whose names match the wildmat. For example:
[C] LIST ACTIVE *.recovery [C] LIST ACTIVE *.recovery
[S] 215 list of newsgroups follows [S] 215 list of newsgroups follows
[S] alt.rfc-writers.recovery 4 1 y [S] alt.rfc-writers.recovery 4 1 y
[S] tx.natives.recovery 89 56 y [S] tx.natives.recovery 89 56 y
[S] . [S] .
7.6.4. LIST ACTIVE.TIMES 7.6.4. LIST ACTIVE.TIMES
This keyword is optional. This keyword is optional.
skipping to change at page 75, line 5 skipping to change at page 72, line 16
[S] 215 information follows [S] 215 information follows
[S] misc.test 930445408 <creatme@isc.org> [S] misc.test 930445408 <creatme@isc.org>
[S] alt.rfc-writers.recovery 930562309 <m@example.com> [S] alt.rfc-writers.recovery 930562309 <m@example.com>
[S] tx.natives.recovery 930678923 <sob@academ.com> [S] tx.natives.recovery 930678923 <sob@academ.com>
[S] . [S] .
The list MAY omit newsgroups for which the information is unavailable The list MAY omit newsgroups for which the information is unavailable
and MAY include groups not available on the server; in particular, it and MAY include groups not available on the server; in particular, it
MAY omit all groups created before the date and time of the oldest MAY omit all groups created before the date and time of the oldest
entry. The client MUST NOT assume that the list is complete or that entry. The client MUST NOT assume that the list is complete or that
it matches the list returned by the LIST ACTIVE (Section 7.6.3) it matches the list returned by the LIST ACTIVE command
command. The NEWGROUPS command (Section 7.3) may provide a better (Section 7.6.3). The NEWGROUPS command (Section 7.3) may provide a
way to access this information, and the results of the two commands better way to access this information, and the results of the two
SHOULD be consistent except that, if the latter is invoked with a commands SHOULD be consistent except that, if the latter is invoked
date and time earlier than the oldest entry in active.times list, its with a date and time earlier than the oldest entry in active.times
result may include extra groups. list, its result may include extra groups.
The information is newsgroup-based and a wildmat MAY be specified, in The information is newsgroup based, and a wildmat MAY be specified,
which case the response is limited to only the groups (if any) whose in which case the response is limited to only the groups (if any)
names match the wildmat. whose names match the wildmat.
7.6.5. LIST DISTRIB.PATS 7.6.5. LIST DISTRIB.PATS
This keyword is optional. This keyword is optional.
The distrib.pats list is maintained by some NNTP servers to assist The distrib.pats list is maintained by some NNTP servers to assist
clients to choose a value for the content of the Distribution header clients to choose a value for the content of the Distribution header
of a news article being posted. Each line of this list consists of of a news article being posted. Each line of this list consists of
three fields separated from each other by a colon (":"). The first three fields separated from each other by a colon (":"). The first
field is a weight, the second field is a wildmat (which may be a field is a weight, the second field is a wildmat (which may be a
skipping to change at page 75, line 42 skipping to change at page 73, line 5
[S] 20:local.here.*:thissite [S] 20:local.here.*:thissite
[S] . [S] .
The client MAY use this information to construct an appropriate The client MAY use this information to construct an appropriate
Distribution header given the name of a newsgroup. To do so, it Distribution header given the name of a newsgroup. To do so, it
should determine the lines whose second field matches the newsgroup should determine the lines whose second field matches the newsgroup
name, select from among them the line with the highest weight (with 0 name, select from among them the line with the highest weight (with 0
being the lowest), and use the value of the third field to construct being the lowest), and use the value of the third field to construct
the Distribution header. the Distribution header.
The information is not newsgroup-based and an argument MUST NOT be The information is not newsgroup based, and an argument MUST NOT be
specified. specified.
7.6.6. LIST NEWSGROUPS 7.6.6. LIST NEWSGROUPS
This keyword MUST be supported by servers advertising the READER This keyword MUST be supported by servers advertising the READER
capability. capability.
The newsgroups list is maintained by NNTP servers to contain the name The newsgroups list is maintained by NNTP servers to contain the name
of each newsgroup that is available on the server and a short of each newsgroup that is available on the server and a short
description about the purpose of the group. Each line of this list description about the purpose of the group. Each line of this list
consists of two fields separated from each other by one or more space consists of two fields separated from each other by one or more space
or TAB characters (the usual practice is a single TAB). The first or TAB characters (the usual practice is a single TAB). The first
field is the name of the newsgroup and the second is a short field is the name of the newsgroup, and the second is a short
description of the group. For example: description of the group. For example:
[C] LIST NEWSGROUPS [C] LIST NEWSGROUPS
[S] 215 information follows [S] 215 information follows
[S] misc.test General Usenet testing [S] misc.test General Usenet testing
[S] alt.rfc-writers.recovery RFC Writers Recovery [S] alt.rfc-writers.recovery RFC Writers Recovery
[S] tx.natives.recovery Texas Natives Recovery [S] tx.natives.recovery Texas Natives Recovery
[S] . [S] .
The list MAY omit newsgroups for which the information is unavailable The list MAY omit newsgroups for which the information is unavailable
and MAY include groups not available on the server. The client MUST and MAY include groups not available on the server. The client MUST
NOT assume that the list is complete or that it matches the list NOT assume that the list is complete or that it matches the list
returned by LIST ACTIVE. returned by LIST ACTIVE.
The description SHOULD be in UTF-8. However, servers often obtain The description SHOULD be in UTF-8. However, servers often obtain
the information from external sources. These sources may have used the information from external sources. These sources may have used
different encodings (ones that use octets in the range 128 to 255 in different encodings (ones that use octets in the range 128 to 255 in
some other manner) and, in this case, the server MAY pass it on some other manner) and, in that case, the server MAY pass it on
unchanged; therefore clients MUST be prepared to receive such unchanged. Therefore, clients MUST be prepared to receive such
descriptions. descriptions.
The information is newsgroup-based and a wildmat MAY be specified, in The information is newsgroup based, and a wildmat MAY be specified,
which case the response is limited to only the groups (if any) whose in which case the response is limited to only the groups (if any)
names match the wildmat. whose names match the wildmat.
8. Article field access commands 8. Article Field Access Commands
This section lists commands that may be used to access specific This section lists commands that may be used to access specific
article fields; that is, headers of articles and metadata about article fields; that is, headers of articles and metadata about
articles. These commands typically fetch data from an "overview articles. These commands typically fetch data from an "overview
database", which is a database of headers extracted from incoming database", which is a database of headers extracted from incoming
articles plus metadata determined as the article arrives. Only articles plus metadata determined as the article arrives. Only
certain fields are included in the database. certain fields are included in the database.
This section is based on the Overview/NOV database [ROBE1995] This section is based on the Overview/NOV database [ROBE1995]
developed by Geoff Collyer. developed by Geoff Collyer.
8.1. Article metadata 8.1. Article Metadata
Article "metadata" is data about articles that does not occur within Article "metadata" is data about articles that does not occur within
the article itself. Each metadata item has a name which MUST begin the article itself. Each metadata item has a name that MUST begin
with a colon (and which MUST NOT contain a colon elsewhere within with a colon (and that MUST NOT contain a colon elsewhere within it).
it). As with header names, metadata item names are not case- As with header names, metadata item names are not case sensitive.
sensitive.
When generating a metadata item, the server MUST compute it for When generating a metadata item, the server MUST compute it for
itself and MUST NOT trust any related value provided in the article. itself and MUST NOT trust any related value provided in the article.
(In particular, a Lines or Bytes header in the article MUST NOT be (In particular, a Lines or Bytes header in the article MUST NOT be
assumed to specify the correct number of lines or bytes in the assumed to specify the correct number of lines or bytes in the
article.) If the server has access to several non-identical copies article.) If the server has access to several non-identical copies
of an article, the value returned MUST be correct for any copy of of an article, the value returned MUST be correct for any copy of
that article retrieved during the same session. that article retrieved during the same session.
This specification defines two metadata items: ":bytes" and ":lines". This specification defines two metadata items: ":bytes" and ":lines".
Other metadata items may be defined by extensions. The names of Other metadata items may be defined by extensions. The names of
metadata items defined by registered extensions MUST NOT begin with metadata items defined by registered extensions MUST NOT begin with
":x-". To avoid the risk of a clash with a future registered ":x-". To avoid the risk of a clash with a future registered
extension, the names of metadata items defined by private extensions extension, the names of metadata items defined by private extensions
SHOULD begin with ":x-". SHOULD begin with ":x-".
8.1.1. The :bytes metadata item 8.1.1. The :bytes Metadata Item
The :bytes metadata item for an article is a decimal integer. It The :bytes metadata item for an article is a decimal integer. It
SHOULD equal the number of octets in the entire article - headers, SHOULD equal the number of octets in the entire article: headers,
body, and separating empty line (counting a CRLF pair as two octets, body, and separating empty line (counting a CRLF pair as two octets,
and excluding both the "." CRLF terminating the response and any "." and excluding both the "." CRLF terminating the response and any "."
added for "dot-stuffing" purposes). added for "dot-stuffing" purposes).
Note to client implementers: some existing servers return a value Note to client implementers: some existing servers return a value
different to that above. The commonest reasons for this are: different from that above. The commonest reasons for this are as
o counting a CRLF pair as one octet; follows:
o including the "." character used for dot-stuffing in the number;
o including the terminating "." CRLF in the number; o Counting a CRLF pair as one octet.
o using one copy of an article for counting the octets but then
o Including the "." character used for dot-stuffing in the number.
o Including the terminating "." CRLF in the number.
o Using one copy of an article for counting the octets but then
returning another one that differs in some (permitted) manner. returning another one that differs in some (permitted) manner.
Implementations should be prepared for such variation and MUST NOT Implementations should be prepared for such variation and MUST NOT
rely on the value being accurate. rely on the value being accurate.
8.1.2. The :lines metadata item 8.1.2. The :lines Metadata Item
The :lines metadata item for an article is a decimal integer. It The :lines metadata item for an article is a decimal integer. It
MUST equal the number of lines in the article body (excluding the MUST equal the number of lines in the article body (excluding the
empty line separating headers and body); equivalently, it is two less empty line separating headers and body). Equivalently, it is two
than the number of CRLF pairs that the BODY command would return for less than the number of CRLF pairs that the BODY command would return
that article (the extra two are those following the response code and for that article (the extra two are those following the response code
the termination octet). and the termination octet).
8.2. Database consistency 8.2. Database Consistency
The information stored in the overview database may change over time. The information stored in the overview database may change over time.
If the database records the content or absence of a given field (that If the database records the content or absence of a given field (that
is, a header or metadata item) for all articles, it is said to be is, a header or metadata item) for all articles, it is said to be
"consistent" for that field. If it records the content of a header "consistent" for that field. If it records the content of a header
for some articles but not for others that nevertheless included that for some articles but not for others that nevertheless included that
header, or records a metadata item for some articles but not others header, or if it records a metadata item for some articles but not
to which that item applies, it is said to be "inconsistent" for that for others to which that item applies, it is said to be
field. "inconsistent" for that field.
The LIST OVERVIEW.FMT command SHOULD list all the fields for which The LIST OVERVIEW.FMT command SHOULD list all the fields for which
the database is consistent at that moment. It MAY omit such fields the database is consistent at that moment. It MAY omit such fields
(for example if it is not known whether the database is consistent or (for example, if it is not known whether the database is consistent
inconsistent). It MUST NOT include fields for which the database is or inconsistent). It MUST NOT include fields for which the database
inconsistent or which are not stored in the database. Therefore if a is inconsistent or that are not stored in the database. Therefore,
header appears in the LIST OVERVIEW.FMT output but not the OVER if a header appears in the LIST OVERVIEW.FMT output but not in the
output for a given article, that header does not appear in the OVER output for a given article, that header does not appear in the
article, and similarly for metadata items. article (similarly for metadata items).
These rules assume the fields being stored in the database remain These rules assume that the fields being stored in the database
constant for long periods of time, with the database therefore being remain constant for long periods of time, and therefore the database
consistent. When the set of fields to be stored is changed, it will will be consistent. When the set of fields to be stored is changed,
be inconsistent until either the database is rebuilt or the only it will be inconsistent until either the database is rebuilt or the
articles remaining are those received since the change. Therefore only articles remaining are those received since the change.
the output from LIST OVERVIEW.FMT needs to be altered twice: before Therefore, the output from LIST OVERVIEW.FMT needs to be altered
any fields stop being stored, they MUST be removed from the output, twice. Firstly, before any fields stop being stored they MUST be
then when the database is once more known to be consistent, the new removed from the output; then, when the database is once more known
fields SHOULD be added to the output. to be consistent, the new fields SHOULD be added to the output.
If the HDR command uses the overview database rather than taking If the HDR command uses the overview database rather than taking
information directly from the articles, the same issues of information directly from the articles, the same issues of
consistency and inconsistency apply and the and the LIST HEADERS consistency and inconsistency apply, and the LIST HEADERS command
command SHOULD take the same approach as the LIST OVERVIEW.FMT SHOULD take the same approach as the LIST OVERVIEW.FMT command in
command in resolving them. resolving them.
8.3. OVER 8.3. OVER
8.3.1. Usage 8.3.1. Usage
Indicating capability: OVER Indicating capability: OVER
Syntax Syntax
OVER message-id OVER message-id
OVER range OVER range
OVER OVER
Responses Responses
First form (message-id specified) First form (message-id specified)
224 Overview information follows (multi-line) 224 Overview information follows (multi-line)
430 No article with that message-id 430 No article with that message-id
Second form (range specified) Second form (range specified)
224 Overview information follows (multi-line) 224 Overview information follows (multi-line)
412 No newsgroup selected 412 No newsgroup selected
423 No articles in that range 423 No articles in that range
Third form (current article number used) Third form (current article number used)
224 Overview information follows (multi-line) 224 Overview information follows (multi-line)
412 No newsgroup selected 412 No newsgroup selected
420 Current article number is invalid 420 Current article number is invalid
Parameters Parameters
range Number(s) of articles
range number(s) of articles message-id Message-id of article
message-id message-id of article
8.3.2. Description 8.3.2. Description
The OVER command returns the contents of all the fields in the The OVER command returns the contents of all the fields in the
database for an article specified by message-id, or from a specified database for an article specified by message-id, or from a specified
article or range of articles in the currently selected newsgroup. article or range of articles in the currently selected newsgroup.
The message-id argument indicates a specific article. The range The message-id argument indicates a specific article. The range
argument may be any of the following: argument may be any of the following:
o an article number o An article number.
o an article number followed by a dash to indicate all following
o an article number followed by a dash followed by another article o An article number followed by a dash to indicate all following.
number
o An article number followed by a dash followed by another article
number.
If neither is specified, the current article number is used. If neither is specified, the current article number is used.
Support for the first (message-id) form is optional. If is is Support for the first (message-id) form is optional. If it is
supported, the OVER capability line MUST include the argument supported, the OVER capability line MUST include the argument
"MSGID". Otherwise, the capability line MUST NOT include this "MSGID". Otherwise, the capability line MUST NOT include this
argument, and the OVER command MUST return the the generic response argument, and the OVER command MUST return the generic response code
code 503 when this form is used. 503 when this form is used.
If the information is available, it is returned as a multi-line data If the information is available, it is returned as a multi-line data
block following the 224 response code and contains one line per block following the 224 response code and contains one line per
article, sorted in numerical order of article number (note that article, sorted in numerical order of article number. (Note that
unless the argument is a range including a dash, there will be unless the argument is a range including a dash, there will be
exactly one line in the data block). Each line consists of a number exactly one line in the data block.) Each line consists of a number
of fields separated by a TAB. A field may be empty (in which case of fields separated by a TAB. A field may be empty (in which case
there will be two adjacent TABs), and a sequence of trailing TABs may there will be two adjacent TABs), and a sequence of trailing TABs may
be omitted. be omitted.
The first 8 fields MUST be the following, in order: The first 8 fields MUST be the following, in order:
"0" or article number (see below) "0" or article number (see below)
Subject header content Subject header content
From header content From header content
Date header content Date header content
Message-ID header content Message-ID header content
References header content References header content
:bytes metadata item :bytes metadata item
:lines metadata item :lines metadata item
If the article is specified by message-id (the first form of the If the article is specified by message-id (the first form of the
command), the article number MUST be replaced with zero, except that command), the article number MUST be replaced with zero, except that
if there is a currently selected newsgroup and the article is present if there is a currently selected newsgroup and the article is present
in that group, the server MAY use that article number (see the in that group, the server MAY use the article's number in that group.
ARTICLE command (Section 6.2.1) and STAT examples (Section 6.2.4.3) (See the ARTICLE command (Section 6.2.1) and STAT examples
for more details). In the other two forms of the command, the (Section 6.2.4.3) for more details.) In the other two forms of the
article number MUST be returned. command, the article number MUST be returned.
Any subsequent fields are the contents of the other headers and Any subsequent fields are the contents of the other headers and
metadata held in the database. metadata held in the database.
For the five mandatory headers, the content of each field MUST be For the five mandatory headers, the content of each field MUST be
based on the content of the header (that is, with the header name and based on the content of the header (that is, with the header name and
following colon and space removed). If the article does not contain following colon and space removed). If the article does not contain
that header, or if the content is empty, the field MUST be empty. that header, or if the content is empty, the field MUST be empty.
For the two mandatory metadata items, the content of the field MUST For the two mandatory metadata items, the content of the field MUST
be just the value, with no other text. be just the value, with no other text.
For all subsequent fields that contain headers, the content MUST be For all subsequent fields that contain headers, the content MUST be
the entire header line other than the trailing CRLF. For all the entire header line other than the trailing CRLF. For all
subsequent fields that contain metadata, the field consists of the subsequent fields that contain metadata, the field consists of the
metadata name, a single space, and then the value. metadata name, a single space, and then the value.
For all fields, the value is processed by first removing all CRLF For all fields, the value is processed by first removing all CRLF
pairs (that is, undoing any folding and removing the terminating pairs (that is, undoing any folding and removing the terminating
CRLF) and then replacing each TAB with a single space. If there is CRLF) and then replacing each TAB with a single space. If there is
no such header in the article, or no such metadata item, or no header no such header in the article, no such metadata item, or no header or
or item stored in the database for that article, the corresponding item stored in the database for that article, the corresponding field
field MUST be empty. MUST be empty.
Note that, after unfolding, the characters NUL, LF, and CR cannot Note that, after unfolding, the characters NUL, LF, and CR cannot
occur in the header of an article offered by a conformant server. occur in the header of an article offered by a conformant server.
Nevertheless, servers SHOULD check for these characters and replace Nevertheless, servers SHOULD check for these characters and replace
each one by a single space (so that, for example, CR LF LF TAB will each one by a single space (so that, for example, CR LF LF TAB will
become two spaces, since the CR and first LF will be removed by the become two spaces, since the CR and first LF will be removed by the
unfolding process). This will encourage robustness in the face of unfolding process). This will encourage robustness in the face of
non-conforming data; it is also possible that future versions of this non-conforming data; it is also possible that future versions of this
specification could permit these characters to appear in articles. specification could permit these characters to appear in articles.
skipping to change at page 81, line 41 skipping to change at page 78, line 35
response MUST be returned. If the argument is a range or is omitted response MUST be returned. If the argument is a range or is omitted
and the currently selected newsgroup is invalid, a 412 response MUST and the currently selected newsgroup is invalid, a 412 response MUST
be returned. If the argument is a range and no articles in that be returned. If the argument is a range and no articles in that
number range exist in the currently selected newsgroup, including the number range exist in the currently selected newsgroup, including the
case where the second number is less than the first one, a 423 case where the second number is less than the first one, a 423
response MUST be returned. If the argument is omitted and the response MUST be returned. If the argument is omitted and the
current article number is invalid, a 420 response MUST be returned. current article number is invalid, a 420 response MUST be returned.
8.3.3. Examples 8.3.3. Examples
In the first three examples, TAB has been replaced by vertical bar In the first four examples, TAB has been replaced by vertical bar and
and some lines have been folded for readability. some lines have been folded for readability.
Example of a successful retrieval of overview information for an Example of a successful retrieval of overview information for an
article (using no article number): article (explicitly not using an article number):
[C] GROUP misc.test [C] GROUP misc.test
[S] 211 1234 3000234 3002322 misc.test [S] 211 1234 3000234 3002322 misc.test
[C] OVER [C] OVER
[S] 224 Overview information follows [S] 224 Overview information follows
[S] 300234|I am just a test article|"Demo User" [S] 3000234|I am just a test article|"Demo User"
<nobody@example.com>|6 Oct 1998 04:38:40 -0500| <nobody@example.com>|6 Oct 1998 04:38:40 -0500|
<45223423@example.com>|<45454@example.net>|1234| <45223423@example.com>|<45454@example.net>|1234|
17|Xref: news.example.com misc.test:3000363 17|Xref: news.example.com misc.test:3000363
[S] . [S] .
Example of a successful retrieval of overview information for an Example of a successful retrieval of overview information for an
article by message-id: article by message-id:
[C] CAPABILITIES [C] CAPABILITIES
[S] 101 Capability list: [S] 101 Capability list:
[S] VERSION 2 [S] VERSION 2
[S] READER [S] READER
[S] OVER MSGID [S] OVER MSGID
[S] LIST ACTIVE NEWSGROUPS OVERVIEW.FMT [S] LIST ACTIVE NEWSGROUPS OVERVIEW.FMT
[S] . [S] .
[C] OVER <45223423@example.com> [C] OVER <45223423@example.com>
[S] 224 Overview information follows [S] 224 Overview information follows
[S] 0|I am just a test article|"Demo User" [S] 0|I am just a test article|"Demo User"
<nobody@example.com>|6 Oct 1998 04:38:40 -0500| <nobody@example.com>|6 Oct 1998 04:38:40 -0500|
<45223423@example.com>|<45454@example.net>|1234| <45223423@example.com>|<45454@example.net>|1234|
17|Xref: news.example.com misc.test:3000363 17|Xref: news.example.com misc.test:3000363
[S] . [S] .
Note that the article number has been replaced by "0". Note that the article number has been replaced by "0".
Example of the same commands on a system that does not implement Example of the same commands on a system that does not implement
retrieval by message-id: retrieval by message-id:
[C] CAPABILITIES [C] CAPABILITIES
[S] 101 Capability list: [S] 101 Capability list:
[S] VERSION 2 [S] VERSION 2
skipping to change at page 82, line 49 skipping to change at page 80, line 12
[C] OVER <45223423@example.com> [C] OVER <45223423@example.com>
[S] 503 Overview by message-id unsupported [S] 503 Overview by message-id unsupported
Example of a successful retrieval of overview information for a range Example of a successful retrieval of overview information for a range
of articles: of articles:
[C] GROUP misc.test [C] GROUP misc.test
[S] 211 1234 3000234 3002322 misc.test [S] 211 1234 3000234 3002322 misc.test
[C] OVER 3000234-3000240 [C] OVER 3000234-3000240
[S] 224 Overview information follows [S] 224 Overview information follows
[S] 300234|I am just a test article|"Demo User" [S] 3000234|I am just a test article|"Demo User"
<nobody@example.com>|6 Oct 1998 04:38:40 -0500| <nobody@example.com>|6 Oct 1998 04:38:40 -0500|
<45223423@example.com>|<45454@example.net>|1234| <45223423@example.com>|<45454@example.net>|1234|
17|Xref: news.example.com misc.test:3000363 17|Xref: news.example.com misc.test:3000363
[S] 3000235|Another test article|nobody@nowhere.to [S] 3000235|Another test article|nobody@nowhere.to
(Demo User)|6 Oct 1998 04:38:45 -0500|<45223425@to.to>|| (Demo User)|6 Oct 1998 04:38:45 -0500|<45223425@to.to>||
4818|37||Distribution: fi 4818|37||Distribution: fi
[S] 3000238|Re: I am just a test article|somebody@elsewhere.to| [S] 3000238|Re: I am just a test article|somebody@elsewhere.to|
7 Oct 1998 11:38:40 +1200|<kfwer3v@elsewhere.to>| 7 Oct 1998 11:38:40 +1200|<kfwer3v@elsewhere.to>|
<45223423@to.to>|9234|51 <45223423@to.to>|9234|51
[S] . [S] .
Note the missing "References" and Xref headers in the second line, Note the missing "References" and Xref headers in the second line,
the missing trailing field(s) in the first and last lines, and that the missing trailing fields in the first and last lines, and that
there are only results for those articles that still exist. there are only results for those articles that still exist.
Example of an unsuccessful retrieval of overview information on an Example of an unsuccessful retrieval of overview information on an
article by number: article by number:
[C] GROUP misc.test [C] GROUP misc.test
[S] 211 1234 3000234 3002322 misc.test [S] 211 1234 3000234 3002322 misc.test
[C] OVER 300256 [C] OVER 300256
[S] 423 No such article in this group [S] 423 No such article in this group
skipping to change at page 84, line 22 skipping to change at page 81, line 33
215 Information follows (multi-line) 215 Information follows (multi-line)
8.4.2. Description 8.4.2. Description
See Section 7.6.1 for general requirements of the LIST command. See Section 7.6.1 for general requirements of the LIST command.
The LIST OVERVIEW.FMT command returns a description of the fields in The LIST OVERVIEW.FMT command returns a description of the fields in
the database for which it is consistent (as described above). The the database for which it is consistent (as described above). The
information is returned as a multi-line data block following the 215 information is returned as a multi-line data block following the 215
response code. The information contains one line per field in the response code. The information contains one line per field in the
order they are returned by the OVER command; the first 7 lines MUST order in which they are returned by the OVER command; the first 7
(except for the case of letters) be exactly: lines MUST (except for the case of letters) be exactly as follows:
Subject: Subject:
From: From:
Date: Date:
Message-ID: Message-ID:
References: References:
:bytes :bytes
:lines :lines
except that, for compatibility with existing implementations, the For compatibility with existing implementations, the last two lines
last two lines MAY instead be: MAY instead be:
Bytes: Bytes:
Lines: Lines:
even though they refer to metadata, not headers. even though they refer to metadata, not headers.
All subsequent lines MUST consist of either a header name followed by All subsequent lines MUST consist of either a header name followed by
":full", or the name of a piece of metadata. ":full", or the name of a piece of metadata.
There are no leading or trailing spaces in the output. There are no leading or trailing spaces in the output.
Note that the 7 fixed lines describe the 2nd to 8th fields of the Note that the 7 fixed lines describe the 2nd to 8th fields of the
OVER output. The "full" suffix (which may use either uppercase, OVER output. The "full" suffix (which may use either uppercase,
lowercase, or a mix) is a reminder that the corresponding fields lowercase, or a mix) is a reminder that the corresponding fields
include the header name. include the header name.
This command MAY generate different results if used more than once in This command MAY generate different results if it is used more than
a session. once in a session.
If the OVER command is not implemented, the meaning of the output If the OVER command is not implemented, the meaning of the output
from this command is not specified but it must still meet the above from this command is not specified, but it must still meet the above
syntactic requirements. syntactic requirements.
8.4.3. Examples 8.4.3. Examples
Example of LIST OVERVIEW.FMT output corresponding to the example OVER Example of LIST OVERVIEW.FMT output corresponding to the example OVER
output above, using the preferred format: output above, in the preferred format:
[C] LIST OVERVIEW.FMT [C] LIST OVERVIEW.FMT
[S] 215 Order of fields in overview database. [S] 215 Order of fields in overview database.
[S] Subject: [S] Subject:
[S] From: [S] From:
[S] Date: [S] Date:
[S] Message-ID: [S] Message-ID:
[S] References: [S] References:
[S] :bytes [S] :bytes
[S] :lines [S] :lines
[S] Xref:full [S] Xref:full
[S] Distribution:full [S] Distribution:full
[S] . [S] .
Example of LIST OVERVIEW.FMT output corresponding to the example OVER Example of LIST OVERVIEW.FMT output corresponding to the example OVER
output above, using the alternative format: output above, in the alternative format:
[C] LIST OVERVIEW.FMT [C] LIST OVERVIEW.FMT
[S] 215 Order of fields in overview database. [S] 215 Order of fields in overview database.
[S] Subject: [S] Subject:
[S] From: [S] From:
[S] Date: [S] Date:
[S] Message-ID: [S] Message-ID:
[S] References: [S] References:
[S] Bytes: [S] Bytes:
[S] Lines: [S] Lines:
skipping to change at page 86, line 4 skipping to change at page 83, line 24
[S] References: [S] References:
[S] Bytes: [S] Bytes:
[S] Lines: [S] Lines:
[S] Xref:FULL [S] Xref:FULL
[S] Distribution:FULL [S] Distribution:FULL
[S] . [S] .
8.5. HDR 8.5. HDR
8.5.1. Usage 8.5.1. Usage
Indicating capability: HDR Indicating capability: HDR
Syntax Syntax
HDR field message-id HDR field message-id
HDR field range HDR field range
HDR field HDR field
Responses Responses
First form (message-id specified) First form (message-id specified)
225 Headers follow (multi-line) 225 Headers follow (multi-line)
430 No article with that message-id 430 No article with that message-id
Second form (range specified) Second form (range specified)
225 Headers follow (multi-line) 225 Headers follow (multi-line)
412 No newsgroup selected 412 No newsgroup selected
423 No articles in that range 423 No articles in that range
Third form (current article number used) Third form (current article number used)
225 Headers follow (multi-line) 225 Headers follow (multi-line)
412 No newsgroup selected 412 No newsgroup selected
420 Current article number is invalid 420 Current article number is invalid
Parameters Parameters
field Name of field
field name of field range Number(s) of articles
range number(s) of articles message-id Message-id of article
message-id message-id of article
8.5.2. Description 8.5.2. Description
The HDR command provides access to specific fields from an article The HDR command provides access to specific fields from an article
specified by message-id, or from a specified article or range of specified by message-id, or from a specified article or range of
articles in the currently selected newsgroup. It MAY take the articles in the currently selected newsgroup. It MAY take the
information directly from the articles or from the overview database. information directly from the articles or from the overview database.
In the case of headers, an implementation MAY restrict the use of In the case of headers, an implementation MAY restrict the use of
this command to a specific list of headers or MAY allow it to be used this command to a specific list of headers or MAY allow it to be used
with any header; it may behave differently when it is used with a with any header; it may behave differently when it is used with a
message-id argument and when it is used with a range or no argument. message-id argument and when it is used with a range or no argument.
The required field argument is the name of a header with the colon The required field argument is the name of a header with the colon
omitted (e.g. "subject"), or the name of a metadata item including omitted (e.g., "subject") or the name of a metadata item including
the leading colon (e.g. ":bytes"), and is case-insensitive. the leading colon (e.g., ":bytes"), and is case insensitive.
The message-id argument indicates a specific article. The range The message-id argument indicates a specific article. The range
argument may be any of the following: argument may be any of the following:
o an article number
o an article number followed by a dash to indicate all following o An article number.
o an article number followed by a dash followed by another article
number o An article number followed by a dash to indicate all following.
o An article number followed by a dash followed by another article
number.
If neither is specified, the current article number is used. If neither is specified, the current article number is used.
If the information is available, it is returned as a multi-line data If the information is available, it is returned as a multi-line data
block following the 225 response code and contains one line for each block following the 225 response code and contains one line for each
article in the range that exists (note that unless the argument is a article in the range that exists. (Note that unless the argument is
range including a dash, there will be exactly one line in the data a range including a dash, there will be exactly one line in the data
block). The line consists of the article number, a space, and then block.) The line consists of the article number, a space, and then
the contents of the field. In the case of a header, the header name, the contents of the field. In the case of a header, the header name,
colon, and the first space after the colon are all omitted. the colon, and the first space after the colon are all omitted.
If the article is specified by message-id (the first form of the If the article is specified by message-id (the first form of the
command), the article number MUST be replaced with zero, except that command), the article number MUST be replaced with zero, except that
if there is a currently selected newsgroup and the article is present if there is a currently selected newsgroup and the article is present
in that group, the server MAY use that article number (see the in that group, the server MAY use the article's number in that group.
ARTICLE command (Section 6.2.1) and STAT examples (Section 6.2.4.3) (See the ARTICLE command (Section 6.2.1) and STAT examples
for more details). In the other two forms of the command, the (Section 6.2.4.3) for more details.) In the other two forms of the
article number MUST be returned. command, the article number MUST be returned.
Header contents are modified as follows: all CRLF pairs are removed, Header contents are modified as follows: all CRLF pairs are removed,
and then each TAB is replaced with a single space (note that this is and then each TAB is replaced with a single space. (Note that this
the same transformation as is performed by the OVER command is the same transformation as is performed by the OVER command
(Section 8.3.2), and the same comment concerning NUL, CR, and LF (Section 8.3.2), and the same comment concerning NUL, CR, and LF
applies). applies.)
Note the distinction between headers and metadata appearing to have Note the distinction between headers and metadata appearing to have
the same meaning. Headers are always taken unchanged from the the same meaning. Headers are always taken unchanged from the
article; metadata are always calculated. For example, a request for article; metadata are always calculated. For example, a request for
"Lines" returns the contents of the "Lines" header of the specified "Lines" returns the contents of the "Lines" header of the specified
articles, if any, no matter whether or not they accurately state the articles, if any, no matter whether they accurately state the number
number of lines, while a request for ":lines" returns the line count of lines, while a request for ":lines" returns the line count
metadata, which is always the actual number of lines irrespective of metadata, which is always the actual number of lines irrespective of
what any header may state. what any header may state.
If the requested header is not present in the article or if it is If the requested header is not present in the article, or if it is
present but empty, a line for that article is included in the output present but empty, a line for that article is included in the output,
but the header content portion of the line is empty (the space after but the header content portion of the line is empty (the space after
the article number MAY be retained or omitted). If the header occurs the article number MAY be retained or omitted). If the header occurs
in a given article more than once, only the content of the first in a given article more than once, only the content of the first
occurrence is returned by HDR. If any article number in the provided occurrence is returned by HDR. If any article number in the provided
range does not exist in the group, no line for that article number is range does not exist in the group, no line for that article number is
included in the output. included in the output.
If the second argument is a message-id and no such article exists, a If the second argument is a message-id and no such article exists, a
430 response MUST be returned. If the second argument is a range or 430 response MUST be returned. If the second argument is a range or
is omitted and the currently selected newsgroup is invalid, a 412 is omitted and the currently selected newsgroup is invalid, a 412
response MUST be returned. If the second argument is a range and no response MUST be returned. If the second argument is a range and no
articles in that number range exist in the currently selected articles in that number range exist in the currently selected
newsgroup, including the case where the second number is less than newsgroup, including the case where the second number is less than
the first one, a 423 response MUST be returned. If the second the first one, a 423 response MUST be returned. If the second
argument is omitted and the current article number is invalid, a 420 argument is omitted and the current article number is invalid, a 420
response MUST be returned. response MUST be returned.
A server MAY only allow HDR commands for a limited set of fields; it A server MAY only allow HDR commands for a limited set of fields; it
may behave differently in this respect for the first (message-id) may behave differently in this respect for the first (message-id)
form than for the other forms. If so, it MUST respond with the form from how it would for the other forms. If so, it MUST respond
generic 503 response to attempts to request other fields, rather than with the generic 503 response to attempts to request other fields,
returning erroneous results such as a successful empty response. rather than return erroneous results, such as a successful empty
response.
If HDR uses the overview database and it is inconsistent for the If HDR uses the overview database and it is inconsistent for the
requested field, the server MAY return what results it can or it MAY requested field, the server MAY return what results it can, or it MAY
respond with the generic 503 response; in the latter case, the field respond with the generic 503 response. In the latter case, the field
MUST NOT appear in the output from LIST HEADERS. MUST NOT appear in the output from LIST HEADERS.
8.5.3. Examples 8.5.3. Examples
Example of a successful retrieval of subject lines from a range of Example of a successful retrieval of subject lines from a range of
articles (3000235 has no Subject header, and 3000236 is missing): articles (3000235 has no Subject header, and 3000236 is missing):
[C] GROUP misc.test [C] GROUP misc.test
[S] 211 1234 3000234 3002322 misc.test [S] 211 1234 3000234 3002322 misc.test
[C] HDR Subject 3000234-300238 [C] HDR Subject 3000234-3000238
[S] 225 Headers follow [S] 225 Headers follow
[S] 3000234 I am just a test article [S] 3000234 I am just a test article
[S] 3000235 [S] 3000235
[S] 3000237 Re: I am just a test article [S] 3000237 Re: I am just a test article
[S] 3000238 Ditto [S] 3000238 Ditto
[S] . [S] .
Example of a successful retrieval of line counts from a range of Example of a successful retrieval of line counts from a range of
articles: articles:
[C] GROUP misc.test [C] GROUP misc.test
[S] 211 1234 3000234 3002322 misc.test [S] 211 1234 3000234 3002322 misc.test
[C] HDR :lines 3000234-300238 [C] HDR :lines 3000234-3000238
[S] 225 Headers follow [S] 225 Headers follow
[S] 3000234 42 [S] 3000234 42
[S] 3000235 5 [S] 3000235 5
[S] 3000237 11 [S] 3000237 11
[S] 3000238 2378 [S] 3000238 2378
[S] . [S] .
Example of a successful retrieval of the subject line from an article Example of a successful retrieval of the subject line from an article
by message-id: by message-id:
skipping to change at page 89, line 51 skipping to change at page 87, line 31
[C] GROUP example.empty.newsgroup [C] GROUP example.empty.newsgroup
[S] 211 0 0 0 example.empty.newsgroup [S] 211 0 0 0 example.empty.newsgroup
[C] HDR subject 1- [C] HDR subject 1-
[S] 423 No articles in that range [S] 423 No articles in that range
Example of an unsuccessful retrieval of headers because the server Example of an unsuccessful retrieval of headers because the server
does not allow HDR commands for that header: does not allow HDR commands for that header:
[C] GROUP misc.test [C] GROUP misc.test
[S] 211 1234 3000234 3002322 misc.test [S] 211 1234 3000234 3002322 misc.test
[C] HDR Content-Type 3000234-300238 [C] HDR Content-Type 3000234-3000238
[S] 503 HDR not permitted on Content-Type [S] 503 HDR not permitted on Content-Type
8.6. LIST HEADERS 8.6. LIST HEADERS
8.6.1. Usage 8.6.1. Usage
Indicating capability: HDR Indicating capability: HDR
Syntax Syntax
LIST HEADERS [MSGID|RANGE] LIST HEADERS [MSGID|RANGE]
Responses Responses
215 Field list follows (multi-line) 215 Field list follows (multi-line)
Parameters Parameters
MSGID Requests list for access by message-id
MSGID requests list for access by message-id RANGE Requests list for access by range
RANGE requests list for access by range
8.6.2. Description 8.6.2. Description
See Section 7.6.1 for general requirements of the LIST command. See Section 7.6.1 for general requirements of the LIST command.
The LIST HEADERS command returns a list of fields that may be The LIST HEADERS command returns a list of fields that may be
retrieved using the HDR command. retrieved using the HDR command.
The information is returned as a multi-line data block following the The information is returned as a multi-line data block following the
215 response code and contains one line for each field name 215 response code and contains one line for each field name
(excluding the trailing colon for headers and including the leading (excluding the trailing colon for headers and including the leading
colon for metadata items). If the implementation allows any header colon for metadata items). If the implementation allows any header
to be retrieved, it MUST NOT include any header names in the list but to be retrieved, it MUST NOT include any header names in the list but
MUST include the special entry ":" (a single colon on its own); it MUST include the special entry ":" (a single colon on its own). It
MUST still explicitly list any metadata items that are available. MUST still explicitly list any metadata items that are available.
The order of items in the list is not significant; the server need The order of items in the list is not significant; the server need
not even consistently return the same order. The list MAY be empty not even consistently return the same order. The list MAY be empty
(though in this circumstance there is little point in providing the (though in this circumstance there is little point in providing the
HDR command). HDR command).
An implementation that also supports the OVER command SHOULD at least An implementation that also supports the OVER command SHOULD at least
permit all the headers and metadata items listed in the output from permit all the headers and metadata items listed in the output from
the LIST OVERVIEW.FMT command. the LIST OVERVIEW.FMT command.
If the server treats the first form of the HDR command (message-id If the server treats the first form of the HDR command (message-id
specified) differently to the other two forms (range specified or specified) differently from the other two forms (range specified or
current article number used) in respect of which headers or metadata current article number used) in respect of which headers or metadata
items are available, then: items are available, then the following apply:
o if the MSGID argument is specified, the results MUST be those o If the MSGID argument is specified, the results MUST be those
available for the first form of the HDR command; available for the first form of the HDR command.
o if the RANGE argument is specified, the results MUST be those
available for the second and third forms of the HDR command; o If the RANGE argument is specified, the results MUST be those
o if no argument is specified, the results MUST be those available available for the second and third forms of the HDR command.
o If no argument is specified, the results MUST be those available
in all forms of the HDR command (that is, it MUST only list those in all forms of the HDR command (that is, it MUST only list those
items listed in both the previous cases). items listed in both the previous cases).
If the server does not treat the various forms differently, then it If the server does not treat the various forms differently, then it
MUST always produce the same results and ignore any argument. MUST ignore any argument and always produce the same results (though
not necessarily always in the same order).
If the HDR command is not implemented, the meaning of the output from If the HDR command is not implemented, the meaning of the output from
this command is not specified but it must still meet the above this command is not specified, but it must still meet the above
syntactic requirements. syntactic requirements.
8.6.3. Examples 8.6.3. Examples
Example of an implementation providing access to only a few headers: Example of an implementation providing access to only a few headers:
[C] LIST HEADERS [C] LIST HEADERS
[S] 215 headers supported: [S] 215 headers supported:
[S] Subject [S] Subject
[S] Message-ID [S] Message-ID
skipping to change at page 92, line 50 skipping to change at page 90, line 38
[S] Date [S] Date
[S] Distribution [S] Distribution
[S] From [S] From
[S] Message-ID [S] Message-ID
[S] References [S] References
[S] Subject [S] Subject
[S] :lines [S] :lines
[S] :bytes [S] :bytes
[S] . [S] .
Note how :x-article-number does not appear in the last set of output. Note that :x-article-number does not appear in the last set of
output.
9. Augmented BNF Syntax for NNTP 9. Augmented BNF Syntax for NNTP
9.1. Introduction 9.1. Introduction
Each of the following sections describes the syntax of a major Each of the following sections describes the syntax of a major
element of NNTP. This syntax extends and refines the descriptions element of NNTP. This syntax extends and refines the descriptions
elsewhere in this specification, and should be given precedence when elsewhere in this specification and should be given precedence when
resolving apparent conflicts. Note that ABNF [RFC2234] strings are resolving apparent conflicts. Note that ABNF [RFC4234] strings are
case-insensitive. Non-terminals used in several places are defined case insensitive. Non-terminals used in several places are defined
in a separate section at the end. in a separate section at the end.
The non-terminals <command-line>, <command-datastream>, <command- Between them, the non-terminals <command-line>, <command-datastream>,
continuation>, and <response> between them specify the text that <command-continuation>, and <response> specify the text that flows
flows between client and server. A consistent naming scheme is used between client and server. A consistent naming scheme is used in
in this document for the non-terminals relating to each command, and this document for the non-terminals relating to each command, and
SHOULD be used by the specification of registered extensions. SHOULD be used by the specification of registered extensions.
For each command, the sequence is: For each command, the sequence is as follows:
o The client sends an instance of <command-line>; the syntax for the o The client sends an instance of <command-line>; the syntax for the
EXAMPLE command is <example-command>. EXAMPLE command is <example-command>.
o If the client is one that immediately streams data, it sends an o If the client is one that immediately streams data, it sends an
instance of <command-datastream>; the syntax for the EXAMPLE instance of <command-datastream>; the syntax for the EXAMPLE
command is <example-datastream>. command is <example-datastream>.
o The server sends an instance of <response>. o The server sends an instance of <response>.
* The initial response line is independent of the command that * The initial response line is independent of the command that
generated it; if the 000 response has arguments, the syntax of generated it; if the 000 response has arguments, the syntax of
the initial line is <response-000-content>. the initial line is <response-000-content>.
* If the response is multi-line, the initial line is followed by * If the response is multi-line, the initial line is followed by
a <multi-line-data-block>. The syntax for the contents of this a <multi-line-data-block>. The syntax for the contents of this
block after "dot-stuffing" has been removed is (for the 000 block after "dot-stuffing" has been removed is (for the 000
response to the EXAMPLE command) <example-000-ml-content> and response to the EXAMPLE command) <example-000-ml-content> and
is an instance of <multi-line-response-content>. is an instance of <multi-line-response-content>.
o While the latest response is one that indicates more data is o While the latest response is one that indicates more data is
required (in general, a 3xx response): required (in general, a 3xx response):
* the client sends an instance of <command-continuation>; the * the client sends an instance of <command-continuation>; the
syntax for the EXAMPLE continuation following a 333 response is syntax for the EXAMPLE continuation following a 333 response is
<example-333-continuation>. <example-333-continuation>;
* the server sends another instance of <response> as above.
* the server sends another instance of <response>, as above.
(There are no commands in this specification that immediately stream (There are no commands in this specification that immediately stream
data, but this non-terminal is defined for the convenience of data, but this non-terminal is defined for the convenience of
extensions.) extensions.)
9.2. Commands 9.2. Commands
This syntax defines the non-terminal <command-line>, which represents This syntax defines the non-terminal <command-line>, which represents
what is sent from the client to the server. what is sent from the client to the server (see section 3.1 for
limits on lengths).
command-line = command EOL command-line = command EOL
command = X-command command = X-command
X-command = keyword *(WS token) X-command = keyword *(WS token)
command =/ article-command / command =/ article-command /
body-command / body-command /
capabilities-command / capabilities-command /
date-command / date-command /
group-command / group-command /
skipping to change at page 95, line 14 skipping to change at page 93, line 20
date4y = 4DIGIT 2DIGIT 2DIGIT date4y = 4DIGIT 2DIGIT 2DIGIT
date2y = 2DIGIT 2DIGIT 2DIGIT date2y = 2DIGIT 2DIGIT 2DIGIT
date-time = date WS time [WS "GMT"] date-time = date WS time [WS "GMT"]
header-meta-name = header-name / metadata-name header-meta-name = header-name / metadata-name
list-arguments = keyword [WS token] list-arguments = keyword [WS token]
metadata-name = ":" 1*A-NOTCOLON metadata-name = ":" 1*A-NOTCOLON
range = article-number ["-" [article-number]] range = article-number ["-" [article-number]]
range-ref = range / message-id range-ref = range / message-id
time = 2DIGIT 2DIGIT 2DIGIT time = 2DIGIT 2DIGIT 2DIGIT
9.3. Command continuation 9.3. Command Continuation
This syntax defines the further material sent by the client in the This syntax defines the further material sent by the client in the
case of multi-stage commands and those that stream data. case of multi-stage commands and those that stream data.
command-datastream = UNDEFINED command-datastream = UNDEFINED
; not used, provided as a hook for extensions ; not used, provided as a hook for extensions
command-continuation = ihave-335-continuation / command-continuation = ihave-335-continuation /
post-340-continuation post-340-continuation
ihave-335-continuation = encoded-article ihave-335-continuation = encoded-article
post-340-continuation = encoded-article post-340-continuation = encoded-article
encoded-article = multi-line-data-block encoded-article = multi-line-data-block
; after undoing the "dot-stuffing", this MUST match <article> ; after undoing the "dot-stuffing", this MUST match <article>
9.4. Responses 9.4. Responses
9.4.1. Generic responses 9.4.1. Generic Responses
This syntax defines the non-terminal <response>, which represents the This syntax defines the non-terminal <response>, which represents the
generic form of responses - that is, what is sent from the server to generic form of responses; that is, what is sent from the server to
the client in response to a <command> or a <command-continuation>. the client in response to a <command> or a <command-continuation>.
response = simple-response / multi-line-response response = simple-response / multi-line-response
simple-response = initial-response-line simple-response = initial-response-line
multi-line-response = initial-response-line multi-line-data-block multi-line-response = initial-response-line multi-line-data-block
initial-response-line = initial-response-line =
initial-response-content [SP trailing-comment] CRLF initial-response-content [SP trailing-comment] CRLF
initial-response-content = X-initial-response-content initial-response-content = X-initial-response-content
X-initial-response-content = 3DIGIT *(SP response-argument) X-initial-response-content = 3DIGIT *(SP response-argument)
response-argument = 1*A-CHAR response-argument = 1*A-CHAR
trailing-comment = *U-CHAR trailing-comment = *U-CHAR
9.4.2. Initial response line contents 9.4.2. Initial Response Line Contents
This syntax defines the specific initial response lines for the This syntax defines the specific initial response lines for the
various commands in this specification. Only those response codes various commands in this specification (see section 3.1 for limits on
with arguments are listed. lengths). Only those response codes with arguments are listed.
initial-response-content =/ response-111-content / initial-response-content =/ response-111-content /
response-211-content / response-211-content /
response-220-content / response-220-content /
response-221-content / response-221-content /
response-222-content / response-222-content /
response-223-content / response-223-content /
response-401-content response-401-content
response-111-content = "111" SP date4y time response-111-content = "111" SP date4y time
response-211-content = "211" 3(SP article-number) SP newsgroup-name response-211-content = "211" 3(SP article-number) SP newsgroup-name
response-220-content = "220" SP article-number SP message-id response-220-content = "220" SP article-number SP message-id
response-221-content = "221" SP article-number SP message-id response-221-content = "221" SP article-number SP message-id
response-222-content = "222" SP article-number SP message-id response-222-content = "222" SP article-number SP message-id
response-223-content = "223" SP article-number SP message-id response-223-content = "223" SP article-number SP message-id
response-401-content = "401" SP capability-label response-401-content = "401" SP capability-label
9.4.3. Multi-line response contents 9.4.3. Multi-line Response Contents
This syntax defines the content of the various multi-line responses; This syntax defines the content of the various multi-line responses;
more precisely, it defines the part of the response in the multi-line more precisely, it defines the part of the response in the multi-line
data block after any "dot-stuffing" has been undone. The numeric data block after any "dot-stuffing" has been undone. The numeric
portion of each non-terminal name indicates the response code that is portion of each non-terminal name indicates the response code that is
followed by this data. followed by this data.
multi-line-response-content = article-220-ml-content / multi-line-response-content = article-220-ml-content /
body-222-ml-content / body-222-ml-content /
capabilities-101-ml-content / capabilities-101-ml-content /
skipping to change at page 98, line 5 skipping to change at page 95, line 24
active-groups-list = *(newsgroup-name SPA article-number active-groups-list = *(newsgroup-name SPA article-number
SPA article-number SPA newsgroup-status CRLF) SPA article-number SPA newsgroup-status CRLF)
hdr-content = *S-NONTAB hdr-content = *S-NONTAB
hdr-n-content = [(header-name ":" / metadata-name) SP hdr-content] hdr-n-content = [(header-name ":" / metadata-name) SP hdr-content]
list-content = body list-content = body
newsgroup-status = %x79 / %x6E / %x6D / private-status newsgroup-status = %x79 / %x6E / %x6D / private-status
over-content = 1*6(TAB hdr-content) / over-content = 1*6(TAB hdr-content) /
7(TAB hdr-content) *(TAB hdr-n-content) 7(TAB hdr-content) *(TAB hdr-n-content)
private-status = token ; except the values in newsgroup-status private-status = token ; except the values in newsgroup-status
9.5. Capability lines 9.5. Capability Lines
This syntax defines the generic form of a capability line in the This syntax defines the generic form of a capability line in the
capabilities list (see Section 3.3.1). capabilities list (see Section 3.3.1).
capability-line = capability-entry capability-line = capability-entry
capability-entry = X-capability-entry capability-entry = X-capability-entry
X-capability-entry = capability-label *(WS capability-argument) X-capability-entry = capability-label *(WS capability-argument)
capability-label = keyword capability-label = keyword
capability-argument = token capability-argument = token
skipping to change at page 99, line 5 skipping to change at page 96, line 14
list-capability = "LIST" 1*(WS keyword) list-capability = "LIST" 1*(WS keyword)
mode-reader-capability = "MODE-READER" mode-reader-capability = "MODE-READER"
newnews-capability = "NEWNEWS" newnews-capability = "NEWNEWS"
over-capability = "OVER" [WS "MSGID"] over-capability = "OVER" [WS "MSGID"]
post-capability = "POST" post-capability = "POST"
reader-capability = "READER" reader-capability = "READER"
version-line = "VERSION" 1*(WS version-number) version-line = "VERSION" 1*(WS version-number)
version-number = nzDIGIT *5DIGIT version-number = nzDIGIT *5DIGIT
9.6. LIST variants 9.6. LIST Variants
This section defines more specifically the keywords for the LIST This section defines more specifically the keywords for the LIST
command and the syntax of the corresponding response contents. command and the syntax of the corresponding response contents.
; active ; active
list-arguments =/ "ACTIVE" [WS wildmat] list-arguments =/ "ACTIVE" [WS wildmat]
list-content =/ list-active-content list-content =/ list-active-content
list-active-content = active-groups-list list-active-content = active-groups-list
; active.times ; active.times
skipping to change at page 100, line 20 skipping to change at page 97, line 28
9.7. Articles 9.7. Articles
This syntax defines the non-terminal <article>, which represents the This syntax defines the non-terminal <article>, which represents the
format of an article as described in Section 3.6. format of an article as described in Section 3.6.
article = 1*header CRLF body article = 1*header CRLF body
header = header-name ":" [CRLF] SP header-content CRLF header = header-name ":" [CRLF] SP header-content CRLF
header-content = *(S-CHAR / [CRLF] WS) header-content = *(S-CHAR / [CRLF] WS)
body = *(*B-CHAR CRLF) body = *(*B-CHAR CRLF)
9.8. General non-terminals 9.8. General Non-terminals
These non-terminals are used at various places in the syntax and are These non-terminals are used at various places in the syntax and are
collected here for convenience. A few of these non-terminals are not collected here for convenience. A few of these non-terminals are not
used in this specification but are provided for the consistency and used in this specification but are provided for the consistency and
convenience of extension authors. convenience of extension authors.
multi-line-data-block = content-lines termination multi-line-data-block = content-lines termination
content-lines = *([content-text] CRLF) content-lines = *([content-text] CRLF)
content-text = (".." / B-NONDOT) *B-CHAR content-text = (".." / B-NONDOT) *B-CHAR
termination = "." CRLF termination = "." CRLF
article-number = 1*16DIGIT article-number = 1*16DIGIT
header-name = 1*A-NOTCOLON header-name = 1*A-NOTCOLON
keyword = ALPHA 2*11(ALPHA / DIGIT / "." / "-") keyword = ALPHA 2*(ALPHA / DIGIT / "." / "-")
message-id = "<" 1*248A-NOTGT ">" message-id = "<" 1*248A-NOTGT ">"
newsgroup-name = 1*wildmat-exact newsgroup-name = 1*wildmat-exact
token = 1*P-CHAR token = 1*P-CHAR
wildmat = wildmat-pattern *("," ["!"] wildmat-pattern) wildmat = wildmat-pattern *("," ["!"] wildmat-pattern)
wildmat-pattern = 1*wildmat-item wildmat-pattern = 1*wildmat-item
wildmat-item = wildmat-exact / wildmat-wild wildmat-item = wildmat-exact / wildmat-wild
wildmat-exact = %x22-29 / %x2B / %x2D-3E / %x40-5A / %x5E-7E / wildmat-exact = %x22-29 / %x2B / %x2D-3E / %x40-5A / %x5E-7E /
UTF8-non-ascii ; exclude ! * , ? [ \ ] UTF8-non-ascii ; exclude ! * , ? [ \ ]
wildmat-wild = "*" / "?" wildmat-wild = "*" / "?"
skipping to change at page 101, line 46 skipping to change at page 98, line 51
UTF8-3 = %xE0 %xA0-BF UTF8-tail / %xE1-EC 2UTF8-tail / UTF8-3 = %xE0 %xA0-BF UTF8-tail / %xE1-EC 2UTF8-tail /
%xED %x80-9F UTF8-tail / %xEE-EF 2UTF8-tail %xED %x80-9F UTF8-tail / %xEE-EF 2UTF8-tail
UTF8-4 = %xF0 %x90-BF 2UTF8-tail / %xF1-F3 3UTF8-tail / UTF8-4 = %xF0 %x90-BF 2UTF8-tail / %xF1-F3 3UTF8-tail /
%xF4 %x80-8F 2UTF8-tail %xF4 %x80-8F 2UTF8-tail
UTF8-tail = %x80-BF UTF8-tail = %x80-BF
WS = 1*(SP / TAB) WS = 1*(SP / TAB)
The following non-terminals require special consideration. They The following non-terminals require special consideration. They
represent situations where material SHOULD be restricted to UTF-8, represent situations where material SHOULD be restricted to UTF-8,
but implementations MUST be able to cope with other character but implementations MUST be able to cope with other character
encodings. Therefore there are two sets of definitions for them. encodings. Therefore, there are two sets of definitions for them.
Implementations MUST accept any content that meets this syntax: Implementations MUST accept any content that meets this syntax:
S-CHAR = %x21-FF S-CHAR = %x21-FF
S-NONTAB = CTRL / SP / S-CHAR S-NONTAB = CTRL / SP / S-CHAR
S-TEXT = (CTRL / S-CHAR) *B-CHAR S-TEXT = (CTRL / S-CHAR) *B-CHAR
and MAY pass such content on unaltered. and MAY pass such content on unaltered.
When generating new content or re-encoding existing content, When generating new content or re-encoding existing content,
skipping to change at page 103, line 19 skipping to change at page 100, line 15
list-arguments list-arguments
for each new variant of the LIST command - the syntax of each for each new variant of the LIST command - the syntax of each
entry MUST be compatible with the definition of <X-command>; entry MUST be compatible with the definition of <X-command>;
list-content list-content
for each new variant of the LIST command - the syntax MUST show for each new variant of the LIST command - the syntax MUST show
the response after the lines containing the 215 response code and the response after the lines containing the 215 response code and
the terminating octet have been removed and any "dot-stuffing" the terminating octet have been removed and any "dot-stuffing"
undone. undone.
The =/ notation of ABNF [RFC2234] and the naming conventions The =/ notation of ABNF [RFC4234] and the naming conventions
described in Section 9.1 SHOULD be used for this. described in Section 9.1 SHOULD be used for this.
When validating the syntax in this specification, or syntax based on When the syntax in this specification, or syntax based on it, is
it, it should be noted that: validated, it should be noted that:
o the non-terminals <command-line>, <command-datastream>, <command-
continuation>, <response>, and <multi-line-response-content> o the non-terminals <command-line>, <command-datastream>,
describe basic concepts of the protocol and are not referred to by <command-continuation>, <response>, and
any other rule; <multi-line-response-content> describe basic concepts of the
protocol and are not referred to by any other rule;
o the non-terminal <base64> is provided for the convenience of o the non-terminal <base64> is provided for the convenience of
extension authors and is not referred to by any rule in this extension authors and is not referred to by any rule in this
specification; specification;
o for the reasons given above, the non-terminals <S-CHAR>, o for the reasons given above, the non-terminals <S-CHAR>,
<S-NONTAB>, and <S-TEXT> each have two definitions; <S-NONTAB>, and <S-TEXT> each have two definitions; and
o the non-terminal <UNDEFINED> is deliberately not defined. o the non-terminal <UNDEFINED> is deliberately not defined.
10. Internationalisation Considerations 10. Internationalisation Considerations
10.1. Introduction and historical situation 10.1. Introduction and Historical Situation
RFC 977 [RFC977] was written at a time when internationalisation was RFC 977 [RFC977] was written at a time when internationalisation was
not seen as a significant issue. As such, it was written on the not seen as a significant issue. As such, it was written on the
assumption that all communication would be in ASCII and use only a assumption that all communication would be in ASCII and use only a
7-bit transport layer, although in practice just about all known 7-bit transport layer, although in practice just about all known
implementations are 8-bit clean. implementations are 8-bit clean.
Since then, Usenet and NNTP have spread throughout the world. In the Since then, Usenet and NNTP have spread throughout the world. In the
absence of standards for handling the issues of language and absence of standards for handling the issues of language and
character sets, countries, newsgroup hierarchies, and individuals character sets, countries, newsgroup hierarchies, and individuals
have found a variety of solutions that work for them but are not have found a variety of solutions that work for them but that are not
necessarily appropriate elsewhere. For example, some have adopted a necessarily appropriate elsewhere. For example, some have adopted a
default 8-bit character set appropriate to their needs (such as ISO/ default 8-bit character set appropriate to their needs (such as
IEC 8859-1 in Western Europe or KOI-8 in Russia), others have used ISO/IEC 8859-1 in Western Europe or KOI-8 in Russia), others have
ASCII (either US-ASCII or national variants) in headers but local 16- used ASCII (either US-ASCII or national variants) in headers but
bit character sets in article bodies, and still others have gone for local 16-bit character sets in article bodies, and still others have
a combination of MIME [RFC2045] and UTF-8. With the increased use of gone for a combination of MIME [RFC2045] and UTF-8. With the
MIME in email, it is becoming more common to find NNTP articles increased use of MIME in email, it is becoming more common to find
containing MIME headers identifying the character set of the body, NNTP articles containing MIME headers that identify the character set
but this is far from universal. of the body, but this is far from universal.
The resulting confusion does not help interoperability. The resulting confusion does not help interoperability.
One point that has been generally accepted is that articles can One point that has been generally accepted is that articles can
contain octets with the top bit set, and NNTP is only expected to contain octets with the top bit set, and NNTP is only expected to
operate on 8-bit clean transport paths. operate on 8-bit clean transport paths.
10.2. This specification 10.2. This Specification
Part of the role of this present specification is to eliminate this Part of the role of this present specification is to eliminate this
confusion and promote interoperability as far as possible. At the confusion and promote interoperability as far as possible. At the
same time, it is necessary to accept the existence of the present same time, it is necessary to accept the existence of the present
situation and not gratuitously break existing implementations and situation and not break existing implementations and arrangements
arrangements, even if they are less than optimal. Therefore the gratuitously, even if they are less than optimal. Therefore, the
current practice described above has been taken into consideration in current practice described above has been taken into consideration in
producing this specification. producing this specification.
This specification extends NNTP from US-ASCII [ANSI1986] to UTF-8 This specification extends NNTP from US-ASCII [ANSI1986] to UTF-8
[RFC3629]. Except in the two areas discussed below, UTF-8 (which is [RFC3629]. Except in the two areas discussed below, UTF-8 (which is
a superset of US-ASCII) is mandatory and implementations MUST NOT use a superset of US-ASCII) is mandatory, and implementations MUST NOT
any other encoding. use any other encoding.
Firstly, the use of MIME for article headers and bodies is strongly Firstly, the use of MIME for article headers and bodies is strongly
recommended. However, given widely divergent existing practices, an recommended. However, given widely divergent existing practices, an
attempt to require a particular encoding and tagging standard would attempt to require a particular encoding and tagging standard would
be premature at this time. Accordingly, this specification allows be premature at this time. Accordingly, this specification allows
the use of arbitrary 8-bit data in articles subject to the following the use of arbitrary 8-bit data in articles subject to the following
requirements and recommendations. requirements and recommendations.
o The names of headers (e.g. "From" or "Subject") MUST be in US- o The names of headers (e.g., "From" or "Subject") MUST be in
ASCII. US-ASCII.
o Header values SHOULD use US-ASCII or an encoding based on it such o Header values SHOULD use US-ASCII or an encoding based on it, such
as RFC 2047 [RFC2047] until such time as another approach has been as RFC 2047 [RFC2047], until such time as another approach has
standardised. At present, 8-bit encodings (including UTF-8) been standardised. At present, 8-bit encodings (including UTF-8)
SHOULD NOT be used because they are likely to cause SHOULD NOT be used because they are likely to cause
interoperability problems. interoperability problems.
o The character set of article bodies SHOULD be indicated in the o The character set of article bodies SHOULD be indicated in the
article headers, and this SHOULD be done in accordance with MIME. article headers, and this SHOULD be done in accordance with MIME.
o Where an article is obtained from an external source an o Where an article is obtained from an external source, an
implementation MAY pass it on, and derive data from it (such as implementation MAY pass it on and derive data from it (such as the
the response to the HDR command), even though the article or the response to the HDR command), even though the article or the data
data does not meet the above requirements. Implementations MUST does not meet the above requirements. Implementations MUST
transfer such articles and data correctly and unchanged; they MUST transfer such articles and data correctly and unchanged; they MUST
NOT attempt to convert or re-encode the article or derived data. NOT attempt to convert or re-encode the article or derived data.
(Nevertheless, a client or server MAY elect not to post or forward (Nevertheless, a client or server MAY elect not to post or forward
the article if, after further examination of the article, it deems the article if, after further examination of the article, it deems
it inappropriate to do so.) it inappropriate to do so.)
This requirement affects the ARTICLE (Section 6.2.1), BODY This requirement affects the ARTICLE (Section 6.2.1), BODY
(Section 6.2.3), HDR (Section 8.5), HEAD (Section 6.2.2), IHAVE (Section 6.2.3), HDR (Section 8.5), HEAD (Section 6.2.2), IHAVE
(Section 6.3.2), OVER (Section 8.3), and POST (Section 6.3.1) (Section 6.3.2), OVER (Section 8.3), and POST (Section 6.3.1)
commands. commands.
Secondly, the following requirements are placed on the newsgroups Secondly, the following requirements are placed on the newsgroups
list returned by the LIST NEWSGROUPS (Section 7.6.6) command: list returned by the LIST NEWSGROUPS command (Section 7.6.6):
o Although this specification allows UTF-8 for newsgroup names, they o Although this specification allows UTF-8 for newsgroup names, they
SHOULD be restricted to US-ASCII until a successor to RFC 1036 SHOULD be restricted to US-ASCII until a successor to RFC 1036
[RFC1036] standardises another approach. 8-bit encodings SHOULD [RFC1036] standardises another approach. 8-bit encodings SHOULD
NOT be used because they are likely to cause interoperability NOT be used because they are likely to cause interoperability
problems. problems.
o The newsgroup description SHOULD be in US-ASCII or UTF-8 unless o The newsgroup description SHOULD be in US-ASCII or UTF-8 unless
and until a successor to RFC 1036 standardised other encoding and until a successor to RFC 1036 standardises other encoding
arrangements. 8-bit encodings other than UTF-8 SHOULD NOT be used arrangements. 8-bit encodings other than UTF-8 SHOULD NOT be used
because they are likely to cause interoperability problems. because they are likely to cause interoperability problems.
o Implementations which obtain this data from an external source o Implementations that obtain this data from an external source MUST
MUST correctly handle it even if it does not meet the above handle it correctly even if it does not meet the above
requirements. Implementations (in particular, clients) MUST requirements. Implementations (in particular, clients) MUST
handle such data correctly. handle such data correctly.
10.3. Outstanding issues 10.3. Outstanding Issues
While the primary use of NNTP is for transmitting articles that While the primary use of NNTP is for transmitting articles that
conform to RFC 1036 (Netnews articles), it is also used for other conform to RFC 1036 (Netnews articles), it is also used for other
formats (see Appendix A). It is therefore most appropriate that formats (see Appendix A). It is therefore most appropriate that
internationalisation issues related to article formats be addressed internationalisation issues related to article formats be addressed
in the relevant specifications. For Netnews articles, this is any in the relevant specifications. For Netnews articles, this is any
successor to RFC 1036. For email messages, it is RFC 2822 [RFC2822]. successor to RFC 1036. For email messages, it is RFC 2822 [RFC2822].
Of course, any article transmitted via NNTP needs to conform to this Of course, any article transmitted via NNTP needs to conform to this
specification as well. specification as well.
Restricting newsgroup names to UTF-8 is not a complete solution. In Restricting newsgroup names to UTF-8 is not a complete solution. In
particular, when new newsgroup names are created or a user is asked particular, when new newsgroup names are created or a user is asked
to enter a newsgroup name, some scheme of canonicalisation will need to enter a newsgroup name, some scheme of canonicalisation will need
to take place. This specification does not attempt to define that to take place. This specification does not attempt to define that
canonicalization; further work is needed in this area in conjunction canonicalization; further work is needed in this area, in conjunction
with the article format specifications. Until such specifications with the article format specifications. Until such specifications
are published, implementations SHOULD match newsgroup names octet-by- are published, implementations SHOULD match newsgroup names octet by
octet. It is anticipated that any approved scheme will be applied octet. It is anticipated that any approved scheme will be applied
"at the edges" and therefore octet-by-octet comparison will continue "at the edges", and therefore octet-by-octet comparison will continue
to apply to most, if not all, uses of newsgroup names in NNTP. to apply to most, if not all, uses of newsgroup names in NNTP.
In the meantime, any implementation experimenting with UTF-8 In the meantime, any implementation experimenting with UTF-8
newsgroup names is strongly cautioned that a future specification may newsgroup names is strongly cautioned that a future specification may
require that those names be canonicalized when used with NNTP in a require that those names be canonicalized when used with NNTP in a
way that is not compatible with their experiments. way that is not compatible with their experiments.
Since the primary use of NNTP is with Netnews, and since newsgroup Since the primary use of NNTP is with Netnews, and since newsgroup
descriptions are normally distributed through specially formatted descriptions are normally distributed through specially formatted
articles, it is recommended that the internationalisation issues articles, it is recommended that the internationalisation issues
related to them be addressed in any successor to RFC 1036. related to them be addressed in any successor to RFC 1036.
11. IANA Considerations 11. IANA Considerations
This specification requires IANA to keep a registry of capability This specification requires IANA to keep a registry of capability
labels. The initial contents of this registry are specified in labels. The initial contents of this registry are specified in
Section 3.3.4. As described in Section 3.3.3, labels beginning with Section 3.3.4. As described in Section 3.3.3, labels beginning with
X are reserved for private use while all other names are expected to X are reserved for private use, while all other names are expected to
be associated with a specification in an RFC on the standards-track be associated with a specification in an RFC on the standards track
or defining an IESG-approved experimental protocol. or defining an IESG-approved experimental protocol.
Different entries in the registry MUST use different capability Different entries in the registry MUST use different capability
labels. labels.
Different entries in the registry MUST NOT use the same command name. Different entries in the registry MUST NOT use the same command name.
For this purpose, variants distinguished by a second or subsequent For this purpose, variants distinguished by a second or subsequent
keyword (e.g. "LIST HEADERS" and "LIST OVERVIEW.FMT") count as keyword (e.g., "LIST HEADERS" and "LIST OVERVIEW.FMT") count as
different commands. If there is a need for two extensions to use the different commands. If there is a need for two extensions to use the
same command, a single harmonised specification MUST be registered. same command, a single harmonised specification MUST be registered.
12. Security Considerations 12. Security Considerations
This section is meant to inform application developers, information This section is meant to inform application developers, information
providers, and users of the security limitations in NNTP as described providers, and users of the security limitations in NNTP as described
by this document. The discussion does not include definitive by this document. The discussion does not include definitive
solutions to the problems revealed, though it does make some solutions to the problems revealed, though it does make some
suggestions for reducing security risks. suggestions for reducing security risks.
12.1. Personal and Proprietary Information 12.1. Personal and Proprietary Information
NNTP, because it was created to distribute network news articles, NNTP, because it was created to distribute network news articles,
will forward whatever information is stored in those articles. will forward whatever information is stored in those articles.
Specification of that information is outside this scope of this Specification of that information is outside this scope of this
document, but it is likely that some personal and/or proprietary document, but it is likely that some personal and/or proprietary
information is available in some of those articles. It is very information is available in some of those articles. It is very
important that designers and implementers provide informative important that designers and implementers provide informative
warnings to users so personal and/or proprietary information in warnings to users so that personal and/or proprietary information in
material that is added automatically to articles (e.g. in headers) is material that is added automatically to articles (e.g., in headers)
not disclosed inadvertently. Additionally, effective and easily is not disclosed inadvertently. Additionally, effective and easily
understood mechanisms to manage the distribution of news articles understood mechanisms to manage the distribution of news articles
SHOULD be provided to NNTP Server administrators, so that they are SHOULD be provided to NNTP Server administrators, so that they are
able to report with confidence the likely spread of any particular able to report with confidence the likely spread of any particular
set of news articles. set of news articles.
12.2. Abuse of Server Log Information 12.2. Abuse of Server Log Information
A server is in the position to save session data about a user's A server is in the position to save session data about a user's
requests that might identify their reading patterns or subjects of requests that might identify their reading patterns or subjects of
interest. This information is clearly confidential in nature and its interest. This information is clearly confidential in nature, and
handling can be constrained by law in certain countries. People its handling can be constrained by law in certain countries. People
using the NNTP protocol to provide data are responsible for ensuring using this protocol to provide data are responsible for ensuring that
that such material is not distributed without the permission of any such material is not distributed without the permission of any
individuals that are identifiable by the published results. individuals that are identifiable by the published results.
12.3. Weak Authentication and Access Control 12.3. Weak Authentication and Access Control
There is no user-based or token-based authentication in the basic There is no user-based or token-based authentication in the basic
NNTP specification. Access is normally controlled by server NNTP specification. Access is normally controlled by server
configuration files. Those files specify access by using domain configuration files. Those files specify access by using domain
names or IP addresses. However, this specification does permit the names or IP addresses. However, this specification does permit the
creation of extensions to the NNTP protocol itself for such purposes; creation of extensions to NNTP for such purposes; one such extension
one such extension is [NNTP-AUTH]. While including such mechanisms is [NNTP-AUTH]. While including such mechanisms is optional, doing
is optional, doing so is strongly encouraged. so is strongly encouraged.
Other mechanisms are also available. For example, a proxy server Other mechanisms are also available. For example, a proxy server
could be put in place that requires authentication before connecting could be put in place that requires authentication before connecting
via the proxy to the NNTP server. via the proxy to the NNTP server.
12.4. DNS Spoofing 12.4. DNS Spoofing
Many existing NNTP implementations authorize incoming connections by Many existing NNTP implementations authorize incoming connections by
checking the IP address of that connection against the IP addresses checking the IP address of that connection against the IP addresses
obtained via DNS lookups of lists of domain names given in local obtained via DNS lookups of lists of domain names given in local
configuration files. Servers that use this type of authentication, configuration files. Servers that use this type of authentication
and clients that find a server by doing a DNS lookup of the server and clients that find a server by doing a DNS lookup of the server
name, rely very heavily on the Domain Name Service, and are thus name rely very heavily on the Domain Name Service, and are thus
generally prone to security attacks based on the deliberate generally prone to security attacks based on the deliberate
misassociation of IP addresses and DNS names. Clients and servers misassociation of IP addresses and DNS names. Clients and servers
need to be cautious in assuming the continuing validity of an IP need to be cautious in assuming the continuing validity of an IP
number/DNS name association. number/DNS name association.
In particular, NNTP clients and servers SHOULD rely on their name In particular, NNTP clients and servers SHOULD rely on their name
resolver for confirmation of an IP number/DNS name association, resolver for confirmation of an IP number/DNS name association,
rather than caching the result of previous host name lookups. Many rather than cache the result of previous host name lookups. Many
platforms already can cache host name lookups locally when platforms already can cache host name lookups locally when
appropriate, and they SHOULD be configured to do so. It is proper appropriate, and they SHOULD be configured to do so. It is proper
for these lookups to be cached, however, only when the TTL (Time To for these lookups to be cached, however, only when the TTL (Time To
Live) information reported by the name server makes it likely that Live) information reported by the name server makes it likely that
the cached information will remain useful. the cached information will remain useful.
If NNTP clients or servers cache the results of host name lookups in If NNTP clients or servers cache the results of host name lookups in
order to achieve a performance improvement, they MUST observe the TTL order to achieve a performance improvement, they MUST observe the TTL
information reported by DNS. If NNTP clients or servers do not information reported by DNS. If NNTP clients or servers do not
observe this rule, they could be spoofed when a previously accessed observe this rule, they could be spoofed when a previously accessed
server's IP address changes. As network renumbering is expected to server's IP address changes. As network renumbering is expected to
become increasingly common, the possibility of this form of attack become increasingly common, the possibility of this form of attack
will grow. Observing this requirement thus reduces this potential will increase. Observing this requirement thus reduces this
security vulnerability. potential security vulnerability.
This requirement also improves the load-balancing behaviour of This requirement also improves the load-balancing behaviour of
clients for replicated servers using the same DNS name and reduces clients for replicated servers using the same DNS name and reduces
the likelihood of a user's experiencing failure in accessing sites the likelihood of a user's experiencing failure in accessing sites
that use that strategy. that use that strategy.
12.5. UTF-8 issues 12.5. UTF-8 Issues
UTF-8 [RFC3629] permits only certain sequences of octets and UTF-8 [RFC3629] permits only certain sequences of octets and
designates others as either malformed or "illegal". The Unicode designates others as either malformed or "illegal". The Unicode
standard identifies a number of security issues related to illegal standard identifies a number of security issues related to illegal
sequences and forbids their generation by conforming implementations. sequences and forbids their generation by conforming implementations.
Implementations of this specification MUST NOT generate malformed or Implementations of this specification MUST NOT generate malformed or
illegal sequences and SHOULD detect them and take some appropriate illegal sequences and SHOULD detect them and take some appropriate
action. This could include: action. This could include the following:
o Generating a 501 response code.
o Replacing such sequences by the sequence %xEF.BF.BD, which encodes
the "replacement character" U+FFFD.
o Closing the connection.
o Replacing such sequences by a "guessed" valid sequence (based on
properties of the UTF-8 encoding).
o generating a 501 response code.
o replacing such sequences by the sequence %xEF.BF.BD, which encodes
the "replacement character" U+FFFD;
o closing the connection;
o replacing such sequences by a "guessed" valid sequence (based on
properties of the UTF-8 encoding);
In the last case, the implementation MUST ensure that any replacement In the last case, the implementation MUST ensure that any replacement
cannot be used to bypass validity or security checks. For example, cannot be used to bypass validity or security checks. For example,
the illegal sequence %xC0.A0 is an over-long encoding for space the illegal sequence %xC0.A0 is an over-long encoding for space
(%x20). If it is replaced by the latter in a command line, this (%x20). If it is replaced by the correct encoding in a command line,
needs to happen before the command line is parsed into individual this needs to happen before the command line is parsed into
arguments. If the replacement came after parsing, it would be individual arguments. If the replacement came after parsing, it
possible to generate an argument with an embedded space, which is would be possible to generate an argument with an embedded space,
forbidden. Use of the "replacement character" does not have this which is forbidden. Use of the "replacement character" does not have
problem, since it is permitted wherever non-US-ASCII characters are. this problem, since it is permitted wherever non-US-ASCII characters
Implementations SHOULD use one of the first two solutions where the are. Implementations SHOULD use one of the first two solutions where
general structure of the NNTP stream remains intact, and close the the general structure of the NNTP stream remains intact and SHOULD
connection if it is no longer possible to parse it sensibly. close the connection if it is no longer possible to parse it
sensibly.
12.6. Caching of capability lists 12.6. Caching of Capability Lists
The CAPABILITIES command provides a capability list, which is The CAPABILITIES command provides a capability list, which is
information about the current capabilities of the server. Whenever information about the current capabilities of the server. Whenever
there is a relevant change to the server state, the results of this there is a relevant change to the server state, the results of this
command are required to change accordingly. command are required to change accordingly.
In most situations the capabilities list in a given server state will In most situations, the capabilities list in a given server state
not change from session to session; for example, a given extension will not change from session to session; for example, a given
will be installed permanently on a server. Some clients may extension will be installed permanently on a server. Some clients
therefore wish to remember which extensions a server supports to may therefore wish to remember which extensions a server supports to
avoid the delay of an additional command and response, particularly avoid the delay of an additional command and response, particularly
if they open multiple connections in the same session. if they open multiple connections in the same session.
However, information about extensions related to security and privacy However, information about extensions related to security and privacy
MUST NOT be cached, since this could allow a variety of attacks. MUST NOT be cached, since this could allow a variety of attacks.
For example, consider a server which permits the use of cleartext For example, consider a server that permits the use of cleartext
passwords on links that are encrypted but not otherwise: passwords on links that are encrypted but not otherwise:
[Initial connection set-up completed.] [Initial connection set-up completed.]
[S] 200 NNTP Service Ready, posting permitted [S] 200 NNTP Service Ready, posting permitted
[C] CAPABILITIES [C] CAPABILITIES
[S] 101 Capability list: [S] 101 Capability list:
[S] VERSION 2 [S] VERSION 2
[S] READER [S] READER
[S] NEWNEWS [S] NEWNEWS
[S] POST [S] POST
skipping to change at page 111, line 30 skipping to change at page 107, line 25
[S] 290 Password for fred accepted [S] 290 Password for fred accepted
If the client caches the last capabilities list, then on the next If the client caches the last capabilities list, then on the next
session it will attempt to use XSECRET on an unencrypted link: session it will attempt to use XSECRET on an unencrypted link:
[Initial connection set-up completed.] [Initial connection set-up completed.]
[S] 200 NNTP Service Ready, posting permitted [S] 200 NNTP Service Ready, posting permitted
[C] XSECRET fred flintstone [C] XSECRET fred flintstone
[S] 483 Only permitted on secure links [S] 483 Only permitted on secure links
exposing the password to any eavesdropper. While the primary cause This exposes the password to any eavesdropper. While the primary
of this is passing a secret without first checking the security of cause of this is passing a secret without first checking the security
the link, caching of capability lists can increase the risk. of the link, caching of capability lists can increase the risk.
Any security extension should include requirements to check the Any security extension should include requirements to check the
security state of the link in a manner appropriate to that extension. security state of the link in a manner appropriate to that extension.
Caching should normally only be considered for anonymous clients that Caching should normally only be considered for anonymous clients that
do not use any security or privacy extensions and for which the time do not use any security or privacy extensions and for which the time
required for an additional command and response is a noticeable required for an additional command and response is a noticeable
issue. issue.
13. Acknowledgements 13. Acknowledgements
This document is the result of much effort by the present and past This document is the result of much effort by the present and past
members of the NNTP Working Group, chaired by Russ Allbery and Ned members of the NNTP Working Group, chaired by Russ Allbery and Ned
Freed. It could not have been produced without them. Freed. It could not have been produced without them.
The author acknowledges the original authors of NNTP as documented in The author acknowledges the original authors of NNTP as documented in
RFC 977 [RFC977]: Brian Kantor and Phil Lapsey. RFC 977 [RFC977]: Brian Kantor and Phil Lapsey.
The author gratefully acknowledges: The author gratefully acknowledges the following:
o The work of the NNTP committee chaired by Eliot Lear. The o The work of the NNTP committee chaired by Eliot Lear. The
organization of this document was influenced by the last available organization of this document was influenced by the last available
draft from this working group. A special thanks to Eliot for version from this working group. A special thanks to Eliot for
generously providing the original machine-readable sources for generously providing the original machine-readable sources for
that document. that document.
o The work of the DRUMS working group, specifically RFC 1869 o The work of the DRUMS working group, specifically RFC 1869
[RFC1869], which drove the original thinking which led to the [RFC1869], that drove the original thinking that led to the
CAPABILITIES command and the extensions mechanism detailed in this CAPABILITIES command and the extensions mechanism detailed in this
document. document.
o The authors of RFC 2616 [RFC2616] for providing specific and o The authors of RFC 2616 [RFC2616] for providing specific and
relevant examples of security issues that should be considered for relevant examples of security issues that should be considered for
HTTP. Since many of the same considerations exist for NNTP, those HTTP. Since many of the same considerations exist for NNTP, those
examples that are relevant have been included here with some minor examples that are relevant have been included here with some minor
rewrites. rewrites.
o The comments and additional information provided by the following o The comments and additional information provided by the following
skipping to change at page 112, line 36 skipping to change at page 108, line 19
o The authors of RFC 2616 [RFC2616] for providing specific and o The authors of RFC 2616 [RFC2616] for providing specific and
relevant examples of security issues that should be considered for relevant examples of security issues that should be considered for
HTTP. Since many of the same considerations exist for NNTP, those HTTP. Since many of the same considerations exist for NNTP, those
examples that are relevant have been included here with some minor examples that are relevant have been included here with some minor
rewrites. rewrites.
o The comments and additional information provided by the following o The comments and additional information provided by the following
individuals in preparing one or more of the progenitors of this individuals in preparing one or more of the progenitors of this
document: document:
Russ Allbery <rra@stanford.edu> Russ Allbery <rra@stanford.edu>
Wayne Davison <davison@armory.com> Wayne Davison <davison@armory.com>
Chris Lewis <clewis@bnr.ca> Chris Lewis <clewis@bnr.ca>
Tom Limoncelli <tal@mars.superlink.net> Tom Limoncelli <tal@mars.superlink.net>
Eric Schnoebelen <eric@egsner.cirr.com> Eric Schnoebelen <eric@egsner.cirr.com>
Rich Salz <rsalz@osf.org> Rich Salz <rsalz@osf.org>
This work was motivated by the work of various news reader authors This work was motivated by the work of various news reader authors
and news server authors, which includes those listed below: and news server authors, including those listed below:
Rick Adams Rick Adams
Original author of the NNTP extensions to the RN news reader and Original author of the NNTP extensions to the RN news reader and
last maintainer of Bnews last maintainer of Bnews.
Stan Barber Stan Barber
Original author of the NNTP extensions to the news readers that Original author of the NNTP extensions to the news readers that
are part of Bnews are part of Bnews.
Geoff Collyer Geoff Collyer
Original author of the OVERVIEW database proposal and one of the Original author of the OVERVIEW database proposal and one of the
original authors of CNEWS original authors of CNEWS.
Dan Curry Dan Curry
Original author of the xvnews news reader Original author of the xvnews news reader.
Wayne Davison Wayne Davison
Author of the first threading extensions to the RN news reader Author of the first threading extensions to the RN news reader
(commonly called TRN) (commonly called TRN).
Geoff Huston Geoff Huston
Original author of ANU NEWS Original author of ANU NEWS.
Phil Lapsey Phil Lapsey
Original author of the UNIX reference implementation for NNTP Original author of the UNIX reference implementation for NNTP.
Iain Lea Iain Lea
Original maintainer of the TIN news reader Original maintainer of the TIN news reader.
Chris Lewis Chris Lewis
First known implementer of the AUTHINFO GENERIC extension First known implementer of the AUTHINFO GENERIC extension.
Rich Salz Rich Salz
Original author of INN Original author of INN.
Henry Spencer Henry Spencer
One of the original authors of CNEWS One of the original authors of CNEWS.
Kim Storm Kim Storm
Original author of the NN news reader Original author of the NN news reader.
Other people who contributed to this document include: Other people who contributed to this document include:
Matthias Andree Matthias Andree
Greg Andruk Greg Andruk
Daniel Barclay Daniel Barclay
Maurizio Codogno Maurizio Codogno
Mark Crispin Mark Crispin
Andrew Gierth Andrew Gier