draft-ietf-nntpext-base-25.txt   draft-ietf-nntpext-base-26.txt 
NNTP C. Feather NNTP C. Feather
Internet-Draft Thus plc Internet-Draft Thus plc
Expires: August 14, 2005 February 10, 2005 Expires: November 21, 2005 May 20, 2005
Network News Transfer Protocol Network News Transfer Protocol
draft-ietf-nntpext-base-25 draft-ietf-nntpext-base-26
Status of this Memo Status of this Memo
This document is an Internet-Draft and is subject to all provisions By submitting this Internet-Draft, each author represents that any
of Section 3 of RFC 3667. By submitting this Internet-Draft, each applicable patent or other IPR claims of which he or she is aware
author represents that any applicable patent or other IPR claims of have been or will be disclosed, and any of which he or she becomes
which he or she is aware have been or will be disclosed, and any of aware will be disclosed, in accordance with Section 6 of BCP 79.
which he or she become aware will be disclosed, in accordance with
RFC 3668.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that Task Force (IETF), its areas, and its working groups. Note that
other groups may also distribute working documents as other groups may also distribute working documents as Internet-
Internet-Drafts. Drafts.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
The list of current Internet-Drafts can be accessed at The list of current Internet-Drafts can be accessed at
http://www.ietf.org/ietf/1id-abstracts.txt. http://www.ietf.org/ietf/1id-abstracts.txt.
The list of Internet-Draft Shadow Directories can be accessed at The list of Internet-Draft Shadow Directories can be accessed at
http://www.ietf.org/shadow.html. http://www.ietf.org/shadow.html.
This Internet-Draft will expire on August 14, 2005. This Internet-Draft will expire on November 21, 2005.
Copyright Notice Copyright Notice
Copyright (C) The Internet Society (2005). Copyright (C) The Internet Society (2005).
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 RFC 977
skipping to change at page 2, line 6 skipping to change at page 2, line 4
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 RFC 977
and officially updates the protocol specification. It clarifies some and officially updates the protocol specification. It clarifies some
vagueness in RFC 977, includes some new base functionality, and vagueness in RFC 977, includes some new base functionality, and
provides a specific mechanism to add standardized extensions to NNTP. provides a specific mechanism to add standardized extensions to NNTP.
Administration Administration
This document is a product of the NNTP Working Group, chaired by Russ This document is a product of the NNTP Working Group, chaired by Russ
Allbery and Ned Freed. Allbery and Ned Freed.
This is draft 25.
Author's Note Author's Note
This document is written in XML using an NNTP-specific DTD. Custom This document is written in XML using an NNTP-specific DTD. Custom
software is used to convert this to RFC 2629 [RFC2629] format, and software is used to convert this to RFC 2629 [RFC2629] format, and
then the public "xml2rfc" package to further reduce this to text, then the public "xml2rfc" package to further reduce this to text,
nroff source, and HTML. nroff source, and HTML.
No perl was used in producing this document. No perl was used in producing this document.
Rights Rights
UNIX is a registered trademark of The Open Group. UNIX is a registered trademark of The Open Group.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 6 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 6
2. Notation . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2. Notation . . . . . . . . . . . . . . . . . . . . . . . . . . 7
3. Basic Concepts . . . . . . . . . . . . . . . . . . . . . . . 9 3. Basic Concepts . . . . . . . . . . . . . . . . . . . . . . . 9
3.1 Commands and Responses . . . . . . . . . . . . . . . . . 9 3.1. Commands and Responses . . . . . . . . . . . . . . . . . 9
3.2 Response Codes . . . . . . . . . . . . . . . . . . . . . 11 3.1.1. Multi-line data blocks . . . . . . . . . . . . . . . 10
3.2.1 Generic Response Codes . . . . . . . . . . . . . . . 12 3.2. Response Codes . . . . . . . . . . . . . . . . . . . . . 11
3.2.1.1 Examples . . . . . . . . . . . . . . . . . . . . 14 3.2.1. Generic Response Codes . . . . . . . . . . . . . . . 13
3.3 Capabilities and Extensions . . . . . . . . . . . . . . 15 3.2.1.1. Examples . . . . . . . . . . . . . . . . . . . . 14
3.3.1 Capability descriptions . . . . . . . . . . . . . . 16 3.3. Capabilities and Extensions . . . . . . . . . . . . . . . 16
3.3.2 Standard capabilities . . . . . . . . . . . . . . . 16 3.3.1. Capability descriptions . . . . . . . . . . . . . . . 17
3.3.3 Extensions . . . . . . . . . . . . . . . . . . . . . 18 3.3.2. Standard capabilities . . . . . . . . . . . . . . . . 17
3.3.4 Initial IANA register . . . . . . . . . . . . . . . 19 3.3.3. Extensions . . . . . . . . . . . . . . . . . . . . . 19
3.4 Mandatory and Optional Commands . . . . . . . . . . . . 20 3.3.4. Initial IANA register . . . . . . . . . . . . . . . . 20
3.4.1 Reading and Transit Servers . . . . . . . . . . . . 21 3.4. Mandatory and Optional Commands . . . . . . . . . . . . . 22
3.4.2 Mode switching . . . . . . . . . . . . . . . . . . . 22 3.4.1. Reading and Transit Servers . . . . . . . . . . . . . 22
3.5 Pipelining . . . . . . . . . . . . . . . . . . . . . . . 23 3.4.2. Mode switching . . . . . . . . . . . . . . . . . . . 23
3.5.1 Examples . . . . . . . . . . . . . . . . . . . . . . 24 3.5. Pipelining . . . . . . . . . . . . . . . . . . . . . . . 24
3.6 Articles . . . . . . . . . . . . . . . . . . . . . . . . 24 3.5.1. Examples . . . . . . . . . . . . . . . . . . . . . . 25
4. The WILDMAT format . . . . . . . . . . . . . . . . . . . . . 26 3.6. Articles . . . . . . . . . . . . . . . . . . . . . . . . 25
4.1 Wildmat syntax . . . . . . . . . . . . . . . . . . . . . 26 4. The WILDMAT format . . . . . . . . . . . . . . . . . . . . . 28
4.2 Wildmat semantics . . . . . . . . . . . . . . . . . . . 26 4.1. Wildmat syntax . . . . . . . . . . . . . . . . . . . . . 28
4.3 Extensions . . . . . . . . . . . . . . . . . . . . . . . 27 4.2. Wildmat semantics . . . . . . . . . . . . . . . . . . . . 28
4.4 Examples . . . . . . . . . . . . . . . . . . . . . . . . 27 4.3. Extensions . . . . . . . . . . . . . . . . . . . . . . . 29
5. Session administration commands . . . . . . . . . . . . . . 28 4.4. Examples . . . . . . . . . . . . . . . . . . . . . . . . 30
5.1 Initial Connection . . . . . . . . . . . . . . . . . . . 28 5. Session administration commands . . . . . . . . . . . . . . . 31
5.2 CAPABILITIES . . . . . . . . . . . . . . . . . . . . . . 29 5.1. Initial Connection . . . . . . . . . . . . . . . . . . . 31
5.3 MODE READER . . . . . . . . . . . . . . . . . . . . . . 31 5.2. CAPABILITIES . . . . . . . . . . . . . . . . . . . . . . 32
5.4 QUIT . . . . . . . . . . . . . . . . . . . . . . . . . . 33 5.3. MODE READER . . . . . . . . . . . . . . . . . . . . . . . 35
6. Article posting and retrieval . . . . . . . . . . . . . . . 35 5.4. QUIT . . . . . . . . . . . . . . . . . . . . . . . . . . 37
6.1 Group and article selection . . . . . . . . . . . . . . 35 6. Article posting and retrieval . . . . . . . . . . . . . . . . 38
6.1.1 GROUP . . . . . . . . . . . . . . . . . . . . . . . 35 6.1. Group and article selection . . . . . . . . . . . . . . . 38
6.1.2 LISTGROUP . . . . . . . . . . . . . . . . . . . . . 38 6.1.1. GROUP . . . . . . . . . . . . . . . . . . . . . . . . 39
6.1.3 LAST . . . . . . . . . . . . . . . . . . . . . . . . 39 6.1.2. LISTGROUP . . . . . . . . . . . . . . . . . . . . . . 42
6.1.4 NEXT . . . . . . . . . . . . . . . . . . . . . . . . 40 6.1.3. LAST . . . . . . . . . . . . . . . . . . . . . . . . 44
6.2 Retrieval of articles and article sections . . . . . . . 42 6.1.4. NEXT . . . . . . . . . . . . . . . . . . . . . . . . 46
6.2.1 ARTICLE . . . . . . . . . . . . . . . . . . . . . . 42 6.2. Retrieval of articles and article sections . . . . . . . 47
6.2.2 HEAD . . . . . . . . . . . . . . . . . . . . . . . . 45 6.2.1. ARTICLE . . . . . . . . . . . . . . . . . . . . . . . 48
6.2.3 BODY . . . . . . . . . . . . . . . . . . . . . . . . 47 6.2.2. HEAD . . . . . . . . . . . . . . . . . . . . . . . . 51
6.2.4 STAT . . . . . . . . . . . . . . . . . . . . . . . . 48 6.2.3. BODY . . . . . . . . . . . . . . . . . . . . . . . . 53
6.3 Article posting . . . . . . . . . . . . . . . . . . . . 51 6.2.4. STAT . . . . . . . . . . . . . . . . . . . . . . . . 55
6.3.1 POST . . . . . . . . . . . . . . . . . . . . . . . . 51 6.3. Article posting . . . . . . . . . . . . . . . . . . . . . 58
6.3.2 IHAVE . . . . . . . . . . . . . . . . . . . . . . . 53 6.3.1. POST . . . . . . . . . . . . . . . . . . . . . . . . 58
7. Information commands . . . . . . . . . . . . . . . . . . . . 56 6.3.2. IHAVE . . . . . . . . . . . . . . . . . . . . . . . . 60
7.1 DATE . . . . . . . . . . . . . . . . . . . . . . . . . . 56 7. Information commands . . . . . . . . . . . . . . . . . . . . 64
7.2 HELP . . . . . . . . . . . . . . . . . . . . . . . . . . 56 7.1. DATE . . . . . . . . . . . . . . . . . . . . . . . . . . 64
7.3 NEWGROUPS . . . . . . . . . . . . . . . . . . . . . . . 57 7.2. HELP . . . . . . . . . . . . . . . . . . . . . . . . . . 65
7.4 NEWNEWS . . . . . . . . . . . . . . . . . . . . . . . . 58 7.3. NEWGROUPS . . . . . . . . . . . . . . . . . . . . . . . . 65
7.5 Time . . . . . . . . . . . . . . . . . . . . . . . . . . 59 7.4. NEWNEWS . . . . . . . . . . . . . . . . . . . . . . . . . 67
7.5.1 Examples . . . . . . . . . . . . . . . . . . . . . . 60 7.5. Time . . . . . . . . . . . . . . . . . . . . . . . . . . 68
7.6 The LIST commands . . . . . . . . . . . . . . . . . . . 60 7.5.1. Examples . . . . . . . . . . . . . . . . . . . . . . 68
7.6.1 LIST . . . . . . . . . . . . . . . . . . . . . . . . 61 7.6. The LIST commands . . . . . . . . . . . . . . . . . . . . 69
7.6.2 Standard LIST keywords . . . . . . . . . . . . . . . 63 7.6.1. LIST . . . . . . . . . . . . . . . . . . . . . . . . 69
7.6.3 LIST ACTIVE . . . . . . . . . . . . . . . . . . . . 63 7.6.2. Standard LIST keywords . . . . . . . . . . . . . . . 72
7.6.4 LIST ACTIVE.TIMES . . . . . . . . . . . . . . . . . 65 7.6.3. LIST ACTIVE . . . . . . . . . . . . . . . . . . . . . 73
7.6.5 LIST DISTRIB.PATS . . . . . . . . . . . . . . . . . 66 7.6.4. LIST ACTIVE.TIMES . . . . . . . . . . . . . . . . . . 74
7.6.6 LIST NEWSGROUPS . . . . . . . . . . . . . . . . . . 66 7.6.5. LIST DISTRIB.PATS . . . . . . . . . . . . . . . . . . 75
8. Article field access commands . . . . . . . . . . . . . . . 68 7.6.6. LIST NEWSGROUPS . . . . . . . . . . . . . . . . . . . 75
8.1 Article metadata . . . . . . . . . . . . . . . . . . . . 68 8. Article field access commands . . . . . . . . . . . . . . . . 77
8.1.1 The :bytes metadata item . . . . . . . . . . . . . . 68 8.1. Article metadata . . . . . . . . . . . . . . . . . . . . 77
8.1.2 The :lines metadata item . . . . . . . . . . . . . . 69 8.1.1. The :bytes metadata item . . . . . . . . . . . . . . 77
8.2 Database consistency . . . . . . . . . . . . . . . . . . 69 8.1.2. The :lines metadata item . . . . . . . . . . . . . . 78
8.3 OVER . . . . . . . . . . . . . . . . . . . . . . . . . . 70 8.2. Database consistency . . . . . . . . . . . . . . . . . . 78
8.4 LIST OVERVIEW.FMT . . . . . . . . . . . . . . . . . . . 74 8.3. OVER . . . . . . . . . . . . . . . . . . . . . . . . . . 79
8.5 HDR . . . . . . . . . . . . . . . . . . . . . . . . . . 75 8.4. LIST OVERVIEW.FMT . . . . . . . . . . . . . . . . . . . . 83
8.6 LIST HEADERS . . . . . . . . . . . . . . . . . . . . . . 79 8.5. HDR . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
9. Augmented BNF Syntax for NNTP . . . . . . . . . . . . . . . 83 8.6. LIST HEADERS . . . . . . . . . . . . . . . . . . . . . . 90
9.1 Commands . . . . . . . . . . . . . . . . . . . . . . . . 83 9. Augmented BNF Syntax for NNTP . . . . . . . . . . . . . . . . 93
9.2 Command continuation . . . . . . . . . . . . . . . . . . 85 9.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 93
9.3 Responses . . . . . . . . . . . . . . . . . . . . . . . 85 9.2. Commands . . . . . . . . . . . . . . . . . . . . . . . . 93
9.3.1 Generic responses . . . . . . . . . . . . . . . . . 85 9.3. Command continuation . . . . . . . . . . . . . . . . . . 95
9.3.2 Initial response line contents . . . . . . . . . . . 86 9.4. Responses . . . . . . . . . . . . . . . . . . . . . . . . 95
9.3.3 Multi-line response contents . . . . . . . . . . . . 87 9.4.1. Generic responses . . . . . . . . . . . . . . . . . . 95
9.4 Capability lines . . . . . . . . . . . . . . . . . . . . 88 9.4.2. Initial response line contents . . . . . . . . . . . 96
9.5 LIST variants . . . . . . . . . . . . . . . . . . . . . 88 9.4.3. Multi-line response contents . . . . . . . . . . . . 97
9.6 Articles . . . . . . . . . . . . . . . . . . . . . . . . 89 9.5. Capability lines . . . . . . . . . . . . . . . . . . . . 98
9.7 General non-terminals . . . . . . . . . . . . . . . . . 90 9.6. LIST variants . . . . . . . . . . . . . . . . . . . . . . 99
9.8 Extensions and Validation . . . . . . . . . . . . . . . 91 9.7. Articles . . . . . . . . . . . . . . . . . . . . . . . . 100
10. IANA Considerations . . . . . . . . . . . . . . . . . . . 93 9.8. General non-terminals . . . . . . . . . . . . . . . . . . 100
11. Security Considerations . . . . . . . . . . . . . . . . . 94 9.9. Extensions and Validation . . . . . . . . . . . . . . . . 102
11.1 Personal and Proprietary Information . . . . . . . . . . 94 10. Internationalisation Considerations . . . . . . . . . . . . . 104
11.2 Abuse of Server Log Information . . . . . . . . . . . . 94 10.1. Introduction and historical situation . . . . . . . . . . 104
11.3 Weak Authentication and Access Control . . . . . . . . . 94 10.2. This specification . . . . . . . . . . . . . . . . . . . 104
11.4 DNS Spoofing . . . . . . . . . . . . . . . . . . . . . . 95 10.3. Outstanding issues . . . . . . . . . . . . . . . . . . . 106
11.5 UTF-8 issues . . . . . . . . . . . . . . . . . . . . . . 95 11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 107
11.6 Caching of capability lists . . . . . . . . . . . . . . 96 12. Security Considerations . . . . . . . . . . . . . . . . . . . 108
12. Acknowledgements . . . . . . . . . . . . . . . . . . . . . 98 12.1. Personal and Proprietary Information . . . . . . . . . . 108
13. References . . . . . . . . . . . . . . . . . . . . . . . . 100 12.2. Abuse of Server Log Information . . . . . . . . . . . . . 108
13.1 Normative References . . . . . . . . . . . . . . . . . . 100 12.3. Weak Authentication and Access Control . . . . . . . . . 108
13.2 Informative References . . . . . . . . . . . . . . . . . 100 12.4. DNS Spoofing . . . . . . . . . . . . . . . . . . . . . . 109
Author's Address . . . . . . . . . . . . . . . . . . . . . . 101 12.5. UTF-8 issues . . . . . . . . . . . . . . . . . . . . . . 109
A. Interaction with other specifications . . . . . . . . . . . 102 12.6. Caching of capability lists . . . . . . . . . . . . . . . 110
A.1 Header folding . . . . . . . . . . . . . . . . . . . . . 102 13. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 112
A.2 Message-IDs . . . . . . . . . . . . . . . . . . . . . . 102 14. References . . . . . . . . . . . . . . . . . . . . . . . . . 115
A.3 Article posting . . . . . . . . . . . . . . . . . . . . 103 14.1. Normative References . . . . . . . . . . . . . . . . . . 115
B. Summary of Commands . . . . . . . . . . . . . . . . . . . . 105 14.2. Informative References . . . . . . . . . . . . . . . . . 115
C. Summary of Response Codes . . . . . . . . . . . . . . . . . 108 A. Interaction with other specifications . . . . . . . . . . . . 117
Intellectual Property and Copyright Statements . . . . . . . 112 A.1. Header folding . . . . . . . . . . . . . . . . . . . . . 117
A.2. Message-IDs . . . . . . . . . . . . . . . . . . . . . . . 117
A.3. Article posting . . . . . . . . . . . . . . . . . . . . . 118
B. Summary of Commands . . . . . . . . . . . . . . . . . . . . . 120
C. Summary of Response Codes . . . . . . . . . . . . . . . . . . 122
D. Changes from RFC 977 . . . . . . . . . . . . . . . . . . . . 127
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 129
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.
Every attempt is made to ensure that the protocol specification in While the protocol specification in this document is largely
this document is compatible with the version specified in RFC 977 compatible with the version specified in RFC 977 [RFC977], there are
[RFC977]. However, this version does not support the ill-defined a number of changes which are summarised in Appendix D. In
SLAVE command and permits four digit years to be specified in the particular:
NEWNEWS and NEWGROUPS commands. It changes the default character set o the default character set is changed from US-ASCII [ANSI1986] to
to UTF-8 [RFC3629] instead of US-ASCII [ANSI1986] (note that US-ASCII UTF-8 [RFC3629] (note that US-ASCII is a subset of UTF-8);
is a subset of UTF-8). It now requires all articles to have a o a number of commands that were optional in RFC 977 or have been
message-id, eliminating the "<0>" placeholder used in RFC 977 in some taken from RFC 2980 [RFC2980] are now mandatory;
responses. It also extends the newsgroup name matching capabilities o a CAPABILITIES command has been added to allow clients to
already documented in RFC 977. determine what functionality is available from a server.
Generally, new functionality is made available using new commands. A
number of such commands (including some commands taken from RFC 2980
[RFC2980]) are now mandatory. Part of the new functionality involves
a mechanism to discover what new functionality is available to
clients from a server. This mechanism can also be used to add more
functionality as needs merit such additions.
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
skipping to change at page 7, line 44 skipping to change at page 7, line 44
%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 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 and MUST NOT exceed 12
characters. 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 a "[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 current 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 the example. Examples may use commands or other keywords not of the example. Examples may use commands or other keywords not
defined in this specification (such as an XENCRYPT command). These defined in this specification (such as an XENCRYPT command). These
will be used to illustrate some point and do not imply that any such will be used to illustrate some point and do not imply that any such
command is defined elsewhere or needs to exist in any particular command 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 which 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. Providing 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 data stream 8-bit-wide channel. NNTP operates over any reliable bidirectional 8-bit-wide data stream
Initially, the server host starts the NNTP service by listening on a channel. When the connection is established, the NNTP server host
TCP port. When a client host wishes to make use of the service, it MUST send a greeting. The client host and server host then exchange
MUST establish a TCP connection with the server host by connecting to commands and responses (respectively) until the connection is closed
that host on the same port on which the server is listening. When or aborted. If the connection used is TCP, then the server host
the connection is established, the NNTP server host MUST send a starts the NNTP service by listening on a TCP port. When a client
greeting. The client host and server host then exchange commands and host wishes to make use of the service, it MUST establish a TCP
responses (respectively) until the connection is closed or aborted. connection with the server host by connecting to that host on the
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 elsewhere in this document, arguments SHOULD consist of printable US-
US-ASCII characters. Keywords and arguments MUST be each separated ASCII characters. Keywords and arguments MUST be each separated by
by one or more space or TAB characters. Command lines MUST NOT one or more space or TAB characters. Command lines MUST NOT exceed
exceed 512 octets, which includes the terminating CRLF pair. The 512 octets, which includes the terminating CRLF pair. The arguments
arguments MUST NOT exceed 497 octets. A server MAY relax these MUST NOT exceed 497 octets. A server MAY relax these limits for
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 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, and SHOULD apply
these same principles throughout. these same principles throughout.
The term "character" means a single Unicode code point and The term "character" means a single Unicode code point and
implementations are not required to carry out normalisation. Thus implementations are not required to carry out normalisation. Thus
skipping to change at page 10, line 5 skipping to change at page 10, line 5
commands in this specification are LIST and MODE. Note that such commands in this specification are LIST and MODE. Note that such
variants are sometimes referred to as if they were commands in their variants are sometimes referred to as if they were commands in their
own right: "the LIST ACTIVE" command should be read as shorthand for own right: "the LIST ACTIVE" command should be read as shorthand for
"the ACTIVE variant of the LIST command". "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 language-specific only when stated, either in this document or in or 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.
The further data may be sent either immediately after the command
line (there are no instances of this in this specification, but there
are in extensions such as [NNTP-STREAM]) or following a request from
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 first or only line of the response MUST NOT in a single line. The initial line of the response MUST NOT exceed
exceed 512 octets, which includes the response code and the 512 octets, which includes the response code and the terminating CRLF
terminating CRLF pair; an extension MAY specify a greater maximum for pair; an extension MAY specify a greater maximum for commands that it
commands that it defines, but not for any other command. defines, but not for any other command. Single-line responses
consist of an initial line only. Multi-line responses consist of an
initial line followed by a multi-line data block.
All multi-line responses MUST adhere to the following format: An NNTP server MAY have an inactivity autologout timer. Such a timer
1. The response consists of a sequence of one or more "lines", each SHOULD be of at least three minutes duration, with the exception that
there MAY be a shorter limit on how long the server is willing to
wait for the first command from the client. The receipt of any
command from the client during the timer interval SHOULD suffice to
reset the autologout timer. Similarly, the receipt of any
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
reset the autologout timer. When the timer expires, the server
SHOULD close the connection without sending any response to the
client.
3.1.1. Multi-line data blocks
A multi-line data block is used in certain commands and responses.
It MUST adhere to the following rules:
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. The first such line contains the response code as with a single
line response. 2. In a multi-line response, the block immediately follows the CRLF
3. If any subsequent line begins with the "termination octet" ("." at the end of the initial line of the response. When used in any
or %x2E), that line MUST be "byte-stuffed" by pre-pending an other context, the specific command will define when the block is
additional termination octet to that line of the response. sent.
4. The lines of the response MUST be followed by a terminating line
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
additional termination octet to that line of the block.
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 a multi-line response is always in the normal way. Thus, unless it is empty, a multi-line block
terminated with the five octets CRLF "." CRLF (%x0D.0A.2E.0D.0A). is always terminated with the five octets CRLF "." CRLF
5. When interpreting a multi-line response, the "byte-stuffing" MUST (%x0D.0A.2E.0D.0A).
be undone; i.e. the client MUST ensure that, in any line
5. When interpreting a multi-line block, the "dot-stuffing" MUST 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 response; i.e. the client 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 is, of course, part of CRLF pair of the terminating CRLF "." CRLF of a non-empty block
the last line of the response). 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
it MAY include octets above and below 128 mixed arbitrarily. (subject to that same requirement) it MAY include octets above and
below 128 mixed arbitrarily.
This document does not place any limit on the length of a subsequent
line in a multi-line response. However, the standards that define
the format of articles may do so.
An NNTP server MAY have an inactivity autologout timer. Such a timer This document does not place any limit on the length of a line in a
SHOULD be of at least three minutes duration, with the exception that multi-line block. However, the standards that define the format of
there MAY be a shorter limit on how long the server is willing to articles may do so.
wait for the first command from the client. The receipt of any
command from the client during the timer interval SHOULD suffice to
reset the autologout timer. Similarly, the receipt of any
significant amount of data from the client while in the midst of
sending a multi-line message to the server (such as during a POST or
IHAVE command) SHOULD suffice to reset the autologout timer. When
the timer expires, the server SHOULD close the TCP connection without
sending any response to the client.
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, set-up, 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
skipping to change at page 11, line 39 skipping to change at page 12, line 16
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 is
fixed for each response code, as is whether or not the code fixed for each response code, as is whether or not the code is
introduces a multi-line response. Any extension MUST follow this single-line or multi-line. Any extension MUST follow this principle
principle as well. Note that, for historical reasons, the 211 as well. Note that, for historical reasons, the 211 response code is
response code is an exception to this in that the response may be an exception to this in that the response may be single-line or
multi-line or not 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
skipping to change at page 12, line 38 skipping to change at page 13, line 15
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 it is an optional command that
is not implemented by the server, the response code 500 MUST be 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
skipping to change at page 13, line 26 skipping to change at page 14, line 4
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 not
store the required information), or only handles a subset of store the required information), or only handles a subset of
legitimate cases (see the HDR command (Section 8.5) for an example), legitimate cases (see the HDR command (Section 8.5) for an example),
the response code 503 MUST be returned. 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 start a new one
with the appropriate authority before the command can be used. 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) have
used this response to indicate that this command will become used this response to indicate that this command will become
available after the MODE READER (Section 5.3) command is used, but available after the MODE READER (Section 5.3) command is used, but
this usage is not conforming to this specification and MUST NOT be this usage is not conforming to this specification and MUST NOT be
used. Note that the server MUST NOT close the TCP connection used. Note that the server MUST NOT close the connection
immediately after a 502 response except at the initial connection immediately 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,
provide information as to the identity of the client) before the provide information as to the identity of the client) before the
facility can be used on this connection. This will involve the facility can be used on this connection. This will involve the
use of an authentication extension such as [NNTP-AUTH]. 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 (usually an extension,
which may be a private extension) that provides the necessary which may be a private extension) that provides the necessary
mechanism. The server MUST NOT use this response code except as mechanism. 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 TCP connection. Following a 400 response, immediately close the connection. Following a 400 response, clients
clients SHOULD NOT simply reconnect immediately and retry the same SHOULD NOT simply reconnect immediately and retry the same actions.
actions. Rather, a client SHOULD either use an exponentially Rather, a client SHOULD either use an exponentially increasing delay
increasing delay between retries (e.g. double the waiting time after between retries (e.g. double the waiting time after each 400
each 400 response) or present any associated text to the user for response) or present any associated text to the user for them to
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:
[C] MAIL [C] MAIL
[S] 500 Unknown command [S] 500 Unknown command
Example of an unsupported command: Example of an unsupported command:
[C] CAPABILITIES [C] CAPABILITIES
[S] 101 Capability list: [S] 101 Capability list:
[S] VERSION 2 [S] VERSION 2
[S] READER LISTGROUP [S] READER
[S] NEWNEWS
[S] LIST ACTIVE NEWSGROUPS [S] LIST ACTIVE NEWSGROUPS
[S] . [S] .
[C] OVER [C] OVER
[S] 500 Unknown command [S] 500 Unknown command
Example of an unsupported variant: Example of an unsupported variant:
[C] MODE POSTER [C] MODE POSTER
[S] 501 Unknown MODE option [S] 501 Unknown MODE option
Example of a syntax error: Example of a syntax error:
[C] ARTICLE a.message.id@no.angle.brackets [C] ARTICLE a.message.id@no.angle.brackets
[S] 501 Syntax error [S] 501 Syntax error
Example of an overlong command line: Example of an overlong command line:
[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: followed by 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 using a facility:
[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:
[C] GROUP archive.local [C] GROUP archive.local
[S] 403 Archive server temporarily offline [S] 403 Archive server temporarily offline
Example of the server needing to close down immediately: Example of the server needing to close down immediately:
[C] ARTICLE 123 [C] ARTICLE 123
[S] 400 Power supply failed, running on UPS [S] 400 Power supply failed, running on UPS
[Server closes connection.] [Server closes connection.]
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 printable US-ASCII characters or any UTF-8 sequence outside the US-
US-ASCII range, but not space or TAB). Unless stated otherwise, ASCII range, but not space or TAB). Unless stated otherwise, tokens
tokens are case-insensitive. Each capability line consists of: are case-insensitive. Each capability line consists of:
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 may be defined 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 in that state. Similarly, if only some of the
commands in an extension will be available, or if the behaviour of commands in an extension will be available, or if the behaviour of
the extension will change in some other manner, according to the the extension will change in some other manner, according to the
state of the server, this MUST be indicated by different arguments in state of the server, this MUST be indicated by different arguments in
the capability line. 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 inter-work 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 which update or replace this specification; servers MUST NOT
create their own version numbers. create their own version numbers.
The version number of this specification is 2. The version number of this specification is 2.
READER
This capability indicates that the server implements the various
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.
READER POST
This capability indicates that the server implements the various This capability indicates that the server implements the POST
commands useful for reading clients. If and only if the LISTGROUP command.
command is implemented, there MUST be a single argument LISTGROUP.
If and only if posting is permitted using the POST command, there
MUST be a single argument POST. (These arguments may appear in
either order.)
LIST NEWNEWS
This capability indicates that the server implements at least one This capability indicates that the server implements the NEWNEWS
variant of the LIST command. There MUST be one argument for each command.
variant of the LIST command supported by the server, giving the
keyword for that variant.
HDR HDR
This capability indicates that the server implements the header This capability indicates that the server implements the header
access commands (HDR and LIST HEADERS). access commands (HDR and LIST HEADERS).
OVER OVER
This capability indicates that the server implements the overview This capability indicates that the server implements the overview
access commands (OVER and LIST OVERVIEW.FMT). If and only if the access commands (OVER and LIST OVERVIEW.FMT). If and only if the
server supports the message-id form of the OVER command, there server supports the message-id form of the OVER command, there
must be a single argument MSGID. must be a single argument MSGID.
LIST
This capability indicates that the server implements at least one
variant of the LIST command. There MUST be one argument for each
variant of the LIST command supported by the server, giving the
keyword for that variant.
IMPLEMENTATION IMPLEMENTATION
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 the MODE READER command needs to be used to
enable the READER capability. 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
with many options tend towards obscurity. with many options tend towards obscurity.
This means that each and every extension, regardless of its benefits, This means that each and every extension, regardless of its benefits,
must be carefully scrutinized with respect to its implementation, must be carefully scrutinized with respect to its implementation,
deployment, and interoperability costs. In many cases, the cost of deployment, and interoperability costs. In many cases, the cost of
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
skipping to change at page 18, line 47 skipping to change at page 19, line 49
"X"; "X";
o the syntax, values, and meanings of any arguments for each o the syntax, values, and meanings of any arguments for each
capability label defined by the extension; capability label defined by the extension;
o any new NNTP commands associated with the extension - the names of 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 o the syntax and possible values of arguments associated with the
new NNTP commands; new NNTP commands;
o the response codes and possible values of arguments for the o the response codes and possible values of arguments for the
responses of the new NNTP commands; responses of the new NNTP commands;
o any new arguments the extension associates with any other o any new arguments the extension associates with any other pre-
pre-existing NNTP commands; existing NNTP commands;
o any increase in the maximum length of commands and initial o any increase in the maximum length of commands and initial
response lines over the value specified in this document; response lines over the value specified in this document;
o a specific statement about the effect on pipelining this extension o a specific statement about the effect on pipelining this extension
may have (if any); may have (if any);
o a specific statement about the circumstances when use of this 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 o the circumstances under which the extension can cause any pre-
pre-existing command to produce a 401, 480, or 483 response; existing command to produce a 401, 480, or 483 response;
o how the use of MODE READER on a mode-switching server interacts o how the use of MODE READER on a mode-switching server interacts
with the extension; with the extension;
o how support for the extension affects the behaviour of a server o how support for the extension affects the behaviour of a server
and NNTP client in any other manner not outlined above; and NNTP client in any other manner not outlined above;
o formal syntax as described in Section 9.8. 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
skipping to change at page 19, line 37 skipping to change at page 20, line 41
in the capabilities list under its registered name; in this case it in the capabilities list under its registered name; in this 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 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 is requested to maintain a registry of NNTP capability labels.
All capability labels in the registry MUST be keywords and MUST NOT All capability labels in the registry MUST be keywords and MUST NOT
begin with X. begin with X.
The initial contents of the registry consists of these entries: The initial contents of the registry consists of these entries:
+--------------------+-------------------------+--------------------+ +--------------------+-------------------------+--------------------+
| Label | Meaning | Definition | | Label | Meaning | Definition |
+--------------------+-------------------------+--------------------+ +--------------------+-------------------------+--------------------+
skipping to change at page 20, line 30 skipping to change at page 21, line 30
| | 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 |
| | 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 |
| | | 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 | [NNTP-TLS] |
| | security | | | | 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 groups, 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 group. 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 groups 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 group. 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 group including this capability label indicating whether or not the bundle including this
command is available. command 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 fully
implemented as specified; a server MUST NOT only partially implement implemented as specified; a server MUST NOT only partially implement
any of the commands in this specification. (Client authors should any of the commands in this specification. (Client authors should
note that some servers, not conforming to this specification, will note that some servers, not conforming to this specification, will
return a 502 generic response code to some commands that are not 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 doing this transfer tend to be
peers in a network that transmit articles among one another, rather peers in a network that transmit articles among one another, rather
than end-user systems, this process is called "peering" or "transit" than 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 grouping 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 (Section 5.3) command 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 NOT cease to advertise them IHAVE or READER capabilities, it MUST continue to advertise them for
later in the 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 which it wishes to use. Such an arrangement is called a "mode-
"mode-switching" server. 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: o Transit mode, which applies after the initial connection:
* it MUST advertise the MODE-READER capability; * it MUST advertise the MODE-READER capability;
* it MUST NOT advertise the 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) o Reading mode, after a successful MODE READER (Section 5.3)
command: command:
* it MUST not advertise the MODE-READER capability; * it MUST NOT advertise the MODE-READER capability;
* it MUST advertise the READER capability; * it MUST advertise the READER capability;
* it MAY NOT advertise the IHAVE capability even if it was * 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 o if the client wishes to use any "reader" commands, it SHOULD use
the MODE READER command immediately after the initial connection; the MODE READER command immediately after the initial connection;
o otherwise it SHOULD NOT use the MODE READER command. o otherwise it SHOULD NOT use the MODE READER command.
In each case it should be prepared for some commands to be 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 connection
such as TCP. Therefore, if a command does not depend on the response such as TCP. Therefore, if a command does not depend on the response
to the previous one, it should not matter if it is sent before that to the previous one, it should not matter if it is sent before that
response is received. Doing this is called "pipelining". However, response is received. Doing this is called "pipelining". However,
certain server implementations throw away all text received from the certain server implementations throw away all text received from the
client following certain commands before sending their response. If client following certain commands before sending their response. If
this happens, pipelining will be affected because one or more this happens, pipelining will be affected because one or more
commands will have been ignored or misinterpreted, and the client commands will have been ignored or misinterpreted, and the client
will be matching the wrong responses to each command. Since there will be matching the wrong responses to each command. Since there
skipping to change at page 24, line 6 skipping to change at page 25, line 13
of the greeting. 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, and
is typically 4k octets for TCP. (Since the server only sends data in is typically 4k octets for TCP. (Since the server only sends data in
response to commands from the client, the converse problem does not response to commands from the client, the converse problem does not
occur.) 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
[S] 223 3000237 <668929@example.org> retrieved [S] 223 3000237 <668929@example.org> retrieved
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 and so there is
no 111 response to match it. no 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.
skipping to change at page 25, line 20 skipping to change at page 26, line 29
than one line when displayed or transmitted; nevertheless it is still than one line when displayed or transmitted; nevertheless it is still
referred to as "a" header line.) The presence or absence of folding referred to as "a" header line.) The presence or absence of folding
does not affect the meaning of the header line; that is, the CRLF does not affect the meaning of the header line; that is, the CRLF
pairs introduced by folding are not considered part of the header pairs introduced by folding are not considered part of the header
content. Header lines SHOULD NOT be folded before the space after content. Header lines SHOULD NOT be folded before the space after
the colon that follows the header name, and SHOULD include at least the colon that follows the header name, and SHOULD include at least
one octet other than %x09 or %x20 between CRLF pairs. However, if an one octet other than %x09 or %x20 between CRLF pairs. However, if an
article has been received from elsewhere with one of these, clients article has been received from elsewhere with one of these, clients
and servers MAY transfer it to the other without re-folding it. and servers MAY transfer it to the other without re-folding it.
The content of a header SHOULD be in UTF-8. However, if a server The content of a header SHOULD be in UTF-8. However, if an
receives an article from elsewhere that uses octets in the range 128 implementation receives an article from elsewhere that uses octets in
to 255 in some other manner, it MAY pass it to a client without the range 128 to 255 in some other manner, it MAY pass it to a client
modification. Therefore clients MUST be prepared to receive such or server without modification. Therefore implementations MUST be
headers and also data derived from them (e.g. in the responses from prepared to receive such headers and also data derived from them
the OVER (Section 8.3) command) and MUST NOT assume that they are (e.g. in the responses from the OVER (Section 8.3) command) and MUST
always UTF-8. How the client will then process those headers, NOT assume that they are always UTF-8. Any external processing of
including identifying the encoding used, is outside the scope of this those headers, including identifying the encoding used, is outside
document. the 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 "<" and 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.
skipping to change at page 26, line 13 skipping to change at page 28, line 13
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 in turn was 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 [RFC2234] syntax, which
is an extract of that in Section 9.7. 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
; must not begin with "!" if not immediately preceded by "!"
wildmat-item = wildmat-exact / wildmat-wild wildmat-item = wildmat-exact / wildmat-wild
wildmat-exact = %x21-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 wildmats, while *
and ? are always wildcards. This should not be a problem since these and ? are always wildcards. This should not be a problem since these
characters cannot occur in newsgroup names, which is the only current characters cannot occur in newsgroup names, which is the only current
use of wildmats. Backslash is commonly used to suppress the special use of wildmats. Backslash is commonly used to suppress the special
meaning of characters while brackets are used to introduce sets. meaning of characters while brackets are used to introduce sets.
However, these usages are not universal and interpretation of these However, these usages are not universal and interpretation of these
characters in the context of UTF-8 strings is both potentially characters in the context of UTF-8 strings is both potentially
complex and differs from existing practice, so they were omitted from complex and differs from existing practice, so they were omitted from
this specification. A future extension to this specification may this specification. A future extension to this specification may
provide semantics for these characters. 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 whole wildmat matches. If it is preceded by "!", or if no <wildmat-
<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*":
the string "aaa" matches because the rightmost match is with "a*" o the string "aaa" matches because the rightmost match is with "a*"
the string "abb" does not match because the rightmost match is o the string "abb" does not match because the rightmost match is
with "*b" with "*b"
the string "ccb" matches because the rightmost match is with "*c*" o the string "ccb" matches because the rightmost match is with "*c*"
the string "xxx" does not match because no <wildmat-pattern> o the string "xxx" does not match because no <wildmat-pattern>
matches 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).
skipping to change at page 27, line 21 skipping to change at page 29, line 25
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.
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"
skipping to change at page 28, line 7 skipping to change at page 31, line 7
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
200 Service available, posting allowed [1] 200 Service available, posting allowed [1]
201 Service available, posting prohibited [1] 201 Service available, posting prohibited [1]
400 Service temporarily unavailable [1][2] 400 Service temporarily unavailable [1][2]
502 Service permanently unavailable [1][2] 502 Service permanently unavailable [1][2]
[1] These are the only valid response codes for the initial greeting;
the server MUST not return any other generic response code.
[2] Following a 400 or 502 response the server MUST immediately close
the connection.
5.1.2 Description [1] These are the only valid response codes for the initial
greeting; the server MUST not return any other generic
response code.
[2] Following a 400 or 502 response the server MUST
immediately close the connection.
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 it is not
skipping to change at page 29, line 5 skipping to change at page 32, line 7
MAY be used if the server has insufficient information to determine MAY be used if the server has insufficient information to determine
whether the issue is temporary or permanent. 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 the
CAPABILITIES command (Section 5.2) rather than rely on this response. 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 which then
terminates the session (see Section 5.4): terminates the session (see Section 5.4):
[Initial TCP 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; it also immediately terminates the session:
[Initial TCP 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 TCP 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 where the server is unable to
provide service: provide service:
[Initial TCP 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
This command is mandatory. This command is mandatory.
Syntax Syntax
CAPABILITIES [keyword] CAPABILITIES [keyword]
Responses Responses
101 Capability list follows (multiline)
101 Capability list follows (multi-line)
Parameters Parameters
keyword = additional feature, see description
5.2.2 Description keyword additional feature, see 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 effects
of other commands or by external events). An NNTP client is only of other commands or by external events). An NNTP client is only
able to get the current and correct information concerning available able to get the current and correct information concerning available
capabilities at any point during a session by issuing a CAPABILITIES capabilities at any point during a session by issuing a CAPABILITIES
command at that point of that session and processing the response. command at that point of that session and processing the response.
The capability list is returned as a multi-line response 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 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 11.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
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 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] 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
[S] OVER MSGID [S] OVER MSGID
[S] STREAMING [S] STREAMING
[S] XSECRET [S] XSECRET
[S] . [S] .
Example of a server that supports more than one version of NNTP: Example of a server that supports more than one version of NNTP:
[C] CAPABILITIES [C] CAPABILITIES
[S] 101 Capability list: [S] 101 Capability list:
[S] VERSION 2 3 [S] VERSION 2 3
[S] READER [S] READER
[S] LIST ACTIVE NEWSGROUPS [S] LIST ACTIVE NEWSGROUPS
[S] . [S] .
Example of a client attempting to use a feature of the CAPABILITIES Example of a client attempting to use a feature of the CAPABILITIES
command that the server does not support: command that the server does not support:
[C] CAPABILITIES AUTOUPDATE [C] CAPABILITIES AUTOUPDATE
[S] 101 Capability list: [S] 101 Capability list:
[S] VERSION 2 [S] VERSION 2
[S] READER LISTGROUP [S] READER
[S] IHAVE [S] IHAVE
[S] LIST ACTIVE NEWSGROUPS OVERVIEW.FMT HEADERS [S] LIST ACTIVE NEWSGROUPS OVERVIEW.FMT HEADERS
[S] OVER MSGID [S] OVER MSGID
[S] HDR [S] HDR
[S] NEWNEWS
[S] . [S] .
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 the
connection.
5.3.2 Description [1] Following a 502 response the server MUST immediately close
the connection.
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 the fact by changing the capability list
accordingly, and then MUST return a 200 or 201 response with the same accordingly, and then MUST 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 the one presented
during the initial greeting. The client MUST NOT issue MODE READER during the initial greeting. The client MUST NOT issue MODE READER
skipping to change at page 32, line 34 skipping to change at page 36, line 16
reset its state to that immediately after the initial connection reset its state to that immediately after the initial connection
before switching mode. before switching mode.
If the server is not mode-switching, then: 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:
[S] VERSION 2 [S] VERSION 2
[S] IHAVE [S] IHAVE
[S] . [S] .
[C] MODE READER [C] MODE READER
[S] 502 Transit service only [S] 502 Transit service only
[Server closes connection.] [Server closes connection.]
Example of use of the MODE READER command on a server that provides Example of use of the MODE READER command on a server that provides
skipping to change at page 32, line 49 skipping to change at page 36, line 32
[S] 101 Capability list: [S] 101 Capability list:
[S] VERSION 2 [S] VERSION 2
[S] IHAVE [S] IHAVE
[S] . [S] .
[C] MODE READER [C] MODE READER
[S] 502 Transit service only [S] 502 Transit service only
[Server closes connection.] [Server closes connection.]
Example of use of the MODE READER command on a server that provides Example of use of the MODE READER command on a server that provides
reading facilities: reading facilities:
[C] CAPABILITIES [C] CAPABILITIES
[S] 101 Capability list: [S] 101 Capability list:
[S] VERSION 2 [S] VERSION 2
[S] READER LISTGROUP [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 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] .
[C] MODE READER [C] MODE READER
[S] 200 Reader mode, posting permitted [S] 200 Reader mode, posting permitted
[C] CAPABILITIES [C] CAPABILITIES
[S] 101 Capability list: [S] 101 Capability list:
skipping to change at page 33, line 29 skipping to change at page 37, line 17
[S] VERSION 2 [S] VERSION 2
[S] IHAVE [S] IHAVE
[S] MODE-READER [S] MODE-READER
[S] . [S] .
[C] MODE READER [C] MODE READER
[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] 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 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
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 its transactions with the NNTP
server. server.
If a client simply disconnects (or the connection times out or some If a client simply disconnects (or the connection times out or some
other fault occurs), the server MUST gracefully cease its attempts to other fault occurs), the server MUST gracefully cease its attempts to
service the client, disconnecting from its end if necessary. 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. One key is the message-id of an article. using three types of keys. The first type of key is the message-id
Another key is composed of the newsgroup name and the article number of an article and is globally unique. The second type of key is
within that newsgroup. That key MUST be unique to a particular composed of a newsgroup name and an article number within that
server (there will be only one article with that number within a newsgroup. On a particular server there MUST be only one article
particular newsgroup), but is not required to be globally unique. with a given number within any newsgroup and an article MUST NOT have
Additionally, because the same article can be cross-posted to two different numbers in the same newsgroup. An article can be
multiple newsgroups, there may be multiple keys that point to the cross-posted to multiple newsgroups, so there may be multiple keys
same article on the same server. The final key is the arrival that point to the same article on the same server; these MAY have
timestamp, giving the time that the article arrived at the server. 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
different articles on different servers. (Note that the terms
"group" and "newsgroup" are equivalent.)
The server MUST ensure that article numbers are issued in order of The final type of key is the arrival timestamp, giving the time that
arrival timestamp; that is, articles arriving later MUST have higher the article arrived at the server. The server MUST ensure that
numbers than those that arrive earlier. The server SHOULD allocate article numbers are issued in order of arrival timestamp; that is,
the next sequential unused number to each new article. articles arriving later MUST have higher numbers than those that
arrive earlier. The server SHOULD allocate the next sequential
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 4,294,967,295 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 6.1. Group and article selection
The following commands are used to set the "current 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
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
number = estimated number of articles in the group
low = reported low water mark
high = reported high water mark
6.1.1.2 Description group name of newsgroup
number estimated number of articles in the group
low reported low water mark
high reported high water mark
6.1.1.2. Description
The GROUP command selects a newsgroup as the currently selected
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.b"). 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
skipping to change at page 37, line 15 skipping to change at page 40, line 43
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 current When a valid group is selected by means of this command, the
selected newsgroup MUST be set to that group and the current article currently selected newsgroup MUST be set to that group and the
number MUST be set to the first article in the group. If an empty current article number MUST be set to the first article in the group
newsgroup is selected, the current article pointer is made invalid. (this applies even if the group is already the currently selected
If an invalid group is specified, the current selected newsgroup and newsgroup). If an empty newsgroup is selected, the current article
current article number MUST NOT be changed. number is made invalid. If an invalid group is specified, the
currently selected newsgroup and current article number MUST NOT be
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 is
used that depends on the value of the current selected newsgroup or used that depends on the value of the currently selected newsgroup or
current article number. 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
Example for a group unknown to the server: Example for a group unknown to the server:
[C] GROUP example.is.sob.bradner.or.barber [C] GROUP example.is.sob.bradner.or.barber
[S] 411 example.is.sob.bradner.or.barber is unknown [S] 411 example.is.sob.bradner.or.barber is unknown
Example of an empty group using the preferred response: Example of an empty group using the preferred response:
[C] GROUP example.currently.empty.newsgroup [C] GROUP example.currently.empty.newsgroup
[S] 211 0 4000 3999 example.currently.empty.newsgroup [S] 211 0 4000 3999 example.currently.empty.newsgroup
Example of an empty group using an alternative response: Example of an empty group using an alternative response:
[C] GROUP example.currently.empty.newsgroup [C] GROUP example.currently.empty.newsgroup
[S] 211 0 0 0 example.currently.empty.newsgroup [S] 211 0 0 0 example.currently.empty.newsgroup
Example of an empty group using a different alternative response: Example of an empty group using a different alternative response:
[C] GROUP example.currently.empty.newsgroup [C] GROUP example.currently.empty.newsgroup
[S] 211 0 4000 4321 example.currently.empty.newsgroup [S] 211 0 4000 4321 example.currently.empty.newsgroup
6.1.2 LISTGROUP Example reselecting the currently selected newsgroup:
6.1.2.1 Usage [C] GROUP misc.test
[S] 211 1234 234 567 misc.test
[C] STAT 444
[S] 223 444 <123456@example.net> retrieved
[C] GROUP misc.test
[S] 211 1234 234 567 misc.test
[C] STAT
[S] 223 234 <different@example.net> retrieved
6.1.2. LISTGROUP
6.1.2.1. Usage
Indicating capability: READER
Indicating capability: READER with argument LISTGROUP
Syntax Syntax
LISTGROUP [group]
LISTGROUP [group [range]]
Responses Responses
211 number low high group Article numbers follow (multiline)
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
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 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
The LISTGROUP command is used to get a listing of all the article [1] The 412 response can only occur if no group has been
numbers in a particular newsgroup. As a side effect, it also selects specified.
the group in the same way as the GROUP command (see Section 6.1.1).
The optional argument is the name of the newsgroup to be selected 6.1.2.2. Description
(e.g. "news.software.misc"). If no group is specified, the current
selected newsgroup is used.
On success, the list of article numbers is returned as a multi-line The LISTGROUP command selects a newsgroup in the same manner as the
response following the 211 response code (the arguments on the the GROUP command (see Section 6.1.1) but also provides a list of
article numbers in the newsgroup. If no group is specified, the
currently selected newsgroup is used.
On success, a list of article numbers is returned as a multi-line
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, is in numerical order, and lists list contains one number per line and is in numerical order. It
precisely those articles that exist in the group at the moment of lists precisely those articles that exist in the group at the moment
selection. of selection (therefore an empty group produces an empty list); if
the optional range argument is specified, only those articles that
are within the range are included in the list (therefore the list MAY
be empty even if the group is not).
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 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
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 current selected MUST be returned. If no group is specified and the currently
newsgroup is invalid, a 412 response MUST be returned. selected newsgroup is invalid, a 412 response MUST be returned.
In all other aspects the LISTGROUP command behaves identically to the Except that the group argument is optional, a range argument can be
GROUP command. specified, and that a multi-line data block follows the 211 response
code, the LISTGROUP command is identical to the GROUP command. In
particular, when successful, the command sets the current article
number to the first article in the group, if any, even if this is not
within the range specified by the second argument.
6.1.2.3 Examples Note that the range argument is a new feature in this specification
and servers that do not support CAPABILITIES (and therefore do not
conform to this specification) are unlikely to support it.
6.1.2.3. Examples
Example of LISTGROUP being used to select a group:
[C] LISTGROUP misc.test
[S] 211 2000 3000234 3002322 misc.test list follows
[S] 3000234
[S] 3000237
[S] 3000238
[S] 3000239
[S] 3002322
[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 current 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 failing because no group has been selected: Example of LISTGROUP with a range:
[Assumes current selected newsgroup is invalid.]
[C] LISTGROUP
[S] 412 no current group
[C] GROUP example.is.sob.bradner.or.barber
[S] 411 no such group
[C] LISTGROUP
[S] 412 no current group
6.1.3 LAST [C] LISTGROUP misc.test 3000238-3000248
[S] 211 2000 3000234 3002322 misc.test list follows
[S] 3000238
[S] 3000239
[S] .
6.1.3.1 Usage Example of LISTGROUP with an empty range:
[C] LISTGROUP misc.test 12345678-
[S] 211 2000 3000234 3002322 misc.test list follows
[S] .
Example of LISTGROUP with an invalid range:
[C] LISTGROUP misc.test 9999-111
[S] 211 2000 3000234 3002322 misc.test list follows
[S] .
6.1.3. LAST
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
message-id = article message-id
6.1.3.2 Description n article number
message-id article message-id
If the current selected newsgroup is valid, the current article 6.1.3.2. Description
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.
There MAY be no previous article in the group, although the current There MAY be no previous article in the group, although the current
article number is not the reported low water mark. There MUST NOT be article number is not the reported low water mark. There MUST NOT be
a previous article when the current article number is the reported a previous article when the current article number is the reported
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 current 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 current 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
[C] LAST [C] LAST
[S] 223 3000234 <45223423@example.com> retrieved [S] 223 3000234 <45223423@example.com> retrieved
Example of an attempt to retrieve an article without having selected Example of an attempt to retrieve an article without having selected
a group (via the GROUP command) first: a group (via the GROUP command) first:
[Assumes current selected newsgroup is invalid.]
[Assumes currently selected newsgroup is invalid.]
[C] LAST [C] LAST
[S] 412 no newsgroup selected [S] 412 no newsgroup selected
Example of an attempt to retrieve an article using the LAST command Example of an attempt to retrieve an article using the LAST command
when the current article number is that of the first article in the when the current article number is that of the first article in the
group: group:
[C] GROUP misc.test [C] GROUP misc.test
[S] 211 1234 3000234 3002322 misc.test [S] 211 1234 3000234 3002322 misc.test
[C] LAST [C] LAST
[S] 422 No previous article to retrieve [S] 422 No previous article to retrieve
Example of an attempt to retrieve an article using the LAST command Example of an attempt to retrieve an article using the LAST command
when the current 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] 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
message-id = article message-id
6.1.4.2 Description n article number
message-id article message-id
If the current selected newsgroup is valid, the current article 6.1.4.2. Description
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
Example of an attempt to retrieve an article without having selected Example of an attempt to retrieve an article without having selected
a group (via the GROUP command) first: a group (via the GROUP command) first:
[Assumes current selected newsgroup is invalid.]
[Assumes currently selected newsgroup is invalid.]
[C] NEXT [C] NEXT
[S] 412 no newsgroup selected [S] 412 no newsgroup selected
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 current article number is that of the last article in the when the current article number is that of the last article in the
group: group:
[C] GROUP misc.test [C] GROUP misc.test
[S] 211 1234 3000234 3002322 misc.test [S] 211 1234 3000234 3002322 misc.test
[C] STAT 3002322 [C] STAT 3002322
[S] 223 3002322 <411@example.net> retrieved [S] 223 3002322 <411@example.net> retrieved
[C] NEXT [C] NEXT
[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 current 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 commands are described in
terms of the differences. As specified in Section 3.6, an article 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
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 (multiline)
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 (multiline)
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 (multiline)
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
n = Returned article number
message-id = Article message-id
6.2.1.2 Description number Requested article number
n Returned article number
message-id Article message-id
6.2.1.2. Description
The ARTICLE command selects an article based on the arguments and The ARTICLE command selects an article based on 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). 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 current selected newsgroup or current article number. This alter the currently selected newsgroup or current article number.
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 current selected group and the article is except that if there is a currently selected newsgroup and the
present in that group, the server MAY use that article number. (The article is present in that group, the server MAY use that article
server is not required to determine whether the article is in the number. (The server is not required to determine whether the article
current selected newsgroup or, if so, what article number it has; the is in the currently selected newsgroup or, if so, what article number
client MUST always be prepared for zero to be specified.) The server it has; the client MUST always be prepared for zero to be specified.)
MUST NOT provide an article number unless use of that number in a The server MUST NOT provide an article number unless use of that
second ARTICLE command immediately following this one would return number in a second ARTICLE command immediately following this one
the same article. Even if the server chooses to return article would return the same article. Even if the server chooses to return
numbers in these circumstances, it need not do so consistently; it article numbers in these circumstances, it need not do so
MAY return zero to any such command (also see the STAT examples consistently; it MAY return zero to any such command (also see the
(Section 6.2.4.3)). 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 current 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 current 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 such an 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 current selected newsgroup as a result The server MUST NOT change the currently selected newsgroup as a
of this command. The server MUST NOT change the current article result of this command. The server MUST NOT change the current
number except when an article number argument was provided and the article number except when an article number argument was provided
article exists; in particular, it MUST NOT change it following an and the article exists; in particular, it MUST NOT change it
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
client to skip duplicate displays of articles that have been posted client to skip duplicate displays of articles that have been posted
more than once, or to more than one newsgroup. more than once, or to more than one newsgroup.
The article is returned as a multi-line response following the 220 The article is returned as a multi-line data block following the 220
response code. response code.
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 current selected newsgroup is invalid, a 412 response MUST be and the currently selected newsgroup is invalid, a 412 response MUST
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 current 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 (using no article
number): 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
[S] Organization: An Example Net, Uncertain, Texas [S] Organization: An Example Net, Uncertain, Texas
skipping to change at page 45, line 9 skipping to change at page 51, line 4
[S] [S]
[S] This is just a test article. [S] This is just a test article.
[S] . [S] .
Example of an unsuccessful retrieval of an article by message-id: Example of an unsuccessful retrieval of an article by message-id:
[C] ARTICLE <i.am.not.there@example.com> [C] ARTICLE <i.am.not.there@example.com>
[S] 430 No Such Article Found [S] 430 No Such Article Found
Example of an unsuccessful retrieval of an article by number: Example of an unsuccessful retrieval of an article by number:
[C] GROUP misc.test [C] GROUP misc.test
[S] 211 1234 3000234 3002322 news.groups [S] 211 1234 3000234 3002322 news.groups
[C] ARTICLE 300256 [C] ARTICLE 300256
[S] 423 No article with that number [S] 423 No article with that number
Example of an unsuccessful retrieval of an article by number because Example of an unsuccessful retrieval of an article by number because
no newsgroup was selected first: no newsgroup was selected first:
[Assumes current selected newsgroup is invalid.]
[Assumes currently selected newsgroup is invalid.]
[C] ARTICLE 300256 [C] ARTICLE 300256
[S] 412 No newsgroup selected [S] 412 No newsgroup selected
Example of an attempt to retrieve an article when the current Example of an attempt to retrieve an article when the currently
selected newsgroup is empty: 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] ARTICLE [C] ARTICLE
[S] 420 No current article selected [S] 420 No current article selected
6.2.2 HEAD 6.2.2. HEAD
6.2.2.1 Usage 6.2.2.1. Usage
This command is mandatory. This command is mandatory.
Syntax Syntax
HEAD message-id HEAD message-id
HEAD number HEAD number
HEAD HEAD
Responses Responses
First form (message-id specified) First form (message-id specified)
221 0|n message-id Headers follow (multiline)
221 0|n message-id Headers follow (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)
221 n message-id Headers follow (multiline)
221 n message-id Headers follow (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)
221 n message-id Headers follow (multiline)
221 n message-id 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
number = Requested article number
n = Returned article number
message-id = Article message-id
6.2.2.2 Description number Requested article number
n Returned article number
message-id Article message-id
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 (using
no article number): no 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
[S] Organization: An Example Net, Uncertain, Texas [S] Organization: An Example Net, Uncertain, Texas
skipping to change at page 46, line 44 skipping to change at page 53, line 15
[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
[S] Organization: An Example Net, Uncertain, Texas [S] Organization: An Example Net, Uncertain, Texas
[S] Message-ID: <411@example.net> [S] Message-ID: <411@example.net>
[S] . [S] .
Example of an unsuccessful retrieval of the headers of an article by Example of an unsuccessful retrieval of the headers of an article by
message-id: message-id:
[C] HEAD <i.am.not.there@example.com> [C] HEAD <i.am.not.there@example.com>
[S] 430 No Such Article Found [S] 430 No Such Article Found
Example of an unsuccessful retrieval of the headers of an article by Example of an unsuccessful retrieval of the headers of an article by
number: 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 300256 [C] HEAD 300256
[S] 423 No article with that number [S] 423 No article with that number
Example of an unsuccessful retrieval of the headers of an article by Example of an unsuccessful retrieval of the headers of an article by
number because no newsgroup was selected first: number because no newsgroup was selected first:
[Assumes current selected newsgroup is invalid.]
[Assumes currently selected newsgroup is invalid.]
[C] HEAD 300256 [C] HEAD 300256
[S] 412 No newsgroup selected [S] 412 No newsgroup selected
Example of an attempt to retrieve the headers of an article when the Example of an attempt to retrieve the headers of an article when the
current selected newsgroup is empty: 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] 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 (multiline)
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 (multiline)
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 (multiline)
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
n = Returned article number
message-id = Article message-id
6.2.3.2 Description number Requested article number
n Returned article number
message-id Article message-id
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 (using no
article number): 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] .
Example of an unsuccessful retrieval of the body of an article by Example of an unsuccessful retrieval of the body of an article by
message-id: message-id:
[C] BODY <i.am.not.there@example.com> [C] BODY <i.am.not.there@example.com>
[S] 430 No Such Article Found [S] 430 No Such Article Found
Example of an unsuccessful retrieval of the body of an article by Example of an unsuccessful retrieval of the body of an article by
number: 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 300256 [C] BODY 300256
[S] 423 No article with that number [S] 423 No article with that number
Example of an unsuccessful retrieval of the body of an article by Example of an unsuccessful retrieval of the body of an article by
number because no newsgroup was selected first: number because no newsgroup was selected first:
[Assumes current selected newsgroup is invalid.]
[Assumes currently selected newsgroup is invalid.]
[C] BODY 300256 [C] BODY 300256
[S] 412 No newsgroup selected [S] 412 No newsgroup selected
Example of an attempt to retrieve the body of an article when the Example of an attempt to retrieve the body of an article when the
current selected newsgroup is empty: 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] BODY [C] BODY
[S] 420 No current article selected [S] 420 No current article selected
6.2.4 STAT 6.2.4. STAT
6.2.4.1. Usage
6.2.4.1 Usage
This command is mandatory. This command is mandatory.
Syntax Syntax
STAT message-id STAT message-id
STAT number STAT number
STAT STAT
Responses Responses
First form (message-id specified) First form (message-id specified)
223 0|n message-id Article exists 223 0|n message-id Article exists
430 No article with that message-id 430 No article with that message-id
Second form (article number specified) Second form (article number specified)
223 n message-id Article exists 223 n message-id Article exists
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)
223 n message-id Article exists 223 n message-id Article exists
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
n = Returned article number
message-id = Article message-id
6.2.4.2 Description number Requested article number
n Returned article number
message-id Article message-id
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, and in the second and third forms what its message-id is, exists, and in the second and third forms what its message-id is,
without having to process an arbitrary amount of text. without 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 (using no 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:
[C] STAT <i.am.not.there@example.com> [C] STAT <i.am.not.there@example.com>
[S] 430 No Such Article Found [S] 430 No Such Article Found
Example of STAT on an article not in the server by number: Example of STAT on an article not in the server 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] STAT 300256 [C] STAT 300256
[S] 423 No article with that number [S] 423 No article with that number
Example of STAT on an article by number when no newsgroup was Example of STAT on an article by number when no newsgroup was
selected first: selected first:
[Assumes current selected newsgroup is invalid.]
[Assumes currently selected newsgroup is invalid.]
[C] STAT 300256 [C] STAT 300256
[S] 412 No newsgroup selected [S] 412 No newsgroup selected
Example of STAT on an article when the current selected newsgroup is Example of STAT on an article when the currently selected newsgroup
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 which 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>
[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
skipping to change at page 50, line 43 skipping to change at page 58, line 12
[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 <45223423@example.com> [C] STAT <45223423@example.com>
[S] 223 0 <45223423@example.com> [S] 223 0 <45223423@example.com>
[C] GROUP alt.crossposts [C] GROUP alt.crossposts
[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 current selected group, the fifth shows that the number, if in the currently selected newsgroup, the fifth shows that the number,
provided, must be that relating to the current selected group, and if provided, must be that relating to the currently selected
the last one shows that the current selected article is still not newsgroup, and the last one shows that the current article number is
changed by the use of STAT with a message-id even if it returns an still not changed by the use of STAT with a message-id even if it
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: READER with argument POST
This command MUST NOT be pipelined. This command MUST NOT be pipelined.
Syntax Syntax
POST POST
Responses Responses
Initial responses Initial responses
340 Send article to be posted 340 Send article to be posted
440 Posting not permitted 440 Posting not permitted
Subsequent responses Subsequent responses
240 Article received OK 240 Article received OK
441 Posting failed 441 Posting failed
6.3.1.2 Description 6.3.1.2. Description
If posting is allowed, a 340 response MUST be returned to indicate If posting is allowed, a 340 response MUST be returned to indicate
that the article to be posted should be sent. If posting is that the article to be posted should be sent. If posting is
prohibited for some installation-dependent reason, a 440 response prohibited for some installation-dependent reason, a 440 response
MUST be returned. MUST be returned.
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 in the in Section 3.6 and MUST be sent by the client to the server as a
manner specified (in Section 3.1) for multi-line responses (except multi-line data block (see Section 3.1.1). Thus a single dot (".")
that there is no initial line containing a response code). Thus a on a line indicates the end of the text, and lines starting with a
single dot (".") on a line indicates the end of the text, and lines dot in the original text have that dot doubled during transmission.
starting with a 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. Others are returned
following the sending of the article. following the sending of the article.
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
skipping to change at page 52, line 19 skipping to change at page 59, line 48
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>
[C] Newsgroups: misc.test [C] Newsgroups: misc.test
[C] Subject: I am just a test article [C] Subject: I am just a test article
[C] Organization: An Example Net [C] Organization: An Example Net
[C] [C]
[C] This is just a test article. [C] This is just a test article.
[C] . [C] .
[S] 240 Article received OK [S] 240 Article received OK
skipping to change at page 52, line 46 skipping to change at page 60, line 30
[C] From: "Demo User" <nobody@example.net> [C] From: "Demo User" <nobody@example.net>
[C] Newsgroups: misc.test [C] Newsgroups: misc.test
[C] Subject: I am just a test article [C] Subject: I am just a test article
[C] Organization: An Example Net [C] Organization: An Example Net
[C] [C]
[C] This is just a test article. [C] This is just a test article.
[C] . [C] .
[S] 441 Posting failed [S] 441 Posting failed
Example of an attempt to post when posting is not allowed: Example of an attempt to post when posting is not allowed:
[Initial TCP connection set-up completed.]
[Initial connection set-up completed.]
[S] 201 NNTP Service Ready, posting prohibited [S] 201 NNTP Service Ready, posting prohibited
[C] POST [C] POST
[S] 440 Posting not permitted [S] 440 Posting not permitted
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
6.3.2.2 Description message-id Article message-id
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, in the format defined entire article, including headers and body, to the server as a multi-
above (Section 3.1) for multi-line responses (except that there is no line data block (see Section 3.1.1). Thus a single dot (".") on a
initial line containing a response code). Thus a single dot (".") on line indicates the end of the text, and lines starting with a dot in
a line indicates the end of the text, and lines starting with a dot the original text have that dot doubled during transmission. The
in the original text have that dot doubled during transmission. The
server MUST return either a 235 response, indicating that the article server MUST return either 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
skipping to change at page 54, line 24 skipping to change at page 62, line 19
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 be able immediately to
determine whether or not an article is suitable for posting or determine whether or not an article is suitable for posting or
forwarding, an NNTP server MAY acknowledge the successful transfer of forwarding, an NNTP server MAY acknowledge the successful transfer of
the article (with a 235 response) but later silently discard it. the article (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
[C] Subject: I am just a test article [C] Subject: I am just a test article
[C] Date: 6 Oct 1998 04:38:40 -0500 [C] Date: 6 Oct 1998 04:38:40 -0500
[C] Organization: An Example Com, San Jose, CA [C] Organization: An Example Com, San Jose, CA
[C] Message-ID: <i.am.an.article.you.will.want@example.com> [C] Message-ID: <i.am.an.article.you.will.want@example.com>
[C] [C]
skipping to change at page 56, line 12 skipping to change at page 64, line 12
[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
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
7.1.2 Description yyyymmddHHmmss Current UTC date and time on server
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
used for determining article arrival and group creation times (see used for determining article arrival and group creation times (see
Section 6). This clock SHOULD be monotonic, and adjustments SHOULD Section 6). This clock SHOULD be monotonic, and adjustments SHOULD
be made by running it fast or slow compared to "real" time rather be made by running it fast or slow compared to "real" time rather
than by making sudden jumps. A system providing NNTP service SHOULD than by making sudden jumps. A system providing NNTP service SHOULD
keep the system clock as accurate as possible, either with NTP or by keep the system clock as accurate as possible, either with NTP or by
some other method. some other method.
The server MUST return a 111 response specifying the date and time on The server MUST return a 111 response specifying the date and time on
the server in the form yyyymmddhhmmss. This date and time is in the server in the form yyyymmddhhmmss. This date and time is in
Coordinated Universal Time. Coordinated Universal Time.
7.1.3 Examples 7.1.3. Examples
[C] DATE [C] DATE
[S] 111 19990623135624 [S] 111 19990623135624
7.2 HELP 7.2. HELP
7.2.1 Usage 7.2.1. Usage
This command is mandatory. This command is mandatory.
Syntax Syntax
HELP HELP
Responses Responses
100 Help text follows (multiline)
7.2.2 Description 100 Help text follows (multi-line)
7.2.2. Description
This command provides a short summary of the commands that are This command provides a short summary of the commands that are
understood by this implementation of the server. The help text will understood by this implementation of the server. The help text will
be presented as a multiline response following the 100 response code. be presented as a multi-line data block following the 100 response
code.
This text is not guaranteed to be in any particular format and MUST This text is not guaranteed to be in any particular format (but must
NOT be used by clients as a replacement for the CAPABILITIES command be UTF-8) and MUST NOT be used by clients as a replacement for the
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 (multiline)
231 List of new newsgroups follows (multi-line)
Parameters Parameters
date = Date in yymmdd or yyyymmdd format
time = Time in hhmmss format
7.3.2 Description date Date in yymmdd or yyyymmdd format
time Time in hhmmss format
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
skipping to change at page 58, line 30 skipping to change at page 67, line 5
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 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] .
Example where there are no new groups: Example where there are no 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] . [S] .
7.4 NEWNEWS 7.4. NEWNEWS
7.4.1 Usage 7.4.1. Usage
Indicating capability: NEWNEWS
Indicating capability: READER
Syntax Syntax
NEWNEWS wildmat date time [GMT] NEWNEWS wildmat date time [GMT]
Responses Responses
230 List of new articles follows (multiline)
230 List of new articles follows (multi-line)
Parameters Parameters
wildmat = Newsgroups of interest
date = Date in yymmdd or yyyymmdd format
time = Time in hhmmss format
7.4.2 Description wildmat Newsgroups of interest
date Date in yymmdd or yyyymmdd format
time Time in hhmmss format
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 so, 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>
[S] . [S] .
Example where there are no new articles: Example where there are no new articles:
[C] NEWNEWS alt.* 19990624 000000 GMT [C] NEWNEWS alt.* 19990624 000000 GMT
[S] 230 list of new articles by message-id follows [S] 230 list of new articles by message-id follows
[S] . [S] .
7.5 Time 7.5. Time
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
[C] NEWNEWS local.chat 20001231 235959 GMT [C] NEWNEWS local.chat 20001231 235959 GMT
[S] 230 list follows [S] 230 list follows
[S] <article.1@local.service> [S] <article.1@local.service>
[S] <article.2@local.service> [S] <article.2@local.service>
[S] <article.3@local.service> [S] <article.3@local.service>
[S] . [S] .
Second session (the client has subtracted 3 minutes from the Second session (the client has subtracted 3 minutes from the
timestamp returned previously): timestamp returned previously):
[C] DATE [C] DATE
[S] 111 20010204003344 [S] 111 20010204003344
[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, in general, can be expected not to change during the session.
Often the information is related to newsgroups, in which case the Often the information is related to newsgroups, in which case the
response has one line per newsgroup and a wildmat MAY be provided to response has one line per newsgroup and a wildmat MAY be provided to
restrict the groups for which information is returned. 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 (multiline)
215 Information follows (multi-line)
Parameters Parameters
keyword = information requested [1]
argument = specific to keyword keyword information requested [1]
wildmat = groups of interest argument specific to keyword
wildmat groups of interest
[1] If no keyword is provided, it defaults to ACTIVE. [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.
If the information is available, it is returned as a multi-line If the information is available, it is returned as a multi-line data
response following the 215 response code. The format of the block following the 215 response code. The format of the information
information depends on the keyword. The information MAY be affected depends on the keyword. The information MAY be affected by the
by the additional argument, but the format MUST NOT be. additional argument, but the format MUST NOT be.
If the information is based on newsgroups and the optional wildmat If the information is based on newsgroups and the optional wildmat
argument is specified, the response is limited to only the groups (if argument is specified, the response is limited to only the groups (if
any) whose names match the wildmat and for which the information is any) whose names match the wildmat and for which the information is
available. available.
Note that an empty list is a possible valid response; for a Note that an empty list is a possible valid response; for a
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 or not. For example,
it MUST NOT make groups available that otherwise would not have been. it 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
[S] tx.natives.recovery 89 56 y [S] tx.natives.recovery 89 56 y
[S] tx.natives.recovery.d 11 9 n [S] tx.natives.recovery.d 11 9 n
[S] . [S] .
Example of LIST with no keyword: Example of LIST with no keyword:
skipping to change at page 63, line 14 skipping to change at page 72, line 19
[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 |
| | | | | | | |
skipping to change at page 63, line 45 skipping to change at page 73, line 5
| | | is advertised | | | | is advertised |
| | | | | | | |
| OVERVIEW.FMT | Section 8.4 | Mandatory if the | | OVERVIEW.FMT | Section 8.4 | Mandatory if the |
| | | OVER capability is | | | | OVER capability is |
| | | advertised | | | | 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 following sub-sections.
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 (Section 6.1.1) command. 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 name of the newsgroup;
skipping to change at page 65, line 16 skipping to change at page 74, line 28
The information is newsgroup-based and a wildmat MAY be specified, in The information is newsgroup-based and a wildmat MAY be specified, in
which case the response is limited to only the groups (if any) whose which case the response is limited to only the groups (if any) whose
names match the wildmat. For example: 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.
The active.times list is maintained by some NNTP servers to contain The active.times list is maintained by some NNTP servers to contain
information about who created a particular newsgroup and when. Each information about who created a particular newsgroup and when. Each
line of this list consists of three fields separated from each other line of this list consists of three fields separated from each other
by one or more spaces. The first field is the name of the newsgroup. by one or more spaces. The first field is the name of the newsgroup.
The second is the time when this group was created on this news The second is the time when this group was created on this news
server, measured in seconds since the start of January 1, 1970. The server, measured in seconds since the start of January 1, 1970. The
third is plain text intended to describe the entity that created the third is plain text intended to describe the entity that created the
skipping to change at page 66, line 5 skipping to change at page 75, line 16
command. The NEWGROUPS command (Section 7.3) may provide a better command. The NEWGROUPS command (Section 7.3) may provide a better
way to access this information, and the results of the two commands way to access this information, and the results of the two commands
SHOULD be consistent except that, if the latter is invoked with a SHOULD be consistent except that, if the latter is invoked with a
date and time earlier than the oldest entry in active.times list, its date and time earlier than the oldest entry in active.times list, its
result may include extra groups. 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, in
which case the response is limited to only the groups (if any) whose which case the response is limited to only the groups (if any) whose
names match the wildmat. 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
simple group name), and the third field is a value for the simple newsgroup name), and the third field is a value for the
Distribution header content. For example: Distribution header content. For example:
[C] LIST DISTRIB.PATS [C] LIST DISTRIB.PATS
[S] 215 information follows [S] 215 information follows
[S] 10:local.*:local [S] 10:local.*:local
[S] 5:*:world [S] 5:*:world
[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
skipping to change at page 67, line 10 skipping to change at page 76, line 22
[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 information from external sources. These sources may have used
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
unchanged; therefore clients MUST be prepared to receive such
descriptions.
The information is newsgroup-based and a wildmat MAY be specified, in The information is newsgroup-based and a wildmat MAY be specified, in
which case the response is limited to only the groups (if any) whose which case the response is limited to only the groups (if any) whose
names match the wildmat. 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 which MUST begin
with a colon (and which MUST NOT contain a colon elsewhere within with a colon (and which MUST NOT contain a colon elsewhere within
it). As with header names, metadata item names are not it). As with header names, metadata item names are not case-
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 of article.) If the server has access to several non-identical copies
an article, the value returned MUST be correct for any copy of that of an article, the value returned MUST be correct for any copy of
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 "byte-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 to that above. The commonest reasons for this are:
o counting a CRLF pair as one octet; o counting a CRLF pair as one octet;
o including the "." character used for byte-stuffing in the number; o including the "." character used for dot-stuffing in the number;
o including the terminating "." CRLF in the number; o including the terminating "." CRLF in the number;
o using one copy of an article for counting the octets but then 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 less
than the number of CRLF pairs that the BODY command would return for than the number of CRLF pairs that the BODY command would return for
that article (the extra two are those following the response code and that article (the extra two are those following the response code and
the termination octet). 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 records a metadata item for some articles but not others
to which that item applies, it is said to be "inconsistent" for that to which that item applies, it is said to be "inconsistent" for that
field. field.
skipping to change at page 70, line 7 skipping to change at page 79, line 8
any fields stop being stored, they MUST be removed from the output, any fields stop being stored, they MUST be removed from the output,
then when the database is once more known to be consistent, the new then when the database is once more known to be consistent, the new
fields SHOULD be added to the output. 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 and the LIST HEADERS
command SHOULD take the same approach as the LIST OVERVIEW.FMT command SHOULD take the same approach as the LIST OVERVIEW.FMT
command in resolving them. command in 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 (multiline)
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 (multiline)
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 (multiline)
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
message-id = message-id of article
8.3.2 Description range number(s) of articles
message-id message-id of article
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 current 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 to indicate all following
o an article number followed by a dash followed by another article o an article number followed by a dash followed by another article
number 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 is 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 the generic response
skipping to change at page 71, line 5 skipping to change at page 80, line 17
o an article number followed by a dash followed by another article o an article number followed by a dash followed by another article
number 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 is 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 the generic response
code 503 when this form is used. code 503 when this form is used.
If the information is available, it is returned as a multi-line If the information is available, it is returned as a multi-line data
response 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 only be unless the argument is a range including a dash, there will be
one line but it will still be in multi-line format). Each line exactly one line in the data block). Each line consists of a number
consists of a number of fields separated by a TAB. A field may be of fields separated by a TAB. A field may be empty (in which case
empty (in which case there will be two adjacent TABs), and a sequence there will be two adjacent TABs), and a sequence of trailing TABs may
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 current selected group and the article is present in if there is a currently selected newsgroup and the article is present
that group, the server MAY use that article number (see the ARTICLE in that group, the server MAY use that article number (see the
command (Section 6.2.1) and STAT examples (Section 6.2.4.3) for more ARTICLE command (Section 6.2.1) and STAT examples (Section 6.2.4.3)
details). In the other two forms of the command, the article number for more details). In the other two forms of the command, the
MUST be returned. 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.
skipping to change at page 72, line 19 skipping to change at page 81, line 32
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.
The server SHOULD NOT produce output for articles that no longer The server SHOULD NOT produce output for articles that no longer
exist. exist.
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 range or is omitted response MUST be returned. If the argument is a range or is omitted
and the current selected newsgroup is invalid, a 412 response MUST be and the currently selected newsgroup is invalid, a 412 response MUST
returned. If the argument is a range and no articles in that number be returned. If the argument is a range and no articles in that
range exist in the current selected newsgroup, a 423 response MUST be number range exist in the currently selected newsgroup, including the
returned. If the argument is omitted and the current article number case where the second number is less than the first one, a 423
is invalid, a 420 response MUST be returned. response MUST be returned. If the argument is omitted and the
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 three examples, TAB has been replaced by vertical bar
and some lines have been folded for readability. and 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 (using no 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] 300234|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] .
skipping to change at page 73, line 40 skipping to change at page 83, line 12
<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 field(s) 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
Example of an invalid range:
[C] GROUP misc.test
[S] 211 1234 3000234 3002322 misc.test
[C] OVER 3000444-3000222
[S] 423 Empty range
Example of an unsuccessful retrieval of overview information by Example of an unsuccessful retrieval of overview information by
number because no newsgroup was selected first: number because no newsgroup was selected first:
[Assumes current selected newsgroup is invalid.]
[Assumes currently selected newsgroup is invalid.]
[C] OVER [C] OVER
[S] 412 No newsgroup selected [S] 412 No newsgroup selected
Example of an attempt to retrieve information when the current Example of an attempt to retrieve information when the currently
selected newsgroup is empty: 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] OVER [C] OVER
[S] 420 No current article selected [S] 420 No current article selected
8.4 LIST OVERVIEW.FMT 8.4. LIST OVERVIEW.FMT
8.4.1 Usage
8.4.1. Usage
Indicating capability: OVER Indicating capability: OVER
Syntax Syntax
LIST OVERVIEW.FMT LIST OVERVIEW.FMT
Responses Responses
215 Information follows (multiline)
8.4.2 Description 215 Information follows (multi-line)
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 response 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 they are returned by the OVER command; the first 7 lines MUST
(except for the case of letters) be exactly: (except for the case of letters) be exactly:
Subject: Subject:
From: From:
Date: Date:
Message-ID: Message-ID:
References: References:
:bytes :bytes
skipping to change at page 75, line 18 skipping to change at page 85, line 6
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 used more than once in
a session. a session.
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, using 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
skipping to change at page 75, line 50 skipping to change at page 85, line 40
[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] .
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 (multiline)
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 (multiline)
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 (multiline)
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
range = number(s) of articles
message-id = message-id of article
8.5.2 Description field name of field
range number(s) of articles
message-id message-id of article
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 current 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.
skipping to change at page 76, line 46 skipping to change at page 87, line 4
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
o an article number followed by a dash to indicate all following 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 followed by another article
number 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 If the information is available, it is returned as a multi-line data
response following the 225 response code and contains one line for block following the 225 response code and contains one line for each
each article in the range that exists (note that unless the argument article in the range that exists (note that unless the argument is a
is a range including a dash, there will be at most one line but it range including a dash, there will be exactly one line in the data
will still be in multi-line format). The line consists of the block). The line consists of the article number, a space, and then
article number, a space, and then the contents of the field. In the the contents of the field. In the case of a header, the header name,
case of a header, the header name, colon, and the first space after colon, and the first space after the colon are all omitted.
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 current selected group and the article is present in if there is a currently selected newsgroup and the article is present
that group, the server MAY use that article number (see the ARTICLE in that group, the server MAY use that article number (see the
command (Section 6.2.1) and STAT examples (Section 6.2.4.3) for more ARTICLE command (Section 6.2.1) and STAT examples (Section 6.2.4.3)
details). In the other two forms of the command, the article number for more details). In the other two forms of the command, the
MUST be returned. 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 is
the same transformation as is performed by the OVER command 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
skipping to change at page 77, line 46 skipping to change at page 88, line 4
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 current 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 current selected articles in that number range exist in the currently selected
newsgroup, a 423 response MUST be returned. If the second argument newsgroup, including the case where the second number is less than
is omitted and the current article number is invalid, a 420 response the first one, a 423 response MUST be returned. If the second
MUST be returned. argument is omitted and the current article number is invalid, a 420
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 than for the other forms. If so, it MUST respond with the
generic 503 response to attempts to request other fields, rather than generic 503 response to attempts to request other fields, rather than
returning erroneous results such as a successful empty response. returning 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-300238
[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] .
skipping to change at page 79, line 14 skipping to change at page 89, line 25
[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 [C] HDR subject
[S] 225 Header information follows [S] 225 Header information follows
[S] 3000234 I am just a test article [S] 3000234 I am just a test article
[S] . [S] .
Example of an unsuccessful retrieval of a header from an article by Example of an unsuccessful retrieval of a header from an article by
message-id: message-id:
[C] HDR subject <i.am.not.there@example.com> [C] HDR subject <i.am.not.there@example.com>
[S] 430 No Such Article Found [S] 430 No Such Article Found
Example of an unsuccessful retrieval of headers from articles by Example of an unsuccessful retrieval of headers from articles by
number because no newsgroup was selected first: number because no newsgroup was selected first:
[Assumes current selected newsgroup is invalid.]
[Assumes currently selected newsgroup is invalid.]
[C] HDR subject 300256- [C] HDR subject 300256-
[S] 412 No newsgroup selected [S] 412 No newsgroup selected
Example of an unsuccessful retrieval of headers because the current Example of an unsuccessful retrieval of headers because the currently
selected newsgroup is empty: 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] 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-300238
[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 (multiline)
215 Field list follows (multi-line)
Parameters Parameters
MSGID = requests list for access by message-id
RANGE = requests list for access by range
8.6.2 Description MSGID requests list for access by message-id
RANGE requests list for access by range
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 response 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).
skipping to change at page 80, line 39 skipping to change at page 91, line 16
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 o if the RANGE argument is specified, the results MUST be those
available for the second and third forms of the HDR command; available for the second and third forms of the HDR command;
o if no argument is specified, the results MUST be those available 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 always produce the same results and ignore any argument.
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
[S] Xref [S] Xref
[S] . [S] .
Example of an implementation providing access to the same fields as Example of an implementation providing access to the same fields as
the first example in Section 8.4.3: the first example in Section 8.4.3:
[C] CAPABILITIES [C] CAPABILITIES
[S] 101 Capability list: [S] 101 Capability list:
[S] VERSION 2 [S] VERSION 2
[S] READER [S] READER
[S] OVER [S] OVER
[S] HDR [S] HDR
[S] LIST ACTIVE NEWSGROUPS HEADERS OVERVIEW.FMT [S] LIST ACTIVE NEWSGROUPS HEADERS OVERVIEW.FMT
[S] . [S] .
[C] LIST HEADERS [C] LIST HEADERS
[S] 215 headers and metadata items supported: [S] 215 headers and metadata items supported:
[S] Date [S] Date
[S] Distribution [S] Distribution
skipping to change at page 82, line 16 skipping to change at page 92, line 45
[S] 215 headers and metadata items supported: [S] 215 headers and metadata items supported:
[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 how :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
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 [RFC2234] 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-continuation>, and The non-terminals <command-line>, <command-datastream>, <command-
<response> between them specify the text that flows between client continuation>, and <response> between them specify the text that
and server. For each command, the sequence is: flows between client and server. A consistent naming scheme is used
o the client sends an instance of <command-line>; in this document for the non-terminals relating to each command, and
o if the client is one that immediately streams data [1], it sends SHOULD be used by the specification of registered extensions.
an instance of <command-datastream>;
o the server sends an instance of <response>; For each command, the sequence is:
o while the latest response is one that indicates more data is o The client sends an instance of <command-line>; the syntax for the
EXAMPLE command is <example-command>.
o If the client is one that immediately streams data, it sends an
instance of <command-datastream>; the syntax for the EXAMPLE
command is <example-datastream>.
o The server sends an instance of <response>.
* The initial response line is independent of the command that
generated it; if the 000 response has arguments, the syntax of
the initial line is <response-000-content>.
* If the response is multi-line, the initial line is followed by
a <multi-line-data-block>. The syntax for the contents of this
block after "dot-stuffing" has been removed is (for the 000
response to the EXAMPLE command) <example-000-ml-content> and
is an instance of <multi-line-response-content>.
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 client sends an instance of <command-continuation>; the
* the server sends an instance of <response>. syntax for the EXAMPLE continuation following a 333 response is
<example-333-continuation>.
* the server sends another instance of <response> as above.
[1] There are no commands in this specification that immediately (There are no commands in this specification that immediately stream
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.1 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.
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 /
skipping to change at page 84, line 15 skipping to change at page 94, line 34
next-command / next-command /
over-command / over-command /
post-command / post-command /
quit-command / quit-command /
stat-command stat-command
article-command = "ARTICLE" [WS article-ref] article-command = "ARTICLE" [WS article-ref]
body-command = "BODY" [WS article-ref] body-command = "BODY" [WS article-ref]
capabilities-command = "CAPABILITIES" [WS keyword] capabilities-command = "CAPABILITIES" [WS keyword]
date-command = "DATE" date-command = "DATE"
group-command = "GROUP" WS newsgroup-name group-command = "GROUP" [WS newsgroup-name]
hdr-command = "HDR" WS header-meta-name [WS range-ref] hdr-command = "HDR" WS header-meta-name [WS range-ref]
head-command = "HEAD" [WS article-ref] head-command = "HEAD" [WS article-ref]
help-command = "HELP" help-command = "HELP"
ihave-command = "IHAVE" WS message-id ihave-command = "IHAVE" WS message-id
last-command = "LAST" last-command = "LAST"
list-command = "LIST" [WS list-arguments] list-command = "LIST" [WS list-arguments]
listgroup-command = "LISTGROUP" [WS newsgroup-name] listgroup-command = "LISTGROUP" [WS newsgroup-name [WS range]]
mode-reader-command = "MODE" WS "READER" mode-reader-command = "MODE" WS "READER"
newgroups-command = "NEWGROUPS" WS date-time newgroups-command = "NEWGROUPS" WS date-time
newnews-command = "NEWNEWS" WS wildmat WS date-time newnews-command = "NEWNEWS" WS wildmat WS date-time
next-command = "NEXT" next-command = "NEXT"
over-command = "OVER" [WS range-ref] over-command = "OVER" [WS range-ref]
post-command = "POST" post-command = "POST"
quit-command = "QUIT" quit-command = "QUIT"
stat-command = "STAT" [WS article-ref] stat-command = "STAT" [WS article-ref]
article-ref = article-number / message-id article-ref = article-number / message-id
skipping to change at page 85, line 5 skipping to change at page 95, line 14
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.2 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-continuation / command-continuation = ihave-335-continuation /
post-continuation post-340-continuation
ihave-continuation = encoded-article ihave-335-continuation = encoded-article
post-continuation = encoded-article post-340-continuation = encoded-article
encoded-article = content-lines termination encoded-article = multi-line-data-block
; after undoing the "byte-stuffing", this MUST match <article> ; after undoing the "dot-stuffing", this MUST match <article>
9.3 Responses 9.4. Responses
9.3.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 / multiline-response response = simple-response / multi-line-response
multiline-response = simple-response content-lines termination simple-response = initial-response-line
multi-line-response = initial-response-line multi-line-data-block
simple-response = initial-response-line =
simple-response-content [SP trailing-comment] CRLF initial-response-content [SP trailing-comment] CRLF
simple-response-content = X-simple-response-content initial-response-content = X-initial-response-content
X-simple-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.3.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. Only those response codes
with arguments are listed. with arguments are listed.
simple-response-content =/ response-111-content initial-response-content =/ response-111-content /
response-211-content response-211-content /
response-22x-content response-220-content /
response-221-content /
response-222-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-22x-content = ("220" / "221" / "222" / "223") response-220-content = "220" SP article-number SP message-id
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-223-content = "223" SP article-number SP message-id
response-401-content = "401" SP capability-label response-401-content = "401" SP capability-label
9.3.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, the part of the response in <content-lines>), in more precisely, it defines the part of the response in the multi-line
each case after any "byte-stuffing" has been undone. data block after any "dot-stuffing" has been undone. The numeric
portion of each non-terminal name indicates the response code that is
followed by this data.
multiline-response-content = article-response / multi-line-response-content = article-220-ml-content /
body-response / body-222-ml-content /
capabilities-response / capabilities-101-ml-content /
hdr-response / hdr-225-ml-content /
head-response / head-221-ml-content /
help-response / help-100-ml-content /
list-response / list-215-ml-content /
listgroup-response / listgroup-211-ml-content /
newgroups-response / newgroups-231-ml-content /
newnews-response / newnews-230-ml-content /
over-response over-224-ml-content
article-response = article article-220-ml-content = article
body-response = body body-222-ml-content = body
capabilities-response = 1*(capability-line CRLF) capabilities-101-ml-content = version-line CRLF
hdr-response = *(article-number SP hdr-content CRLF) *(capability-line CRLF)
head-response = 1*header hdr-225-ml-content = *(article-number SP hdr-content CRLF)
help-response = *(*B-CHAR CRLF) head-221-ml-content = 1*header
list-response = body help-100-ml-content = *(*U-CHAR CRLF)
listgroup-response = *(article-number CRLF) list-215-ml-content = list-content
newgroups-response = *(newsgroup-name SPA article-number listgroup-211-ml-content = *(article-number CRLF)
SPA article-number SPA newsgroup-status CRLF) newgroups-231-ml-content = active-groups-list
newnews-response = *(message-id CRLF) newnews-230-ml-content = *(message-id CRLF)
over-response = *(article-number over-content CRLF) over-224-ml-content = *(article-number over-content CRLF)
active-groups-list = *(newsgroup-name SPA article-number
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
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.4 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
This syntax defines the specific capability entries for the This syntax defines the specific capability entries for the
capabilities in this specification. capabilities in this specification.
capability-entry =/ capability-entry =/
hdr-capability / hdr-capability /
ihave-capability / ihave-capability /
implementation-capability / implementation-capability /
list-capability / list-capability /
mode-reader-capability / mode-reader-capability /
newnews-capability /
over-capability / over-capability /
reader-capability / post-capability /
version-capability reader-capability
hdr-capability = "HDR" hdr-capability = "HDR"
ihave-capability = "IHAVE" ihave-capability = "IHAVE"
implementation-capability = "IMPLEMENTATION" *(WS token) implementation-capability = "IMPLEMENTATION" *(WS token)
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"
over-capability = "OVER" [WS "MSGID"] over-capability = "OVER" [WS "MSGID"]
reader-capability = "READER" *(WS reader-option) post-capability = "POST"
reader-option = "POST" / "LISTGROUP" ; each to appear at most once reader-capability = "READER"
version-capability = "VERSION" 1*(WS version-number)
version-line = "VERSION" 1*(WS version-number)
version-number = nzDIGIT *5DIGIT version-number = nzDIGIT *5DIGIT
9.5 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 responses. command and the syntax of the corresponding response contents.
; active ; active
list-arguments =/ "ACTIVE" [WS wildmat] list-arguments =/ "ACTIVE" [WS wildmat]
list-response =/ list-active-response list-content =/ list-active-content
list-active-response = newgroups-response list-active-content = active-groups-list
; active.times ; active.times
list-arguments =/ "ACTIVE.TIMES" [WS wildmat] list-arguments =/ "ACTIVE.TIMES" [WS wildmat]
list-response =/ list-active-times-response list-content =/ list-active-times-content
list-active-times-response = list-active-times-content =
*(newsgroup-name SPA 1*DIGIT SPA newsgroup-creator CRLF) *(newsgroup-name SPA 1*DIGIT SPA newsgroup-creator CRLF)
newsgroup-creator = U-TEXT newsgroup-creator = U-TEXT
; distrib.pats ; distrib.pats
list-arguments =/ "DISTRIB.PATS" list-arguments =/ "DISTRIB.PATS"
list-response =/ list-distrib-pats-response list-content =/ list-distrib-pats-content
list-distrib-pats-response = list-distrib-pats-content =
*(1*DIGIT ":" wildmat ":" distribution CRLF) *(1*DIGIT ":" wildmat ":" distribution CRLF)
distribution = token distribution = token
; headers ; headers
list-arguments =/ "HEADERS" [WS ("MSGID" / "RANGE")] list-arguments =/ "HEADERS" [WS ("MSGID" / "RANGE")]
list-response =/ list-headers-response list-content =/ list-headers-content
list-headers-response = *(header-meta-name CRLF) / list-headers-content = *(header-meta-name CRLF) /
*((metadata-name / ":") CRLF) *((metadata-name / ":") CRLF)
; newsgroups ; newsgroups
list-arguments =/ "NEWSGROUPS" [WS wildmat] list-arguments =/ "NEWSGROUPS" [WS wildmat]
list-response =/ list-newsgroups-response list-content =/ list-newsgroups-content
list-newsgroups-response = list-newsgroups-content =
*(newsgroup-name WS newsgroup-description CRLF) *(newsgroup-name WS newsgroup-description CRLF)
newsgroup-description = S-TEXT newsgroup-description = S-TEXT
; overview.fmt ; overview.fmt
list-arguments =/ "OVERVIEW.FMT" list-arguments =/ "OVERVIEW.FMT"
list-response =/ list-overview-fmt-response list-content =/ list-overview-fmt-content
list-overview-fmt-response = "Subject:" CRLF list-overview-fmt-content = "Subject:" CRLF
"From:" CRLF "From:" CRLF
"Date:" CRLF "Date:" CRLF
"Message-ID:" CRLF "Message-ID:" CRLF
"References:" CRLF "References:" CRLF
( ":bytes" CRLF ":lines" / "Bytes:" CRLF "Lines:") CRLF ( ":bytes" CRLF ":lines" / "Bytes:" CRLF "Lines:") CRLF
*((header-name ":full" / metadata-name) CRLF) *((header-name ":full" / metadata-name) CRLF)
9.6 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.7 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.
article-number = 1*16DIGIT 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
article-number = 1*16DIGIT
header-name = 1*A-NOTCOLON header-name = 1*A-NOTCOLON
keyword = ALPHA 2*11(ALPHA / DIGIT / "." / "-") keyword = ALPHA 2*11(ALPHA / DIGIT / "." / "-")
message-id = "<" 1*248A-NOTGT ">" message-id = "<" 1*248A-NOTGT ">"
newsgroup-name = 1*wildmat-exact newsgroup-name = 1*wildmat-exact
termination = "." CRLF
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
; must not begin with "!" if not immediately preceded by "!"
wildmat-item = wildmat-exact / wildmat-wild wildmat-item = wildmat-exact / wildmat-wild
wildmat-exact = %x21-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 = "*" / "?"
base64 = *(4base64-char) [base64-terminal] base64 = *(4base64-char) [base64-terminal]
base64-char = UPPER / LOWER / DIGIT / "+" / "/" base64-char = UPPER / LOWER / DIGIT / "+" / "/"
base64-terminal = 2base64-char "==" / 3base64-char "=" base64-terminal = 2base64-char "==" / 3base64-char "="
; Assorted special character sets ; Assorted special character sets
; A- means based on US-ASCII, excluding controls and SP ; A- means based on US-ASCII, excluding controls and SP
; P- means based on UTF-8, excluding controls and SP ; P- means based on UTF-8, excluding controls and SP
; U- means based on UTF-8, excluding NUL CR and LF ; U- means based on UTF-8, excluding NUL CR and LF
skipping to change at page 91, line 33 skipping to change at page 102, line 11
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
Implementations SHOULD only generate content that meets this syntax: and MAY pass such content on unaltered.
When generating new content or re-encoding existing content,
implementations SHOULD conform to this syntax:
S-CHAR = P-CHAR S-CHAR = P-CHAR
S-NONTAB = U-NONTAB S-NONTAB = U-NONTAB
S-TEXT = U-TEXT S-TEXT = U-TEXT
9.8 Extensions and Validation 9.9. Extensions and Validation
The specification of a registered extension MUST include formal The specification of a registered extension MUST include formal
syntax that defines additional forms for the following non-terminals: syntax that defines additional forms for the following non-terminals:
command command
for each new command other than a variant of the LIST command - for each new command other than a variant of the LIST command -
the syntax of each command MUST be compatible with the definition the syntax of each command MUST be compatible with the definition
of <X-command>; of <X-command>;
command-datastream command-datastream
for each new command that immediately streams data; for each new command that immediately streams data;
command-continuation command-continuation
for each new command that sends further material after the initial for each new command that sends further material after the initial
command line - the syntax of each continuation MUST be exactly command line - the syntax of each continuation MUST be exactly
what is sent to the server, including any escape mechanisms such what is sent to the server, including any escape mechanisms such
as "byte-stuffing"; as "dot-stuffing";
simple-response-content
initial-response-content
for each new response code that has arguments - the syntax of each for each new response code that has arguments - the syntax of each
response MUST be compatible with the definition of response MUST be compatible with the definition of <X-initial-
<X-simple-response-content>; response-content>;
multiline-response-content
multi-line-response-content
for each new response code that has a multi-line response - the for each new response code that has a multi-line response - the
syntax MUST show the response after the lines containing the syntax MUST show the response after the lines containing the
response code and the terminating octet have been removed and any response code and the terminating octet have been removed and any
"byte-stuffing" undone; "dot-stuffing" undone;
capability-entry capability-entry
for each new capability label - the syntax of each entry MUST be for each new capability label - the syntax of each entry MUST be
compatible with the definition of <X-capability-entry>; compatible with the definition of <X-capability-entry>;
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-response
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 "byte-stuffing" the terminating octet have been removed and any "dot-stuffing"
undone. undone.
The =/ notation of ABNF [RFC2234] SHOULD be used for this. The =/ notation of ABNF [RFC2234] and the naming conventions
described in Section 9.1 SHOULD be used for this.
When validating the syntax in this specification, or syntax based on When validating the syntax in this specification, or syntax based on
it, it should be noted that: it, it should be noted that:
o the non-terminals <command-line>, <command-datastream>, o the non-terminals <command-line>, <command-datastream>, <command-
<command-continuation>, <response>, and continuation>, <response>, and <multi-line-response-content>
<multiline-response-content> describe basic concepts of the describe basic concepts of the protocol and are not referred to by
protocol and are not referred to by any other rule; 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;
o the non-terminal <UNDEFINED> is deliberately not defined. o the non-terminal <UNDEFINED> is deliberately not defined.
10. IANA Considerations 10. Internationalisation Considerations
10.1. Introduction and historical situation
RFC 977 [RFC977] was written at a time when internationalisation was
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
7-bit transport layer, although in practice just about all known
implementations are 8-bit clean.
Since then, Usenet and NNTP have spread throughout the world. In the
absence of standards for handling the issues of language and
character sets, countries, newsgroup hierarchies, and individuals
have found a variety of solutions that work for them but are not
necessarily appropriate elsewhere. For example, some have adopted a
default 8-bit character set appropriate to their needs (such as ISO/
IEC 8859-1 in Western Europe or KOI-8 in Russia), others have used
ASCII (either US-ASCII or national variants) in headers but local 16-
bit character sets in article bodies, and still others have gone for
a combination of MIME [RFC2045] and UTF-8. With the increased use of
MIME in email, it is becoming more common to find NNTP articles
containing MIME headers identifying the character set of the body,
but this is far from universal.
The resulting confusion does not help interoperability.
One point that has been generally accepted is that articles can
contain octets with the top bit set, and NNTP is only expected to
operate on 8-bit clean transport paths.
10.2. This specification
Part of the role of this present specification is to eliminate this
confusion and promote interoperability as far as possible. At the
same time, it is necessary to accept the existence of the present
situation and not gratuitously break existing implementations and
arrangements, even if they are less than optimal. Therefore the
current practice described above has been taken into consideration in
producing this specification.
This specification extends NNTP from US-ASCII [ANSI1986] to UTF-8
[RFC3629]. Except in the two areas discussed below, UTF-8 (which is
a superset of US-ASCII) is mandatory and implementations MUST NOT use
any other encoding.
Firstly, the use of MIME for article headers and bodies is strongly
recommended. However, given widely divergent existing practices, an
attempt to require a particular encoding and tagging standard would
be premature at this time. Accordingly, this specification allows
the use of arbitrary 8-bit data in articles subject to the following
requirements and recommendations.
o The names of headers (e.g. "From" or "Subject") MUST be in US-
ASCII.
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
standardised. At present, 8-bit encodings (including UTF-8)
SHOULD NOT be used because they are likely to cause
interoperability problems.
o The character set of article bodies SHOULD be indicated in the
article headers, and this SHOULD be done in accordance with MIME.
o Where an article is obtained from an external source an
implementation MAY pass it on, and derive data from it (such as
the response to the HDR command), even though the article or the
data does not meet the above requirements. Implementations MUST
transfer such articles and data correctly and unchanged; they MUST
NOT attempt to convert or re-encode the article or derived data.
(Nevertheless, a client or server MAY elect not to post or forward
the article if, after further examination of the article, it deems
it inappropriate to do so.)
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.3.2), OVER (Section 8.3), and POST (Section 6.3.1)
commands.
Secondly, the following requirements are placed on the newsgroups
list returned by the LIST NEWSGROUPS (Section 7.6.6) command:
o Although this specification allows UTF-8 for newsgroup names, they
SHOULD be restricted to US-ASCII until a successor to RFC 1036
[RFC1036] standardises another approach. 8-bit encodings SHOULD
NOT be used because they are likely to cause interoperability
problems.
o The newsgroup description SHOULD be in US-ASCII or UTF-8 unless
and until a successor to RFC 1036 standardised other encoding
arrangements. 8-bit encodings other than UTF-8 SHOULD NOT be used
because they are likely to cause interoperability problems.
o Implementations which obtain this data from an external source
MUST correctly handle it even if it does not meet the above
requirements. Implementations (in particular, clients) MUST
handle such data correctly.
10.3. Outstanding issues
While the primary use of NNTP is for transmitting articles that
conform to RFC 1036 (Netnews articles), it is also used for other
formats (see Appendix A). It is therefore most appropriate that
internationalisation issues related to article formats be addressed
in the relevant specifications. For Netnews articles, this is any
successor to RFC 1036. For email messages, it is RFC 2822 [RFC2822].
Of course, any article transmitted via NNTP needs to conform to this
specification as well.
Restricting newsgroup names to UTF-8 is not a complete solution. In
particular, when new newsgroup names are created or a user is asked
to enter a newsgroup name, some scheme of canonicalisation will need
to take place. This specification does not attempt to define that
canonicalization; further work is needed in this area in conjunction
with the article format specifications. Until such specifications
are published, implementations SHOULD match newsgroup names octet-by-
octet. It is anticipated that any approved scheme will be applied
"at the edges" and therefore octet-by-octet comparison will continue
to apply to most, if not all, uses of newsgroup names in NNTP.
In the meantime, any implementation experimenting with UTF-8
newsgroup names is strongly cautioned that a future specification may
require that those names be canonicalized when used with NNTP in a
way that is not compatible with their experiments.
Since the primary use of NNTP is with Netnews, and since newsgroup
descriptions are normally distributed through specially formatted
articles, it is recommended that the internationalisation issues
related to them be addressed in any successor to RFC 1036.
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.
11. 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.
11.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 personal and/or proprietary information in
material that is added automatically to articles (e.g. in headers) material that is added automatically to articles (e.g. in headers) is
is not disclosed inadvertently. Additionally, effective and easily 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.
11.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 its
handling can be constrained by law in certain countries. People handling can be constrained by law in certain countries. People
using the NNTP protocol to provide data are responsible for ensuring using the NNTP protocol to provide data are responsible for ensuring
that such material is not distributed without the permission of any that 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.
11.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 the N