idnits 2.17.1 draft-ietf-nntpext-base-23.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** It looks like you're using RFC 3978 boilerplate. You should update this to the boilerplate described in the IETF Trust License Policy document (see https://trustee.ietf.org/license-info), which is required now. -- Found old boilerplate from RFC 3978, Section 5.1.a on line 15. -- Found old boilerplate from RFC 3978, Section 5.5 on line 4579. -- Found old boilerplate from RFC 3979, Section 5, paragraph 1 on line 4556. -- Found old boilerplate from RFC 3979, Section 5, paragraph 2 on line 4563. -- Found old boilerplate from RFC 3979, Section 5, paragraph 3 on line 4569. ** The document seems to lack an RFC 3978 Section 5.1 IPR Disclosure Acknowledgement. ** This document has an original RFC 3978 Section 5.4 Copyright Line, instead of the newer IETF Trust Copyright according to RFC 4748. ** This document has an original RFC 3978 Section 5.5 Disclaimer, instead of the newer disclaimer which includes the IETF Trust according to RFC 4748. ** The document uses RFC 3667 boilerplate or RFC 3978-like boilerplate instead of verbatim RFC 3978 boilerplate. After 6 May 2005, submission of drafts without verbatim RFC 3978 boilerplate is not accepted. The following non-3978 patterns matched text found in the document. That text should be removed or replaced: This document is an Internet-Draft and is subject to all provisions of Section 3 of RFC 3667. By submitting this Internet-Draft, each author represents that any applicable patent or other IPR claims of which he or she is aware have been or will be disclosed, and any of which he or she becomes aware will be disclosed, in accordance with Section 6 of BCP 79. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- == No 'Intended status' indicated for this document; assuming Proposed Standard == The page length should not exceed 58 lines per page, but there was 97 longer pages, the longest (page 94) being 71 lines == It seems as if not all pages are separated by form feeds - found 0 form feeds but 106 pages Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The abstract seems to contain references ([RFC2629]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. == There are 43 instances of lines with non-RFC2606-compliant FQDNs in the document. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the RFC 3978 Section 5.4 Copyright Line does not match the current year == Line 221 has weird spacing: '...cal|bar indic...' == Line 818 has weird spacing: '...abc,def the t...' == Line 2067 has weird spacing: '...dhhmmss serv...' == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'MUST not' in this paragraph: Responses 200 Service available, posting allowed [1] 201 Service available, posting prohibited [1] 400 Service temporarily 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. -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (August 26, 2004) is 7176 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'C' is mentioned on line 3981, but not defined == Missing Reference: 'S' is mentioned on line 3982, but not defined -- Looks like a reference, but probably isn't: '1' on line 2726 -- Looks like a reference, but probably isn't: '2' on line 848 == Missing Reference: 'GMT' is mentioned on line 2186, but not defined -- Possible downref: Non-RFC (?) normative reference: ref. 'ANSI1986' ** Obsolete normative reference: RFC 2234 (Obsoleted by RFC 4234) ** Obsolete normative reference: RFC 3548 (Obsoleted by RFC 4648) ** Obsolete normative reference: RFC 977 (Obsoleted by RFC 3977) == Outdated reference: A later version (-10) exists of draft-ietf-nntpext-authinfo-02 == Outdated reference: A later version (-09) exists of draft-ietf-nntpext-tls-nntp-01 -- Obsolete informational reference (is this intentional?): RFC 1036 (Obsoleted by RFC 5536, RFC 5537) -- Obsolete informational reference (is this intentional?): RFC 1305 (Obsoleted by RFC 5905) -- Obsolete informational reference (is this intentional?): RFC 1869 (Obsoleted by RFC 2821) -- Obsolete informational reference (is this intentional?): RFC 2616 (Obsoleted by RFC 7230, RFC 7231, RFC 7232, RFC 7233, RFC 7234, RFC 7235) -- Obsolete informational reference (is this intentional?): RFC 2629 (Obsoleted by RFC 7749) -- Obsolete informational reference (is this intentional?): RFC 2822 (Obsoleted by RFC 5322) Summary: 9 errors (**), 0 flaws (~~), 14 warnings (==), 16 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 1 NNTP C. Feather 2 Internet-Draft Thus plc 3 Expires: February 24, 2005 August 26, 2004 5 Network News Transport Protocol 6 draft-ietf-nntpext-base-23 8 Status of this Memo 10 This document is an Internet-Draft and is subject to all provisions 11 of section 3 of RFC 3667. By submitting this Internet-Draft, each 12 author represents that any applicable patent or other IPR claims of 13 which he or she is aware have been or will be disclosed, and any of 14 which he or she become aware will be disclosed, in accordance with 15 RFC 3668. 17 Internet-Drafts are working documents of the Internet Engineering 18 Task Force (IETF), its areas, and its working groups. Note that 19 other groups may also distribute working documents as 20 Internet-Drafts. 22 Internet-Drafts are draft documents valid for a maximum of six months 23 and may be updated, replaced, or obsoleted by other documents at any 24 time. It is inappropriate to use Internet-Drafts as reference 25 material or to cite them other than as "work in progress." 27 The list of current Internet-Drafts can be accessed at 28 http://www.ietf.org/ietf/1id-abstracts.txt. 30 The list of Internet-Draft Shadow Directories can be accessed at 31 http://www.ietf.org/shadow.html. 33 This Internet-Draft will expire on February 24, 2005. 35 Copyright Notice 37 Copyright (C) The Internet Society (2004). 39 Abstract 41 The Network News Transport Protocol (NNTP) has been in use in the 42 Internet for a decade and remains one of the most popular protocols 43 (by volume) in use today. This document is a replacement for RFC 977 44 and officially updates the protocol specification. It clarifies some 45 vagueness in RFC 977, includes some new base functionality, and 46 provides a specific mechanism to add standardized extensions to NNTP. 48 Administration 49 This document is a product of the NNTP Working Group, chaired by Russ 50 Allbery and Ned Freed. 52 Author's Note 54 This document is written in XML using an NNTP-specific DTD. Custom 55 software is used to convert this to RFC 2629 [RFC2629] format, and 56 then the public "xml2rfc" package to further reduce this to text, 57 nroff source, and HTML. 59 No perl was used in producing this document. 61 Rights 63 UNIX is a registered trademark of The Open Group. 65 Table of Contents 67 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 5 68 2. Notation . . . . . . . . . . . . . . . . . . . . . . . . . . 6 69 3. Basic Concepts . . . . . . . . . . . . . . . . . . . . . . . 8 70 3.1 Commands and Responses . . . . . . . . . . . . . . . . . 8 71 3.2 Response Codes . . . . . . . . . . . . . . . . . . . . . 10 72 3.2.1 Generic Response Codes . . . . . . . . . . . . . . . 11 73 3.2.1.1 Examples . . . . . . . . . . . . . . . . . . . . 13 74 3.3 Pipelining . . . . . . . . . . . . . . . . . . . . . . . 14 75 3.3.1 Examples . . . . . . . . . . . . . . . . . . . . . . 15 76 3.4 Articles . . . . . . . . . . . . . . . . . . . . . . . . 16 77 4. The WILDMAT format . . . . . . . . . . . . . . . . . . . . . 18 78 4.1 Wildmat syntax . . . . . . . . . . . . . . . . . . . . . 18 79 4.2 Wildmat semantics . . . . . . . . . . . . . . . . . . . 18 80 4.3 Extensions . . . . . . . . . . . . . . . . . . . . . . . 19 81 4.4 Examples . . . . . . . . . . . . . . . . . . . . . . . . 20 82 5. Session administration commands . . . . . . . . . . . . . . 21 83 5.1 Initial Connection . . . . . . . . . . . . . . . . . . . 21 84 5.2 MODE READER . . . . . . . . . . . . . . . . . . . . . . 22 85 5.3 LIST EXTENSIONS . . . . . . . . . . . . . . . . . . . . 24 86 5.4 QUIT . . . . . . . . . . . . . . . . . . . . . . . . . . 26 87 6. Article posting and retrieval . . . . . . . . . . . . . . . 28 88 6.1 Group and article selection . . . . . . . . . . . . . . 28 89 6.1.1 GROUP . . . . . . . . . . . . . . . . . . . . . . . 28 90 6.1.2 LAST . . . . . . . . . . . . . . . . . . . . . . . . 31 91 6.1.3 NEXT . . . . . . . . . . . . . . . . . . . . . . . . 32 92 6.2 Retrieval of articles and article sections . . . . . . . 33 93 6.2.1 ARTICLE . . . . . . . . . . . . . . . . . . . . . . 34 94 6.2.2 HEAD . . . . . . . . . . . . . . . . . . . . . . . . 37 95 6.2.3 BODY . . . . . . . . . . . . . . . . . . . . . . . . 38 96 6.2.4 STAT . . . . . . . . . . . . . . . . . . . . . . . . 40 97 6.3 Article posting . . . . . . . . . . . . . . . . . . . . 42 98 6.3.1 POST . . . . . . . . . . . . . . . . . . . . . . . . 42 99 6.3.2 IHAVE . . . . . . . . . . . . . . . . . . . . . . . 44 100 7. Information commands . . . . . . . . . . . . . . . . . . . . 48 101 7.1 DATE . . . . . . . . . . . . . . . . . . . . . . . . . . 48 102 7.2 HELP . . . . . . . . . . . . . . . . . . . . . . . . . . 48 103 7.3 NEWGROUPS . . . . . . . . . . . . . . . . . . . . . . . 49 104 7.4 NEWNEWS . . . . . . . . . . . . . . . . . . . . . . . . 50 105 7.5 Time . . . . . . . . . . . . . . . . . . . . . . . . . . 51 106 7.5.1 Examples . . . . . . . . . . . . . . . . . . . . . . 52 107 7.6 The LIST commands . . . . . . . . . . . . . . . . . . . 52 108 7.6.1 LIST ACTIVE . . . . . . . . . . . . . . . . . . . . 52 109 7.6.2 LIST ACTIVE.TIMES . . . . . . . . . . . . . . . . . 54 110 7.6.3 LIST DISTRIBUTIONS . . . . . . . . . . . . . . . . . 56 111 7.6.4 LIST DISTRIB.PATS . . . . . . . . . . . . . . . . . 56 112 7.6.5 LIST NEWSGROUPS . . . . . . . . . . . . . . . . . . 58 114 8. Framework for NNTP extensions . . . . . . . . . . . . . . . 60 115 8.1 Initial IANA registry . . . . . . . . . . . . . . . . . 62 116 8.2 Standard extensions . . . . . . . . . . . . . . . . . . 62 117 8.3 The LISTGROUP extension . . . . . . . . . . . . . . . . 62 118 8.3.1 LISTGROUP . . . . . . . . . . . . . . . . . . . . . 62 119 8.4 Article metadata . . . . . . . . . . . . . . . . . . . . 64 120 8.4.1 The :bytes metadata item . . . . . . . . . . . . . . 65 121 8.4.2 The :lines metadata item . . . . . . . . . . . . . . 65 122 8.5 The OVER extension . . . . . . . . . . . . . . . . . . . 65 123 8.5.1 OVER . . . . . . . . . . . . . . . . . . . . . . . . 66 124 8.5.2 LIST OVERVIEW.FMT . . . . . . . . . . . . . . . . . 70 125 8.6 The HDR extension . . . . . . . . . . . . . . . . . . . 72 126 8.6.1 HDR . . . . . . . . . . . . . . . . . . . . . . . . 72 127 8.6.2 LIST HEADERS . . . . . . . . . . . . . . . . . . . . 76 128 9. Augmented BNF Syntax for NNTP . . . . . . . . . . . . . . . 79 129 9.1 Commands . . . . . . . . . . . . . . . . . . . . . . . . 79 130 9.2 Command continuation . . . . . . . . . . . . . . . . . . 81 131 9.3 Responses . . . . . . . . . . . . . . . . . . . . . . . 81 132 9.3.1 Generic responses . . . . . . . . . . . . . . . . . 81 133 9.3.2 Initial response line contents . . . . . . . . . . . 82 134 9.3.3 Multi-line response contents . . . . . . . . . . . . 82 135 9.4 LIST EXTENSIONS responses . . . . . . . . . . . . . . . 84 136 9.5 Articles . . . . . . . . . . . . . . . . . . . . . . . . 84 137 9.6 General non-terminals . . . . . . . . . . . . . . . . . 84 138 10. IANA Considerations . . . . . . . . . . . . . . . . . . . 87 139 11. Security Considerations . . . . . . . . . . . . . . . . . 88 140 11.1 Personal and Proprietary Information . . . . . . . . . . 88 141 11.2 Abuse of Server Log Information . . . . . . . . . . . . 88 142 11.3 Weak Authentication and Access Control . . . . . . . . . 88 143 11.4 DNS Spoofing . . . . . . . . . . . . . . . . . . . . . . 89 144 11.5 UTF-8 issues . . . . . . . . . . . . . . . . . . . . . . 89 145 11.6 Caching of LIST EXTENSIONS results . . . . . . . . . . . 90 146 12. Acknowledgements . . . . . . . . . . . . . . . . . . . . . 92 147 13. References . . . . . . . . . . . . . . . . . . . . . . . . 94 148 13.1 Normative References . . . . . . . . . . . . . . . . . . . 94 149 13.2 Informative References . . . . . . . . . . . . . . . . . . 94 150 Author's Address . . . . . . . . . . . . . . . . . . . . . . 95 151 A. Future Directions . . . . . . . . . . . . . . . . . . . . . 96 152 B. Interaction with other specifications . . . . . . . . . . . 97 153 B.1 Header folding . . . . . . . . . . . . . . . . . . . . . 97 154 B.2 Message-IDs . . . . . . . . . . . . . . . . . . . . . . 97 155 B.3 Article posting . . . . . . . . . . . . . . . . . . . . 98 156 C. Summary of Response Codes . . . . . . . . . . . . . . . . . 100 157 D. Formal specification of the standard extensions . . . . . . 104 158 D.1 The LISTGROUP extension . . . . . . . . . . . . . . . . 104 159 D.2 The OVER extension . . . . . . . . . . . . . . . . . . . 104 160 D.3 The HDR extension . . . . . . . . . . . . . . . . . . . 105 161 Intellectual Property and Copyright Statements . . . . . . . 106 163 1. Introduction 165 This document specifies the Network News Transport Protocol (NNTP), 166 which is used for the distribution, inquiry, retrieval, and posting 167 of Netnews articles using a reliable stream-based mechanism. For 168 news reading clients, NNTP enables retrieval of news articles that 169 are stored in a central database, giving subscribers the ability to 170 select only those articles they wish to read. 172 The Netnews model provides for indexing, cross-referencing, and 173 expiration of aged messages. For server-to-server interaction, NNTP 174 is designed for efficient transmission of Netnews articles over a 175 reliable full duplex communication channel. 177 Every attempt is made to ensure that the protocol specification in 178 this document is compatible with the version specified in RFC 977 179 [RFC977]. However, this version does not support the ill-defined 180 SLAVE command and permits four digit years to be specified in the 181 NEWNEWS and NEWGROUPS commands. It changes the default character set 182 to UTF-8 [RFC3629] instead of US-ASCII [ANSI1986] (note that US-ASCII 183 is a subset of UTF-8). It now requires all articles to have a 184 message-id, eliminating the "<0>" placeholder used in RFC 977 in some 185 responses. It also extends the newsgroup name matching capabilities 186 already documented in RFC 977. 188 Generally, new functionality is made available using new commands. A 189 number of such commands (including some commands taken from RFC 2980 190 [RFC2980]) are now mandatory. Part of the new functionality involves 191 a mechanism to discover what new functionality is available to 192 clients from a server. This mechanism can also be used to add more 193 functionality as needs merit such additions. 195 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 196 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 197 document are to be interpreted as described in RFC 2119 [RFC2119]. 199 An implementation is not compliant if it fails to satisfy one or more 200 of the MUST requirements for this protocol. An implementation that 201 satisfies all the MUST and all the SHOULD requirements for its 202 protocols is said to be "unconditionally compliant"; one that 203 satisfies all the MUST requirements but not all the SHOULD 204 requirements for NNTP is said to be "conditionally compliant". 206 For the remainder of this document, the term "client" or "client 207 host" refers to a host making use of the NNTP service, while the term 208 "server" or "server host" refers to a host that offers the NNTP 209 service. 211 2. Notation 213 The following notational conventions are used in this document. 215 UPPERCASE indicates literal text to be included in the 216 command; 217 lowercase indicates a token described elsewhere; 218 [brackets] indicate that the argument is optional; 219 ellipsis... indicates that the argument may be repeated any 220 number of times (it must occur at least once); 221 vertical|bar indicates a choice of two mutually exclusive 222 arguments (exactly one must be provided). 224 The name "message-id" for a command or response argument indicates 225 that it is the message-id of an article as described in Section 3.4, 226 including the angle brackets. 228 The name "wildmat" for an argument indicates that it is a wildmat as 229 defined in Section 4. If the argument does not meet the requirements 230 of that section (for example, if it does not fit the grammar of 231 Section 4.1) the NNTP server MAY place some interpretation on it (not 232 specified by this document) or otherwise MUST treat it as a syntax 233 error. 235 Responses for each command will be described in tables listing the 236 required format of a response followed by the meaning that should be 237 ascribed to that response. 239 The terms "NUL", "TAB", "LF", "CR, and "space" refer to the octets 240 %x00, %x09, %x0A, %x0D, and %x20 respectively (that is, the octets 241 with those codes in US-ASCII [ANSI1986] and thus UTF-8 [RFC3629]). 242 The term "CRLF" or "CRLF pair" means the sequence CR immediately 243 followed by LF (that is, %x0D.0A). A "printable US-ASCII character" 244 is an octet in the range %x21-7E. Quoted characters refer to the 245 octets with those codes in US-ASCII (so "." and "<" refer to %x2E and 246 %x3C) and will always be printable US-ASCII characters; similarly, 247 "digit" refers to the octets %x30-39. 249 Examples in this document are not normative but serve to illustrate 250 usages, arguments, and responses. In the examples, a "[C]" will be 251 used to represent the client host and a "[S]" will be used to 252 represent the server host. Most of the examples do not rely on a 253 particular server state. In some cases, however, they do assume that 254 the current selected newsgroup (see the GROUP command (Section 255 6.1.1)) is invalid; when so, this is indicated at the start of the 256 example. Examples may use commands (or other names) not defined in 257 this specification (such as an XENCRYPT command). These will be used 258 to illustrate some point and do not imply that any such command is 259 defined elsewhere or needs to exist in any particular implementation. 261 Terms which might be read as specifying details of a client or server 262 implementation, such as "database", are used simply to ease 263 description. Providing that implementations conform to the protocol 264 and format specifications in this document, no specific technique is 265 mandated. 267 3. Basic Concepts 269 3.1 Commands and Responses 271 NNTP operates over any reliable data stream 8-bit-wide channel. 272 Initially, the server host starts the NNTP service by listening on a 273 TCP port; when running over TCP/IP, the official port for the NNTP 274 service is 119. When a client host wishes to make use of the 275 service, it MUST establish a TCP connection with the server host by 276 connecting to that host on the same port on which the server is 277 listening. When the connection is established, the NNTP server host 278 MUST send a greeting. The client host and server host then exchange 279 commands and responses (respectively) until the connection is closed 280 or aborted. 282 The character set for all NNTP commands is UTF-8 [RFC3629]. Commands 283 in NNTP MUST consist of a keyword, which MAY be followed by one or 284 more arguments. A CRLF pair MUST terminate all commands. Multiple 285 commands MUST NOT be on the same line. Keywords MUST consist of 286 printable US-ASCII characters. Unless otherwise noted elsewhere in 287 this document, arguments SHOULD consist of printable US-ASCII 288 characters. Keywords and arguments MUST be each separated by one or 289 more space or TAB characters. Keywords MUST be at least three 290 characters and MUST NOT exceed 12 characters. Command lines MUST NOT 291 exceed 512 octets, which includes the terminating CRLF pair. The 292 arguments MUST NOT exceed 497 octets. A server MAY relax these 293 limits for commands defined in an extension. 295 Where this specification permits UTF-8 characters outside the range 296 U+0000 to U+007F, implementations MUST NOT use the Byte Order Mark 297 (U+FEFF, encoding %xEF.BB.BF), and MUST use the Word Joiner (U+2060, 298 encoding %xE2.91.A0) for the meaning Zero Width No-Break Space, in 299 command lines and the initial lines of responses, and SHOULD apply 300 these same principles throughout. 302 The term "character" means a single Unicode code point and 303 implementations are not required to carry out normalisation. Thus 304 U+0084 (A-dieresis) is one character while U+0041 U+0308 (A composed 305 with dieresis) is two; the two need not be treated as equivalent. 307 Commands may have variants, using a second keyword immediately after 308 the first to indicate which variant is required. The only such 309 commands in this specification are LIST and MODE. Note that such 310 variants are sometimes referred to as if they were commands in their 311 own right: "the LIST ACTIVE" command should be read as shorthand for 312 "the ACTIVE variant of the LIST command". 314 Keywords are case-insensitive; the case of keywords for commands MUST 315 be ignored by the server. Command and response arguments are case- 316 or language-specific only when stated, either in this document or in 317 other relevant specifications. 319 An NNTP server MUST implement all the commands in this specification 320 except for those marked as optional and those in extensions. 322 Each response MUST start with a three-digit response code that is 323 sufficient to distinguish all responses. Certain valid responses are 324 defined to be multi-line; for all others, the response is contained 325 in a single line. The first or only line of the response MUST NOT 326 exceed 512 octets, which includes the response code and the 327 terminating CRLF pair; an extension MAY specify a greater maximum for 328 commands that it defines, but not for any other command. 330 All multi-line responses MUST adhere to the following format: 331 1. The response consists of a sequence of one or more "lines", each 332 being a stream of octets ending with a CRLF pair. Apart from 333 those line endings, the stream MUST NOT include the octets NUL, 334 LF, or CR. 335 2. The first such line contains the response code as with a single 336 line response. 337 3. If any subsequent line begins with the "termination octet" ("." 338 or %x2E), that line MUST be "byte-stuffed" by pre-pending an 339 additional termination octet to that line of the response. 340 4. The lines of the response MUST be followed by a terminating line 341 consisting of a single termination octet followed by a CRLF pair 342 in the normal way. Thus a multi-line response is always 343 terminated with the five octets CRLF "." CRLF (%x0D.0A.2E.0D.0A). 344 5. When interpreting a multi-line response, the "byte-stuffing" MUST 345 be undone; i.e. the client MUST ensure that, in any line 346 beginning with the termination octet followed by octets other 347 than a CRLF pair, that initial termination octet is disregarded. 348 6. Likewise, the terminating line ("." CRLF or %x2E.0D.0A) MUST NOT 349 be considered part of the multi-line response; i.e. the client 350 MUST ensure that any line beginning with the termination octet 351 followed immediately by a CRLF pair is disregarded; (the first 352 CRLF pair of the terminating CRLF "." CRLF is, of course, part of 353 the last line of the response). 355 Note that texts using an encoding (such as UTF-16 or UTF-32) that may 356 contain the octets NUL, LF, or CR other than a CRLF pair cannot be 357 reliably conveyed in the above format (that is, they violate the MUST 358 requirement above). However, except when stated otherwise, this 359 specification does not require the content to be UTF-8 and therefore 360 it MAY include octets above and below 128 mixed arbitrarily. 362 This document does not place any limit on the length of a subsequent 363 line in a multi-line response. However, the standards that define 364 the format of articles may do so. 366 An NNTP server MAY have an inactivity autologout timer. Such a timer 367 SHOULD be of at least three minutes duration, with the exception that 368 there MAY be a shorter limit on how long the server is willing to 369 wait for the first command from the client. The receipt of any 370 command from the client during the timer interval SHOULD suffice to 371 reset the autologout timer. Similarly, the receipt of any 372 significant amount of data from the client while in the midst of 373 sending a multi-line message to the server (such as during a POST or 374 IHAVE command) SHOULD suffice to reset the autologout timer. When 375 the timer expires, the server SHOULD close the TCP connection without 376 sending any response to the client. 378 3.2 Response Codes 380 Each response MUST begin with a three-digit status indicator. These 381 are status reports from the server and indicate the response to the 382 last command received from the client. 384 The first digit of the response broadly indicates the success, 385 failure, or progress of the previous command: 386 1xx - Informative message. 387 2xx - Command completed OK. 388 3xx - Command OK so far; send the rest of it. 389 4xx - Command was syntactically correct but failed for some 390 reason. 391 5xx - Command unknown, unsupported, unavailable, or syntax error. 393 The next digit in the code indicates the function response category: 394 x0x - Connection, set-up, and miscellaneous messages 395 x1x - Newsgroup selection 396 x2x - Article selection 397 x3x - Distribution functions 398 x4x - Posting 399 x8x - Reserved for authentication and privacy extensions 400 x9x - Reserved for private use (non-standard extensions) 402 Certain responses contain arguments such as numbers and names in 403 addition to the status indicator. In those cases, to simplify 404 interpretation by the client the number and type of such arguments is 405 fixed for each response code, as is whether or not the code 406 introduces a multi-line response. Any extension MUST follow this 407 principle as well, but note that, for historical reasons, the 211 408 response code is an exception to this in that the response may be 409 multi-line or not depending on the command (GROUP or LISTGROUP) that 410 generated it. In all other cases, the client MUST only use the 411 status indicator itself to determine the nature of the response. The 412 exact response codes that can be returned by any given command are 413 detailed in the description of that command. 415 Arguments MUST be separated from the numeric status indicator and 416 from each other by a single space. All numeric arguments MUST be in 417 base 10 (decimal) format, and MAY have leading zeros. String 418 arguments MUST contain at least one character and MUST NOT contain 419 TAB, LF, CR, or space. The server MAY add any text after the 420 response code or last argument as appropriate, and the client MUST 421 NOT make decisions based on this text. Such text MUST be separated 422 from the numeric status indicator or the last argument by at least 423 one space. 425 The server MUST respond to any command with the appropriate generic 426 response (given in Section 3.2.1) if it represents the situation. 427 Otherwise, each recognized command MUST return one of the response 428 codes specifically listed in its description or in an extension. A 429 server MAY provide extensions to this specification, including new 430 commands, new variants or features of existing commands, and other 431 ways of changing the internal state of the server. However, the 432 server MUST NOT produce any other responses to a client that does not 433 invoke any of the additional features. (Therefore a client that 434 restricts itself to this specification will only receive the 435 responses that are listed.) 437 If a client receives an unexpected response, it SHOULD use the first 438 digit of the response to determine the result. For example, an 439 unexpected 2xx should be taken as success and an unexpected 4xx or 440 5xx as failure. 442 Response codes not specified in this document MAY be used for any 443 installation-specific additional commands also not specified. These 444 SHOULD be chosen to fit the pattern of x9x specified above. 446 Neither this document nor any registered extension (see Section 8) 447 will specify any response codes of the x9x pattern. (Implementers of 448 extensions are accordingly cautioned not to use such responses for 449 extensions that may subsequently be submitted for registration.) 451 3.2.1 Generic Response Codes 453 The server MUST respond to any command with the appropriate one of 454 the following generic responses if it represents the situation. 456 If the command is not recognized, or it is an optional command or 457 extension that is not implemented by the server, the response code 458 500 MUST be returned. 460 If there is a syntax error in the arguments of a recognized command, 461 including the case where more arguments are provided than the command 462 specifies or the command line is longer than the server accepts, the 463 response code 501 MUST be returned. The line MUST NOT be truncated 464 or split and then interpreted. Note that where a command has 465 variants depending on a second keyword (e.g. LIST ACTIVE and LIST 466 NEWSGROUPS), then 501 MUST be used when the base command is 467 implemented but the requested variant is not, and 500 MUST be used 468 only when the base command itself is not implemented. 470 As a special case, if an argument is required to be a base64-encoded 471 string [RFC3548] (there are no such arguments in this specification, 472 but there may be in extensions) and is not validly encoded, the 473 response code 504 MUST be returned. 475 If the server experiences an internal fault or problem that means it 476 is unable to carry out the command (for example, a necessary file is 477 missing or a necessary service could not be contacted), the response 478 code 403 MUST be returned. If the server recognizes the command but 479 does not provide an optional feature (for example because it does not 480 store the required information), or only handles a subset of 481 legitimate cases (see the HDR command (Section 8.6.1) for an 482 example), the response code 503 MUST be returned. Note that where a 483 command is optional (e.g. LIST ACTIVE.TIMES) and is not provided by 484 a server, this MAY be treated as an unimplemented command (response 485 code 500 or 501 as appropriate) or as a working command where the 486 information is not available (response code 503). 488 If the client is not authorized to use the specified facility when 489 the server is in its current state, then the appropriate one of the 490 following response codes MUST be used. 491 502: it is necessary to terminate the connection and start a new one 492 with the appropriate authority before the command can be used. 493 Note that the server MUST NOT close the TCP connection immediately 494 after a 502 response except at the initial connection (Section 495 5.1) and with the MODE READER (Section 5.2) command. See also the 496 latter command for historical usage of this response. 497 480: the client must authenticate itself to the server (that is, 498 provide information as to the identity of the client) before the 499 facility can be used on this connection. This will involve the 500 use of an authentication extension such as [NNTP-AUTH]. 501 483: the client must negotiate appropriate privacy protection on the 502 connection. This will involve the use of a privacy extension such 503 as [NNTP-TLS]. 504 401: the client must change the state of the connection in some other 505 manner. The first argument of the response MUST be the 506 extension-label (see Section 8) of the extension (which may be a 507 private extension) that provides the necessary mechanism, or 508 "MODE-READER" if it is necessary to use the MODE READER (Section 509 5.2) command. 511 If the server has to terminate the connection for some reason, it 512 MUST give a 400 response code to the next command and then 513 immediately close the TCP connection. 515 The client MUST be prepared to receive any of these responses for any 516 command (except, of course, that the server MUST NOT generate a 500 517 response code for mandatory commands). 519 3.2.1.1 Examples 521 Example of an unknown command: 522 [C] MAIL 523 [S] 500 Unknown command 525 Example of an unsupported extension: 526 [C] LIST EXTENSIONS 527 [S] 202 Extensions supported: 528 [S] LISTGROUP 529 [S] . 530 [C] OVER 531 [S] 500 Unknown command 533 Example of an unsupported variant: 534 [C] MODE POSTER 535 [S] 501 Unknown MODE option 537 Example of a syntax error: 538 [C] ARTICLE a.message.id@no.angle.brackets 539 [S] 501 Syntax error 541 Example of an overlong command line: 542 [C] HEAD 53 54 55 543 [S] 501 Too many arguments 545 Example of a bad wildmat: 546 [C] LIST ACTIVE u[ks].* 547 [S] 501 Syntax error 549 Example of a base64-encoding error (the second argument is meant to 550 be base64-encoded): 551 [C] XENCRYPT RSA abcd=efg 552 [S] 504 Base64 encoding error 554 Example of an attempt to access a facility not available to this 555 connection: 557 [C] MODE READER 558 [S] 200 Reader mode, posting permitted 559 [C] IHAVE 560 [S] 502 Permission denied 562 Example of an attempt to access a facility requiring authentication: 563 [C] GROUP secret.group 564 [S] 480 Permission denied 565 followed by a successful attempt following such authentication: 566 [C] XSECRET fred flintstone 567 [S] 290 Password for fred accepted 568 [C] GROUP secret.group 569 [S] 211 5 1 20 secret.group selected 571 Example of an attempt to access a facility requiring privacy: 572 [C] GROUP secret.group 573 [S] 483 Secure connection required 574 [C] XENCRYPT 575 [Client and server negotiate encryption on the link] 576 [S] 283 Encrypted link established 577 [C] GROUP secret.group 578 [S] 211 5 1 20 secret.group selected 580 Example of a need to change mode before using a facility: 581 [C] GROUP binary.group 582 [S] 401 XHOST Not on this virtual host 583 [C] XHOST binary.news.example.org 584 [S] 290 binary.news.example.org virtual host selected 585 [C] GROUP binary.group 586 [S] 211 5 1 77 binary.group selected 588 Example of a temporary failure: 589 [C] GROUP archive.local 590 [S] 403 Archive server temporarily offline 592 Example of the server needing to close down immediately: 593 [C] ARTICLE 123 594 [S] 400 Power supply failed, running on UPS 595 [Server closes connection.] 597 3.3 Pipelining 599 NNTP is designed to operate over a reliable bi-directional connection 600 such as TCP. Therefore, if a command does not depend on the response 601 to the previous one, it should not matter if it is sent before that 602 response is received. Doing this is called "pipelining". However, 603 certain server implementations throw away all text received from the 604 client following certain commands before sending their response. If 605 this happens, pipelining will be affected because one or more 606 commands will have been ignored or misinterpreted, and the client 607 will be matching the wrong responses to each command. Since there 608 are significant benefits to pipelining, but also circumstances where 609 it is reasonable or common for servers to behave in the above manner, 610 this document puts certain requirements on both clients and servers. 612 Except where stated otherwise, a client MAY use pipelining. That is, 613 it may send a command before receiving the response for the previous 614 command. The server MUST allow pipelining and MUST NOT throw away 615 any text received after a command. Irrespective of whether or not 616 pipelining is used, the server MUST process commands in the order 617 they are sent. 619 If the specific description of a command says it "MUST NOT be 620 pipelined", that command MUST end any pipeline of commands. That is, 621 the client MUST NOT send any following command until receiving the 622 CRLF at the end of the response from the command. The server MAY 623 ignore any data received after the command and before the CRLF at the 624 end of the response is sent to the client. 626 The initial connection must not be part of a pipeline; that is, the 627 client MUST NOT send any command until receiving the CRLF at the end 628 of the greeting. 630 If the client uses blocking system calls to send commands, it MUST 631 ensure that the amount of text sent in pipelining does not cause a 632 deadlock between transmission and reception. The amount of text 633 involved will depend on window sizes in the transmission layer, and 634 is typically 4k octets for TCP. (Since the server only sends data in 635 response to commands from the client, the converse problem does not 636 occur.) 638 3.3.1 Examples 640 Example of correct use of pipelining: 641 [C] GROUP misc.test 642 [C] STAT 643 [C] NEXT 644 [S] 211 1234 3000234 3002322 misc.test 645 [S] 223 3000234 <45223423@example.com> retrieved 646 [S] 223 3000237 <668929@example.org> retrieved 648 Example of incorrect use of pipelining (the MODE READER command may 649 not be pipelined): 650 [C] GROUP misc.test 651 [C] MODE READER 652 [C] DATE 654 [C] NEXT 655 [S] 211 1234 3000234 3002322 misc.test 656 [S] 200 Server ready, posting allowed 657 [S] 223 3000237 <668929@example.org> retrieved 658 The DATE command has been thrown away by the server and so there is 659 no 111 response to match it. 661 3.4 Articles 663 NNTP is intended to transfer articles between clients and servers. 664 For the purposes of this specification, articles are required to 665 conform to the rules in this section and clients and servers MUST 666 correctly process any article received from the other that does so. 667 Note that this requirement applies only to the contents of 668 communications over NNTP; it does not prevent the client or server 669 from subsequently rejecting an article for reasons of local policy. 670 Also see Appendix B for further restrictions on the format of 671 articles in some uses of NNTP. 673 An article consists of two parts: the headers and the body. They are 674 separated by a single empty line, or in other words by two 675 consecutive CRLF pairs (if there is more than one empty line, the 676 second and subsequent ones are part of the body). In order to meet 677 the general requirements of NNTP, an article MUST NOT include the 678 octet NUL, MUST NOT contain the octets LF and CR other than as part 679 of a CRLF pair, and MUST end with a CRLF pair. This specification 680 puts no further restrictions on the body; in particular, it MAY be 681 empty. 683 The headers of an article consist of one or more header lines. Each 684 header line consists of a header name, a colon, a space, the header 685 content, and a CRLF in that order. The name consists of one or more 686 printable US-ASCII characters other than colon and, for the purposes 687 of this specification, is not case-sensitive. There MAY be more than 688 one header line with the same name. The content MUST NOT contain 689 CRLF; it MAY be empty. A header may be "folded"; that is, a CRLF 690 pair may be placed before any TAB or space in the line; there MUST 691 still be some other octet between any two CRLF pairs in a header 692 line. (Note that folding means that the header line occupies more 693 than one line when displayed or transmitted; nevertheless it is still 694 referred to as "a" header line.) The presence or absence of folding 695 does not affect the meaning of the header line; that is, the CRLF 696 pairs introduced by folding are not considered part of the header 697 content. Header lines SHOULD NOT be folded before the space after 698 the colon that follows the header name, and SHOULD include at least 699 one octet other than %x09 or %x20 between CRLF pairs. However, if an 700 article has been received from elsewhere with one of these, clients 701 and servers MAY transfer it to the other without re-folding it. 703 The content of a header SHOULD be in UTF-8. However, if a server 704 receives an article from elsewhere that uses octets in the range 128 705 to 255 in some other manner, it MAY pass it to a client without 706 modification. Therefore clients MUST be prepared to receive such 707 headers and also data derived from them (e.g. in the responses from 708 the OVER extension (Section 8.5)) and MUST NOT assume that they are 709 always UTF-8. How the client will then process those headers, 710 including identifying the encoding used, is outside the scope of this 711 document. 713 Each article MUST have a unique message-id; two articles offered by 714 an NNTP server MUST NOT have the same message-id. For the purposes 715 of this specification, message-ids are opaque strings that MUST meet 716 the following requirements: 717 o A message-id MUST begin with "<" and end with ">", and MUST NOT 718 contain the latter except at the end. 719 o A message-id MUST be between 3 and 250 octets in length. 720 o A message-id MUST NOT contain octets other than printable US-ASCII 721 characters. 722 Two message-ids are the same if and only if they consist of the same 723 sequence of octets. 725 This specification does not describe how the message-id of an article 726 is determined. If the server does not have any way to determine a 727 message-id from the article itself, it MUST synthesize one (this 728 specification does not require the article to be changed as a 729 result). See also Appendix B.2. 731 4. The WILDMAT format 733 The WILDMAT format described here is based on the version first 734 developed by Rich Salz [SALZ1992], which in turn was derived from the 735 format used in the UNIX "find" command to articulate file names. It 736 was developed to provide a uniform mechanism for matching patterns in 737 the same manner that the UNIX shell matches filenames. 739 4.1 Wildmat syntax 741 A wildmat is described by the following ABNF [RFC2234] syntax (note 742 that this syntax contains ambiguities and special cases described at 743 the end): 745 wildmat = wildmat-pattern *("," ["!"] wildmat-pattern) 746 wildmat-pattern = 1*wildmat-item 747 wildmat-item = wildmat-exact / wildmat-wild 748 wildmat-exact = %x21-29 / %x2B / %x2D-3E / %x40-5A / %x5E-7E / 749 UTF8-non-ascii ; exclude * , ? [ \ ] 750 wildmat-wild = "*" / "?" 752 UTF8-non-ascii is defined in Section 9. 754 This syntax must be interpreted subject to the following rule: 756 Where a wildmat-pattern is not immediately preceded by "!", it shall 757 not begin with a "!". 759 Note: the characters \ , [ and ] are not allowed in wildmats, while * 760 and ? are always wildcards. This should not be a problem since these 761 characters cannot occur in newsgroup names, which is the only current 762 use of wildmats. Backslash is commonly used to suppress the special 763 meaning of characters while brackets are used to introduce sets. 764 However, these usages are not universal and interpretation of these 765 characters in the context of UTF-8 strings is both potentially 766 complex and differs from existing practice, so they were omitted from 767 this specification. A future extension to this specification may 768 provide semantics for these characters. 770 4.2 Wildmat semantics 772 A wildmat is tested against a string, and either matches or does not 773 match. To do this, each constituent wildmat-pattern is matched 774 against the string and the rightmost pattern that matches is 775 identified. If that wildmat-pattern is not preceded with "!", the 776 whole wildmat matches. If it is preceded by "!", or if no 777 wildmat-pattern matches, the whole wildmat does not match. 779 For example, consider the wildmat "a*,!*b,*c*": 780 the string "aaa" matches because the rightmost match is with "a*" 781 the string "abb" does not match because the rightmost match is 782 with "*b" 783 the string "ccb" matches because the rightmost match is with "*c*" 784 the string "xxx" does not match because no wildmat-pattern matches 786 A wildmat-pattern matches a string if the string can be broken into 787 components, each of which matches the corresponding wildmat-item in 788 the pattern; the matches must be in the same order, and the whole 789 string must be used in the match. The pattern is "anchored"; that 790 is, the first and last characters in the string must match the first 791 and last item respectively (unless that item is an asterisk matching 792 zero characters). 794 A wildmat-exact matches the same character (which may be more than 795 one octet in UTF-8). 797 "?" matches exactly one character (which may be more than one octet). 799 "*" matches zero or more characters. It can match an empty string, 800 but it cannot match a subsequence of a UTF-8 sequence that is not 801 aligned to the character boundaries. 803 4.3 Extensions 805 An NNTP server or extension MAY extend the syntax or semantics of 806 wildmats provided that all wildmats that meet the requirements of 807 Section 4.1 have the meaning ascribed to them by Section 4.2. Future 808 editions of this document may also extend wildmats. 810 4.4 Examples 812 In these examples, $ and @ are used to represent the two octets %xC2 813 and %xA3 respectively; $@ is thus the UTF-8 encoding for the pound 814 sterling symbol, shown as # in the descriptions. 816 Wildmat Description of strings that match 817 abc the one string "abc" 818 abc,def the two strings "abc" and "def" 819 $@ the one character string "#" 820 a* any string that begins with "a" 821 a*b any string that begins with "a" and ends with "b" 822 a*,*b any string that begins with "a" or ends with "b" 823 a*,!*b any string that begins with "a" and does not end with 824 "b" 825 a*,!*b,c* any string that begins with "a" and does not end with 826 "b", and any string that begins with "c" no matter 827 what it ends with 828 a*,c*,!*b any string that begins with "a" or "c" and does not 829 end with "b" 830 ?a* any string with "a" as its second character 831 ??a* any string with "a" as its third character 832 *a? any string with "a" as its penultimate character 833 *a?? any string with "a" as its antepenultimate character 835 5. Session administration commands 837 5.1 Initial Connection 839 5.1.1 Usage 841 Responses 842 200 Service available, posting allowed [1] 843 201 Service available, posting prohibited [1] 844 400 Service temporarily unavailable [1][2] 845 502 Service permanently unavailable [1][2] 846 [1] These are the only valid response codes for the initial greeting; 847 the server MUST not return any other generic response code. 848 [2] Following a 400 or 502 response the server MUST immediately close 849 the connection. 851 5.1.2 Description 853 There is no command presented by the client upon initial connection 854 to the server. The server MUST present an appropriate response code 855 as a greeting to the client. This response informs the client 856 whether service is available and whether the client is permitted to 857 post. 859 If the server will accept further commands from the client including 860 POST, the server MUST present a 200 greeting code. If the server 861 will accept further commands from the client, but it is not 862 authorized to post articles using the POST command, the server MUST 863 present a 201 greeting code. 865 Otherwise the server MUST present a 400 or 502 greeting code and then 866 immediately close the connection. 400 SHOULD be used if the issue is 867 only temporary (for example, because of load) and the client can 868 expect to be able to connect successfully at some point in the future 869 without making any changes. 502 MUST be used if the client is not 870 permitted under any circumstances to interact with the server, and 871 MAY be used if the server has insufficient information to determine 872 whether the issue is temporary or permanent. 874 5.1.3 Examples 876 Example of a normal connection from an authorized client which then 877 terminates the session (see Section 5.4): 878 [Initial TCP connection set-up completed.] 879 [S] 200 NNTP Service Ready, posting permitted 880 [C] QUIT 881 [S] 205 NNTP Service exits normally 882 [Server closes connection.] 884 Example of a normal connection from an authorized client that is not 885 permitted to post; it also immediately terminates the session: 886 [Initial TCP connection set-up completed.] 887 [S] 201 NNTP Service Ready, posting prohibited 888 [C] QUIT 889 [S] 205 NNTP Service exits normally 890 [Server closes connection.] 892 Example of a normal connection from an unauthorized client: 893 [Initial TCP connection set-up completed.] 894 [S] 502 NNTP Service permanently unavailable 895 [Server closes connection.] 897 Example of a connection from a client where the server is unable to 898 provide service: 899 [Initial TCP connection set-up completed.] 900 [S] 400 NNTP Service temporarily unavailable 901 [Server closes connection.] 903 5.2 MODE READER 905 5.2.1 Usage 907 This command MUST NOT be pipelined. 908 Syntax 909 MODE READER 910 Responses 911 200 Posting allowed 912 201 Posting prohibited 913 400 Service temporarily unavailable [1] 914 502 Service permanently unavailable [1] 915 [1] Following a 400 or 502 response the server MUST immediately close 916 the connection. 918 5.2.2 Description 920 MODE READER SHOULD be sent by any client that intends to use any 921 command in this specification (including Section 8) other than IHAVE, 922 HEAD, STAT, LIST ACTIVE, or LIST EXTENSIONS; other extensions MAY 923 also require MODE READER to be used. Servers MAY require that this 924 command be issued before any commands other than the above are sent 925 and MAY reject such commands until after a MODE READER command has 926 been sent. Such rejections SHOULD use response code 401 with 927 argument "MODE-READER", but for historical reasons response code 502 928 MAY be used, even though this situation does not meet the conditions 929 for that response. 931 Once MODE READER is sent, IHAVE (and any related extensions) MAY no 932 longer be permitted, even if it were permitted before the MODE READER 933 command. The results of LIST EXTENSIONS MAY be different following a 934 MODE READER command than prior to the issuing of that command. 936 The server MUST return a response using the same codes as the initial 937 greeting (as described in Section 5.1.1) to indicate its ability to 938 provide reading service to the client. Note that the response need 939 not be the same as the one presented during the initial greeting. 941 Servers are encouraged to not require this command even though 942 clients SHOULD send it when appropriate. It is present to support 943 some news architectures that switch between modes based on whether a 944 given connection is a peer-to-peer connection with another server or 945 a news reading client. 947 5.2.3 Examples 949 Example of use of the MODE READER command by an authorized client 950 which then terminates the session (see Section 5.4): 951 [C] MODE READER 952 [S] 200 NNTP Service Ready, posting permitted 953 [C] QUIT 954 [S] 205 NNTP Service exits normally 955 [Server closes connection.] 957 Example of use of the MODE READER command by an authorized client 958 that is not permitted to post; it also immediately terminates the 959 session: 960 [C] MODE READER 961 [S] 201 NNTP Service Ready, posting prohibited 962 [C] QUIT 963 [S] 205 NNTP Service exits normally 964 [Server closes connection.] 966 Example of use of MODE READER by a client not authorized to receive 967 service from the server as a news reader: 968 [C] MODE READER 969 [S] 502 NNTP Service permanently unavailable 970 [Server closes connection.] 972 Example of a connection from any client where the server is 973 temporarily unable to provide news reader service: 974 [C] MODE READER 975 [S] 400 NNTP Service temporarily unavailable 976 [Server closes connection.] 978 Example of a facility that requires MODE READER before use, using the 979 preferred response: 981 [C] GROUP misc.test 982 [S] 401 MODE-READER currently in peering mode 983 [C] MODE READER 984 [S] 200 NNTP Service Ready, posting permitted 985 [C] GROUP misc.test 986 [S] 211 1234 3000234 3002322 misc.test 988 Example of a facility that requires MODE READER before use, using the 989 historical but deprecated response: 990 [C] GROUP misc.test 991 [S] 502 Not available in peering mode 992 [C] MODE READER 993 [S] 200 NNTP Service Ready, posting permitted 994 [C] GROUP misc.test 995 [S] 211 1234 3000234 3002322 misc.test 997 Example of a facility that cannot be used after MODE READER: 998 [C] IHAVE 999 [S] 435 Duplicate 1000 [C] MODE READER 1001 [S] 200 Reader mode, posting permitted 1002 [C] IHAVE 1003 [S] 502 Permission denied 1005 5.3 LIST EXTENSIONS 1007 5.3.1 Usage 1009 This command is optional. 1010 Syntax 1011 LIST EXTENSIONS 1012 Responses 1013 202 Extension list follows (multiline) 1014 402 Server has no extensions 1016 5.3.2 Description 1018 The LIST EXTENSIONS command allows a client to determine which 1019 extensions are supported by the server at any given time. See 1020 Section 8 for further discussion of extensions. 1022 This command MUST be implemented by any server that implements any 1023 registered extension, and is optional otherwise. A server MUST NOT 1024 generate the generic response 401, 480, 483, or 502 (all of which 1025 indicate "not permitted") to this command. 1027 This command MAY be issued at anytime during a session. It is not 1028 required that the client issues this command before attempting to 1029 make use of any extension. The response generated by this command 1030 MAY change during a session because of other state information (which 1031 in turn may be changed by the effects of other commands). An NNTP 1032 client is only able to get the current and correct information 1033 concerning available extensions at any point during a session by 1034 issuing a LIST EXTENSIONS command at that point of that session and 1035 processing the response, and the server MUST ensure that those 1036 extensions currently listed in the returned information are 1037 available. Therefore, if an extension (including those in Section 8) 1038 is only available before or after a MODE READER command, the LIST 1039 EXTENSIONS command MUST only include the extension in that situation. 1040 Similarly, if only some of the commands in an extension will be 1041 available, or if the behaviour of the extension will change in some 1042 other manner, before or after a MODE READER command, this MUST be 1043 indicated by different arguments to the extension-label in the 1044 results of LIST EXTENSIONS in each situation. 1046 While some extensions are likely to be always available or never 1047 available, others will "appear" and "disappear" depending on server 1048 state changes within the session or external events between sessions. 1049 An NNTP client MAY cache the results of this command, but MUST NOT 1050 rely on the correctness of any cached results, whether from earlier 1051 in this session or from a previous session, MUST cope gracefully with 1052 the cached status being out of date, and SHOULD (if caching results) 1053 provide a way to force the cached information to be refreshed. 1054 Furthermore, a client MUST NOT use cached results in relation to 1055 security, privacy, and authentication extensions. See Section 11.6 1056 for further discussion of this topic. 1058 The list of extensions is returned as a multi-line response following 1059 the 202 response code. Each extension is listed on a separate line; 1060 the line MUST begin with an extension-label and optionally one or 1061 more arguments (separated by one or more spaces). The 1062 extension-label and the meaning of the arguments are specified as 1063 part of the definition of the extension. The extension-label is a 1064 string of 1 to 12 US-ASCII letters and MUST be in uppercase (that is, 1065 %x41-5A). Arguments are strings of 1 or more printable UTF-8 1066 characters (that is, either printable US-ASCII characters or any 1067 UTF-8 sequence outside the US-ASCII range, but not space or TAB). 1069 The server MUST NOT list the same extension twice in the response, 1070 MUST list all supported registered extensions, and SHOULD list all 1071 supported private extensions. The order in which the extensions are 1072 listed is not significant. The server need not even consistently 1073 return the same order. If the server does not support any 1074 extensions, it MUST return an empty list. The 402 response code is 1075 documented for historic reasons only; clients SHOULD handle it 1076 gracefully, but servers MUST NOT generate it. 1078 Following a generic failure response, such as 403, an extension might 1079 still be available, and the client MAY attempt to use it. 1081 5.3.3 Examples 1083 Example of a successful response: 1084 [C] LIST EXTENSIONS 1085 [S] 202 Extensions supported: 1086 [S] OVER MSGID 1087 [S] HDR 1088 [S] LISTGROUP 1089 [S] . 1090 The particular extensions shown here are simply examples of what 1091 might be defined in other places, and no particular meaning should be 1092 attributed to them. 1094 Example where no extensions are available: 1095 [C] LIST EXTENSIONS 1096 [S] 202 Extensions supported: 1097 [S] . 1099 Example from a non-conforming server which indicates "no extensions 1100 available" using the 402 response code: 1101 [C] LIST EXTENSIONS 1102 [S] 402 Server has no extensions 1104 5.4 QUIT 1106 5.4.1 Usage 1108 Syntax 1109 QUIT 1110 Responses 1111 205 Connection closing 1113 5.4.2 Description 1115 The client uses the QUIT command to terminate the session. The 1116 server MUST acknowledge the QUIT command and then close the 1117 connection to the client. This is the preferred method for a client 1118 to indicate that it has finished all its transactions with the NNTP 1119 server. 1121 If a client simply disconnects (or the connection times out or some 1122 other fault occurs), the server MUST gracefully cease its attempts to 1123 service the client, disconnecting from its end if necessary. 1125 The server MUST NOT generate any response code to the QUIT command 1126 other than 205 or, if any arguments are provided, 501. 1128 5.4.3 Examples 1130 [C] QUIT 1131 [S] 205 closing connection 1132 [Server closes connection.] 1134 6. Article posting and retrieval 1136 News reading clients have available a variety of mechanisms to 1137 retrieve articles via NNTP. The news articles are stored and indexed 1138 using three types of keys. One key is the message-id of an article. 1139 Another key is composed of the newsgroup name and the article number 1140 within that newsgroup. That key MUST be unique to a particular 1141 server (there will be only one article with that number within a 1142 particular newsgroup), but is not required to be globally unique. 1143 Additionally, because the same article can be cross-posted to 1144 multiple newsgroups, there may be multiple keys that point to the 1145 same article on the same server. The final key is the arrival 1146 timestamp, giving the time that the article arrived at the server. 1148 The server MUST ensure that article numbers are issued in order of 1149 arrival timestamp; that is, articles arriving later MUST have higher 1150 numbers than those that arrive earlier. The server SHOULD allocate 1151 the next sequential unused number to each new article. 1153 Article numbers MUST lie between 1 and 4,294,967,295 inclusive. The 1154 client and server MAY use leading zeroes in specifying article 1155 numbers, but MUST NOT use more than 16 digits. In some situations, 1156 the value zero replaces an article number to show some special 1157 situation. 1159 6.1 Group and article selection 1161 The following commands are used to set the "current selected 1162 newsgroup" and the "current article number", which are used by 1163 various commands. At the start of an NNTP session, both of these 1164 values are set to the special value "invalid". 1166 6.1.1 GROUP 1168 6.1.1.1 Usage 1170 Syntax 1171 GROUP group 1172 Responses 1173 211 number low high group Group successfully selected 1174 411 No such newsgroup 1175 Parameters 1176 group = name of newsgroup 1177 number = estimated number of articles in the group 1178 low = reported low water mark 1179 high = reported high water mark 1181 6.1.1.2 Description 1183 The required argument is the name of the newsgroup to be selected 1184 (e.g. "news.software.b"). A list of valid newsgroups may be 1185 obtained by using the LIST ACTIVE command (see Section 7.6.1). 1187 The successful selection response will return the article numbers of 1188 the first and last articles in the group at the moment of selection 1189 (these numbers are referred to as the "reported low water mark" and 1190 the "reported high water mark"), and an estimate of the number of 1191 articles in the group currently available. 1193 If the group is not empty, the estimate MUST be at least the actual 1194 number of articles available, and MUST be no greater than one more 1195 than the difference between the reported low and high water marks. 1196 (Some implementations will actually count the number of articles 1197 currently stored. Others will just subtract the low water mark from 1198 the high water mark and add one to get an estimate.) 1200 If the group is empty, one of the following three situations will 1201 occur. Clients MUST accept all three cases; servers MUST NOT 1202 represent an empty group in any other way. 1203 o The high water mark will be one less than the low water mark, and 1204 the estimated article count will be zero. Servers SHOULD use this 1205 method to show an empty group. This is the only time that the 1206 high water mark can be less than the low water mark. 1207 o All three numbers will be zero. 1208 o The high water mark is greater than or equal to the low water 1209 mark. The estimated article count might be zero or non-zero; if 1210 non-zero, the same requirements apply as for a non-empty group. 1212 The set of articles in a group may change after the GROUP command is 1213 carried out. That is: 1214 o articles may be removed from the group 1215 o articles may be reinstated in the group with the same article 1216 number, but those articles MUST have numbers no less than the 1217 reported low water mark (note that this is a reinstatement of the 1218 previous article, not a new article reusing the number) 1219 o new articles may be added with article numbers greater than the 1220 reported high water mark (if an article that was the one with the 1221 highest number has been removed and the high water mark adjusted 1222 accordingly, the next new article will not have the number one 1223 greater than the reported high water mark) 1225 Except when the group is empty and all three numbers are zero, 1226 whenever a subsequent GROUP command for the same newsgroup is issued, 1227 either by the same client or a different client, the reported low 1228 water mark in the response MUST be no less than that in any previous 1229 response for that newsgroup in any session, and SHOULD be no less 1230 than that in any previous response for that newsgroup ever sent to 1231 any client. Any failure to meet the latter condition SHOULD be 1232 transient only. The client may make use of the low water mark to 1233 remove all remembered information about articles with lower numbers, 1234 as these will never recur. This includes the situation when the high 1235 water mark is one less than the low water mark. No similar 1236 assumption can be made about the high water mark, as this can 1237 decrease if an article is removed, and then increase again if it is 1238 reinstated or if new articles arrive. 1240 When a valid group is selected by means of this command, the current 1241 selected newsgroup MUST be set to that group and the current article 1242 number MUST be set to the first article in the group. If an empty 1243 newsgroup is selected, the current article pointer is made invalid. 1244 If an invalid group is specified, the current selected newsgroup and 1245 current article number MUST NOT be changed. 1247 The GROUP command (or the LISTGROUP command, if implemented) MUST be 1248 used by a client and a successful response received before any other 1249 command is used that depends on the value of the current selected 1250 newsgroup or current article number. 1252 If the group specified is not available on the server, a 411 response 1253 MUST be returned. 1255 6.1.1.3 Examples 1257 Example for a group known to the server: 1258 [C] GROUP misc.test 1259 [S] 211 1234 3000234 3002322 misc.test 1261 Example for a group unknown to the server: 1262 [C] GROUP example.is.sob.bradner.or.barber 1263 [S] 411 example.is.sob.bradner.or.barber is unknown 1265 Example of an empty group using the preferred response: 1266 [C] GROUP example.currently.empty.newsgroup 1267 [S] 211 0 4000 3999 example.currently.empty.newsgroup 1269 Example of an empty group using an alternative response: 1270 [C] GROUP example.currently.empty.newsgroup 1271 [S] 211 0 0 0 example.currently.empty.newsgroup 1273 Example of an empty group using a different alternative response: 1274 [C] GROUP example.currently.empty.newsgroup 1275 [S] 211 0 4000 4321 example.currently.empty.newsgroup 1277 6.1.2 LAST 1279 6.1.2.1 Usage 1281 Syntax 1282 LAST 1283 Responses 1284 223 n message-id Article found 1285 412 No newsgroup selected 1286 420 Current article number is invalid 1287 422 No previous article in this group 1288 Parameters 1289 n = article number 1290 message-id = article message-id 1292 6.1.2.2 Description 1294 If the current selected newsgroup is valid, the current article 1295 number MUST be set to the previous article in that newsgroup (that 1296 is, the highest existing article number less than the current article 1297 number). If successful, a response indicating the new current 1298 article number and the message-id of that article MUST be returned. 1299 No article text is sent in response to this command. 1301 There MAY be no previous article in the group, although the current 1302 article number is not the reported low water mark. There MUST NOT be 1303 a previous article when the current article number is the reported 1304 low water mark. 1306 Because articles can be removed and added, the results of multiple 1307 LAST and NEXT commands MAY not be consistent over the life of a 1308 particular NNTP session. 1310 If the current article number is already the first article of the 1311 newsgroup, a 422 response MUST be returned. If the current article 1312 number is invalid, a 420 response MUST be returned. If the current 1313 selected newsgroup is invalid, a 412 response MUST be returned. In 1314 all three cases the current selected newsgroup and current article 1315 number MUST NOT be altered. 1317 6.1.2.3 Examples 1319 Example of a successful article retrieval using LAST: 1320 [C] GROUP misc.test 1321 [S] 211 1234 3000234 3002322 misc.test 1322 [C] NEXT 1323 [S] 223 3000237 <668929@example.org> retrieved 1324 [C] LAST 1326 [S] 223 3000234 <45223423@example.com> retrieved 1328 Example of an attempt to retrieve an article without having selected 1329 a group (via the GROUP command) first: 1330 [Assumes current selected newsgroup is invalid.] 1331 [C] LAST 1332 [S] 412 no newsgroup selected 1334 Example of an attempt to retrieve an article using the LAST command 1335 when the current article number is that of the first article in the 1336 group: 1337 [C] GROUP misc.test 1338 [S] 211 1234 3000234 3002322 misc.test 1339 [C] LAST 1340 [S] 422 No previous article to retrieve 1342 Example of an attempt to retrieve an article using the LAST command 1343 when the current selected newsgroup is empty: 1344 [C] GROUP example.empty.newsgroup 1345 [S] 211 0 0 0 example.empty.newsgroup 1346 [C] LAST 1347 [S] 420 No current article selected 1349 6.1.3 NEXT 1351 6.1.3.1 Usage 1353 Syntax 1354 NEXT 1355 Responses 1356 223 n message-id Article found 1357 412 No newsgroup selected 1358 420 Current article number is invalid 1359 421 No next article in this group 1360 Parameters 1361 n = article number 1362 message-id = article message-id 1364 6.1.3.2 Description 1366 If the current selected newsgroup is valid, the current article 1367 number MUST be set to the next article in that newsgroup (that is, 1368 the lowest existing article number greater than the current article 1369 number). If successful, a response indicating the new current 1370 article number and the message-id of that article MUST be returned. 1371 No article text is sent in response to this command. 1373 If the current article number is already the last article of the 1374 newsgroup, a 421 response MUST be returned. In all other aspects 1375 (apart, of course, from the lack of 422 response) this command is 1376 identical to the LAST command (Section 6.1.2). 1378 6.1.3.3 Examples 1380 Example of a successful article retrieval using NEXT: 1381 [C] GROUP misc.test 1382 [S] 211 1234 3000234 3002322 misc.test 1383 [C] NEXT 1384 [S] 223 3000237 <668929@example.org> retrieved 1386 Example of an attempt to retrieve an article without having selected 1387 a group (via the GROUP command) first: 1388 [Assumes current selected newsgroup is invalid.] 1389 [C] NEXT 1390 [S] 412 no newsgroup selected 1392 Example of an attempt to retrieve an article using the NEXT command 1393 when the current article number is that of the last article in the 1394 group: 1395 [C] GROUP misc.test 1396 [S] 211 1234 3000234 3002322 misc.test 1397 [C] STAT 3002322 1398 [S] 223 3002322 <411@example.net> retrieved 1399 [C] NEXT 1400 [S] 421 No next article to retrieve 1402 Example of an attempt to retrieve an article using the NEXT command 1403 when the current selected newsgroup is empty: 1404 [C] GROUP example.empty.newsgroup 1405 [S] 211 0 0 0 example.empty.newsgroup 1406 [C] NEXT 1407 [S] 420 No current article selected 1409 6.2 Retrieval of articles and article sections 1411 The ARTICLE, BODY, HEAD, and STAT commands are very similar. They 1412 differ only in the parts of the article that are presented to the 1413 client and in the successful response code. The ARTICLE command is 1414 described here in full, while the other commands are described in 1415 terms of the differences. As specified in Section 3.4, an article 1416 consists of two parts: the article headers and the article body. 1417 When responding to one of these commands, the server MUST present the 1418 entire article or appropriate part and MUST NOT attempt to alter or 1419 translate it in any way. 1421 6.2.1 ARTICLE 1423 6.2.1.1 Usage 1425 Syntax 1426 ARTICLE message-id 1427 ARTICLE number 1428 ARTICLE 1429 Responses 1430 First form (message-id specified) 1431 220 0|n message-id Article follows (multiline) 1432 430 No article with that message-id 1433 Second form (article number specified) 1434 220 n message-id Article follows (multiline) 1435 412 No newsgroup selected 1436 423 No article with that number 1437 Third form (current article number used) 1438 220 n message-id Article follows (multiline) 1439 412 No newsgroup selected 1440 420 Current article number is invalid 1441 Parameters 1442 number = Requested article number 1443 n = Returned article number 1444 message-id = Article message-id 1446 6.2.1.2 Description 1448 The ARTICLE command selects an article based on the arguments and 1449 presents the entire article (that is, the headers, an empty line, and 1450 the body in that order). The command has three forms. 1452 In the first form, a message-id is specified and the server presents 1453 the article with that message-id. In this case, the server MUST NOT 1454 alter the current selected newsgroup or current article number. This 1455 is both to facilitate the presentation of articles that may be 1456 referenced within another article being read, and because of the 1457 semantic difficulties of determining the proper sequence and 1458 membership of an article that may have been cross-posted to more than 1459 one newsgroup. 1461 In the response, the article number MUST be replaced with zero, 1462 except that if there is a current selected group and the article is 1463 present in that group, the server MAY use that article number. (The 1464 server is not required to determine whether the article is in the 1465 current selected newsgroup or, if so, what article number it has; the 1466 client MUST always be prepared for zero to be specified.) The server 1467 MUST NOT provide an article number unless use of that number in a 1468 second ARTICLE command immediately following this one would return 1469 the same article. Even if the server chooses to return article 1470 numbers in these circumstances, it need not do so consistently; it 1471 MAY return zero to any such command (also see the STAT examples 1472 (Section 6.2.4.3)). 1474 In the second form, an article number is specified. If there is an 1475 article with that number in the current selected newsgroup, the 1476 server MUST set the current article number to that number. 1478 In the third form, the article indicated by the current article 1479 number in the current selected newsgroup is used. 1481 Note that a previously valid article number MAY become invalid if the 1482 article has been removed. A previously invalid article number MAY 1483 become valid if the article has been reinstated, but such an article 1484 number MUST be no less than the reported low water mark for that 1485 group. 1487 The server MUST NOT change the current selected newsgroup as a result 1488 of this command. The server MUST NOT change the current article 1489 number except when an article number argument was provided and the 1490 article exists; in particular, it MUST NOT change it following an 1491 unsuccessful response. 1493 Since the message-id is unique for each article, it may be used by a 1494 client to skip duplicate displays of articles that have been posted 1495 more than once, or to more than one newsgroup. 1497 The article is returned as a multi-line response following the 220 1498 response code. 1500 If the argument is a message-id and no such article exists, a 430 1501 response MUST be returned. If the argument is a number or is omitted 1502 and the current selected newsgroup is invalid, a 412 response MUST be 1503 returned. If the argument is a number and that article does not 1504 exist in the current selected newsgroup, a 423 response MUST be 1505 returned. If the argument is omitted and the current article number 1506 is invalid, a 420 response MUST be returned. 1508 6.2.1.3 Examples 1510 Example of a successful retrieval of an article (using no article 1511 number): 1512 [C] GROUP misc.test 1513 [S] 211 1234 3000234 3002322 misc.test 1514 [C] ARTICLE 1515 [S] 220 3000234 <45223423@example.com> 1516 [S] Path: pathost!demo!whitehouse!not-for-mail 1518 [S] From: "Demo User" 1519 [S] Newsgroups: misc.test 1520 [S] Subject: I am just a test article 1521 [S] Date: 6 Oct 1998 04:38:40 -0500 1522 [S] Organization: An Example Net, Uncertain, Texas 1523 [S] Message-ID: <411@example.net> 1524 [S] 1525 [S] This is just a test article. 1526 [S] . 1528 Example of a successful retrieval of an article by message-id: 1529 [C] ARTICLE <45223423@example.com> 1530 [S] 220 0 <45223423@example.com> 1531 [S] Path: pathost!demo!whitehouse!not-for-mail 1532 [S] From: "Demo User" 1533 [S] Newsgroups: misc.test 1534 [S] Subject: I am just a test article 1535 [S] Date: 6 Oct 1998 04:38:40 -0500 1536 [S] Organization: An Example Net, Uncertain, Texas 1537 [S] Message-ID: <411@example.net> 1538 [S] 1539 [S] This is just a test article. 1540 [S] . 1542 Example of an unsuccessful retrieval of an article by message-id: 1543 [C] ARTICLE 1544 [S] 430 No Such Article Found 1546 Example of an unsuccessful retrieval of an article by number: 1547 [C] GROUP misc.test 1548 [S] 211 1234 3000234 3002322 news.groups 1549 [C] ARTICLE 300256 1550 [S] 423 No article with that number 1552 Example of an unsuccessful retrieval of an article by number because 1553 no newsgroup was selected first: 1554 [Assumes current selected newsgroup is invalid.] 1555 [C] ARTICLE 300256 1556 [S] 412 No newsgroup selected 1558 Example of an attempt to retrieve an article when the current 1559 selected newsgroup is empty: 1560 [C] GROUP example.empty.newsgroup 1561 [S] 211 0 0 0 example.empty.newsgroup 1562 [C] ARTICLE 1563 [S] 420 No current article selected 1565 6.2.2 HEAD 1567 6.2.2.1 Usage 1569 Syntax 1570 HEAD message-id 1571 HEAD number 1572 HEAD 1573 Responses 1574 First form (message-id specified) 1575 221 0|n message-id Headers follow (multiline) 1576 430 No article with that message-id 1577 Second form (article number specified) 1578 221 n message-id Headers follow (multiline) 1579 412 No newsgroup selected 1580 423 No article with that number 1581 Third form (current article number used) 1582 221 n message-id Headers follow (multiline) 1583 412 No newsgroup selected 1584 420 Current article number is invalid 1585 Parameters 1586 number = Requested article number 1587 n = Returned article number 1588 message-id = Article message-id 1590 6.2.2.2 Description 1592 The HEAD command behaves identically to the ARTICLE command except 1593 that, if the article exists, the response code is 221 instead of 220 1594 and only the headers are presented (the empty line separating the 1595 headers and body MUST NOT be included). 1597 6.2.2.3 Examples 1599 Example of a successful retrieval of the headers of an article (using 1600 no article number): 1601 [C] GROUP misc.test 1602 [S] 211 1234 3000234 3002322 misc.test 1603 [C] HEAD 1604 [S] 221 3000234 <45223423@example.com> 1605 [S] Path: pathost!demo!whitehouse!not-for-mail 1606 [S] From: "Demo User" 1607 [S] Newsgroups: misc.test 1608 [S] Subject: I am just a test article 1609 [S] Date: 6 Oct 1998 04:38:40 -0500 1610 [S] Organization: An Example Net, Uncertain, Texas 1611 [S] Message-ID: <411@example.net> 1612 [S] . 1614 Example of a successful retrieval of the headers of an article by 1615 message-id: 1616 [C] HEAD <45223423@example.com> 1617 [S] 221 0 <45223423@example.com> 1618 [S] Path: pathost!demo!whitehouse!not-for-mail 1619 [S] From: "Demo User" 1620 [S] Newsgroups: misc.test 1621 [S] Subject: I am just a test article 1622 [S] Date: 6 Oct 1998 04:38:40 -0500 1623 [S] Organization: An Example Net, Uncertain, Texas 1624 [S] Message-ID: <411@example.net> 1625 [S] . 1627 Example of an unsuccessful retrieval of the headers of an article by 1628 message-id: 1629 [C] HEAD 1630 [S] 430 No Such Article Found 1632 Example of an unsuccessful retrieval of the headers of an article by 1633 number: 1634 [C] GROUP misc.test 1635 [S] 211 1234 3000234 3002322 misc.test 1636 [C] HEAD 300256 1637 [S] 423 No article with that number 1639 Example of an unsuccessful retrieval of the headers of an article by 1640 number because no newsgroup was selected first: 1641 [Assumes current selected newsgroup is invalid.] 1642 [C] HEAD 300256 1643 [S] 412 No newsgroup selected 1645 Example of an attempt to retrieve the headers of an article when the 1646 current selected newsgroup is empty: 1647 [C] GROUP example.empty.newsgroup 1648 [S] 211 0 0 0 example.empty.newsgroup 1649 [C] HEAD 1650 [S] 420 No current article selected 1652 6.2.3 BODY 1654 6.2.3.1 Usage 1656 Syntax 1657 BODY message-id 1658 BODY number 1659 BODY 1661 Responses 1662 First form (message-id specified) 1663 222 0|n message-id Body follows (multiline) 1664 430 No article with that message-id 1665 Second form (article number specified) 1666 222 n message-id Body follows (multiline) 1667 412 No newsgroup selected 1668 423 No article with that number 1669 Third form (current article number used) 1670 222 n message-id Body follows (multiline) 1671 412 No newsgroup selected 1672 420 Current article number is invalid 1673 Parameters 1674 number = Requested article number 1675 n = Returned article number 1676 message-id = Article message-id 1678 6.2.3.2 Description 1680 The BODY command behaves identically to the ARTICLE command except 1681 that, if the article exists, the response code is 222 instead of 220 1682 and only the body is presented (the empty line separating the headers 1683 and body MUST NOT be included). 1685 6.2.3.3 Examples 1687 Example of a successful retrieval of the body of an article (using no 1688 article number): 1689 [C] GROUP misc.test 1690 [S] 211 1234 3000234 3002322 misc.test 1691 [C] BODY 1692 [S] 222 3000234 <45223423@example.com> 1693 [S] This is just a test article. 1694 [S] . 1696 Example of a successful retrieval of the body of an article by 1697 message-id: 1698 [C] BODY <45223423@example.com> 1699 [S] 222 0 <45223423@example.com> 1700 [S] This is just a test article. 1701 [S] . 1703 Example of an unsuccessful retrieval of the body of an article by 1704 message-id: 1705 [C] BODY 1706 [S] 430 No Such Article Found 1708 Example of an unsuccessful retrieval of the body of an article by 1709 number: 1710 [C] GROUP misc.test 1711 [S] 211 1234 3000234 3002322 misc.test 1712 [C] BODY 300256 1713 [S] 423 No article with that number 1715 Example of an unsuccessful retrieval of the body of an article by 1716 number because no newsgroup was selected first: 1717 [Assumes current selected newsgroup is invalid.] 1718 [C] BODY 300256 1719 [S] 412 No newsgroup selected 1721 Example of an attempt to retrieve the body of an article when the 1722 current selected newsgroup is empty: 1723 [C] GROUP example.empty.newsgroup 1724 [S] 211 0 0 0 example.empty.newsgroup 1725 [C] BODY 1726 [S] 420 No current article selected 1728 6.2.4 STAT 1730 6.2.4.1 Usage 1732 Syntax 1733 STAT message-id 1734 STAT number 1735 STAT 1736 Responses 1737 First form (message-id specified) 1738 223 0|n message-id Article exists 1739 430 No article with that message-id 1740 Second form (article number specified) 1741 223 n message-id Article exists 1742 412 No newsgroup selected 1743 423 No article with that number 1744 Third form (current article number used) 1745 223 n message-id Article exists 1746 412 No newsgroup selected 1747 420 Current article number is invalid 1748 Parameters 1749 number = Requested article number 1750 n = Returned article number 1751 message-id = Article message-id 1753 6.2.4.2 Description 1755 The STAT command behaves identically to the ARTICLE command except 1756 that, if the article exists, it is NOT presented to the client and 1757 the response code is 223 instead of 220. Note that the response is 1758 NOT multi-line. 1760 This command allows the client to determine whether an article 1761 exists, and in the second and third forms what its message-id is, 1762 without having to process an arbitrary amount of text. 1764 6.2.4.3 Examples 1766 Example of STAT on an existing article (using no article number): 1767 [C] GROUP misc.test 1768 [S] 211 1234 3000234 3002322 misc.test 1769 [C] STAT 1770 [S] 223 3000234 <45223423@example.com> 1772 Example of STAT on an existing article by message-id: 1773 [C] STAT <45223423@example.com> 1774 [S] 223 0 <45223423@example.com> 1776 Example of STAT on an article not on the server by message-id: 1777 [C] STAT 1778 [S] 430 No Such Article Found 1780 Example of STAT on an article not in the server by number: 1781 [C] GROUP misc.test 1782 [S] 211 1234 3000234 3002322 misc.test 1783 [C] STAT 300256 1784 [S] 423 No article with that number 1786 Example of STAT on an article by number when no newsgroup was 1787 selected first: 1788 [Assumes current selected newsgroup is invalid.] 1789 [C] STAT 300256 1790 [S] 412 No newsgroup selected 1792 Example of STAT on an article when the current selected newsgroup is 1793 empty: 1794 [C] GROUP example.empty.newsgroup 1795 [S] 211 0 0 0 example.empty.newsgroup 1796 [C] STAT 1797 [S] 420 No current article selected 1799 Example of STAT by message-id on a server which sometimes reports the 1800 actual article number: 1801 [C] GROUP misc.test 1802 [S] 211 1234 3000234 3002322 misc.test 1803 [C] STAT 1804 [S] 223 3000234 <45223423@example.com> 1806 [C] STAT <45223423@example.com> 1807 [S] 223 0 <45223423@example.com> 1808 [C] STAT <45223423@example.com> 1809 [S] 223 3000234 <45223423@example.com> 1810 [C] GROUP example.empty.newsgroup 1811 [S] 211 0 0 0 example.empty.newsgroup 1812 [C] STAT <45223423@example.com> 1813 [S] 223 0 <45223423@example.com> 1814 [C] GROUP alt.crossposts 1815 [S] 211 9999 111111 222222 alt.crossposts 1816 [C] STAT <45223423@example.com> 1817 [S] 223 123456 <45223423@example.com> 1818 [C] STAT 1819 [S] 223 111111 <23894720@example.com> 1820 The first STAT command establishes the identity of an article in the 1821 group. The second and third show that the server may, but need not, 1822 give the article number when the message-id is specified. The fourth 1823 STAT command shows that zero must be specified if the article isn't 1824 in the current selected group, the fifth shows that the number, if 1825 provided, must be that relating to the current selected group, and 1826 the last one shows that the current selected article is still not 1827 changed by the use of STAT with a message-id even if it returns an 1828 article number. 1830 6.3 Article posting 1832 Article posting is done in one of two modes: individual article 1833 posting from news reading clients using POST, and article transfer 1834 from other news servers using IHAVE. 1836 6.3.1 POST 1838 6.3.1.1 Usage 1840 This command MUST NOT be pipelined. 1841 Syntax 1842 POST 1843 Responses 1844 Initial responses 1845 340 Send article to be posted 1846 440 Posting not permitted 1847 Subsequent responses 1848 240 Article received OK 1849 441 Posting failed 1851 6.3.1.2 Description 1853 If posting is allowed, a 340 response MUST be returned to indicate 1854 that the article to be posted should be sent. If posting is 1855 prohibited for some installation-dependent reason, a 440 response 1856 MUST be returned. 1858 If posting is permitted, the article MUST be in the format specified 1859 in Section 3.4 and MUST be sent by the client to the server in the 1860 manner specified (in Section 3.1) for multi-line responses (except 1861 that there is no initial line containing a response code). Thus a 1862 single dot (".") on a line indicates the end of the text, and lines 1863 starting with a dot in the original text have that dot doubled during 1864 transmission. 1866 Following the presentation of the termination sequence by the client, 1867 the server MUST return a response indicating success or failure of 1868 the article transfer. Note that response codes 340 and 440 are used 1869 in direct response to the POST command. Others are returned 1870 following the sending of the article. 1872 A response of 240 SHOULD indicate that, barring unforeseen server 1873 errors, the posted article will be made available on the server and/ 1874 or transferred to other servers as appropriate, possibly following 1875 further processing. In other words, articles not wanted by the 1876 server SHOULD be rejected with a 441 response and not accepted and 1877 silently discarded. However, the client SHOULD NOT assume that the 1878 article has been successfully transferred unless it receives an 1879 affirmative response from the server, and SHOULD NOT assume that it 1880 is being made available to other clients without explicitly checking 1881 (for example using the STAT command). 1883 If the session is interrupted before the response is received, it is 1884 possible that an affirmative response was sent but has been lost. 1885 Therefore, in any subsequent session, the client SHOULD either check 1886 whether the article was successfully posted before resending or 1887 ensure that the server will allocate the same message-id to the new 1888 attempt (see Appendix B.2) - the latter approach is preferred since 1889 the article might not have been made available for reading yet (for 1890 example, it may have to go through a moderation process). 1892 6.3.1.3 Examples 1894 Example of a successful posting: 1895 [C] POST 1896 [S] 340 Input article; end with . 1897 [C] From: "Demo User" 1898 [C] Newsgroups: misc.test 1899 [C] Subject: I am just a test article 1900 [C] Organization: An Example Net 1901 [C] 1903 [C] This is just a test article. 1904 [C] . 1905 [S] 240 Article received OK 1907 Example of an unsuccessful posting: 1908 [C] POST 1909 [S] 340 Input article; end with . 1910 [C] From: "Demo User" 1911 [C] Newsgroups: misc.test 1912 [C] Subject: I am just a test article 1913 [C] Organization: An Example Net 1914 [C] 1915 [C] This is just a test article. 1916 [C] . 1917 [S] 441 Posting failed 1919 Example of an attempt to post when posting is not allowed: 1920 [C] MODE READER 1921 [S] 201 NNTP Service Ready, posting prohibited 1922 [C] POST 1923 [S] 440 Posting not permitted 1925 6.3.2 IHAVE 1927 6.3.2.1 Usage 1929 This command MUST NOT be pipelined. 1930 Syntax 1931 IHAVE message-id 1932 Responses 1933 Initial responses 1934 335 Send article to be transferred 1935 435 Article not wanted 1936 436 Transfer not possible; try again later 1937 Subsequent responses 1938 235 Article transferred OK 1939 436 Transfer failed; try again later 1940 437 Transfer rejected; do not retry 1941 Parameters 1942 message-id = Article message-id 1944 6.3.2.2 Description 1946 The IHAVE command informs the server that the client has an article 1947 with the specified message-id. If the server desires a copy of that 1948 article a 335 response MUST be returned, instructing the client to 1949 send the entire article. If the server does not want the article 1950 (if, for example, the server already has a copy of it), a 435 1951 response MUST be returned, indicating that the article is not wanted. 1952 Finally, if the article isn't wanted immediately but the client 1953 should retry later if possible (if, for example, another client is in 1954 the process of sending the same article to the server), a 436 1955 response MUST be returned. 1957 If transmission of the article is requested, the client MUST send the 1958 entire article, including headers and body, in the format defined 1959 above (Section 3.1) for multi-line responses (except that there is no 1960 initial line containing a response code). Thus a single dot (".") on 1961 a line indicates the end of the text, and lines starting with a dot 1962 in the original text have that dot doubled during transmission. The 1963 server MUST return either a 235 response, indicating that the article 1964 was successfully transferred, a 436 response, indicating that the 1965 transfer failed but should be tried again later, or a 437 response, 1966 indicating that the article was rejected. 1968 This function differs from the POST command in that it is intended 1969 for use in transferring already-posted articles between hosts. It 1970 SHOULD NOT be used when the client is a personal news reading 1971 program, since use of this command indicates that the article has 1972 already been posted at another site and is simply being forwarded 1973 from another host. However, despite this, the server MAY elect not 1974 to post or forward the article if, after further examination of the 1975 article, it deems it inappropriate to do so. Reasons for such 1976 subsequent rejection of an article may include such problems as 1977 inappropriate newsgroups or distributions, disc space limitations, 1978 article lengths, garbled headers, and the like. These are typically 1979 restrictions enforced by the server host's news software and not 1980 necessarily the NNTP server itself. 1982 The client SHOULD NOT assume that the article has been successfully 1983 transferred unless it receives an affirmative response from the 1984 server. A lack of response (such as a dropped network connection or 1985 a network timeout) SHOULD be treated the same as a 436 response. 1987 Because some news server software may not be able immediately to 1988 determine whether or not an article is suitable for posting or 1989 forwarding, an NNTP server MAY acknowledge the successful transfer of 1990 the article (with a 235 response) but later silently discard it. 1992 6.3.2.3 Examples 1994 Example of successfully sending an article to another site: 1995 [C] IHAVE 1996 [S] 335 Send it; end with . 1997 [C] Path: pathost!demo!somewhere!not-for-mail 1998 [C] From: "Demo User" 2000 [C] Newsgroups: misc.test 2001 [C] Subject: I am just a test article 2002 [C] Date: 6 Oct 1998 04:38:40 -0500 2003 [C] Organization: An Example Com, San Jose, CA 2004 [C] Message-ID: 2005 [C] 2006 [C] This is just a test article. 2007 [C] . 2008 [S] 235 Article transferred OK 2010 Example of sending an article to another site that rejects it. Note 2011 that the message-id in the IHAVE command is not the same as the one 2012 in the article headers; while this is bad practice and SHOULD NOT be 2013 done, it is not forbidden. 2014 [C] IHAVE 2015 [S] 335 Send it; end with . 2016 [C] Path: pathost!demo!somewhere!not-for-mail 2017 [C] From: "Demo User" 2018 [C] Newsgroups: misc.test 2019 [C] Subject: I am just a test article 2020 [C] Date: 6 Oct 1998 04:38:40 -0500 2021 [C] Organization: An Example Com, San Jose, CA 2022 [C] Message-ID: 2023 [C] 2024 [C] This is just a test article. 2025 [C] . 2026 [S] 437 Article rejected; don't send again 2028 Example of sending an article to another site where the transfer 2029 fails: 2030 [C] IHAVE 2031 [S] 335 Send it; end with . 2032 [C] Path: pathost!demo!somewhere!not-for-mail 2033 [C] From: "Demo User" 2034 [C] Newsgroups: misc.test 2035 [C] Subject: I am just a test article 2036 [C] Date: 6 Oct 1998 04:38:40 -0500 2037 [C] Organization: An Example Com, San Jose, CA 2038 [C] Message-ID: 2039 [C] 2040 [C] This is just a test article. 2041 [C] . 2042 [S] 436 Transfer failed 2044 Example of sending an article to a site that already has it: 2045 [C] IHAVE 2046 [S] 435 Duplicate 2048 Example of sending an article to a site that requests the article be 2049 tried again later: 2050 [C] IHAVE 2051 [S] 436 Retry later 2053 7. Information commands 2055 This section lists other commands that may be used at any time 2056 between the beginning of a session and its termination. Using these 2057 commands does not alter any state information, but the response 2058 generated from their use may provide useful information to clients. 2060 7.1 DATE 2062 7.1.1 Usage 2064 Syntax 2065 DATE 2066 Responses 2067 111 yyyymmddhhmmss server date and time 2068 Parameters 2069 yyyymmddHHmmss = Current UTC date and time on server 2071 7.1.2 Description 2073 This command exists to help clients find out the current Coordinated 2074 Universal Time [TF.686-1] from the server's perspective. This 2075 command SHOULD NOT be used as a substitute for NTP [RFC1305] but to 2076 provide information that might be useful when using the NEWNEWS 2077 command (see Section 7.4). A system providing NNTP service SHOULD 2078 keep the system clock as accurate as possible, either with NTP or by 2079 some other method. 2081 The server MUST return a 111 response specifying the date and time on 2082 the server in the form yyyymmddhhmmss. This date and time is in 2083 Coordinated Universal Time. 2085 7.1.3 Examples 2087 [C] DATE 2088 [S] 111 19990623135624 2090 7.2 HELP 2092 7.2.1 Usage 2094 Syntax 2095 HELP 2096 Responses 2097 100 Help text follows (multiline) 2099 7.2.2 Description 2101 This command provides a short summary of commands that are understood 2102 by this implementation of the server. The help text will be 2103 presented as a multiline response following the 100 response code. 2105 This text is not guaranteed to be in any particular format and MUST 2106 NOT be used by clients as a replacement for the LIST EXTENSIONS 2107 command described in Section 5.3 2109 7.2.3 Examples 2111 [C] HELP 2112 [S] 100 Help text follows 2113 [S] This is some help text. There is no specific 2114 [S] formatting requirement for this test, though 2115 [S] it is customary for it to list the valid commands 2116 [S] and give a brief definition of what they do 2117 [S] . 2119 7.3 NEWGROUPS 2121 7.3.1 Usage 2123 Syntax 2124 NEWGROUPS date time [GMT] 2125 Responses 2126 231 List of new newsgroups follows (multiline) 2127 Parameters 2128 date = Date in yymmdd or yyyymmdd format 2129 time = Time in hhmmss format 2131 7.3.2 Description 2133 This command returns a list of newsgroups created on the server since 2134 the specified date and time. The results are in the same format as 2135 the LIST ACTIVE command (see Section 7.6.1). However, they MAY 2136 include groups not available on the server (and so not returned by 2137 LIST ACTIVE) and MAY omit groups for which the creation date is not 2138 available. The results SHOULD be consistent with those of the LIST 2139 ACTIVE.TIMES command (Section 7.6.2), except that if the specified 2140 date and time is earlier than the oldest entry in the latter then the 2141 results of this command may include extra groups. 2143 The date is specified as 6 or 8 digits in the format [xx]yymmdd, 2144 where xx is the first two digits of the year (19-99), yy is the last 2145 two digits of the year (00-99), mm is the month (01-12), and dd is 2146 the day of the month (01-31). Clients SHOULD specify all four digits 2147 of the year. If the first two digits of the year are not specified 2148 (this is supported only for backwards compatibility), the year is to 2149 be taken from the current century if yy is smaller than or equal to 2150 the current year, otherwise the year is from the previous century. 2152 The time is specified as 6 digits in the format hhmmss, where hh is 2153 the hours in the 24-hour clock (00-23), mm is the minutes (00-59), 2154 and ss is the seconds (00-60, to allow for leap seconds). The token 2155 "GMT" specifies that the date and time are given in Coordinated 2156 Universal Time [TF.686-1]; if it is omitted then the date and time 2157 are specified in the server's local timezone. Note that there is no 2158 way using the protocol specified in this document to establish the 2159 server's local timezone. 2161 Note that an empty list is a possible valid response and indicates 2162 that there are no new newsgroups since that date-time. 2164 Clients SHOULD make all queries using Coordinated Universal Time 2165 (i.e. by including the "GMT" argument) when possible. 2167 7.3.3 Examples 2169 Example where there are new groups: 2170 [C] NEWGROUPS 19990624 000000 GMT 2171 [S] 231 list of new newsgroups follows 2172 [S] alt.rfc-writers.recovery 4 1 y 2173 [S] tx.natives.recovery 89 56 y 2174 [S] . 2176 Example where there are no new groups: 2177 [C] NEWGROUPS 19990624 000000 GMT 2178 [S] 231 list of new newsgroups follows 2179 [S] . 2181 7.4 NEWNEWS 2183 7.4.1 Usage 2185 Syntax 2186 NEWNEWS wildmat date time [GMT] 2187 Responses 2188 230 List of new articles follows (multiline) 2189 Parameters 2190 wildmat = Newsgroups of interest 2191 date = Date in yymmdd or yyyymmdd format 2192 time = Time in hhmmss format 2194 7.4.2 Description 2196 This command returns a list of message-ids of articles posted or 2197 received on the server, in the newsgroups whose names match the 2198 wildmat, since the specified date and time. One message-id is sent 2199 on each line; the order of the response has no specific significance 2200 and may vary from response to response in the same session. A 2201 message-id MAY appear more than once; if it does so, it has the same 2202 meaning as if it appeared only once. 2204 Date and time are in the same format as the NEWGROUPS command (see 2205 Section 7.3). 2207 Note that an empty list is a possible valid response and indicates 2208 that there is currently no new news in the relevant groups. 2210 Clients SHOULD make all queries in Coordinated Universal Time (i.e. 2211 by using the "GMT" argument) when possible. 2213 7.4.3 Examples 2215 Example where there are new articles: 2216 [C] NEWNEWS news.*,sci.* 19990624 000000 GMT 2217 [S] 230 list of new articles by message-id follows 2218 [S] 2219 [S] 2220 [S] . 2222 Example where there are no new articles: 2223 [C] NEWNEWS alt.* 19990624 000000 GMT 2224 [S] 230 list of new articles by message-id follows 2225 [S] . 2227 7.5 Time 2229 As described in Section 6, each article has an arrival timestamp. 2230 Each newsgroup also has a creation timestamp. These timestamps are 2231 used by the NEWNEWS and NEWGROUP commands to construct their 2232 responses. 2234 The DATE command MUST return a timestamp from the same clock as is 2235 used for determining article arrival and group creation times. This 2236 clock SHOULD be monotonic, and adjustments SHOULD be made by running 2237 it fast or slow compared to "real" time rather than by making sudden 2238 jumps. 2240 Clients can ensure that they do not have gaps in lists of articles or 2241 groups by using the DATE command in the following manner: 2243 First session: 2244 Issue DATE command and record result 2245 Issue NEWNEWS command using a previously chosen timestamp 2246 Subsequent sessions: 2247 Issue DATE command and hold result in temporary storage 2248 Issue NEWNEWS command using timestamp saved from previous session 2249 Overwrite saved timestamp with that currently in temporary storage 2250 In order to allow for minor errors, clients MAY want to adjust the 2251 timestamp back by two or three minutes before using it in NEWNEWS. 2253 7.5.1 Examples 2255 First session: 2256 [C] DATE 2257 [S] 111 20010203112233 2258 [C] NEWNEWS local.chat 20001231 235959 GMT 2259 [S] 230 list follows 2260 [S] 2261 [S] 2262 [S] 2263 [S] . 2264 Second session (the client has subtracted 3 minutes from the 2265 timestamp returned previously): 2266 [C] DATE 2267 [S] 111 20010204003344 2268 [C] NEWNEWS local.chat 20010203 111933 GMT 2269 [S] 230 list follows 2270 [S] 2271 [S] 2272 [S] 2273 [S] . 2274 Note how arrived in the 3 minute gap and so 2275 is listed in both responses. 2277 7.6 The LIST commands 2279 7.6.1 LIST ACTIVE 2281 7.6.1.1 Usage 2283 Syntax 2284 LIST ACTIVE [wildmat] 2285 Responses 2286 215 Information follows (multiline) 2287 Parameters 2288 wildmat = groups of interest 2290 7.6.1.2 Description 2292 The LIST ACTIVE command with no arguments returns a list of valid 2293 newsgroups and associated information. The server MUST include every 2294 group that the client is permitted to select with the GROUP (Section 2295 6.1.1) command. Each newsgroup is sent as a line of text in the 2296 following format: 2297 group high low status 2298 where: 2299 "group" is the name of the newsgroup; 2300 "high" is the reported high water mark for the group; 2301 "low" is the reported low water mark for the group; 2302 "status" is the current status of the group on this server. 2303 Each field in the line is separated from its neighbouring fields by 2304 one or more spaces. 2306 Note that an empty list is a possible valid response, and indicates 2307 that there are currently no valid newsgroups. 2309 The reported high and low water marks are as described in the GROUP 2310 command (see Section 6.1.1). 2312 The status field is typically one of: 2313 "y" posting is permitted 2314 "n" posting is not permitted 2315 "m" postings will be forwarded to the newsgroup moderator 2316 The server SHOULD use these values when these meanings are required 2317 and MUST NOT use them with any other meaning. Other values for the 2318 status may exist; the definition of these other values and the 2319 circumstances under which they are returned may be specified in an 2320 extension or may be private to the server. A client SHOULD treat an 2321 unrecognized status as giving no information. 2323 The status of a newsgroup only indicates how posts to that newsgroup 2324 are normally processed and is not necessarily customised to the 2325 specific client. For example, if the current client is forbidden 2326 from posting, then this will apply equally to groups with status "y". 2327 Conversely, a client with special privileges (not defined by this 2328 specification) might be able to post to a group with status "n". 2330 If the optional wildmat argument is specified, the response is 2331 limited to only the groups (if any) whose names match the wildmat. 2332 If no wildmat is specified, the keyword ACTIVE MAY be omitted without 2333 altering the effect of the command. 2335 7.6.1.3 Examples 2337 Example of LIST ACTIVE returning a list of newsgroups: 2339 [C] LIST ACTIVE 2340 [S] 215 list of newsgroups follows 2341 [S] misc.test 3002322 3000234 y 2342 [S] comp.risks 442001 441099 m 2343 [S] alt.rfc-writers.recovery 4 1 y 2344 [S] tx.natives.recovery 89 56 y 2345 [S] tx.natives.recovery.d 11 9 n 2346 [S] . 2348 The same output on an implementation that includes leading zeroes: 2349 [C] LIST ACTIVE 2350 [S] 215 list of newsgroups follows 2351 [S] misc.test 0003002322 0003000234 y 2352 [S] comp.risks 0000442001 0000441099 m 2353 [S] alt.rfc-writers.recovery 0000000004 0000000001 y 2354 [S] tx.natives.recovery 0000000089 0000000056 y 2355 [S] tx.natives.recovery.d 0000000011 0000000009 n 2356 [S] . 2358 Example of LIST ACTIVE omitting the second keyword and returning no 2359 newsgroups: 2360 [C] LIST 2361 [S] 215 list of newsgroups follows 2362 [S] . 2364 Example of LIST ACTIVE with a wildmat: 2365 [C] LIST ACTIVE *.recovery 2366 [S] 215 list of newsgroups follows 2367 [S] alt.rfc-writers.recovery 4 1 y 2368 [S] tx.natives.recovery 89 56 y 2369 [S] . 2371 7.6.2 LIST ACTIVE.TIMES 2373 7.6.2.1 Usage 2375 This command is optional. 2376 Syntax 2377 LIST ACTIVE.TIMES [wildmat] 2378 Responses 2379 215 Information follows (multiline) 2380 Parameters 2381 wildmat = groups of interest 2383 7.6.2.2 Description 2385 The active.times list is maintained by some news transport systems to 2386 contain information about who created a particular newsgroup and 2387 when. Each line of this list consists of three fields separated from 2388 each other by one or more spaces. The first field is the name of the 2389 newsgroup. The second is the time when this group was created on 2390 this news server, measured in seconds since the start of January 1, 2391 1970. The third is plain text intended to describe the entity that 2392 created the newsgroup; it is often a mailbox as defined in RFC 2822 2393 [RFC2822]. 2395 The list MAY omit newsgroups for which the information is unavailable 2396 and MAY include groups not available on the server; in particular, it 2397 MAY omit all groups created before the date and time of the oldest 2398 entry. The client MUST NOT assume that the list is complete or that 2399 it matches the list returned by LIST ACTIVE. The NEWGROUPS command 2400 (Section 7.3) may provide a better way to access this information and 2401 the results of the two commands SHOULD be consistent (subject to the 2402 caveats in the description of that command). 2404 If the information is available, it is returned as a multi-line 2405 response following the 215 response code. If the optional wildmat 2406 argument is specified, the response is limited to only the groups (if 2407 any) whose names match the wildmat and for which the information is 2408 available. 2410 Note that an empty list is a possible valid response (whether or not 2411 a wildmat is specified) and indicates that there are no groups 2412 meeting the above criteria. 2414 7.6.2.3 Examples 2416 Example of LIST ACTIVE.TIMES returning a list of newsgroups: 2417 [C] LIST ACTIVE.TIMES 2418 [S] 215 information follows 2419 [S] misc.test 930445408 2420 [S] alt.rfc-writers.recovery 930562309 2421 [S] tx.natives.recovery 930678923 2422 [S] . 2424 Example of LIST ACTIVE.TIMES returning an error where the command is 2425 recognized but the software does not maintain this information: 2426 [C] LIST ACTIVE.TIMES 2427 [S] 503 program error, function not performed 2429 Example of LIST ACTIVE.TIMES sent to a server that does not recognize 2430 this command: 2431 [C] LIST ACTIVE.TIMES 2432 [S] 501 Syntax Error 2434 7.6.3 LIST DISTRIBUTIONS 2436 7.6.3.1 Usage 2438 This command is optional. 2439 Syntax 2440 LIST DISTRIBUTIONS 2441 Responses 2442 215 Information follows (multiline) 2444 7.6.3.2 Description 2446 The distributions list is maintained by some news transport systems 2447 to contain information about valid values for the content of the 2448 Distribution header in a news article and about what the various 2449 values mean. Each line of this list consists of two fields separated 2450 from each other by one or more spaces. The first field is a value 2451 and the second is a short explanation of the meaning of that value. 2453 If the information is available, it is returned as a multi-line 2454 response following the 215 response code. 2456 7.6.3.3 Examples 2458 Example of LIST DISTRIBUTIONS returning a list of distributions: 2459 [C] LIST DISTRIBUTIONS 2460 [S] 215 information follows 2461 [S] usa United States of America 2462 [S] na North America 2463 [S] world All over the World 2464 [S] . 2466 Example of LIST DISTRIBUTIONS returning an error where the command is 2467 recognized but the software does not maintain this information: 2468 [C] LIST DISTRIBUTIONS 2469 [S] 503 program error, function not performed 2471 Example of LIST DISTRIBUTIONS sent to a server that does not 2472 recognize this command: 2473 [C] LIST DISTRIBUTIONS 2474 [S] 501 Syntax Error 2476 7.6.4 LIST DISTRIB.PATS 2478 7.6.4.1 Usage 2479 This command is optional. 2480 Syntax 2481 LIST DISTRIB.PATS 2482 Responses 2483 215 Information follows (multiline) 2485 7.6.4.2 Description 2487 The distrib.pats list is maintained by some news transport systems to 2488 choose a value for the content of the Distribution header of a news 2489 article being posted. Each line of this list consists of three 2490 fields separated from each other by a colon (":"). The first field 2491 is a weight, the second field is a wildmat (which may be a simple 2492 group name), and the third field is a value for the Distribution 2493 header content. 2495 The client MAY use this information to construct an appropriate 2496 Distribution header given the name of a newsgroup. To do so, it 2497 should determine the lines whose second field matches the newsgroup 2498 name, select from among them the line with the highest weight (with 0 2499 being the lowest), and use the value of the third field to construct 2500 the Distribution header. 2502 If the information is available, it is returned as a multi-line 2503 response following the 215 response code. 2505 7.6.4.3 Examples 2507 Example of LIST DISTRIB.PATS returning a list of newsgroups: 2508 [C] LIST DISTRIB.PATS 2509 [S] 215 information follows 2510 [S] 10:local.*:local 2511 [S] 5:*:world 2512 [S] 20:local.here.*:thissite 2513 [S] . 2515 Example of LIST DISTRIB.PATS returning an error where the command is 2516 recognized but the software does not maintain this information: 2517 [C] LIST DISTRIB.PATS 2518 [S] 503 program error, function not performed 2520 Example of LIST DISTRIB.PATS sent to a server that does not recognize 2521 this command: 2522 [C] LIST DISTRIB.PATS 2523 [S] 501 Syntax Error 2525 7.6.5 LIST NEWSGROUPS 2527 7.6.5.1 Usage 2529 This command is optional. 2530 Syntax 2531 LIST NEWSGROUPS [wildmat] 2532 Responses 2533 215 Information follows (multiline) 2534 Parameters 2535 wildmat = groups of interest 2537 7.6.5.2 Description 2539 The newsgroups list is maintained by some news transport systems to 2540 contain the name of each newsgroup that is available on the server 2541 and a short description about the purpose of the group. Each line of 2542 this list consists of two fields separated from each other by one or 2543 more space or TAB characters (usual practice is a single TAB). The 2544 first field is the name of the newsgroup and the second is a short 2545 description of the group. 2547 The list MAY omit newsgroups for which the information is unavailable 2548 and MAY include groups not available on the server. The client MUST 2549 NOT assume that the list is complete or that it matches the list 2550 returned by LIST ACTIVE. 2552 If the information is available, it is returned as a multi-line 2553 response following the 215 response code. If the optional wildmat 2554 argument is specified, the response is limited to only the groups (if 2555 any) whose names match the wildmat and for which the information is 2556 available. 2558 Note that an empty list is a possible valid response (whether or not 2559 a wildmat is specified) and indicates that there are no groups 2560 meeting the above criteria. 2562 7.6.5.3 Examples 2564 Example of LIST NEWSGROUPS returning a list of newsgroups: 2565 [C] LIST NEWSGROUPS 2566 [S] 215 information follows 2567 [S] misc.test General Usenet testing 2568 [S] alt.rfc-writers.recovery RFC Writers Recovery 2569 [S] tx.natives.recovery Texas Natives Recovery 2570 [S] . 2572 Example of LIST NEWSGROUPS returning an error where the command is 2573 recognized but the software does not maintain this information: 2574 [C] LIST NEWSGROUPS 2575 [S] 503 program error, function not performed 2577 Example of LIST NEWSGROUPS sent to a server that does not recognize 2578 this command: 2579 [C] LIST NEWSGROUPS 2580 [S] 501 Syntax error 2582 8. Framework for NNTP extensions 2584 Although NNTP is widely and robustly deployed, some parts of the 2585 Internet community might wish to extend the NNTP service. This 2586 document defines a means whereby an extended NNTP client can query 2587 the server to determine the service extensions that it supports. 2589 It must be emphasized that any extension to the NNTP service should 2590 not be considered lightly. NNTP's strength comes primarily from its 2591 simplicity. Experience with many protocols has shown that: 2592 Protocols with few options tend towards ubiquity, whilst protocols 2593 with many options tend towards obscurity. 2594 This means that each and every extension, regardless of its benefits, 2595 must be carefully scrutinized with respect to its implementation, 2596 deployment, and interoperability costs. In many cases, the cost of 2597 extending the NNTP service will likely outweigh the benefit. 2599 Given this environment, the framework for extensions described in 2600 this document consists of: 2601 o a mechanism for clients to determine a server's available 2602 extensions 2603 o a registry of NNTP service extensions 2605 The LIST EXTENSIONS command is described in this document (see 2606 Section 5.3) and is the mechanism for clients to use to determine 2607 what extensions are available. Except where stated otherwise, the 2608 commands in this document are understood (even if not supported) by 2609 all servers and are not described in the list of features returned by 2610 the LIST EXTENSIONS command. 2612 The IANA shall maintain a registry of NNTP service extensions. 2614 An extension is identified by a unique extension-label, which is a 2615 string of 1 to 12 uppercase US-ASCII letters. The extension-label 2616 will often be the name of a new command that the extension adds. 2617 However this is not a requirement: an extension might not add any new 2618 commands or keywords. 2620 An extension is either a private extension or else it is included in 2621 the IANA registry and is defined in an RFC (in which case it is a 2622 "standard extension" or "registered extension"). Such RFCs either 2623 must be on the standards track or must define an IESG-approved 2624 experimental protocol. 2626 The definition of an extension must include: 2627 o a descriptive name for the extension; 2628 o the extension-label (which is returned by LIST EXTENSIONS to 2629 indicate to the client that the server supports this particular 2630 extension) - the extension-label of a registered extension MUST 2631 NOT begin with "X"; 2632 o the syntax, values, and meanings of any arguments following the 2633 extension-label in the output of LIST EXTENSIONS; 2634 o any new NNTP commands associated with the extension - the names of 2635 commands associated with registered extensions MUST NOT begin with 2636 "X"; 2637 o the syntax and possible values of arguments associated with the 2638 new NNTP commands; 2639 o the response codes and possible values of arguments for the 2640 responses of the new NNTP commands; 2641 o any new arguments the extension associates with any other 2642 pre-existing NNTP commands; 2643 o how support for the extension affects the behaviour of a server 2644 and NNTP client; 2645 o any increase in the maximum length of commands and initial 2646 response lines over the value specified in this document; 2647 o a specific statement about the effect on pipelining this extension 2648 may have (if any); 2649 o a specific statement about the circumstances when use of this 2650 extension can alter the output from LIST EXTENSIONS; 2651 o the circumstances under which the extension can cause any 2652 pre-existing command to produce a 401, 480, or 483 response; 2653 o whether the extension can be used before or after the MODE READER 2654 command, and what changes (if any) the latter has on the 2655 extension. 2657 A private extension need not be included in the output of LIST 2658 EXTENSIONS. A server MAY provide additional keywords - either for 2659 new commands or new variants of existing commands - as part of a 2660 private extension. To avoid the risk of a clash with a future 2661 registered extension, the names of private extensions and commands 2662 defined by them SHOULD begin with "X" and MUST NOT be the same as the 2663 name of a registered extension. 2665 If the server provides a registered extension (indicated by listing 2666 it in the output of LIST EXTENSIONS), it MUST implement all of the 2667 commands in the specification of the extension except for those 2668 marked as optional. If it does not implement the extension as 2669 specified, it MUST NOT list the extension in the output of LIST 2670 EXTENSIONS under its registered name; in this case it MAY, but SHOULD 2671 NOT, provide a private extension (not listed, or listed with a 2672 different name) that implements part of the extension or implements 2673 the commands of the extension with a different meaning. 2675 A server MUST NOT send different response codes to basic NNTP 2676 commands documented here or commands documented in registered 2677 extensions in response to the availability or use of a private 2678 extension. 2680 8.1 Initial IANA registry 2682 The IANA's initial registry of NNTP service extensions consists of 2683 these entries: 2685 +-------------------------+--------------+--------------------------+ 2686 | Extension | Label | Added behaviour | 2687 +-------------------------+--------------+--------------------------+ 2688 | Specific article | LISTGROUP | Defined in this document | 2689 | numbers | | | 2690 | | | | 2691 | Overview support | OVER | Defined in this document | 2692 | | | | 2693 | Batched header | HDR | Defined in this document | 2694 | retrieval | | | 2695 +-------------------------+--------------+--------------------------+ 2697 8.2 Standard extensions 2699 N.B. while these extensions are standard extensions, the term 2700 includes all extensions in the IANA registry, not just these three. 2702 Each of the following sections describes an extension that a server 2703 MAY provide. If the server provides the extension, it MUST include 2704 the appropriate extension label in the response to LIST EXTENSIONS. 2705 If it does not provide it, it MUST NOT include the appropriate 2706 extension label. The descriptions of facilities in each section are 2707 written as if the extension is provided. If it is not provided, the 2708 entire section should be ignored. 2710 The formal definitions of these extensions are provided in Appendix 2711 D. 2713 8.3 The LISTGROUP extension 2715 This extension provides one command and has the extension label 2716 LISTGROUP. 2718 8.3.1 LISTGROUP 2720 8.3.1.1 Usage 2721 Syntax 2722 LISTGROUP [group] 2723 Responses 2724 211 number low high group Article numbers follow (multiline) 2725 411 No such newsgroup 2726 412 No newsgroup selected [1] 2727 Parameters 2728 group = name of newsgroup 2729 number = estimated number of articles in the group 2730 low = reported low water mark 2731 high = reported high water mark 2732 [1] The 412 response can only occur if no group has been specified. 2734 8.3.1.2 Description 2736 The LISTGROUP command is used to get a listing of all the article 2737 numbers in a particular newsgroup. As a side effect, it also selects 2738 the group in the same way as the the GROUP command (see Section 2739 6.1.1). 2741 The optional argument is the name of the newsgroup to be selected 2742 (e.g. "news.software.misc"). A list of valid newsgroups may be 2743 obtained from the LIST ACTIVE command. If no group is specified, the 2744 current selected newsgroup is used. 2746 On success, the list of article numbers is returned as a multi-line 2747 response following the 211 response code (the arguments on the 2748 initial response line are the same as for the GROUP command. The 2749 list contains one number per line, is in numerical order, and lists 2750 precisely those articles that exist in the group. 2752 When a valid group is selected by means of this command, the current 2753 selected newsgroup MUST be set to that group and the current article 2754 number MUST be set to the first article in the group. If an empty 2755 newsgroup is selected, the current article pointer is made invalid. 2756 If an invalid group is specified, the current selected newsgroup and 2757 current article number MUST NOT be changed. 2759 The LISTGROUP command MAY be used by a client as a replacement for 2760 the GROUP command in establishing a valid current selected newsgroup 2761 and current article number. 2763 If the group specified is not available on the server, a 411 response 2764 MUST be returned. If no group is specified and the current selected 2765 newsgroup is invalid, a 412 response MUST be returned. 2767 8.3.1.3 Examples 2769 Example of LISTGROUP on an empty group: 2770 [C] LISTGROUP example.empty.newsgroup 2771 [S] 211 0 0 0 example.empty.newsgroup list follows 2772 [S] . 2774 Example of LISTGROUP on a valid current selected newsgroup: 2775 [C] GROUP misc.test 2776 [S] 211 2000 3000234 3002322 misc.test 2777 [C] LISTGROUP 2778 [S] 211 2000 3000234 3002322 misc.test list follows 2779 [S] 3000234 2780 [S] 3000237 2781 [S] 3000238 2782 [S] 3000239 2783 [S] 3002322 2784 [S] . 2786 Example of LISTGROUP failing because no group has been selected: 2787 [Assumes current selected newsgroup is invalid.] 2788 [C] LISTGROUP 2789 [S] 412 no current group 2790 [C] GROUP example.is.sob.bradner.or.barber 2791 [S] 411 no such group 2792 [C] LISTGROUP 2793 [S] 412 no current group 2795 8.4 Article metadata 2797 The OVER and HDR extensions refer to the concept of "article 2798 metadata". This is data about articles that does not occur within 2799 the article itself. Each metadata item has a name which MUST begin 2800 with a colon (and which MUST NOT contain a colon elsewhere within 2801 it). As with header names, metadata item names are not 2802 case-sensitive. 2804 When generating a metadata item, the server MUST compute it for 2805 itself and MUST NOT trust any related value provided in the article. 2806 (In particular, a Lines or Bytes header in the article MUST NOT be 2807 assumed to specify the correct number of lines or bytes in the 2808 article.) If the server has access to several non-identical copies of 2809 an article, the value returned MUST be correct for any copy of that 2810 article retrieved during the same session. 2812 This specification defines two metadata items: ":bytes" and ":lines". 2813 Other metadata items may be defined by extensions. The names of 2814 metadata items defined by registered extensions MUST NOT begin with 2815 ":x-". To avoid the risk of a clash with a future registered 2816 extension, the names of metadata items defined by private extensions 2817 SHOULD begin with ":x-". 2819 8.4.1 The :bytes metadata item 2821 The :bytes metadata item for an article is a decimal integer. It 2822 SHOULD equal the number of octets in the entire article - headers, 2823 body, and separating empty line (counting a CRLF pair as two octets, 2824 and excluding both the "." CRLF terminating the response and any "." 2825 added for "byte-stuffing" purposes). 2827 Note to client implementers: some existing servers return a value 2828 different to that above. The commonest reasons for this are: 2829 o counting a CRLF pair as one octet; 2830 o including the "." character used for byte-stuffing in the number; 2831 o including the terminating "." CRLF in the number; 2832 o using one copy of an article for counting the octets but then 2833 returning another one that differs in some (permitted) manner. 2834 Implementations should be prepared for such variation and MUST NOT 2835 rely on the value being accurate. 2837 8.4.2 The :lines metadata item 2839 The :lines metadata item for an article is a decimal integer. It 2840 MUST equal the number of lines in the article body (excluding the 2841 empty line separating headers and body); equivalently, it is two less 2842 than the number of CRLF pairs that the BODY command would return for 2843 that article (the extra two are those following the response code and 2844 the termination octet). 2846 8.5 The OVER extension 2848 This extension provides two commands, OVER and LIST OVERVIEW.FMT. 2849 The label for this extension is OVER. 2851 The OVER extension provides access to the "overview database", which 2852 is a database of headers extracted from incoming articles. Only 2853 certain headers are included in the database. The database also 2854 includes some article metadata. 2856 The information stored in the database may change over time. If the 2857 database records the content or absence of a given field (that is, a 2858 header or metadata item) for all articles, it is said to be 2859 "consistent" for that field. If it records the content of a header 2860 for some articles but not for others that nevertheless included that 2861 header, or records a metadata item for some articles but not others 2862 to which that item applies, it is said to be "inconsistent" for that 2863 field. 2865 The LIST OVERVIEW.FMT command SHOULD list all the fields for which 2866 the database is consistent at that moment. It MAY omit such fields 2867 (for example if it is not known whether the database is consistent or 2868 inconsistent). It MUST NOT include fields for which the database is 2869 inconsistent or which are not stored in the database. Therefore if a 2870 header appears in the LIST OVERVIEW.FMT output but not the OVER 2871 output for a given article, that header does not appear in the 2872 article, and similarly for metadata items. 2874 These rules assume the fields being stored in the database remain 2875 constant for long periods of time, with the database therefore being 2876 consistent. When the set of fields to be stored is changed, it will 2877 be inconsistent until either the database is rebuilt or the only 2878 articles remaining are those received since the change. Therefore 2879 the output from LIST OVERVIEW.FMT needs to be altered twice: before 2880 any fields stop being stored, they MUST be removed from the output, 2881 then when the database is once more known to be consistent, the new 2882 fields SHOULD be added to the output. 2884 Support for the message-id form of the OVER command is optional. If 2885 an implementation supports this form, it MUST use the argument 2886 "MSGID" following the extension label in the output of LIST 2887 EXTENSIONS; if not, it MUST NOT use any argument. 2889 This extension is based on the Overview/NOV database [ROBE1995] 2890 developed by Geoff Collyer. 2892 8.5.1 OVER 2894 8.5.1.1 Usage 2896 Syntax 2897 OVER message-id 2898 OVER range 2899 OVER 2900 Responses 2901 First form (message-id specified) 2902 224 Overview information follows (multiline) 2903 430 No article with that message-id 2904 Second form (range specified) 2905 224 Overview information follows (multiline) 2906 412 No newsgroup selected 2907 423 No articles in that range 2909 Third form (current article number used) 2910 224 Overview information follows (multiline) 2911 412 No newsgroup selected 2912 420 Current article number is invalid 2913 Parameters 2914 range = number(s) of articles 2915 message-id = message-id of article 2917 8.5.1.2 Description 2919 The OVER command returns the contents of the headers and metadata in 2920 the database for an article specified by message-id, or from a 2921 specified article or range of articles in the current selected 2922 newsgroup. 2924 The message-id argument indicates a specific article. The range 2925 argument may be any of the following: 2926 o an article number 2927 o an article number followed by a dash to indicate all following 2928 o an article number followed by a dash followed by another article 2929 number 2930 If neither is specified, the current article number is used. Support 2931 for the first (message-id) form is optional. If it is not supported, 2932 the generic response code 503 MUST be returned. 2934 If the information is available, it is returned as a multi-line 2935 response following the 224 response code and contains one line per 2936 article, sorted in numerical order of article number (note that 2937 unless the argument is a range including a dash, there will only be 2938 one line but it will still be in multi-line format). Each line 2939 consists of a number of fields separated by a TAB. A field may be 2940 empty (in which case there will be two adjacent TABs), and a sequence 2941 of trailing TABs may be omitted. 2943 The first 8 fields MUST be the following, in order: 2944 "0" or article number (see below) 2945 Subject header content 2946 From header content 2947 Date header content 2948 Message-ID header content 2949 References header content 2950 :bytes metadata item 2951 :lines metadata item 2952 If the article is specified by message-id (the first form of the 2953 command), the article number MUST be replaced with zero, except that 2954 if there is a current selected group and the article is present in 2955 that group, the server MAY use that article number (see the ARTICLE 2956 command (Section 6.2.1) and STAT examples (Section 6.2.4.3) for more 2957 details). In the other two forms of the command, the article number 2958 MUST be returned. 2960 Any subsequent fields are the contents of the other headers and 2961 metadata held in the database. 2963 For the five mandatory headers, the content of each field MUST be 2964 based on the content of the header (that is, with the header name and 2965 following colon and space removed). If the article does not contain 2966 that header, or if the content is empty, the field MUST be empty. 2967 For the two mandatory metadata items, the content of the field MUST 2968 be just the value, with no other text. 2970 For all subsequent fields that contain headers, the content MUST be 2971 the entire header line other than the trailing CRLF. For all 2972 subsequent fields that contain metadata, the field consists of the 2973 metadata name, a single space, and then the value. 2975 For all fields, the value is processed by first removing all CRLF 2976 pairs (that is, undoing any folding and removing the terminating 2977 CRLF) and then replacing each TAB with a single space. If there is 2978 no such header in the article, or no such metadata item, or no header 2979 or item stored in the database for that article, the corresponding 2980 field MUST be empty. 2982 Note that, after unfolding, the characters NUL, LF, and CR cannot 2983 occur in the header of an article offered by a conformant server. 2984 Nevertheless, servers SHOULD check for these characters and replace 2985 each one by a single space (so that, for example, CR LF LF TAB will 2986 become two spaces, since the CR and first LF will be removed by the 2987 unfolding process). This will encourage robustness in the face of 2988 non-conforming data; it is also possible that future versions of this 2989 specification could permit these characters to appear in articles. 2991 The server SHOULD NOT produce output for articles that no longer 2992 exist. 2994 If the argument is a message-id and no such article exists, a 430 2995 response MUST be returned. If the argument is a range or is omitted 2996 and the current selected newsgroup is invalid, a 412 response MUST be 2997 returned. If the argument is a range and no articles in that number 2998 range exist in the current selected newsgroup, a 423 response MUST be 2999 returned. If the argument is omitted and the current article number 3000 is invalid, a 420 response MUST be returned. 3002 8.5.1.3 Examples 3004 In the first three examples, TAB has been replaced by vertical bar 3005 and some lines have been folded for readability. 3007 Example of a successful retrieval of overview information for an 3008 article (using no article number): 3009 [C] GROUP misc.test 3010 [S] 211 1234 3000234 3002322 misc.test 3011 [C] OVER 3012 [S] 224 Overview information follows 3013 [S] 300234|I am just a test article|"Demo User" 3014 |6 Oct 1998 04:38:40 -0500| 3015 <45223423@example.com>|<45454@example.net>|1234| 3016 17|Xref: news.example.com misc.test:3000363 3017 [S] . 3019 Example of a successful retrieval of overview information for an 3020 article by message-id: 3021 [C] LIST EXTENSIONS 3022 [S] 202 extensions supported: 3023 [S] OVER MSGID 3024 [S] . 3025 [C] OVER <45223423@example.com> 3026 [S] 224 Overview information follows 3027 [S] 0|I am just a test article|"Demo User" 3028 |6 Oct 1998 04:38:40 -0500| 3029 <45223423@example.com>|<45454@example.net>|1234| 3030 17|Xref: news.example.com misc.test:3000363 3031 [S] . 3032 Note that the article number has been replaced by "0". 3034 Example of the same commands on a system that does not implement 3035 retrieval by message-id: 3036 [C] LIST EXTENSIONS 3037 [S] 202 extensions supported: 3038 [S] OVER 3039 [S] . 3040 [C] OVER <45223423@example.com> 3041 [S] 503 Overview by message-id unsupported 3043 Example of a successful retrieval of overview information for a range 3044 of articles: 3045 [C] GROUP misc.test 3046 [S] 211 1234 3000234 3002322 misc.test 3047 [C] OVER 3000234-3000240 3048 [S] 224 Overview information follows 3049 [S] 300234|I am just a test article|"Demo User" 3050 |6 Oct 1998 04:38:40 -0500| 3051 <45223423@example.com>|<45454@example.net>|1234| 3052 17|Xref: news.example.com misc.test:3000363 3054 [S] 3000235|Another test article|nobody@nowhere.to 3055 (Demo User)|6 Oct 1998 04:38:45 -0500|<45223425@to.to>|| 3056 4818|37||Distribution: fi 3057 [S] 3000238|Re: I am just a test article|somebody@elsewhere.to| 3058 7 Oct 1998 11:38:40 +1200|| 3059 <45223423@to.to>|9234|51 3060 [S] . 3061 Note the missing "References" and Xref headers in the second line, 3062 the missing trailing field(s) in the first and last lines, and that 3063 there are only results for those articles that still exist. 3065 Example of an unsuccessful retrieval of overview information on an 3066 article by number: 3067 [C] GROUP misc.test 3068 [S] 211 1234 3000234 3002322 misc.test 3069 [C] OVER 300256 3070 [S] 423 No such article in this group 3072 Example of an unsuccessful retrieval of overview information by 3073 number because no newsgroup was selected first: 3074 [Assumes current selected newsgroup is invalid.] 3075 [C] OVER 3076 [S] 412 No newsgroup selected 3078 Example of an attempt to retrieve information when the current 3079 selected newsgroup is empty: 3080 [C] GROUP example.empty.newsgroup 3081 [S] 211 0 0 0 example.empty.newsgroup 3082 [C] OVER 3083 [S] 420 No current article selected 3085 8.5.2 LIST OVERVIEW.FMT 3087 8.5.2.1 Usage 3089 This command is optional. 3090 Syntax 3091 LIST OVERVIEW.FMT 3092 Responses 3093 215 Information follows (multiline) 3095 8.5.2.2 Description 3097 The LIST OVERVIEW.FMT command returns a description of the fields in 3098 the database for which it is consistent (as described above). 3100 If the information is available, it is returned as a multi-line 3101 response following the 215 response code. The information contains 3102 one line per field in the order they are returned by the OVER 3103 command; the first 7 lines MUST (except for the case of letters) be 3104 exactly: 3106 Subject: 3107 From: 3108 Date: 3109 Message-ID: 3110 References: 3111 :bytes 3112 :lines 3114 except that, for compatibility with existing implementations, the 3115 last two lines MAY instead be: 3117 Bytes: 3118 Lines: 3120 even though they refer to metadata, not headers. 3122 All subsequent lines MUST consist of either a header name followed by 3123 ":full", or the name of a piece of metadata. 3125 There are no leading or trailing spaces in the output. 3127 Note that the 7 fixed lines describe the 2nd to 8th fields of the 3128 OVER output. The "full" suffix (which may use either uppercase, 3129 lowercase, or a mix) is a reminder that the corresponding fields 3130 include the header name. 3132 This command MAY generate different results if used more than once in 3133 a session. 3135 8.5.2.3 Examples 3137 Example of LIST OVERVIEW.FMT output corresponding to the example OVER 3138 output above, using the preferred format: 3139 [C] LIST OVERVIEW.FMT 3140 [S] 215 Order of fields in overview database. 3141 [S] Subject: 3142 [S] From: 3143 [S] Date: 3144 [S] Message-ID: 3145 [S] References: 3146 [S] :bytes 3147 [S] :lines 3148 [S] Xref:full 3149 [S] Distribution:full 3151 [S] . 3153 Example of LIST OVERVIEW.FMT output corresponding to the example OVER 3154 output above, using the alternative format: 3155 [C] LIST OVERVIEW.FMT 3156 [S] 215 Order of fields in overview database. 3157 [S] Subject: 3158 [S] From: 3159 [S] Date: 3160 [S] Message-ID: 3161 [S] References: 3162 [S] Bytes: 3163 [S] Lines: 3164 [S] Xref:FULL 3165 [S] Distribution:FULL 3166 [S] . 3168 Example of LIST OVERVIEW.FMT returning an error where the command is 3169 recognized but the software does not maintain this information: 3170 [C] LIST OVERVIEW.FMT 3171 [S] 503 overview.fmt not available 3173 8.6 The HDR extension 3175 This extension provides two new commands: HDR and LIST HEADERS. The 3176 label for this extension is HDR. 3178 The HDR extension provides access to specific headers and metadata 3179 items (collectively "fields") of articles or groups of articles. In 3180 the case of headers, an implementation MAY restrict the use of this 3181 extension to a specific list of headers or MAY allow it to be used 3182 with any header; it may behave differently when the HDR command is 3183 used with a message-id argument and when it is used with a range or 3184 no argument. 3186 The HDR command may take information from a database rather than 3187 directly from the articles. If so, the same issues of consistency 3188 and inconsistency apply as with the OVER extension (Section 8.5) and 3189 the LIST HEADERS command SHOULD take the same approach as the LIST 3190 OVERVIEW.FMT command in resolving them. 3192 8.6.1 HDR 3194 8.6.1.1 Usage 3195 Syntax 3196 HDR header message-id 3197 HDR header range 3198 HDR header 3199 Responses 3200 First form (message-id specified) 3201 225 Headers follow (multiline) 3202 430 No article with that message-id 3203 Second form (range specified) 3204 225 Headers follow (multiline) 3205 412 No newsgroup selected 3206 423 No articles in that range 3207 Third form (current article number used) 3208 225 Headers follow (multiline) 3209 412 No newsgroup selected 3210 420 Current article number is invalid 3211 Parameters 3212 header = name of header, without the colon 3213 range = number(s) of articles 3214 message-id = message-id of article 3216 8.6.1.2 Description 3218 The HDR command retrieves specific headers from an article specified 3219 by message-id, or from a specified article or range of articles in 3220 the current selected newsgroup. It can also return certain metadata 3221 about the article or articles. 3223 The required header argument is the name of a header (e.g. 3224 "subject") in an article, or the name of a metadata item, and is 3225 case-insensitive. Names of metadata items always begin with a colon. 3226 Except where stated otherwise, metadata items are treated as if they 3227 were header contents, and references to headers in this description 3228 apply equally to metadata items. 3230 The message-id argument indicates a specific article. The range 3231 argument may be any of the following: 3232 o an article number 3233 o an article number followed by a dash to indicate all following 3234 o an article number followed by a dash followed by another article 3235 number 3236 If neither is specified, the current article number is used. 3238 If the information is available, it is returned as a multi-line 3239 response following the 225 response code and contains one line for 3240 each article in the range that exists (note that unless the argument 3241 is a range including a dash, there will be at most one line but it 3242 will still be in multi-line format). The line consists of the 3243 article number, a space, and then the contents of the header or 3244 metadata item. In the case of a header, the header name, colon, and 3245 the first space after the colon are all omitted. 3247 If the article is specified by message-id (the first form of the 3248 command), the article number MUST be replaced with zero, except that 3249 if there is a current selected group and the article is present in 3250 that group, the server MAY use that article number (see the ARTICLE 3251 command (Section 6.2.1) and STAT examples (Section 6.2.4.3) for more 3252 details). In the other two forms of the command, the article number 3253 MUST be returned. 3255 Header contents are modified as follows: all CRLF pairs are removed, 3256 and then each TAB is replaced with a single space (note that this is 3257 the same transformation as is performed by the OVER extension 3258 (Section 8.5.1.2), and the same comment concerning NUL, CR, and LF 3259 applies). 3261 The header content is in all cases taken from the article. This 3262 means that, for example, a request for the header "Lines" returns the 3263 contents of the "Lines" header of the specified articles, if any, not 3264 the line count metadata or any other server-generated value. If the 3265 header occurs in a given article multiple times, only the content of 3266 the first occurrence is returned by HDR. 3268 If the requested header is not present in the article or if it is 3269 present but empty, a line for that article is included in the output 3270 but the header content portion of the line is empty (the space after 3271 the article number MAY be retained or omitted). If any article 3272 number in the provided range does not exist in the group, no line for 3273 that article number is included in the output. 3275 If the second argument is a message-id and no such article exists, a 3276 430 response MUST be returned. If the second argument is a range or 3277 is omitted and the current selected newsgroup is invalid, a 412 3278 response MUST be returned. If the second argument is a range and no 3279 articles in that number range exist in the current selected 3280 newsgroup, a 423 response MUST be returned. If the second argument 3281 is omitted and the current article number is invalid, a 420 response 3282 MUST be returned. 3284 A server MAY only allow HDR commands for a limited set of headers and 3285 metadata items; it may behave differently in this respect for the 3286 first (message-id) form than for the other forms. If so, it MUST 3287 respond with the generic 503 response to attempts to request other 3288 headers, rather than returning erroneous results such as a successful 3289 empty response. 3291 If HDR uses a separate database and it is inconsistent for the 3292 requested header or metadata item, the server MAY return what results 3293 it can or it MAY respond with the generic 503 response; in the latter 3294 case, the field MUST NOT appear in the output from LIST HEADERS. 3296 8.6.1.3 Examples 3298 Example of a successful retrieval of subject lines from a range of 3299 articles (3000235 has no Subject header, and 3000236 is missing): 3300 [C] GROUP misc.test 3301 [S] 211 1234 3000234 3002322 misc.test 3302 [C] HDR Subject 3000234-300238 3303 [S] 225 Headers follow 3304 [S] 3000234 I am just a test article 3305 [S] 3000235 3306 [S] 3000237 Re: I am just a test article 3307 [S] 3000238 Ditto 3308 [S] . 3310 Example of a successful retrieval of line counts from a range of 3311 articles: 3312 [C] GROUP misc.test 3313 [S] 211 1234 3000234 3002322 misc.test 3314 [C] HDR :lines 3000234-300238 3315 [S] 225 Headers follow 3316 [S] 3000234 42 3317 [S] 3000235 5 3318 [S] 3000237 11 3319 [S] 3000238 2378 3320 [S] . 3322 Example of a successful retrieval of the subject line from an article 3323 by message-id: 3324 [C] GROUP misc.test 3325 [S] 211 1234 3000234 3002322 misc.test 3326 [C] HDR subject 3327 [S] 225 Header information follows 3328 [S] 0 I am just a test article 3329 [S] . 3331 Example of a successful retrieval of the subject line from the 3332 current article: 3333 [C] GROUP misc.test 3334 [S] 211 1234 3000234 3002322 misc.test 3335 [C] HDR subject 3336 [S] 225 Header information follows 3337 [S] 3000234 I am just a test article 3338 [S] . 3340 Example of an unsuccessful retrieval of a header from an article by 3341 message-id: 3342 [C] HDR subject 3343 [S] 430 No Such Article Found 3345 Example of an unsuccessful retrieval of headers from articles by 3346 number because no newsgroup was selected first: 3347 [Assumes current selected newsgroup is invalid.] 3348 [C] HDR subject 300256- 3349 [S] 412 No newsgroup selected 3351 Example of an unsuccessful retrieval of headers because the current 3352 selected newsgroup is empty: 3353 [C] GROUP example.empty.newsgroup 3354 [S] 211 0 0 0 example.empty.newsgroup 3355 [C] HDR subject 1- 3356 [S] 423 No articles in that range 3358 Example of an unsuccessful retrieval of headers because the server 3359 does not allow HDR commands for that header: 3360 [C] GROUP misc.test 3361 [S] 211 1234 3000234 3002322 misc.test 3362 [C] HDR Content-Type 3000234-300238 3363 [S] 503 HDR not permitted on Content-Type 3365 8.6.2 LIST HEADERS 3367 8.6.2.1 Usage 3369 Syntax 3370 LIST HEADERS [MSGID|RANGE] 3371 Responses 3372 215 Header and metadata list follows (multiline) 3373 Parameters 3374 MSGID = requests list for access by message-id 3375 RANGE = requests list for access by range 3377 8.6.2.2 Description 3379 The LIST HEADERS command returns a list of headers and metadata items 3380 that may be retrieved using the HDR command. 3382 The information is returned as a multi-line response following the 3383 215 response code and contains one line for each header or metadata 3384 item name (excluding the colon in the former case). If the 3385 implementation allows any header to be retrieved, it MUST NOT include 3386 any header names in the list but MUST include the special entry ":" 3387 (a single colon on its own); it MUST still list any metadata items 3388 that are available. The order of items in the list is not 3389 significant; the server need not even consistently return the same 3390 order. The list MAY be empty (though in this circumstance there is 3391 little point in providing the extension). 3393 An implementation that also supports the OVER extension SHOULD at 3394 least permit all the headers and metadata items listed in the output 3395 from the LIST OVERVIEW.FMT command. 3397 If the server treats the first form of the HDR command (message-id 3398 specified) differently to the other two forms (range specified or 3399 current article number used) in respect of which headers or metadata 3400 items are available, then: 3401 o if the MSGID argument is specified, the results MUST be those 3402 available for the first form of the HDR command; 3403 o if the RANGE argument is specified, the results MUST be those 3404 available for the second and third forms of the HDR command; 3405 o if no argument is specified, the results MUST be those available 3406 in all forms of the HDR command (that is, it MUST only list those 3407 items listed in both the previous cases). 3409 If the server does not treat the various forms differently, then it 3410 MUST always produce the same results and ignore any argument. 3412 8.6.2.3 Examples 3414 Example of an implementation providing access to only a few headers: 3415 [C] LIST HEADERS 3416 [S] 215 headers supported: 3417 [S] Subject 3418 [S] Message-ID 3419 [S] Xref 3420 [S] . 3422 Example of an implementation providing access to the same fields as 3423 the first example in Section 8.5.2.3: 3424 [C] LIST EXTENSIONS 3425 [S] 202 extensions supported: 3426 [S] OVER 3427 [S] HDR 3428 [S] . 3429 [C] LIST HEADERS 3430 [S] 215 headers and metadata items supported: 3431 [S] Date 3432 [S] Distribution 3433 [S] From 3434 [S] Message-ID 3435 [S] References 3437 [S] Subject 3438 [S] Xref 3439 [S] :bytes 3440 [S] :lines 3441 [S] . 3443 Example of an implementation providing access to all headers: 3444 [C] LIST HEADERS 3445 [S] 215 metadata items supported: 3446 [S] : 3447 [S] :lines 3448 [S] :bytes 3449 [S] :x-article-number 3450 [S] . 3452 Example of an implementation distinguishing the first form of the HDR 3453 command from the other two forms: 3454 [C] LIST HEADERS RANGE 3455 [S] 215 metadata items supported: 3456 [S] : 3457 [S] :lines 3458 [S] :bytes 3459 [S] . 3460 [C] LIST HEADERS MSGID 3461 [S] 215 headers and metadata items supported: 3462 [S] Date 3463 [S] Distribution 3464 [S] From 3465 [S] Message-ID 3466 [S] References 3467 [S] Subject 3468 [S] :lines 3469 [S] :bytes 3470 [S] :x-article-number 3471 [S] . 3472 [C] LIST HEADERS 3473 [S] 215 headers and metadata items supported: 3474 [S] Date 3475 [S] Distribution 3476 [S] From 3477 [S] Message-ID 3478 [S] References 3479 [S] Subject 3480 [S] :lines 3481 [S] :bytes 3482 [S] . 3483 Note how :x-article-number does not appear in the last set of output. 3485 9. Augmented BNF Syntax for NNTP 3487 Each of the following sections describes the syntax of a major 3488 element of NNTP. This syntax extends and refines the descriptions 3489 elsewhere in this specification, and should be given precedence when 3490 resolving apparent conflicts. Note that ABNF [RFC2234] strings are 3491 case-insensitive. Non-terminals used in several places are defined 3492 in a separate section at the end. 3494 The non-terminals "command-line", "command-continuation", and 3495 "response" between them specify the text that flows between client 3496 and server. For each command, the sequence is: 3497 o the client sends an instance of "command-line"; 3498 o the server sends an instance of "response"; 3499 o while the latest response is one that indicates more data is 3500 required (in general, a 3xx response): 3501 * the client sends an instance of "command-continuation"; 3502 * the server sends an instance of "response". 3504 9.1 Commands 3506 This syntax defines the non-terminal "command-line", which represents 3507 what is sent from the client to the server. 3509 command-line = command EOL 3510 command = article-command / 3511 body-command / 3512 date-command / 3513 group-command / 3514 hdr-command / 3515 head-command / 3516 help-command / 3517 ihave-command / 3518 last-command / 3519 list-active-command / 3520 list-active-times-command / 3521 list-distrib-pats-command / 3522 list-distributions-command / 3523 list-extensions-command / 3524 list-headers-command / 3525 list-newsgroups-command / 3526 list-overview-fmt-command / 3527 listgroup-command / 3528 mode-reader-command / 3529 newgroups-command / 3530 newnews-command / 3531 next-command / 3532 over-command / 3533 post-command / 3534 quit-command / 3535 stat-command / 3536 x-command 3538 article-command = "ARTICLE" [article-ref] 3539 body-command = "BODY" [article-ref] 3540 date-command = "DATE" 3541 group-command = "GROUP" WS newsgroup-name 3542 hdr-command = "HDR" WS header-meta-name [range-ref] 3543 head-command = "HEAD" [article-ref] 3544 help-command = "HELP" 3545 ihave-command = "IHAVE" WS message-id 3546 last-command = "LAST" 3547 list-active-command = "LIST" [WS "ACTIVE" [WS wildmat]] 3548 list-active-times-command = "LIST" WS "ACTIVE.TIMES" [WS wildmat] 3549 list-distrib-pats-command = "LIST" WS "DISTRIB.PATS" 3550 list-distributions-command = "LIST" WS "DISTRIBUTIONS" 3551 list-extensions-command = "LIST" WS "EXTENSIONS" 3552 list-headers-command = "LIST" WS "HEADERS" WS ["MSGID" / "RANGE"] 3553 list-newsgroups-command = "LIST" WS "NEWSGROUPS" [WS wildmat] 3554 list-overview-fmt-command = "LIST" WS "OVERVIEW.FMT" 3555 listgroup-command = "LISTGROUP" [WS newsgroup-name] 3556 mode-reader-command = "MODE" WS "READER" 3557 newgroups-command = "NEWGROUPS" WS date-time 3558 newnews-command = "NEWNEWS" WS wildmat WS date-time 3559 next-command = "NEXT" 3560 over-command = "OVER" [WS range-ref] 3561 post-command = "POST" 3562 quit-command = "QUIT" 3563 stat-command = "STAT" [article-ref] 3564 x-command = x-command-name *(WS x-argument) 3565 ; This is the generic syntax for an extension command. 3566 ; Each extension command is specified fully elsewhere 3568 article-ref = WS (article-number / message-id) 3569 date = date2y / date4y 3570 date4y = 4DIGIT 2DIGIT 2DIGIT 3571 date2y = 2DIGIT 2DIGIT 2DIGIT 3572 date-time = date WS time [WS "GMT"] 3573 header-meta-name = header-name / metadata-name 3574 metadata-name = ":" 1*A-NOTCOLON 3575 range = article-number ["-" [article-number]] 3576 range-ref = WS (range / message-id) 3577 time = 2DIGIT 2DIGIT 2DIGIT 3578 x-command-name = 3*12A-CHAR 3579 x-argument = 1*P-CHAR 3581 9.2 Command continuation 3583 This syntax defines the further material sent by the client in the 3584 case of multi-stage commands. 3586 command-continuation = ihave-continuation / 3587 post-continuation 3589 ihave-continuation = encoded-article 3590 post-continuation = encoded-article 3592 encoded-article = content-lines termination 3593 ; after undoing the "byte-stuffing", this MUST match "article" 3595 9.3 Responses 3597 9.3.1 Generic responses 3599 This syntax defines the non-terminal "response", which represents the 3600 generic form of responses - that is, what is sent from the server to 3601 the client in response to a command or a command-continuation. 3603 response = simple-response / multiline-response 3604 multiline-response = simple-response content-lines termination 3606 simple-response = 3607 simple-response-content [SP trailing-comment] CRLF 3608 simple-response-content = 3DIGIT arguments 3609 trailing-comment = *U-CHAR 3610 arguments = *(SP argument) ; How many depends on the response 3611 argument = 1*A-CHAR 3613 9.3.2 Initial response line contents 3615 This syntax defines the specific initial response lines for the 3616 various commands and extensions in this specification. Only those 3617 response codes with arguments are listed. 3619 simple-response-content =/ response-111-content 3620 response-211-content 3621 response-22x-content 3622 response-401-content 3624 response-111-content = "111" SP date4y time 3625 response-211-content = "211" 3(SP article-number) SP newsgroup-name 3626 response-22x-content = ("220" / "221" / "222" / "223") 3627 SP article-number SP message-id 3628 response-401-content = "401" SP extension-label 3630 9.3.3 Multi-line response contents 3632 This syntax defines the content of the various multi-line responses 3633 (more precisely, the part of the response in "content-lines"), in 3634 each case after any "byte-stuffing" has been undone. 3636 multiline-response-content = article-response / 3637 body-response / 3638 hdr-response / 3639 head-response / 3640 help-response / 3641 list-active-response / 3642 list-active-times-response / 3643 list-distrib-pats-response / 3644 list-distributions-response / 3645 list-extensions-response / 3646 list-headers-response / 3647 list-newsgroups-response / 3648 list-overview-fmt-response / 3649 listgroup-response / 3650 newgroups-response / 3651 newnews-response / 3652 over-response 3654 article-response = article 3655 body-response = body 3656 hdr-response = *(article-number SP hdr-content CRLF) 3657 head-response = 1*header 3658 help-response = *(*B-CHAR CRLF) 3659 list-active-response = *(newsgroup-name SPA article-number 3660 SPA article-number SPA newsgroup-status CRLF) 3661 list-active-times-response = 3662 *(newsgroup-name SPA 1*DIGIT SPA newsgroup-creator CRLF) 3663 list-distrib-pats-response = 3664 *(1*DIGIT ":" wildmat ":" distribution CRLF) 3665 list-distributions-response = 3666 *(distribution SPA distribution-description CRLF) 3667 list-extensions-response = 3668 *(extension-descriptor CRLF) 3669 list-headers-response = *(header-meta-name CRLF) / 3670 *((metadata-name / ":") CRLF) 3671 list-newsgroups-response = 3672 *(newsgroup-name WS newsgroup-description CRLF) 3673 list-overview-fmt-response = list-overview-fmt-text 3674 listgroup-response = *(article-number CRLF) 3675 newgroups-response = list-active-response 3676 newnews-response = *(message-id CRLF) 3677 over-response = *(article-number over-content CRLF) 3679 list-overview-fmt-text = 3680 "Subject:" CRLF 3681 "From:" CRLF 3682 "Date:" CRLF 3683 "Message-ID:" CRLF 3684 "References:" CRLF 3685 ( ":bytes" CRLF ":lines" / "Bytes:" CRLF "Lines:") CRLF 3686 *((header-name ":full" / metadata-name) CRLF) 3688 distribution = 1*P-CHAR 3689 distribution-description = U-TEXT 3690 hdr-content = *S-NONTAB 3691 hdr-n-content = [(header-name ":" / metadata-name) SP hdr-content] 3692 newsgroup-creator = U-TEXT 3693 newsgroup-description = S-TEXT 3694 newsgroup-status = %x79 / %x6E / %x6D / private-status 3695 over-content = 1*6(TAB hdr-content) / 3696 7(TAB hdr-content) *(TAB hdr-n-content) 3697 private-status = 1*P-CHAR ; except the values in newsgroup-status 3699 9.4 LIST EXTENSIONS responses 3701 This syntax defines the generic form of a LIST EXTENSIONS response 3702 line. 3704 extension-argument = 1*P-CHAR 3705 extension-descriptor = extension-generic-descriptor 3706 extension-generic-descriptor = 3707 extension-label *(SPA extension-argument) 3708 extension-label = 1*12UPPER 3710 This syntax defines the specific LIST EXTENSIONS response lines for 3711 the various extensions in this specification. 3713 extension-descriptor =/ hdr-extension / 3714 listgroup-extension / 3715 over-extension 3717 hdr-extension = %x48.44.52 ; "HDR" 3718 listgroup-extension = %x4C.49.53.54.47.52.4F.55.50 ; "LISTGROUP" 3719 over-extension = %x4F.56.45.52 [SPA "MSGID"] ; "OVER" 3721 9.5 Articles 3723 This syntax defines the non-terminal "article", which represents the 3724 format of an article as described in Section 3.4. 3726 article = 1*header CRLF body 3727 header = header-name ":" [CRLF] SP header-content CRLF 3728 header-content = *(S-CHAR / [CRLF] WS) 3729 body = *(*B-CHAR CRLF) 3731 9.6 General non-terminals 3733 These non-terminals are used at various places in the syntax and are 3734 collected here for convenience. A few of these non-terminals are not 3735 used in this specification but are provided for the consistency and 3736 convenience of extension authors. 3738 article-number = 1*16DIGIT 3739 content-lines = *([content-text] CRLF) 3740 content-text = (".." / B-NONDOT) *B-CHAR 3741 header-name = 1*A-NOTCOLON 3742 message-id = "<" 1*248A-NOTGT ">" 3743 newsgroup-name = 1*wildmat-exact 3744 termination = "." CRLF 3745 wildmat = wildmat-pattern *("," ["!"] wildmat-pattern) 3746 wildmat-pattern = 1*wildmat-item 3747 wildmat-item = wildmat-exact / wildmat-wild 3748 wildmat-exact = %x21-29 / %x2B / %x2D-3E / %x40-5A / %x5E-7E / 3749 UTF8-non-ascii ; exclude * , ? [ \ ] 3750 wildmat-wild = "*" / "?" 3752 base64 = *(4base64-char) [base64-terminal] 3753 base64-char = UPPER / LOWER / DIGIT / "+" / "/" 3754 base64-terminal = 2base64-char "==" / 3base64-char "=" 3756 ; Assorted special character sets 3757 ; A- means based on US-ASCII, excluding controls and SP 3758 ; P- means based on UTF-8, excluding controls and SP 3759 ; U- means based on UTF-8, excluding NUL CR and LF 3760 ; B- means based on bytes, excluding NUL CR and LF 3761 A-CHAR = %x21-7E 3762 A-NOTCOLON = %x21-39 / %x3B-7E ; exclude ":" 3763 A-NOTGT = %x21-3D / %x3F-7E ; exclude ">" 3764 P-CHAR = A-CHAR / UTF8-non-ascii 3765 U-CHAR = CTRL / TAB / SP / A-CHAR / UTF8-non-ascii 3766 U-NONTAB = CTRL / SP / A-CHAR / UTF8-non-ascii 3767 U-TEXT = P-CHAR *U-CHAR 3768 B-CHAR = CTRL / TAB / SP / %x21-FF 3769 B-NONDOT = CTRL / TAB / SP / %x21-2D / %x2F-FF ; exclude "." 3771 ALPHA = UPPER / LOWER ; use only when case-insensitive 3772 CR = %x0D 3773 CRLF = CR LF 3774 CTRL = %x01-08 / %x0B-0C / %x0E-1F 3775 DIGIT = %x30-39 3776 EOL = *(SP / TAB) CRLF 3777 LF = %x0A 3778 LOWER = %x61-7A 3779 SP = %x20 3780 SPA = 1*SP 3781 TAB = %x09 3782 UPPER = %x41-5A 3783 UTF8-non-ascii = UTF8-2 / UTF8-3 / UTF8-4 3784 UTF8-2 = %xC2-DF UTF8-tail 3785 UTF8-3 = %xE0 %xA0-BF UTF8-tail / %xE1-EC 2UTF8-tail / 3786 %xED %x80-9F UTF8-tail / %xEE-EF 2UTF8-tail 3787 UTF8-4 = %xF0 %x90-BF 2UTF8-tail / %xF1-F3 3UTF8-tail / 3788 %xF4 %x80-8F 2UTF8-tail 3789 UTF8-tail = %x80-BF 3790 WS = 1*(SP / TAB) 3792 The following non-terminals require special consideration. They 3793 represent situations where material SHOULD be restricted to UTF-8, 3794 but implementations MUST be able to cope with other character 3795 encodings. Therefore there are two sets of definitions for them. 3797 Implementations MUST accept any content that meets this syntax: 3799 S-CHAR = %x21-FF 3800 S-NONTAB = CTRL / SP / S-CHAR 3801 S-TEXT = (CTRL / S-CHAR) *B-CHAR 3803 Implementations SHOULD only generate content that meets this syntax: 3805 S-CHAR = P-CHAR 3806 S-NONTAB = U-NONTAB 3807 S-TEXT = U-TEXT 3809 10. IANA Considerations 3811 This specification requires IANA to keep a registry of 3812 extension-labels. The initial contents of this registry are 3813 specified in Section 8.1. As described in Section 8, names beginning 3814 with X are reserved for private use while all other names are 3815 expected to be associated with a specification in an RFC on the 3816 standards-track or defining an IESG-approved experimental protocol. 3818 Different entries in the registry MUST use different 3819 extension-labels. 3821 Different entries in the registry MUST NOT use the same command name. 3822 For this purpose, variants distinguished by a second or subsequent 3823 keyword (e.g. "LIST HEADERS" and "LIST OVERVIEW.FMT") count as 3824 different commands. If there is a need for two extensions to use the 3825 same command, a single harmonised specification MUST be registered. 3827 11. Security Considerations 3829 This section is meant to inform application developers, information 3830 providers, and users of the security limitations in NNTP as described 3831 by this document. The discussion does not include definitive 3832 solutions to the problems revealed, though it does make some 3833 suggestions for reducing security risks. 3835 11.1 Personal and Proprietary Information 3837 NNTP, because it was created to distribute network news articles, 3838 will forward whatever information is stored in those articles. 3839 Specification of that information is outside this scope of this 3840 document, but it is likely that some personal and/or proprietary 3841 information is available in some of those articles. It is very 3842 important that designers and implementers provide informative 3843 warnings to users so personal and/or proprietary information in 3844 material that is added automatically to articles (e.g. in headers) 3845 is not disclosed inadvertently. Additionally, effective and easily 3846 understood mechanisms to manage the distribution of news articles 3847 SHOULD be provided to NNTP Server administrators, so that they are 3848 able to report with confidence the likely spread of any particular 3849 set of news articles. 3851 11.2 Abuse of Server Log Information 3853 A server is in the position to save session data about a user's 3854 requests that might identify their reading patterns or subjects of 3855 interest. This information is clearly confidential in nature and its 3856 handling can be constrained by law in certain countries. People 3857 using the NNTP protocol to provide data are responsible for ensuring 3858 that such material is not distributed without the permission of any 3859 individuals that are identifiable by the published results. 3861 11.3 Weak Authentication and Access Control 3863 There is no user-based or token-based authentication in the basic 3864 NNTP specification. Access is normally controlled by server 3865 configuration files. Those files specify access by using domain 3866 names or IP addresses. However, this specification does permit the 3867 creation of extensions to the NNTP protocol itself for such purposes; 3868 one such extension is [NNTP-AUTH]. While including such mechanisms 3869 is optional, doing so is strongly encouraged. 3871 Other mechanisms are also available. For example, a proxy server 3872 could be put in place that requires authentication before connecting 3873 via the proxy to the NNTP server. 3875 11.4 DNS Spoofing 3877 Many existing NNTP implementations authorize incoming connections by 3878 checking the IP address of that connection against the IP addresses 3879 obtained via DNS lookups of lists of domain names given in local 3880 configuration files. Servers that use this type of authentication, 3881 and clients that find a server by doing a DNS lookup of the server 3882 name, rely very heavily on the Domain Name Service, and are thus 3883 generally prone to security attacks based on the deliberate 3884 misassociation of IP addresses and DNS names. Clients and servers 3885 need to be cautious in assuming the continuing validity of an IP 3886 number/DNS name association. 3888 In particular, NNTP clients and servers SHOULD rely on their name 3889 resolver for confirmation of an IP number/DNS name association, 3890 rather than caching the result of previous host name lookups. Many 3891 platforms already can cache host name lookups locally when 3892 appropriate, and they SHOULD be configured to do so. It is proper 3893 for these lookups to be cached, however, only when the TTL (Time To 3894 Live) information reported by the name server makes it likely that 3895 the cached information will remain useful. 3897 If NNTP clients or servers cache the results of host name lookups in 3898 order to achieve a performance improvement, they MUST observe the TTL 3899 information reported by DNS. If NNTP clients or servers do not 3900 observe this rule, they could be spoofed when a previously accessed 3901 server's IP address changes. As network renumbering is expected to 3902 become increasingly common, the possibility of this form of attack 3903 will grow. Observing this requirement thus reduces this potential 3904 security vulnerability. 3906 This requirement also improves the load-balancing behaviour of 3907 clients for replicated servers using the same DNS name and reduces 3908 the likelihood of a user's experiencing failure in accessing sites 3909 that use that strategy. 3911 11.5 UTF-8 issues 3913 UTF-8 [RFC3629] permits only certain sequences of octets and 3914 designates others as either malformed or "illegal". The Unicode 3915 standard identifies a number of security issues related to illegal 3916 sequences and forbids their generation by conforming implementations. 3918 Implementations of this specification MUST NOT generate malformed or 3919 illegal sequences and SHOULD detect them and take some appropriate 3920 action. This could include: 3921 o generating a 501 response code. 3923 o replacing such sequences by the sequence %xEF.BF.BD, which encodes 3924 the "replacement character" U+FFFD; 3925 o closing the connection; 3926 o replacing such sequences by a "guessed" valid sequence (based on 3927 properties of the UTF-8 encoding); 3928 In the last case, the implementation MUST ensure that any replacement 3929 cannot be used to bypass validity or security checks. For example, 3930 the illegal sequence %xC0.A0 is an over-long encoding for space 3931 (%x20). If it is replaced by the latter in a command line, this 3932 needs to happen before the command line is parsed into individual 3933 arguments. If the replacement came after parsing, it would be 3934 possible to generate an argument with an embedded space, which is 3935 forbidden. Use of the "replacement character" does not have this 3936 problem, since it is permitted wherever non-US-ASCII characters are. 3937 Implementations SHOULD use one of the first two solutions where the 3938 general structure of the NNTP stream remains intact, and close the 3939 connection if it is no longer possible to parse it sensibly. 3941 11.6 Caching of LIST EXTENSIONS results 3943 The LIST EXTENSIONS command provides information about the extensions 3944 currently available from the server. Whenever there is a relevant 3945 change to the server state, the results of this command are required 3946 to change accordingly. 3948 In most situations the results from this command in a given server 3949 state will not change from session to session; a given extension will 3950 be installed permanently on a server. Some clients may therefore 3951 wish to remember which extensions a server supports to avoid the 3952 delay of an additional command and response, particularly if they 3953 open multiple connections in the same session. 3955 However, information about extensions related to security and privacy 3956 MUST NOT be cached, since this could allow a variety of attacks. 3958 For example, consider a server which permits the use of cleartext 3959 passwords on links that are encrypted but not otherwise: 3960 [Initial TCP connection set-up completed.] 3961 [S] 200 NNTP Service Ready, posting permitted 3962 [C] LIST EXTENSIONS 3963 [S] 202 Extensions supported: 3964 [S] XENCRYPT 3965 [S] . 3966 [C] XENCRYPT 3967 [Client and server negotiate encryption on the link] 3968 [S] 283 Encrypted link established 3969 [C] LIST EXTENSIONS 3970 [S] 202 Extensions supported: 3972 [S] XSECRET 3973 [S] . 3974 [C] XSECRET fred flintstone 3975 [S] 290 Password for fred accepted 3977 If the client caches the last LIST EXTENSIONS result, then on the 3978 next session it will attempt to use XSECRET on an unencrypted link: 3979 [Initial TCP connection set-up completed.] 3980 [S] 200 NNTP Service Ready, posting permitted 3981 [C] XSECRET fred flintstone 3982 [S] 483 Only permitted on secure links 3983 exposing the password to any eavesdropper. While the primary cause 3984 of this is passing a secret without first checking the security of 3985 the link, caching of LIST EXTENSIONS results can increase the risk. 3987 Any security extension should include requirements to check the 3988 security state of the link in a manner appropriate to that extension. 3990 Caching should normally only be considered for anonymous clients that 3991 do not use any security or privacy extensions and for which the time 3992 required for an additional command and response is a noticeable 3993 issue. 3995 12. Acknowledgements 3997 This document is the result of much effort by the present and past 3998 members of the NNTP Working Group, chaired by Russ Allbery and Ned 3999 Freed. It could not have been produced without them. 4001 The author acknowledges the original authors of NNTP as documented in 4002 RFC 977 [RFC977]: Brian Kantor and Phil Lapsey. 4004 The author gratefully acknowledges: 4005 o The work of the NNTP committee chaired by Eliot Lear. The 4006 organization of this document was influenced by the last available 4007 draft from this working group. A special thanks to Eliot for 4008 generously providing the original machine-readable sources for 4009 that document. 4010 o The work of the DRUMS working group, specifically RFC 1869 4011 [RFC1869], which is the basis of the NNTP extensions mechanism 4012 detailed in this document. 4013 o The authors of RFC 2616 [RFC2616] for providing specific and 4014 relevant examples of security issues that should be considered for 4015 HTTP. Since many of the same considerations exist for NNTP, those 4016 examples that are relevant have been included here with some minor 4017 rewrites. 4018 o The comments and additional information provided by the following 4019 individuals in preparing one or more of the progenitors of this 4020 document: 4021 Russ Allbery 4022 Wayne Davison 4023 Chris Lewis 4024 Tom Limoncelli 4025 Eric Schnoebelen 4026 Rich Salz 4028 This work was motivated by the work of various news reader authors 4029 and news server authors, which includes those listed below: 4030 Rick Adams 4031 Original author of the NNTP extensions to the RN news reader and 4032 last maintainer of Bnews 4033 Stan Barber 4034 Original author of the NNTP extensions to the news readers that 4035 are part of Bnews 4036 Geoff Collyer 4037 Original author of the OVERVIEW database proposal and one of the 4038 original authors of CNEWS 4039 Dan Curry 4040 Original author of the xvnews news reader 4042 Wayne Davison 4043 Author of the first threading extensions to the RN news reader 4044 (commonly called TRN) 4045 Geoff Huston 4046 Original author of ANU NEWS 4047 Phil Lapsey 4048 Original author of the UNIX reference implementation for NNTP 4049 Iain Lea 4050 Original maintainer of the TIN news reader 4051 Chris Lewis 4052 First known implementer of the AUTHINFO GENERIC extension 4053 Rich Salz 4054 Original author of INN 4055 Henry Spencer 4056 One of the original authors of CNEWS 4057 Kim Storm 4058 Original author of the NN news reader 4060 Other people who contributed to this document include: 4062 Matthias Andree 4063 Greg Andruk 4064 Maurizio Codogno 4065 Andrew Gierth 4066 Juergen Helbing 4067 Scott Hollenbeck 4068 Charles Lindsey 4069 Ade Lovett 4070 Ken Murchinson 4071 Francois Petillon 4072 Peter Robinson 4073 Rob Siemborski 4074 Howard Swinehart 4075 Ruud van Tol 4076 Jeffrey Vinocur 4078 The author thanks them all and apologises to anyone omitted. 4080 Finally, the present author gratefully acknowledges the vast amount 4081 of work put into previous drafts by the previous author: 4082 Stan Barber 4084 13. References 4086 13.1 Normative References 4088 [ANSI1986] 4089 American National Standards Institute, "Coded Character 4090 Set - 7-bit American Standard Code for Information 4091 Interchange", ANSI X3.4, 1986. 4093 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 4094 Requirement Levels", BCP 14, RFC 2119, March 1997. 4096 [RFC2234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 4097 Specifications: ABNF", RFC 2234, November 1997. 4099 [RFC3548] Josefsson, S., "The Base16, Base32, and Base64 Data 4100 Encodings", RFC 3548, July 2003. 4102 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 4103 10646", STD 63, RFC 3629, November 2003. 4105 [RFC977] Kantor, B. and P. Lapsley, "Network News Transfer 4106 Protocol", RFC 977, February 1986. 4108 [TF.686-1] 4109 International Telecommunications Union - Radio, "Glossary, 4110 ITU-R Recommendation TF.686-1", ITU-R Recommendation 4111 TF.686-1, October 1997. 4113 13.2 Informative References 4115 [NNTP-AUTH] 4116 Vinocur, J., Newman, C. and K. Murchinson, "NNTP 4117 Authentication", draft-ietf-nntpext-authinfo-02 (work in 4118 progress), July 2004. 4120 [NNTP-TLS] 4121 Vinocur, J. and C. Newman, "Using TLS with NNTP", 4122 draft-ietf-nntpext-tls-nntp-01 (work in progress), October 4123 2003. 4125 [RFC1036] Horton, M. and R. Adams, "Standard for interchange of 4126 USENET messages", RFC 1036, December 1987. 4128 [RFC1305] Mills, D., "Network Time Protocol (Version 3) 4129 Specification, Implementation", RFC 1305, March 1992. 4131 [RFC1869] Klensin, J., Freed, N., Rose, M., Stefferud, E. and D. 4133 Crocker, "SMTP Service Extensions", STD 10, RFC 1869, 4134 November 1995. 4136 [RFC2616] Fielding, R., Gettys, J., Mogul, J., Nielsen, H., 4137 Masinter, L., Leach, P. and T. Berners-Lee, "Hypertext 4138 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. 4140 [RFC2629] Rose, M., "Writing I-Ds and RFCs using XML", RFC 2629, 4141 June 1999. 4143 [RFC2822] Resnick, P., "Internet Message Format", RFC 2822, April 4144 2001. 4146 [RFC2980] Barber, S., "Common NNTP Extensions", RFC 2980, October 4147 2000. 4149 [ROBE1995] 4150 Robertson, R., "FAQ: Overview database / NOV General 4151 Information", January 1995. 4153 There is no definitive copy of this document known to the 4154 author. It was previously posted as the Usenet article 4155 4157 [SALZ1992] 4158 Salz, R., "Manual Page for wildmat(3) from the INN 1.4 4159 distribution, Revision 1.10", April 1992. 4161 There is no definitive copy of this document known to the 4162 author. 4164 Author's Address 4166 Clive D.W. Feather 4167 Thus plc 4168 322 Regents Park Road 4169 London N3 2QQ 4170 GB 4172 Phone: +44 20 8495 6138 4173 Fax: +44 870 051 9937 4174 EMail: clive@demon.net 4175 URI: http://www.davros.org/ 4177 Appendix A. Future Directions 4179 It has been proposed that the response code range 6xx be used for 4180 multiline responses. While existing commands and extensions do not 4181 use this, it would at least limit the problem clients would face in 4182 dealing with an unknown response. 4184 Appendix B. Interaction with other specifications 4186 NNTP is most often used for transferring articles that conform to RFC 4187 1036 [RFC1036] (such articles are called "Netnews articles" here). 4188 It is also sometimes used for transferring email messages that 4189 conform to RFC 2822 [RFC2822] (such articles are called "email 4190 articles" here). In this situation, articles must conform both to 4191 this specification and to that other one; this appendix describes 4192 some relevant issues. 4194 B.1 Header folding 4196 NNTP allows a header line to be folded (by inserting a CRLF pair) 4197 before any space or TAB character. 4199 Both email and Netnews articles are required to have at least one 4200 octet other than space or TAB on each header line. Thus folding can 4201 only happen at one point in each sequence of consecutive spaces or 4202 TABs. Netnews articles are further required to have the header name, 4203 colon, and following space all on the first line; folding may only 4204 happen beyond that space. Finally, some non-conforming software will 4205 remove trailing spaces and TABs from a line. Therefore it might be 4206 inadvisable to fold a header after a space or TAB. 4208 For maximum safety, header lines SHOULD conform to the following 4209 syntax rather than that in Section 9.5. 4211 header = header-name ":" SP [header-content] CRLF 4212 header-content = [WS] 1*P-CHAR *( [CRLF] WS 1*P-CHAR ) 4214 B.2 Message-IDs 4216 Every article handled by an NNTP server MUST have a unique 4217 message-id. For the purposes of this specification, a message-id is 4218 an arbitrary opaque string that merely needs to meet certain 4219 syntactic requirements and is just a way to refer to the article. 4221 Because there is a significant risk of old articles being reinjected 4222 into the global Usenet system, RFC 1036 [RFC1036] requires that 4223 message-ids are globally unique for all time. 4225 This specification states that message-ids are the same if and only 4226 if they consist of the same sequence of octets. Other specifications 4227 may define two different sequences as being equal because they are 4228 putting an interpretation on particular characters. RFC 2822 4229 [RFC2822] has a concept of "quoted" and "escaped" characters. It 4230 therefore considers the three message-ids: 4232 4233 <"abcd"@example.com> 4234 <"ab\cd"@example.com> 4235 as being identical. Therefore an NNTP implementation handing email 4236 articles must ensure that only one of these three appears in the 4237 protocol and the other two are converted to it as and when necessary, 4238 such as when a client checks the results of a NEWNEWS command against 4239 an internal database of message-ids. Note that RFC 1036 [RFC1036] 4240 never treats two different strings as being identical. Its draft 4241 successor restricts the syntax of message-ids so that, whenever RFC 4242 2822 would treat two strings as equivalent, only one of them is valid 4243 (in the above example only the first string is valid). 4245 This specification does not describe how the message-id of an article 4246 is determined; it may be deduced from the contents of the article or 4247 derived from some external source. If the server is also conforming 4248 to another specification that contains a definition of message-id 4249 compatible with this one, the server SHOULD use those message-ids. A 4250 common approach, and one that SHOULD be used for email and Netnews 4251 articles, is to extract the message-id from the contents of a header 4252 with name "Message-ID". This may not be as simple as copying the 4253 entire header contents; it may be necessary to strip off comments and 4254 undo quoting, or to reduce "equivalent" message-ids to a canonical 4255 form. 4257 If an article is obtained through the IHAVE command, there will be a 4258 message-id provided with the command. The server MAY either use it 4259 or determine one from the article contents. However, whichever it 4260 does it SHOULD ensure that, if the IHAVE command is repeated with the 4261 same argument and article, it will be recognized as a duplicate. 4263 If an article does not contain a message-id that the server can 4264 identify, it MUST synthesize one. This could, for example, be a 4265 simple sequence number or based on the date and time that the article 4266 arrived. When handling email or Netnews articles, a Message-ID 4267 header SHOULD be added to ensure global consistency and uniqueness. 4269 B.3 Article posting 4271 As far as NNTP is concerned, the POST and IHAVE commands provide the 4272 same basic facilities in a slightly different way. However they have 4273 rather different intentions. 4275 The IHAVE command is intended for transmitting conforming articles 4276 between a system of NNTP servers, with all articles perhaps also 4277 conforming to another specification (e.g. all articles are Netnews 4278 articles). It is expected that the client will have already done any 4279 necessary validation (or has in turn obtained the article from a 4280 third party which has done so); therefore the contents SHOULD be left 4281 unchanged. 4283 In contrast, the POST command is intended for use when an end-user is 4284 injecting a newly-created article into a such a system. The article 4285 being transferred might not be a conforming email or Netnews article, 4286 and the server is expected to validate it and, if necessary, convert 4287 it to the right form for onward distribution. It is often the case 4288 that this is done by a separate piece of software on the server 4289 installation. If so, the NNTP server SHOULD pass the incoming 4290 article to that software unaltered, making no attempt to filter 4291 characters, fold or limit lines, or otherwise process the incoming 4292 text. 4294 The POST command can fail in various ways and clients should be 4295 prepared to re-send an article. When doing so, however, it is often 4296 important to ensure - as far as possible - that the same message-id 4297 is allocated to both attempts so that the server, or other servers, 4298 can recognize the two articles as being duplicates. In the case of 4299 email or Netnews articles, therefore, the posted article SHOULD 4300 contain a header with name "Message-ID" and the contents of this 4301 header SHOULD be identical on each attempt. The server SHOULD ensure 4302 that two POSTed articles with the same contents for this header are 4303 recognized as identical and the same message-id allocated, whether or 4304 not those contents are suitable for use as the message-id. 4306 Appendix C. Summary of Response Codes 4308 This section contains a list of every response code defined in this 4309 document, whether it is multi-line, which commands can generate it, 4310 what arguments it has, and what its meaning is. 4312 Response code 100 (multi-line) 4313 Generated by: HELP 4314 Meaning: help text follows. 4315 Response code 111 4316 Generated by: DATE 4317 1 argument: yyyymmddhhmmss 4318 Meaning: server date and time. 4319 Response code 200 4320 Generated by: initial connection, MODE READER 4321 Meaning: service available, posting allowed. 4322 Response code 201 4323 Generated by: initial connection, MODE READER 4324 Meaning: service available, posting prohibited. 4325 Response code 202 (multi-line) 4326 Generated by: LIST EXTENSIONS 4327 Meaning: extension list follows. 4328 Response code 205 4329 Generated by: QUIT 4330 Meaning: connection closing (the server immediately closes the 4331 connection). 4332 Response code 211 4333 The 211 response code has two completely different forms depending 4334 on which command generated it: 4335 Generated by: GROUP 4336 4 arguments: number low high group 4337 Meaning: group selected. 4338 (multi-line) 4339 Generated by: LISTGROUP 4340 4 arguments: number low high group 4341 Meaning: article numbers follow. 4342 Response code 215 (multi-line) 4343 Generated by: LIST ACTIVE, LIST ACTIVE.TIMES, LIST DISTRIB.PATS, 4344 LIST DISTRIBUTIONS, LIST HEADERS, LIST NEWSGROUPS, 4345 LIST OVERVIEW.FMT 4346 Meaning: information follows. 4347 Response code 220 (multi-line) 4348 Generated by: ARTICLE 4349 2 arguments: n message-id 4350 Meaning: article follows. 4352 Response code 221 (multi-line) 4353 Generated by: HEAD 4354 2 arguments: n message-id 4355 Meaning: article headers follow. 4356 Response code 222 (multi-line) 4357 Generated by: BODY 4358 2 arguments: n message-id 4359 Meaning: article body follows. 4360 Response code 223 4361 Generated by: LAST, NEXT, STAT 4362 2 arguments: n message-id 4363 Meaning: article exists and selected. 4364 Response code 224 (multi-line) 4365 Generated by: OVER 4366 Meaning: overview information follows. 4367 Response code 225 (multi-line) 4368 Generated by: HDR 4369 Meaning: headers follow. 4370 Response code 230 (multi-line) 4371 Generated by: NEWNEWS 4372 Meaning: list of new articles follows. 4373 Response code 231 (multi-line) 4374 Generated by: NEWGROUPS 4375 Meaning: list of new newsgroups follows. 4376 Response code 235 4377 Generated by: IHAVE (second stage) 4378 Meaning: article transferred OK. 4379 Response code 240 4380 Generated by: POST (second stage) 4381 Meaning: article received OK. 4382 Response code 335 4383 Generated by: IHAVE (first stage) 4384 Meaning: send article to be transferred. 4385 Response code 340 4386 Generated by: POST (first stage) 4387 Meaning: send article to be posted. 4388 Response code 400 4389 Generic response and generated by initial connection 4390 Meaning: service not available or no longer available (the server 4391 immediately closes the connection). 4392 Response code 401 4393 Generic response 4394 1 argument: extension-label 4395 Meaning: the server is in the wrong mode; the indicated extension 4396 should be used to change the mode. 4398 Response code 402 4399 Generated by: LIST EXTENSIONS 4400 Meaning: server has no extensions. 4401 Response code 403 4402 Generic response 4403 Meaning: internal fault or problem preventing action being taken. 4404 Response code 411 4405 Generated by: GROUP, LISTGROUP 4406 Meaning: no such newsgroup. 4407 Response code 412 4408 Generated by: ARTICLE, BODY, HDR, HEAD, LAST, LISTGROUP, NEXT, 4409 OVER, STAT 4410 Meaning: no newsgroup selected. 4411 Response code 420 4412 Generated by: ARTICLE, BODY, HDR, HEAD, LAST, NEXT, OVER, STAT 4413 Meaning: current article number is invalid. 4414 Response code 421 4415 Generated by: NEXT 4416 Meaning: no next article in this group. 4417 Response code 422 4418 Generated by: LAST 4419 Meaning: no previous article in this group. 4420 Response code 423 4421 Generated by: ARTICLE, BODY, HDR, HEAD, OVER, STAT 4422 Meaning: no article with that number or in that range. 4423 Response code 430 4424 Generated by: ARTICLE, BODY, HDR, HEAD, OVER, STAT 4425 Meaning: no article with that message-id. 4426 Response code 435 4427 Generated by: IHAVE (first stage) 4428 Meaning: article not wanted. 4429 Response code 436 4430 Generated by: IHAVE (either stage) 4431 Meaning: transfer not possible (first stage) or failed (second 4432 stage); try again later. 4433 Response code 437 4434 Generated by: IHAVE (second stage) 4435 Meaning: transfer rejected; do not retry. 4436 Response code 440 4437 Generated by: POST (first stage) 4438 Meaning: posting not permitted. 4439 Response code 441 4440 Generated by: POST (second stage) 4441 Meaning: posting failed. 4442 Response code 480 4443 Generic response 4444 Meaning: command unavailable until the client has authenticated 4445 itself. 4447 Response code 483 4448 Generic response 4449 Meaning: command unavailable until suitable privacy has been 4450 arranged. 4451 Response code 500 4452 Generic response 4453 Meaning: unknown command. 4454 Response code 501 4455 Generic response 4456 Meaning: syntax error in command. 4457 Response code 502 4458 Generic response and generated by initial connection 4459 Meaning for the initial connection and the MODE READER command: 4460 service permanently unavailable (the server immediately closes the 4461 connection). 4462 Meaning for all other commands: command not permitted (and there 4463 is no way for the client to change this). 4464 Response code 503 4465 Generic response 4466 Meaning: feature not supported. 4467 Response code 504 4468 Generic response 4469 Meaning: error in base64-encoding [RFC3548] of an argument 4471 Appendix D. Formal specification of the standard extensions 4473 This section gives a formal definition of each of the extensions in 4474 Section 8.2 as required by Section 8 for the IANA registry. 4476 D.1 The LISTGROUP extension 4478 o This extension provides information about specific article 4479 numbers. 4480 o The extension-label is "LISTGROUP". 4481 o The extension-label has no arguments. 4482 o The extension defines one new command: LISTGROUP, whose behaviour, 4483 arguments, and responses are defined in Section 8.3. 4484 o The extension does not associate any new responses with 4485 pre-existing NNTP commands. 4486 o The extension does not affect the behaviour of a server or client 4487 other than via the new command. 4488 o The extension does not affect the maximum length of commands and 4489 initial response lines. 4490 o The extension does not alter pipelining, and the LISTGROUP command 4491 can be pipelined. 4492 o Use of this extension does not alter the output from LIST 4493 EXTENSIONS. 4494 o The extension does not cause any pre-existing command to produce a 4495 401, 480, or 483 response. 4496 o The LISTGROUP command can only be used after the MODE READER 4497 command. 4499 D.2 The OVER extension 4501 o This extension provides support for an overview of newsgroups. 4502 o The extension-label is "OVER". 4503 o The extension-label has the optional argument "MSGID", indicating 4504 that the message-id variant of the OVER command is supported. 4505 o The extension defines two new commands: OVER and LIST 4506 OVERVIEW.FMT, whose behaviour, arguments, and responses are 4507 defined in Section 8.5. 4508 o The extension does not associate any new responses with 4509 pre-existing NNTP commands. 4510 o The extension requires the server to maintain an overview database 4511 and article metadata, as described in Section 8.4. 4512 o The extension does not affect the maximum length of commands and 4513 initial response lines. 4514 o The extension does not alter pipelining, and the OVER and LIST 4515 OVERVIEW.FMT commands can be pipelined. 4516 o Use of this extension does not alter the output from LIST 4517 EXTENSIONS. 4519 o The extension does not cause any pre-existing command to produce a 4520 401, 480, or 483 response. 4521 o The OVER and LIST OVERVIEW.FMT commands can only be used after the 4522 MODE READER command. 4524 D.3 The HDR extension 4526 o This extension provides batched header retrieval. 4527 o The extension-label is "HDR". 4528 o The extension-label has no arguments. 4529 o The extension defines two new commands: HDR and LIST HEADERS, 4530 whose behaviour, arguments, and responses are defined in Section 4531 8.6. 4532 o The extension does not associate any new responses with 4533 pre-existing NNTP commands. 4534 o The extension requires the server to maintain article metadata, as 4535 described in Section 8.4. 4536 o The extension does not affect the maximum length of commands and 4537 initial response lines. 4538 o The extension does not alter pipelining, and the HDR and LIST 4539 HEADERS commands can be pipelined. 4540 o Use of this extension does not alter the output from LIST 4541 EXTENSIONS. 4542 o The extension does not cause any pre-existing command to produce a 4543 401, 480, or 483 response. 4544 o The HDR and LIST HEADERS commands can only be used after the MODE 4545 READER command. 4547 Intellectual Property Statement 4549 The IETF takes no position regarding the validity or scope of any 4550 Intellectual Property Rights or other rights that might be claimed to 4551 pertain to the implementation or use of the technology described in 4552 this document or the extent to which any license under such rights 4553 might or might not be available; nor does it represent that it has 4554 made any independent effort to identify any such rights. Information 4555 on the procedures with respect to rights in RFC documents can be 4556 found in BCP 78 and BCP 79. 4558 Copies of IPR disclosures made to the IETF Secretariat and any 4559 assurances of licenses to be made available, or the result of an 4560 attempt made to obtain a general license or permission for the use of 4561 such proprietary rights by implementers or users of this 4562 specification can be obtained from the IETF on-line IPR repository at 4563 http://www.ietf.org/ipr. 4565 The IETF invites any interested party to bring to its attention any 4566 copyrights, patents or patent applications, or other proprietary 4567 rights that may cover technology that may be required to implement 4568 this standard. Please address the information to the IETF at 4569 ietf-ipr@ietf.org. 4571 Disclaimer of Validity 4573 This document and the information contained herein are provided on an 4574 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS 4575 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET 4576 ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, 4577 INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE 4578 INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED 4579 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 4581 Copyright Statement 4583 Copyright (C) The Internet Society (2004). This document is subject 4584 to the rights, licenses and restrictions contained in BCP 78, and 4585 except as set forth therein, the authors retain all their rights. 4587 Acknowledgment 4589 Funding for the RFC Editor function is currently provided by the 4590 Internet Society.