Add some checks to prevent #13 happen.
authorcli
Sun, 29 Aug 2010 17:43:58 +0200
changeset 36c404a87db5b7
parent 35 ed84c8bdd87b
child 37 74139325d305
Add some checks to prevent #13 happen.
RFC3977
RFC3977.pdf
build.xml
doc/RFC3977
doc/RFC3977.pdf
src/org/sonews/mlgw/Dispatcher.java
src/org/sonews/util/Purger.java
     1.1 --- a/RFC3977	Sun Aug 29 17:28:58 2010 +0200
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,6998 +0,0 @@
     1.4 -
     1.5 -Network Working Group                                         C. Feather
     1.6 -Request for Comments: 3977                                      THUS plc
     1.7 -Obsoletes: 977                                              October 2006
     1.8 -Updates: 2980
     1.9 -Category: Standards Track
    1.10 -
    1.11 -
    1.12 -                 Network News Transfer Protocol (NNTP)
    1.13 -
    1.14 -Status of This Memo
    1.15 -
    1.16 -   This document specifies an Internet standards track protocol for the
    1.17 -   Internet community, and requests discussion and suggestions for
    1.18 -   improvements.  Please refer to the current edition of the "Internet
    1.19 -   Official Protocol Standards" (STD 1) for the standardization state
    1.20 -   and status of this protocol.  Distribution of this memo is unlimited.
    1.21 -
    1.22 -Copyright Notice
    1.23 -
    1.24 -   Copyright (C) The Internet Society (2006).
    1.25 -
    1.26 -Abstract
    1.27 -
    1.28 -   The Network News Transfer Protocol (NNTP) has been in use in the
    1.29 -   Internet for a decade, and remains one of the most popular protocols
    1.30 -   (by volume) in use today.  This document is a replacement for
    1.31 -   RFC 977, and officially updates the protocol specification.  It
    1.32 -   clarifies some vagueness in RFC 977, includes some new base
    1.33 -   functionality, and provides a specific mechanism to add standardized
    1.34 -   extensions to NNTP.
    1.35 -
    1.36 -Table of Contents
    1.37 -
    1.38 -   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .  3
    1.39 -     1.1.  Author's Note . . . . . . . . . . . . . . . . . . . . . .  4
    1.40 -   2.  Notation  . . . . . . . . . . . . . . . . . . . . . . . . . .  5
    1.41 -   3.  Basic Concepts  . . . . . . . . . . . . . . . . . . . . . . .  6
    1.42 -     3.1.  Commands and Responses  . . . . . . . . . . . . . . . . .  6
    1.43 -       3.1.1.  Multi-line Data Blocks . . . . . . . . . . . . . . . . 8
    1.44 -     3.2.  Response Codes  . . . . . . . . . . . . . . . . . . . . .  9
    1.45 -       3.2.1.  Generic Response Codes  . . . . . . . . . . . . . . . 10
    1.46 -         3.2.1.1.  Examples  . . . . . . . . . . . . . . . . . . . . 12
    1.47 -     3.3.  Capabilities and Extensions . . . . . . . . . . . . . . . 14
    1.48 -       3.3.1.  Capability Descriptions . . . . . . . . . . . . . . . 14
    1.49 -       3.3.2.  Standard Capabilities . . . . . . . . . . . . . . . . 15
    1.50 -       3.3.3.  Extensions  . . . . . . . . . . . . . . . . . . . . . 16
    1.51 -       3.3.4.  Initial IANA Register . . . . . . . . . . . . . . . . 18
    1.52 -     3.4.  Mandatory and Optional Commands . . . . . . . . . . . . . 20
    1.53 -
    1.54 -
    1.55 -
    1.56 -Feather                     Standards Track                     [Page 1]
    1.57 -
    1.58 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
    1.59 -
    1.60 -
    1.61 -       3.4.1.  Reading and Transit Servers . . . . . . . . . . . . . 21
    1.62 -       3.4.2.  Mode Switching  . . . . . . . . . . . . . . . . . . . 21
    1.63 -     3.5.  Pipelining  . . . . . . . . . . . . . . . . . . . . . . . 22
    1.64 -       3.5.1.  Examples  . . . . . . . . . . . . . . . . . . . . . . 23
    1.65 -     3.6.  Articles  . . . . . . . . . . . . . . . . . . . . . . . . 24
    1.66 -   4.  The WILDMAT Format  . . . . . . . . . . . . . . . . . . . . . 25
    1.67 -     4.1.  Wildmat Syntax  . . . . . . . . . . . . . . . . . . . . . 26
    1.68 -     4.2.  Wildmat Semantics . . . . . . . . . . . . . . . . . . . . 26
    1.69 -     4.3.  Extensions  . . . . . . . . . . . . . . . . . . . . . . . 27
    1.70 -     4.4.  Examples  . . . . . . . . . . . . . . . . . . . . . . . . 27
    1.71 -   5.  Session Administration Commands . . . . . . . . . . . . . . . 28
    1.72 -     5.1.  Initial Connection  . . . . . . . . . . . . . . . . . . . 28
    1.73 -     5.2.  CAPABILITIES  . . . . . . . . . . . . . . . . . . . . . . 29
    1.74 -     5.3.  MODE READER . . . . . . . . . . . . . . . . . . . . . . . 32
    1.75 -     5.4.  QUIT  . . . . . . . . . . . . . . . . . . . . . . . . . . 34
    1.76 -   6.  Article Posting and Retrieval . . . . . . . . . . . . . . . . 35
    1.77 -     6.1.  Group and Article Selection . . . . . . . . . . . . . . . 36
    1.78 -       6.1.1.  GROUP . . . . . . . . . . . . . . . . . . . . . . . . 36
    1.79 -       6.1.2.  LISTGROUP . . . . . . . . . . . . . . . . . . . . . . 39
    1.80 -       6.1.3.  LAST  . . . . . . . . . . . . . . . . . . . . . . . . 42
    1.81 -       6.1.4.  NEXT  . . . . . . . . . . . . . . . . . . . . . . . . 44
    1.82 -     6.2.  Retrieval of Articles and Article Sections  . . . . . . . 45
    1.83 -       6.2.1.  ARTICLE . . . . . . . . . . . . . . . . . . . . . . . 46
    1.84 -       6.2.2.  HEAD  . . . . . . . . . . . . . . . . . . . . . . . . 49
    1.85 -       6.2.3.  BODY  . . . . . . . . . . . . . . . . . . . . . . . . 51
    1.86 -       6.2.4.  STAT  . . . . . . . . . . . . . . . . . . . . . . . . 53
    1.87 -     6.3.  Article Posting . . . . . . . . . . . . . . . . . . . . . 56
    1.88 -       6.3.1.  POST  . . . . . . . . . . . . . . . . . . . . . . . . 56
    1.89 -       6.3.2.  IHAVE . . . . . . . . . . . . . . . . . . . . . . . . 58
    1.90 -   7.  Information Commands  . . . . . . . . . . . . . . . . . . . . 61
    1.91 -     7.1.  DATE  . . . . . . . . . . . . . . . . . . . . . . . . . . 61
    1.92 -     7.2.  HELP  . . . . . . . . . . . . . . . . . . . . . . . . . . 62
    1.93 -     7.3.  NEWGROUPS . . . . . . . . . . . . . . . . . . . . . . . . 63
    1.94 -     7.4.  NEWNEWS . . . . . . . . . . . . . . . . . . . . . . . . . 64
    1.95 -     7.5.  Time  . . . . . . . . . . . . . . . . . . . . . . . . . . 65
    1.96 -       7.5.1.  Examples  . . . . . . . . . . . . . . . . . . . . . . 66
    1.97 -     7.6.  The LIST Commands . . . . . . . . . . . . . . . . . . . . 66
    1.98 -       7.6.1.  LIST  . . . . . . . . . . . . . . . . . . . . . . . . 67
    1.99 -       7.6.2.  Standard LIST Keywords  . . . . . . . . . . . . . . . 69
   1.100 -       7.6.3.  LIST ACTIVE . . . . . . . . . . . . . . . . . . . . . 70
   1.101 -       7.6.4.  LIST ACTIVE.TIMES . . . . . . . . . . . . . . . . . . 71
   1.102 -       7.6.5.  LIST DISTRIB.PATS . . . . . . . . . . . . . . . . . . 72
   1.103 -       7.6.6.  LIST NEWSGROUPS . . . . . . . . . . . . . . . . . . . 73
   1.104 -   8.  Article Field Access Commands . . . . . . . . . . . . . . . . 73
   1.105 -     8.1.  Article Metadata  . . . . . . . . . . . . . . . . . . . . 74
   1.106 -       8.1.1.  The :bytes Metadata Item  . . . . . . . . . . . . . . 74
   1.107 -       8.1.2.  The :lines Metadata Item  . . . . . . . . . . . . . . 75
   1.108 -     8.2.  Database Consistency  . . . . . . . . . . . . . . . . . . 75
   1.109 -
   1.110 -
   1.111 -
   1.112 -Feather                     Standards Track                     [Page 2]
   1.113 -
   1.114 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
   1.115 -
   1.116 -
   1.117 -     8.3.  OVER  . . . . . . . . . . . . . . . . . . . . . . . . . . 76
   1.118 -     8.4.  LIST OVERVIEW.FMT . . . . . . . . . . . . . . . . . . . . 81
   1.119 -     8.5.  HDR . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
   1.120 -     8.6.  LIST HEADERS  . . . . . . . . . . . . . . . . . . . . . . 87
   1.121 -   9.  Augmented BNF Syntax for NNTP . . . . . . . . . . . . . . . . 90
   1.122 -     9.1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . 90
   1.123 -     9.2.  Commands  . . . . . . . . . . . . . . . . . . . . . . . . 92
   1.124 -     9.3.  Command Continuation  . . . . . . . . . . . . . . . . . . 93
   1.125 -     9.4.  Responses . . . . . . . . . . . . . . . . . . . . . . . . 93
   1.126 -       9.4.1.  Generic Responses . . . . . . . . . . . . . . . . . . 93
   1.127 -       9.4.2.  Initial Response Line Contents  . . . . . . . . . . . 94
   1.128 -       9.4.3.  Multi-line Response Contents  . . . . . . . . . . . . 94
   1.129 -     9.5.  Capability Lines  . . . . . . . . . . . . . . . . . . . . 95
   1.130 -     9.6.  LIST Variants . . . . . . . . . . . . . . . . . . . . . . 96
   1.131 -     9.7.  Articles  . . . . . . . . . . . . . . . . . . . . . . . . 97
   1.132 -     9.8.  General Non-terminals . . . . . . . . . . . . . . . . . . 97
   1.133 -     9.9.  Extensions and Validation . . . . . . . . . . . . . . . . 99
   1.134 -   10. Internationalisation Considerations . . . . . . . . . . . . .100
   1.135 -     10.1. Introduction and Historical Situation . . . . . . . . . .100
   1.136 -     10.2. This Specification  . . . . . . . . . . . . . . . . . . .101
   1.137 -     10.3. Outstanding Issues  . . . . . . . . . . . . . . . . . . .102
   1.138 -   11. IANA Considerations . . . . . . . . . . . . . . . . . . . . .103
   1.139 -   12. Security Considerations . . . . . . . . . . . . . . . . . . .103
   1.140 -     12.1. Personal and Proprietary Information  . . . . . . . . . .104
   1.141 -     12.2. Abuse of Server Log Information . . . . . . . . . . . . .104
   1.142 -     12.3. Weak Authentication and Access Control  . . . . . . . . .104
   1.143 -     12.4. DNS Spoofing  . . . . . . . . . . . . . . . . . . . . . .104
   1.144 -     12.5. UTF-8 Issues  . . . . . . . . . . . . . . . . . . . . . .105
   1.145 -     12.6. Caching of Capability Lists . . . . . . . . . . . . . . .106
   1.146 -   13. Acknowledgements  . . . . . . . . . . . . . . . . . . . . . .107
   1.147 -   14. References  . . . . . . . . . . . . . . . . . . . . . . . . .110
   1.148 -     14.1. Normative References  . . . . . . . . . . . . . . . . . .110
   1.149 -     14.2. Informative References  . . . . . . . . . . . . . . . . .110
   1.150 -   A.  Interaction with Other Specifications . . . . . . . . . . . .112
   1.151 -     A.1.  Header Folding  . . . . . . . . . . . . . . . . . . . . .112
   1.152 -     A.2.  Message-IDs . . . . . . . . . . . . . . . . . . . . . . .112
   1.153 -     A.3.  Article Posting . . . . . . . . . . . . . . . . . . . . .114
   1.154 -   B.  Summary of Commands . . . . . . . . . . . . . . . . . . . . .115
   1.155 -   C.  Summary of Response Codes . . . . . . . . . . . . . . . . . .117
   1.156 -   D.  Changes from RFC 977  . . . . . . . . . . . . . . . . . . . .121
   1.157 -
   1.158 -1.  Introduction
   1.159 -
   1.160 -   This document specifies the Network News Transfer Protocol (NNTP),
   1.161 -   which is used for the distribution, inquiry, retrieval, and posting
   1.162 -   of Netnews articles using a reliable stream-based mechanism.  For
   1.163 -   news-reading clients, NNTP enables retrieval of news articles that
   1.164 -
   1.165 -
   1.166 -
   1.167 -
   1.168 -Feather                     Standards Track                     [Page 3]
   1.169 -
   1.170 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
   1.171 -
   1.172 -
   1.173 -   are stored in a central database, giving subscribers the ability to
   1.174 -   select only those articles they wish to read.
   1.175 -
   1.176 -   The Netnews model provides for indexing, cross-referencing, and
   1.177 -   expiration of aged messages.  NNTP is designed for efficient
   1.178 -   transmission of Netnews articles over a reliable full duplex
   1.179 -   communication channel.
   1.180 -
   1.181 -   Although the protocol specification in this document is largely
   1.182 -   compatible with the version specified in RFC 977 [RFC977], a number
   1.183 -   of changes are summarised in Appendix D.  In particular:
   1.184 -
   1.185 -   o  the default character set is changed from US-ASCII [ANSI1986] to
   1.186 -      UTF-8 [RFC3629] (note that US-ASCII is a subset of UTF-8);
   1.187 -
   1.188 -   o  a number of commands that were optional in RFC 977 or that have
   1.189 -      been taken from RFC 2980 [RFC2980] are now mandatory; and
   1.190 -
   1.191 -   o  a CAPABILITIES command has been added to allow clients to
   1.192 -      determine what functionality is available from a server.
   1.193 -
   1.194 -   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   1.195 -   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
   1.196 -   document are to be interpreted as described in RFC 2119 [RFC2119].
   1.197 -
   1.198 -   An implementation is not compliant if it fails to satisfy one or more
   1.199 -   of the MUST requirements for this protocol.  An implementation that
   1.200 -   satisfies all the MUST and all the SHOULD requirements for its
   1.201 -   protocols is said to be "unconditionally compliant"; one that
   1.202 -   satisfies all the MUST requirements but not all the SHOULD
   1.203 -   requirements for NNTP is said to be "conditionally compliant".
   1.204 -
   1.205 -   For the remainder of this document, the terms "client" and "client
   1.206 -   host" refer to a host making use of the NNTP service, while the terms
   1.207 -   "server" and "server host" refer to a host that offers the NNTP
   1.208 -   service.
   1.209 -
   1.210 -1.1.  Author's Note
   1.211 -
   1.212 -   This document is written in XML using an NNTP-specific DTD.  Custom
   1.213 -   software is used to convert this to RFC 2629 [RFC2629] format, and
   1.214 -   then the public "xml2rfc" package to further reduce this to text,
   1.215 -   nroff source, and HTML.
   1.216 -
   1.217 -   No perl was used in producing this document.
   1.218 -
   1.219 -
   1.220 -
   1.221 -
   1.222 -
   1.223 -
   1.224 -Feather                     Standards Track                     [Page 4]
   1.225 -
   1.226 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
   1.227 -
   1.228 -
   1.229 -2.  Notation
   1.230 -
   1.231 -   The following notational conventions are used in this document.
   1.232 -
   1.233 -     UPPERCASE     indicates literal text to be included in the
   1.234 -                   command.
   1.235 -
   1.236 -     lowercase     indicates a token described elsewhere.
   1.237 -
   1.238 -     [brackets]    indicate that the enclosed material is optional.
   1.239 -
   1.240 -     elliptical    indicates that the argument may be repeated any
   1.241 -     ... marks     number of times (it must occur at least once).
   1.242 -
   1.243 -     vertical|bar  indicates a choice of two mutually exclusive
   1.244 -                   arguments (exactly one must be provided).
   1.245 -
   1.246 -   The name "message-id" for a command or response argument indicates
   1.247 -   that it is the message-id of an article as described in Section 3.6,
   1.248 -   including the angle brackets.
   1.249 -
   1.250 -   The name "wildmat" for an argument indicates that it is a wildmat as
   1.251 -   defined in Section 4.  If the argument does not meet the requirements
   1.252 -   of that section (for example, if it does not fit the grammar of
   1.253 -   Section 4.1), the NNTP server MAY place some interpretation on it
   1.254 -   (not specified by this document) or otherwise MUST treat it as a
   1.255 -   syntax error.
   1.256 -
   1.257 -   Responses for each command will be described in tables listing the
   1.258 -   required format of a response followed by the meaning that should be
   1.259 -   ascribed to that response.
   1.260 -
   1.261 -   The terms "NUL", "TAB", "LF", "CR, and "space" refer to the octets
   1.262 -   %x00, %x09, %x0A, %x0D, and %x20, respectively (that is, the octets
   1.263 -   with those codes in US-ASCII [ANSI1986] and thus in UTF-8 [RFC3629]).
   1.264 -   The term "CRLF" or "CRLF pair" means the sequence CR immediately
   1.265 -   followed by LF (that is, %x0D.0A).  A "printable US-ASCII character"
   1.266 -   is an octet in the range %x21-7E.  Quoted characters refer to the
   1.267 -   octets with those codes in US-ASCII (so "." and "<" refer to %x2E and
   1.268 -   %x3C) and will always be printable US-ASCII characters; similarly,
   1.269 -   "digit" refers to the octets %x30-39.
   1.270 -
   1.271 -   A "keyword" MUST consist only of US-ASCII letters, digits, and the
   1.272 -   characters dot (".") and dash ("-") and MUST begin with a letter.
   1.273 -   Keywords MUST be at least three characters in length.
   1.274 -
   1.275 -
   1.276 -
   1.277 -
   1.278 -
   1.279 -
   1.280 -Feather                     Standards Track                     [Page 5]
   1.281 -
   1.282 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
   1.283 -
   1.284 -
   1.285 -   Examples in this document are not normative but serve to illustrate
   1.286 -   usages, arguments, and responses.  In the examples, a "[C]" will be
   1.287 -   used to represent the client host and an "[S]" will be used to
   1.288 -   represent the server host.  Most of the examples do not rely on a
   1.289 -   particular server state.  In some cases, however, they do assume that
   1.290 -   the currently selected newsgroup (see the GROUP command,
   1.291 -   Section 6.1.1) is invalid; when so, this is indicated at the start of
   1.292 -   the example.  Examples may use commands or other keywords not defined
   1.293 -   in this specification (such as an XENCRYPT command).  These will be
   1.294 -   used to illustrate some point and do not imply that any such command
   1.295 -   is defined elsewhere or needs to exist in any particular
   1.296 -   implementation.
   1.297 -
   1.298 -   Terms that might be read as specifying details of a client or server
   1.299 -   implementation, such as "database", are used simply to ease
   1.300 -   description.  Provided that implementations conform to the protocol
   1.301 -   and format specifications in this document, no specific technique is
   1.302 -   mandated.
   1.303 -
   1.304 -3.  Basic Concepts
   1.305 -
   1.306 -3.1.  Commands and Responses
   1.307 -
   1.308 -   NNTP operates over any reliable bi-directional 8-bit-wide data stream
   1.309 -   channel.  When the connection is established, the NNTP server host
   1.310 -   MUST send a greeting.  The client host and server host then exchange
   1.311 -   commands and responses (respectively) until the connection is closed
   1.312 -   or aborted.  If the connection used is TCP, then the server host
   1.313 -   starts the NNTP service by listening on a TCP port.  When a client
   1.314 -   host wishes to make use of the service, it MUST establish a TCP
   1.315 -   connection with the server host by connecting to that host on the
   1.316 -   same port on which the server is listening.
   1.317 -
   1.318 -   The character set for all NNTP commands is UTF-8 [RFC3629].  Commands
   1.319 -   in NNTP MUST consist of a keyword, which MAY be followed by one or
   1.320 -   more arguments.  A CRLF pair MUST terminate all commands.  Multiple
   1.321 -   commands MUST NOT be on the same line.  Unless otherwise noted
   1.322 -   elsewhere in this document, arguments SHOULD consist of printable US-
   1.323 -   ASCII characters.  Keywords and arguments MUST each be separated by
   1.324 -   one or more space or TAB characters.  Command lines MUST NOT exceed
   1.325 -   512 octets, which includes the terminating CRLF pair.  The arguments
   1.326 -   MUST NOT exceed 497 octets.  A server MAY relax these limits for
   1.327 -   commands defined in an extension.
   1.328 -
   1.329 -   Where this specification permits UTF-8 characters outside the range
   1.330 -   of U+0000 to U+007F, implementations MUST NOT use the Byte Order Mark
   1.331 -   (U+FEFF, encoding %xEF.BB.BF) and MUST use the Word Joiner (U+2060,
   1.332 -   encoding %xE2.91.A0) for the meaning Zero Width No-Break Space in
   1.333 -
   1.334 -
   1.335 -
   1.336 -Feather                     Standards Track                     [Page 6]
   1.337 -
   1.338 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
   1.339 -
   1.340 -
   1.341 -   command lines and the initial lines of responses.  Implementations
   1.342 -   SHOULD apply these same principles throughout.
   1.343 -
   1.344 -   The term "character" means a single Unicode code point.
   1.345 -   Implementations are not required to carry out Unicode normalisation.
   1.346 -   Thus, U+0084 (A-dieresis) is one character, while U+0041 U+0308 (A
   1.347 -   composed with dieresis) is two; the two need not be treated as
   1.348 -   equivalent.
   1.349 -
   1.350 -   Commands may have variants; if so, they use a second keyword
   1.351 -   immediately after the first to indicate which variant is required.
   1.352 -   The only such commands in this specification are LIST and MODE.  Note
   1.353 -   that such variants are sometimes referred to as if they were commands
   1.354 -   in their own right: "the LIST ACTIVE" command should be read as
   1.355 -   shorthand for "the ACTIVE variant of the LIST command".
   1.356 -
   1.357 -   Keywords are case insensitive; the case of keywords for commands MUST
   1.358 -   be ignored by the server.  Command and response arguments are case or
   1.359 -   language specific only when stated, either in this document or in
   1.360 -   other relevant specifications.
   1.361 -
   1.362 -   In some cases, a command involves more data than just a single line.
   1.363 -   The further data may be sent either immediately after the command
   1.364 -   line (there are no instances of this in this specification, but there
   1.365 -   are in extensions such as [NNTP-STREAM]) or following a request from
   1.366 -   the server (indicated by a 3xx response).
   1.367 -
   1.368 -   Each response MUST start with a three-digit response code that is
   1.369 -   sufficient to distinguish all responses.  Certain valid responses are
   1.370 -   defined to be multi-line; for all others, the response is contained
   1.371 -   in a single line.  The initial line of the response MUST NOT exceed
   1.372 -   512 octets, which includes the response code and the terminating CRLF
   1.373 -   pair; an extension MAY specify a greater maximum for commands that it
   1.374 -   defines, but not for any other command.  Single-line responses
   1.375 -   consist of an initial line only.  Multi-line responses consist of an
   1.376 -   initial line followed by a multi-line data block.
   1.377 -
   1.378 -   An NNTP server MAY have an inactivity autologout timer.  Such a timer
   1.379 -   SHOULD be of at least three minutes' duration, with the exception
   1.380 -   that there MAY be a shorter limit on how long the server is willing
   1.381 -   to wait for the first command from the client.  The receipt of any
   1.382 -   command from the client during the timer interval SHOULD suffice to
   1.383 -   reset the autologout timer.  Similarly, the receipt of any
   1.384 -   significant amount of data from a client that is sending a multi-line
   1.385 -   data block (such as during a POST or IHAVE command) SHOULD suffice to
   1.386 -   reset the autologout timer.  When the timer expires, the server
   1.387 -   SHOULD close the connection without sending any response to the
   1.388 -   client.
   1.389 -
   1.390 -
   1.391 -
   1.392 -Feather                     Standards Track                     [Page 7]
   1.393 -
   1.394 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
   1.395 -
   1.396 -
   1.397 -3.1.1.  Multi-line Data Blocks
   1.398 -
   1.399 -   A multi-line data block is used in certain commands and responses.
   1.400 -   It MUST adhere to the following rules:
   1.401 -
   1.402 -   1.  The block consists of a sequence of zero or more "lines", each
   1.403 -       being a stream of octets ending with a CRLF pair.  Apart from
   1.404 -       those line endings, the stream MUST NOT include the octets NUL,
   1.405 -       LF, or CR.
   1.406 -
   1.407 -   2.  In a multi-line response, the block immediately follows the CRLF
   1.408 -       at the end of the initial line of the response.  When used in any
   1.409 -       other context, the specific command will define when the block is
   1.410 -       sent.
   1.411 -
   1.412 -   3.  If any line of the data block begins with the "termination octet"
   1.413 -       ("." or %x2E), that line MUST be "dot-stuffed" by prepending an
   1.414 -       additional termination octet to that line of the block.
   1.415 -
   1.416 -   4.  The lines of the block MUST be followed by a terminating line
   1.417 -       consisting of a single termination octet followed by a CRLF pair
   1.418 -       in the normal way.  Thus, unless it is empty, a multi-line block
   1.419 -       is always terminated with the five octets CRLF "." CRLF
   1.420 -       (%x0D.0A.2E.0D.0A).
   1.421 -
   1.422 -   5.  When a multi-line block is interpreted, the "dot-stuffing" MUST
   1.423 -       be undone; i.e., the recipient MUST ensure that, in any line
   1.424 -       beginning with the termination octet followed by octets other
   1.425 -       than a CRLF pair, that initial termination octet is disregarded.
   1.426 -
   1.427 -   6.  Likewise, the terminating line ("." CRLF or %x2E.0D.0A) MUST NOT
   1.428 -       be considered part of the multi-line block; i.e., the recipient
   1.429 -       MUST ensure that any line beginning with the termination octet
   1.430 -       followed immediately by a CRLF pair is disregarded.  (The first
   1.431 -       CRLF pair of the terminating CRLF "." CRLF of a non-empty block
   1.432 -       is, of course, part of the last line of the block.)
   1.433 -
   1.434 -   Note that texts using an encoding (such as UTF-16 or UTF-32) that may
   1.435 -   contain the octets NUL, LF, or CR other than a CRLF pair cannot be
   1.436 -   reliably conveyed in the above format (that is, they violate the MUST
   1.437 -   requirement above).  However, except when stated otherwise, this
   1.438 -   specification does not require the content to be UTF-8, and therefore
   1.439 -   (subject to that same requirement) it MAY include octets above and
   1.440 -   below 128 mixed arbitrarily.
   1.441 -
   1.442 -   This document does not place any limit on the length of a line in a
   1.443 -   multi-line block.  However, the standards that define the format of
   1.444 -   articles may do so.
   1.445 -
   1.446 -
   1.447 -
   1.448 -Feather                     Standards Track                     [Page 8]
   1.449 -
   1.450 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
   1.451 -
   1.452 -
   1.453 -3.2.  Response Codes
   1.454 -
   1.455 -   Each response MUST begin with a three-digit status indicator.  These
   1.456 -   are status reports from the server and indicate the response to the
   1.457 -   last command received from the client.
   1.458 -
   1.459 -   The first digit of the response broadly indicates the success,
   1.460 -   failure, or progress of the previous command:
   1.461 -
   1.462 -      1xx - Informative message
   1.463 -      2xx - Command completed OK
   1.464 -      3xx - Command OK so far; send the rest of it
   1.465 -      4xx - Command was syntactically correct but failed for some reason
   1.466 -      5xx - Command unknown, unsupported, unavailable, or syntax error
   1.467 -
   1.468 -   The next digit in the code indicates the function response category:
   1.469 -
   1.470 -      x0x - Connection, setup, and miscellaneous messages
   1.471 -      x1x - Newsgroup selection
   1.472 -      x2x - Article selection
   1.473 -      x3x - Distribution functions
   1.474 -      x4x - Posting
   1.475 -      x8x - Reserved for authentication and privacy extensions
   1.476 -      x9x - Reserved for private use (non-standard extensions)
   1.477 -
   1.478 -   Certain responses contain arguments such as numbers and names in
   1.479 -   addition to the status indicator.  In those cases, to simplify
   1.480 -   interpretation by the client, the number and type of such arguments
   1.481 -   is fixed for each response code, as is whether the code is
   1.482 -   single-line or multi-line.  Any extension MUST follow this principle
   1.483 -   as well.  Note that, for historical reasons, the 211 response code is
   1.484 -   an exception to this in that the response may be single-line or
   1.485 -   multi-line depending on the command (GROUP or LISTGROUP) that
   1.486 -   generated it.  In all other cases, the client MUST only use the
   1.487 -   status indicator itself to determine the nature of the response.  The
   1.488 -   exact response codes that can be returned by any given command are
   1.489 -   detailed in the description of that command.
   1.490 -
   1.491 -   Arguments MUST be separated from the numeric status indicator and
   1.492 -   from each other by a single space.  All numeric arguments MUST be in
   1.493 -   base 10 (decimal) format and MAY have leading zeros.  String
   1.494 -   arguments MUST contain at least one character and MUST NOT contain
   1.495 -   TAB, LF, CR, or space.  The server MAY add any text after the
   1.496 -   response code or last argument, as appropriate, and the client MUST
   1.497 -   NOT make decisions based on this text.  Such text MUST be separated
   1.498 -   from the numeric status indicator or the last argument by at least
   1.499 -   one space.
   1.500 -
   1.501 -
   1.502 -
   1.503 -
   1.504 -Feather                     Standards Track                     [Page 9]
   1.505 -
   1.506 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
   1.507 -
   1.508 -
   1.509 -   The server MUST respond to any command with the appropriate generic
   1.510 -   response (given in Section 3.2.1) if it represents the situation.
   1.511 -   Otherwise, each recognized command MUST return one of the response
   1.512 -   codes specifically listed in its description or in an extension.  A
   1.513 -   server MAY provide extensions to this specification, including new
   1.514 -   commands, new variants or features of existing commands, and other
   1.515 -   ways of changing the internal state of the server.  However, the
   1.516 -   server MUST NOT produce any other responses to a client that does not
   1.517 -   invoke any of the additional features.  (Therefore, a client that
   1.518 -   restricts itself to this specification will only receive the
   1.519 -   responses that are listed.)
   1.520 -
   1.521 -   If a client receives an unexpected response, it SHOULD use the first
   1.522 -   digit of the response to determine the result.  For example, an
   1.523 -   unexpected 2xx should be taken as success, and an unexpected 4xx or
   1.524 -   5xx as failure.
   1.525 -
   1.526 -   Response codes not specified in this document MAY be used for any
   1.527 -   installation-specific additional commands also not specified.  These
   1.528 -   SHOULD be chosen to fit the pattern of x9x specified above.
   1.529 -
   1.530 -   Neither this document nor any registered extension (see
   1.531 -   Section 3.3.3) will specify any response codes of the x9x pattern.
   1.532 -   (Implementers of extensions are accordingly cautioned not to use such
   1.533 -   responses for extensions that may subsequently be submitted for
   1.534 -   registration.)
   1.535 -
   1.536 -3.2.1.  Generic Response Codes
   1.537 -
   1.538 -   The server MUST respond to any command with the appropriate one of
   1.539 -   the following generic responses if it represents the situation.
   1.540 -
   1.541 -   If the command is not recognized, or if it is an optional command
   1.542 -   that is not implemented by the server, the response code 500 MUST be
   1.543 -   returned.
   1.544 -
   1.545 -   If there is a syntax error in the arguments of a recognized command,
   1.546 -   including the case where more arguments are provided than the command
   1.547 -   specifies or the command line is longer than the server accepts, the
   1.548 -   response code 501 MUST be returned.  The line MUST NOT be truncated
   1.549 -   or split and then interpreted.  Note that where a command has
   1.550 -   variants depending on a second keyword (e.g., LIST ACTIVE and LIST
   1.551 -   NEWSGROUPS), 501 MUST be used when the base command is implemented
   1.552 -   but the requested variant is not, and 500 MUST be used only when the
   1.553 -   base command itself is not implemented.
   1.554 -
   1.555 -   If an argument is required to be a base64-encoded string [RFC4648]
   1.556 -   (there are no such arguments in this specification, but there may be
   1.557 -
   1.558 -
   1.559 -
   1.560 -Feather                     Standards Track                    [Page 10]
   1.561 -
   1.562 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
   1.563 -
   1.564 -
   1.565 -   in extensions) and is not validly encoded, the response code 504 MUST
   1.566 -   be returned.
   1.567 -
   1.568 -   If the server experiences an internal fault or problem that means it
   1.569 -   is unable to carry out the command (for example, a necessary file is
   1.570 -   missing or a necessary service could not be contacted), the response
   1.571 -   code 403 MUST be returned.  If the server recognizes the command but
   1.572 -   does not provide an optional feature (for example, because it does
   1.573 -   not store the required information), or if it only handles a subset
   1.574 -   of legitimate cases (see the HDR command, Section 8.5, for an
   1.575 -   example), the response code 503 MUST be returned.
   1.576 -
   1.577 -   If the client is not authorized to use the specified facility when
   1.578 -   the server is in its current state, then the appropriate one of the
   1.579 -   following response codes MUST be used.
   1.580 -
   1.581 -   502: It is necessary to terminate the connection and to start a new
   1.582 -      one with the appropriate authority before the command can be used.
   1.583 -      Historically, some mode-switching servers (see Section 3.4.1) used
   1.584 -      this response to indicate that this command will become available
   1.585 -      after the MODE READER command (Section 5.3) is used, but this
   1.586 -      usage does not conform to this specification and MUST NOT be used.
   1.587 -      Note that the server MUST NOT close the connection immediately
   1.588 -      after a 502 response except at the initial connection
   1.589 -      (Section 5.1) and with the MODE READER command.
   1.590 -
   1.591 -   480: The client must authenticate itself to the server (that is, it
   1.592 -      must provide information as to the identity of the client) before
   1.593 -      the facility can be used on this connection.  This will involve
   1.594 -      the use of an authentication extension such as [NNTP-AUTH].
   1.595 -
   1.596 -   483: The client must negotiate appropriate privacy protection on the
   1.597 -      connection.  This will involve the use of a privacy extension such
   1.598 -      as [NNTP-TLS].
   1.599 -
   1.600 -   401: The client must change the state of the connection in some other
   1.601 -      manner.  The first argument of the response MUST be the capability
   1.602 -      label (see Section 5.2) of the facility that provides the
   1.603 -      necessary mechanism (usually an extension, which may be a private
   1.604 -      extension).  The server MUST NOT use this response code except as
   1.605 -      specified by the definition of the capability in question.
   1.606 -
   1.607 -   If the server has to terminate the connection for some reason, it
   1.608 -   MUST give a 400 response code to the next command and then
   1.609 -   immediately close the connection.  Following a 400 response, clients
   1.610 -   SHOULD NOT simply reconnect immediately and retry the same actions.
   1.611 -   Rather, a client SHOULD either use an exponentially increasing delay
   1.612 -   between retries (e.g., double the waiting time after each 400
   1.613 -
   1.614 -
   1.615 -
   1.616 -Feather                     Standards Track                    [Page 11]
   1.617 -
   1.618 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
   1.619 -
   1.620 -
   1.621 -   response) or present any associated text to the user for them to
   1.622 -   decide whether and when to retry.
   1.623 -
   1.624 -   The client MUST be prepared to receive any of these responses for any
   1.625 -   command (except, of course, that the server MUST NOT generate a 500
   1.626 -   response code for mandatory commands).
   1.627 -
   1.628 -3.2.1.1.  Examples
   1.629 -
   1.630 -   Example of an unknown command:
   1.631 -
   1.632 -      [C] MAIL
   1.633 -      [S] 500 Unknown command
   1.634 -
   1.635 -   Example of an unsupported command:
   1.636 -
   1.637 -      [C] CAPABILITIES
   1.638 -      [S] 101 Capability list:
   1.639 -      [S] VERSION 2
   1.640 -      [S] READER
   1.641 -      [S] NEWNEWS
   1.642 -      [S] LIST ACTIVE NEWSGROUPS
   1.643 -      [S] .
   1.644 -      [C] OVER
   1.645 -      [S] 500 Unknown command
   1.646 -
   1.647 -   Example of an unsupported variant:
   1.648 -
   1.649 -      [C] MODE POSTER
   1.650 -      [S] 501 Unknown MODE option
   1.651 -
   1.652 -   Example of a syntax error:
   1.653 -
   1.654 -      [C] ARTICLE a.message.id@no.angle.brackets
   1.655 -      [S] 501 Syntax error
   1.656 -
   1.657 -   Example of an overlong command line:
   1.658 -
   1.659 -      [C] HEAD 53 54 55
   1.660 -      [S] 501 Too many arguments
   1.661 -
   1.662 -   Example of a bad wildmat:
   1.663 -
   1.664 -      [C] LIST ACTIVE u[ks].*
   1.665 -      [S] 501 Syntax error
   1.666 -
   1.667 -
   1.668 -
   1.669 -
   1.670 -
   1.671 -
   1.672 -Feather                     Standards Track                    [Page 12]
   1.673 -
   1.674 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
   1.675 -
   1.676 -
   1.677 -   Example of a base64-encoding error (the second argument is meant to
   1.678 -   be base64 encoded):
   1.679 -
   1.680 -      [C] XENCRYPT RSA abcd=efg
   1.681 -      [S] 504 Base64 encoding error
   1.682 -
   1.683 -   Example of an attempt to access a facility not available to this
   1.684 -   connection:
   1.685 -
   1.686 -      [C] MODE READER
   1.687 -      [S] 200 Reader mode, posting permitted
   1.688 -      [C] IHAVE <i.am.an.article.you.will.want@example.com>
   1.689 -      [S] 500 Permission denied
   1.690 -
   1.691 -   Example of an attempt to access a facility requiring authentication:
   1.692 -
   1.693 -      [C] GROUP secret.group
   1.694 -      [S] 480 Permission denied
   1.695 -
   1.696 -   Example of a successful attempt following such authentication:
   1.697 -
   1.698 -      [C] XSECRET fred flintstone
   1.699 -      [S] 290 Password for fred accepted
   1.700 -      [C] GROUP secret.group
   1.701 -      [S] 211 5 1 20 secret.group selected
   1.702 -
   1.703 -   Example of an attempt to access a facility requiring privacy:
   1.704 -
   1.705 -      [C] GROUP secret.group
   1.706 -      [S] 483 Secure connection required
   1.707 -      [C] XENCRYPT
   1.708 -      [Client and server negotiate encryption on the link]
   1.709 -      [S] 283 Encrypted link established
   1.710 -      [C] GROUP secret.group
   1.711 -      [S] 211 5 1 20 secret.group selected
   1.712 -
   1.713 -   Example of a need to change mode before a facility is used:
   1.714 -
   1.715 -      [C] GROUP binary.group
   1.716 -      [S] 401 XHOST Not on this virtual host
   1.717 -      [C] XHOST binary.news.example.org
   1.718 -      [S] 290 binary.news.example.org virtual host selected
   1.719 -      [C] GROUP binary.group
   1.720 -      [S] 211 5 1 77 binary.group selected
   1.721 -
   1.722 -
   1.723 -
   1.724 -
   1.725 -
   1.726 -
   1.727 -
   1.728 -Feather                     Standards Track                    [Page 13]
   1.729 -
   1.730 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
   1.731 -
   1.732 -
   1.733 -   Example of a temporary failure:
   1.734 -
   1.735 -      [C] GROUP archive.local
   1.736 -      [S] 403 Archive server temporarily offline
   1.737 -
   1.738 -   Example of the server needing to close down immediately:
   1.739 -
   1.740 -      [C] ARTICLE 123
   1.741 -      [S] 400 Power supply failed, running on UPS
   1.742 -      [Server closes connection.]
   1.743 -
   1.744 -3.3.  Capabilities and Extensions
   1.745 -
   1.746 -   Not all NNTP servers provide exactly the same facilities, both
   1.747 -   because this specification allows variation and because servers may
   1.748 -   provide extensions.  A set of facilities that are related are called
   1.749 -   a "capability".  This specification provides a way to determine what
   1.750 -   capabilities are available, includes a list of standard capabilities,
   1.751 -   and includes a mechanism (the extension mechanism) for defining new
   1.752 -   capabilities.
   1.753 -
   1.754 -3.3.1.  Capability Descriptions
   1.755 -
   1.756 -   A client can determine the available capabilities of the server by
   1.757 -   using the CAPABILITIES command (Section 5.2).  This returns a
   1.758 -   capability list, which is a list of capability lines.  Each line
   1.759 -   describes one available capability.
   1.760 -
   1.761 -   Each capability line consists of one or more tokens, which MUST be
   1.762 -   separated by one or more space or TAB characters.  A token is a
   1.763 -   string of 1 or more printable UTF-8 characters (that is, either
   1.764 -   printable US-ASCII characters or any UTF-8 sequence outside the US-
   1.765 -   ASCII range, but not space or TAB).  Unless stated otherwise, tokens
   1.766 -   are case insensitive.  Each capability line consists of the
   1.767 -   following:
   1.768 -
   1.769 -   o  The capability label, which is a keyword indicating the
   1.770 -      capability.  A capability label may be defined by this
   1.771 -      specification or a successor, or by an extension.
   1.772 -
   1.773 -   o  The label is then followed by zero or more tokens, which are
   1.774 -      arguments of the capability.  The form and meaning of these tokens
   1.775 -      is specific to each capability.
   1.776 -
   1.777 -   The server MUST ensure that the capability list accurately reflects
   1.778 -   the capabilities (including extensions) currently available.  If a
   1.779 -   capability is only available with the server in a certain state (for
   1.780 -   example, only after authentication), the list MUST only include the
   1.781 -
   1.782 -
   1.783 -
   1.784 -Feather                     Standards Track                    [Page 14]
   1.785 -
   1.786 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
   1.787 -
   1.788 -
   1.789 -   capability label when the server is in that state.  Similarly, if
   1.790 -   only some of the commands in an extension will be available, or if
   1.791 -   the behaviour of the extension will change in some other manner,
   1.792 -   according to the state of the server, this MUST be indicated by
   1.793 -   different arguments in the capability line.
   1.794 -
   1.795 -   Note that a capability line can only begin with a letter.  Lines
   1.796 -   beginning with other characters are reserved for future versions of
   1.797 -   this specification.  In order to interoperate with such versions,
   1.798 -   clients MUST be prepared to receive lines beginning with other
   1.799 -   characters and MUST ignore any they do not understand.
   1.800 -
   1.801 -3.3.2.  Standard Capabilities
   1.802 -
   1.803 -   The following capabilities are defined by this specification.
   1.804 -
   1.805 -   VERSION
   1.806 -      This capability MUST be advertised by all servers and MUST be the
   1.807 -      first capability in the capability list; it indicates the
   1.808 -      version(s) of NNTP that the server supports.  There must be at
   1.809 -      least one argument; each argument is a decimal number and MUST NOT
   1.810 -      have a leading zero.  Version numbers are assigned only in RFCs
   1.811 -      that update or replace this specification; servers MUST NOT create
   1.812 -      their own version numbers.
   1.813 -
   1.814 -      The version number of this specification is 2.
   1.815 -
   1.816 -   READER
   1.817 -      This capability indicates that the server implements the various
   1.818 -      commands useful for reading clients.
   1.819 -
   1.820 -   IHAVE
   1.821 -      This capability indicates that the server implements the IHAVE
   1.822 -      command.
   1.823 -
   1.824 -   POST
   1.825 -      This capability indicates that the server implements the POST
   1.826 -      command.
   1.827 -
   1.828 -   NEWNEWS
   1.829 -      This capability indicates that the server implements the NEWNEWS
   1.830 -      command.
   1.831 -
   1.832 -   HDR
   1.833 -      This capability indicates that the server implements the header
   1.834 -      access commands (HDR and LIST HEADERS).
   1.835 -
   1.836 -
   1.837 -
   1.838 -
   1.839 -
   1.840 -Feather                     Standards Track                    [Page 15]
   1.841 -
   1.842 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
   1.843 -
   1.844 -
   1.845 -   OVER
   1.846 -      This capability indicates that the server implements the overview
   1.847 -      access commands (OVER and LIST OVERVIEW.FMT).  If and only if the
   1.848 -      server supports the message-id form of the OVER command, there
   1.849 -      must be a single argument MSGID.
   1.850 -
   1.851 -   LIST
   1.852 -      This capability indicates that the server implements at least one
   1.853 -      variant of the LIST command.  There MUST be one argument for each
   1.854 -      variant of the LIST command supported by the server, giving the
   1.855 -      keyword for that variant.
   1.856 -
   1.857 -   IMPLEMENTATION
   1.858 -      This capability MAY be provided by a server.  If so, the arguments
   1.859 -      SHOULD be used to provide information such as the server software
   1.860 -      name and version number.  The client MUST NOT use this line to
   1.861 -      determine capabilities of the server.  (While servers often
   1.862 -      provide this information in the initial greeting, clients need to
   1.863 -      guess whether this is the case; this capability makes it clear
   1.864 -      what the information is.)
   1.865 -
   1.866 -   MODE-READER
   1.867 -      This capability indicates that the server is mode-switching
   1.868 -      (Section 3.4.2) and that the MODE READER command needs to be used
   1.869 -      to enable the READER capability.
   1.870 -
   1.871 -3.3.3.  Extensions
   1.872 -
   1.873 -   Although NNTP is widely and robustly deployed, some parts of the
   1.874 -   Internet community might wish to extend the NNTP service.  It must be
   1.875 -   emphasized that any extension to NNTP should not be considered
   1.876 -   lightly.  NNTP's strength comes primarily from its simplicity.
   1.877 -   Experience with many protocols has shown that:
   1.878 -
   1.879 -      Protocols with few options tend towards ubiquity, whilst protocols
   1.880 -      with many options tend towards obscurity.
   1.881 -
   1.882 -   This means that each and every extension, regardless of its benefits,
   1.883 -   must be carefully scrutinized with respect to its implementation,
   1.884 -   deployment, and interoperability costs.  In many cases, the cost of
   1.885 -   extending the NNTP service will likely outweigh the benefit.
   1.886 -
   1.887 -   An extension is a package of associated facilities, often but not
   1.888 -   always including one or more new commands.  Each extension MUST
   1.889 -   define at least one new capability label (this will often, but need
   1.890 -   not, be the name of one of these new commands).  While any additional
   1.891 -   capability information can normally be specified using arguments to
   1.892 -
   1.893 -
   1.894 -
   1.895 -
   1.896 -Feather                     Standards Track                    [Page 16]
   1.897 -
   1.898 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
   1.899 -
   1.900 -
   1.901 -   that label, an extension MAY define more than one capability label.
   1.902 -   However, this SHOULD be limited to exceptional circumstances.
   1.903 -
   1.904 -   An extension is either a private extension, or its capabilities are
   1.905 -   included in the IANA registry of capabilities (see Section 3.3.4) and
   1.906 -   it is defined in an RFC (in which case it is a "registered
   1.907 -   extension").  Such RFCs either must be on the standards track or must
   1.908 -   define an IESG-approved experimental protocol.
   1.909 -
   1.910 -   The definition of an extension must include the following:
   1.911 -
   1.912 -   o  a descriptive name for the extension.
   1.913 -
   1.914 -   o  the capability label or labels defined by the extension (the
   1.915 -      capability label of a registered extension MUST NOT begin with
   1.916 -      "X").
   1.917 -
   1.918 -   o  The syntax, values, and meanings of any arguments for each
   1.919 -      capability label defined by the extension.
   1.920 -
   1.921 -   o  Any new NNTP commands associated with the extension (the names of
   1.922 -      commands associated with registered extensions MUST NOT begin with
   1.923 -      "X").
   1.924 -
   1.925 -   o  The syntax and possible values of arguments associated with the
   1.926 -      new NNTP commands.
   1.927 -
   1.928 -   o  The response codes and possible values of arguments for the
   1.929 -      responses of the new NNTP commands.
   1.930 -
   1.931 -   o  Any new arguments the extension associates with any other
   1.932 -      pre-existing NNTP commands.
   1.933 -
   1.934 -   o  Any increase in the maximum length of commands and initial
   1.935 -      response lines over the value specified in this document.
   1.936 -
   1.937 -   o  A specific statement about the effect on pipelining that this
   1.938 -      extension may have (if any).
   1.939 -
   1.940 -   o  A specific statement about the circumstances when use of this
   1.941 -      extension can alter the contents of the capabilities list (other
   1.942 -      than the new capability labels it defines).
   1.943 -
   1.944 -   o  A specific statement about the circumstances under which the
   1.945 -      extension can cause any pre-existing command to produce a 401,
   1.946 -      480, or 483 response.
   1.947 -
   1.948 -
   1.949 -
   1.950 -
   1.951 -
   1.952 -Feather                     Standards Track                    [Page 17]
   1.953 -
   1.954 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
   1.955 -
   1.956 -
   1.957 -   o  A description of how the use of MODE READER on a mode-switching
   1.958 -      server interacts with the extension.
   1.959 -
   1.960 -   o  A description of how support for the extension affects the
   1.961 -      behaviour of a server and NNTP client in any other manner not
   1.962 -      outlined above.
   1.963 -
   1.964 -   o  Formal syntax as described in Section 9.9.
   1.965 -
   1.966 -   A private extension MAY or MAY NOT be included in the capabilities
   1.967 -   list.  If it is, the capability label MUST begin with "X".  A server
   1.968 -   MAY provide additional keywords (for new commands and also for new
   1.969 -   variants of existing commands) as part of a private extension.  To
   1.970 -   avoid the risk of a clash with a future registered extension, these
   1.971 -   keywords SHOULD begin with "X".
   1.972 -
   1.973 -   If the server advertises a capability defined by a registered
   1.974 -   extension, it MUST implement the extension so as to fully conform
   1.975 -   with the specification (for example, it MUST implement all the
   1.976 -   commands that the extension describes as mandatory).  If it does not
   1.977 -   implement the extension as specified, it MUST NOT list the extension
   1.978 -   in the capabilities list under its registered name.  In that case, it
   1.979 -   MAY, but SHOULD NOT, provide a private extension (not listed, or
   1.980 -   listed with a different name) that implements part of the extension
   1.981 -   or implements the commands of the extension with a different meaning.
   1.982 -
   1.983 -   A server MUST NOT send different response codes to basic NNTP
   1.984 -   commands documented here or to commands documented in registered
   1.985 -   extensions in response to the availability or use of a private
   1.986 -   extension.
   1.987 -
   1.988 -3.3.4.  Initial IANA Register
   1.989 -
   1.990 -   IANA will maintain a registry of NNTP capability labels.  All
   1.991 -   capability labels in the registry MUST be keywords and MUST NOT begin
   1.992 -   with X.
   1.993 -
   1.994 -
   1.995 -
   1.996 -
   1.997 -
   1.998 -
   1.999 -
  1.1000 -
  1.1001 -
  1.1002 -
  1.1003 -
  1.1004 -
  1.1005 -
  1.1006 -
  1.1007 -
  1.1008 -Feather                     Standards Track                    [Page 18]
  1.1009 -
  1.1010 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.1011 -
  1.1012 -
  1.1013 -   The initial content of the registry consists of these entries:
  1.1014 -
  1.1015 -   +-------------------+--------------------------+--------------------+
  1.1016 -   | Label             | Meaning                  | Definition         |
  1.1017 -   +-------------------+--------------------------+--------------------+
  1.1018 -   | AUTHINFO          | Authentication           | [NNTP-AUTH]        |
  1.1019 -   |                   |                          |                    |
  1.1020 -   | HDR               | Batched header retrieval | Section 3.3.2,     |
  1.1021 -   |                   |                          | Section 8.5, and   |
  1.1022 -   |                   |                          | Section 8.6        |
  1.1023 -   |                   |                          |                    |
  1.1024 -   | IHAVE             | IHAVE command available  | Section 3.3.2 and  |
  1.1025 -   |                   |                          | Section 6.3.2      |
  1.1026 -   |                   |                          |                    |
  1.1027 -   | IMPLEMENTATION    | Server                   | Section 3.3.2      |
  1.1028 -   |                   | implementation-specific  |                    |
  1.1029 -   |                   | information              |                    |
  1.1030 -   |                   |                          |                    |
  1.1031 -   | LIST              | LIST command variants    | Section 3.3.2 and  |
  1.1032 -   |                   |                          | Section 7.6.1      |
  1.1033 -   |                   |                          |                    |
  1.1034 -   | MODE-READER       | Mode-switching server    | Section 3.4.2      |
  1.1035 -   |                   | and MODE READER command  |                    |
  1.1036 -   |                   | available                |                    |
  1.1037 -   |                   |                          |                    |
  1.1038 -   | NEWNEWS           | NEWNEWS command          | Section 3.3.2 and  |
  1.1039 -   |                   | available                | Section 7.4        |
  1.1040 -   |                   |                          |                    |
  1.1041 -   | OVER              | Overview support         | Section 3.3.2,     |
  1.1042 -   |                   |                          | Section 8.3, and   |
  1.1043 -   |                   |                          | Section 8.4        |
  1.1044 -   |                   |                          |                    |
  1.1045 -   | POST              | POST command available   | Section 3.3.2 and  |
  1.1046 -   |                   |                          | Section 6.3.1      |
  1.1047 -   |                   |                          |                    |
  1.1048 -   | READER            | Reader commands          | Section 3.3.2      |
  1.1049 -   |                   | available                |                    |
  1.1050 -   |                   |                          |                    |
  1.1051 -   | SASL              | Supported SASL           | [NNTP-AUTH]        |
  1.1052 -   |                   | mechanisms               |                    |
  1.1053 -   |                   |                          |                    |
  1.1054 -   | STARTTLS          | Transport layer security | [NNTP-TLS]         |
  1.1055 -   |                   |                          |                    |
  1.1056 -   | STREAMING         | Streaming feeds          | [NNTP-STREAM]      |
  1.1057 -   |                   |                          |                    |
  1.1058 -   | VERSION           | Supported NNTP versions  | Section 3.3.2      |
  1.1059 -   +-------------------+--------------------------+--------------------+
  1.1060 -
  1.1061 -
  1.1062 -
  1.1063 -
  1.1064 -Feather                     Standards Track                    [Page 19]
  1.1065 -
  1.1066 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.1067 -
  1.1068 -
  1.1069 -3.4.  Mandatory and Optional Commands
  1.1070 -
  1.1071 -   For a number of reasons, not all the commands in this specification
  1.1072 -   are mandatory.  However, it is equally undesirable for every command
  1.1073 -   to be optional, since this means that a client will have no idea what
  1.1074 -   facilities are available.  Therefore, as a compromise, some of the
  1.1075 -   commands in this specification are mandatory (they must be supported
  1.1076 -   by all servers) while the remainder are not.  The latter are then
  1.1077 -   subdivided into bundles, each indicated by a single capability label.
  1.1078 -
  1.1079 -   o  If the label is included in the capability list returned by the
  1.1080 -      server, the server MUST support all commands in that bundle.
  1.1081 -
  1.1082 -   o  If the label is not included, the server MAY support none or some
  1.1083 -      of the commands but SHOULD NOT support all of them.  In general,
  1.1084 -      there will be no way for a client to determine which commands are
  1.1085 -      supported without trying them.
  1.1086 -
  1.1087 -   The bundles have been chosen to provide useful functionality, and
  1.1088 -   therefore server authors are discouraged from implementing only part
  1.1089 -   of a bundle.
  1.1090 -
  1.1091 -   The description of each command will either indicate that it is
  1.1092 -   mandatory, or will give, using the term "indicating capability", the
  1.1093 -   capability label indicating whether the bundle including this command
  1.1094 -   is available.
  1.1095 -
  1.1096 -   Where a server does not implement a command, it MUST always generate
  1.1097 -   a 500 generic response code (or a 501 generic response code in the
  1.1098 -   case of a variant of a command depending on a second keyword where
  1.1099 -   the base command is recognised).  Otherwise, the command MUST be
  1.1100 -   fully implemented as specified; a server MUST NOT only partially
  1.1101 -   implement any of the commands in this specification.  (Client authors
  1.1102 -   should note that some servers not conforming to this specification
  1.1103 -   will return a 502 generic response code to some commands that are not
  1.1104 -   implemented.)
  1.1105 -
  1.1106 -   Note: some commands have cases that require other commands to be used
  1.1107 -   first.  If the former command is implemented but the latter is not,
  1.1108 -   the former MUST still generate the relevant specific response code.
  1.1109 -   For example, if ARTICLE (Section 6.2.1) is implemented but GROUP
  1.1110 -   (Section 6.1.1) is not, the correct response to "ARTICLE 1234"
  1.1111 -   remains 412.
  1.1112 -
  1.1113 -
  1.1114 -
  1.1115 -
  1.1116 -
  1.1117 -
  1.1118 -
  1.1119 -
  1.1120 -Feather                     Standards Track                    [Page 20]
  1.1121 -
  1.1122 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.1123 -
  1.1124 -
  1.1125 -3.4.1.  Reading and Transit Servers
  1.1126 -
  1.1127 -   NNTP is traditionally used in two different ways.  The first use is
  1.1128 -   "reading", where the client fetches articles from a large store
  1.1129 -   maintained by the server for immediate or later presentation to a
  1.1130 -   user and sends articles created by that user back to the server (an
  1.1131 -   action called "posting") to be stored and distributed to other stores
  1.1132 -   and users.  The second use is for the bulk transfer of articles from
  1.1133 -   one store to another.  Since the hosts making this transfer tend to
  1.1134 -   be peers in a network that transmit articles among one another, and
  1.1135 -   not end-user systems, this process is called "peering" or "transit".
  1.1136 -   (Even so, one host is still the client and the other is the server).
  1.1137 -
  1.1138 -   In practice, these two uses are so different that some server
  1.1139 -   implementations are optimised for reading or for transit and, as a
  1.1140 -   result, do not offer the other facility or only offer limited
  1.1141 -   features.  Other implementations are more general and offer both.
  1.1142 -   This specification allows for this by bundling the relevant commands
  1.1143 -   accordingly: the IHAVE command is designed for transit, while the
  1.1144 -   commands indicated by the READER capability are designed for reading
  1.1145 -   clients.
  1.1146 -
  1.1147 -   Except as an effect of the MODE READER command (Section 5.3) on a
  1.1148 -   mode-switching server, once a server advertises either or both of the
  1.1149 -   IHAVE or READER capabilities, it MUST continue to advertise them for
  1.1150 -   the entire session.
  1.1151 -
  1.1152 -   A server MAY provide different modes of behaviour (transit, reader,
  1.1153 -   or a combination) to different client connections and MAY use
  1.1154 -   external information, such as the IP address of the client, to
  1.1155 -   determine which mode to provide to any given connection.
  1.1156 -
  1.1157 -   The official TCP port for the NNTP service is 119.  However, if a
  1.1158 -   host wishes to offer separate servers for transit and reading
  1.1159 -   clients, port 433 SHOULD be used for the transit server and 119 for
  1.1160 -   the reading server.
  1.1161 -
  1.1162 -3.4.2.  Mode Switching
  1.1163 -
  1.1164 -   An implementation MAY, but SHOULD NOT, provide both transit and
  1.1165 -   reader facilities on the same server but require the client to select
  1.1166 -   which it wishes to use.  Such an arrangement is called a
  1.1167 -   "mode-switching" server.
  1.1168 -
  1.1169 -
  1.1170 -
  1.1171 -
  1.1172 -
  1.1173 -
  1.1174 -
  1.1175 -
  1.1176 -Feather                     Standards Track                    [Page 21]
  1.1177 -
  1.1178 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.1179 -
  1.1180 -
  1.1181 -   A mode-switching server has two modes:
  1.1182 -
  1.1183 -   o  Transit mode, which applies after the initial connection.
  1.1184 -
  1.1185 -      *  It MUST advertise the MODE-READER capability.
  1.1186 -
  1.1187 -      *  It MUST NOT advertise the READER capability.
  1.1188 -
  1.1189 -      However, the server MAY cease to advertise the MODE-READER
  1.1190 -      capability after the client uses any command except CAPABILITIES.
  1.1191 -
  1.1192 -   o  Reading mode, after a successful MODE READER command (see Section
  1.1193 -      5.3).
  1.1194 -
  1.1195 -      *  It MUST NOT advertise the MODE-READER capability.
  1.1196 -
  1.1197 -      *  It MUST advertise the READER capability.
  1.1198 -
  1.1199 -      *  It MAY NOT advertise the IHAVE capability, even if it was
  1.1200 -         advertising it in transit mode.
  1.1201 -
  1.1202 -   A client SHOULD only issue a MODE READER command to a server if it is
  1.1203 -   advertising the MODE-READER capability.  If the server does not
  1.1204 -   support CAPABILITIES (and therefore does not conform to this
  1.1205 -   specification), the client MAY use the following heuristic:
  1.1206 -
  1.1207 -   o  If the client wishes to use any "reader" commands, it SHOULD use
  1.1208 -      the MODE READER command immediately after the initial connection.
  1.1209 -
  1.1210 -   o  Otherwise, it SHOULD NOT use the MODE READER command.
  1.1211 -
  1.1212 -   In each case, it should be prepared for some commands to be
  1.1213 -   unavailable that would have been available if it had made the other
  1.1214 -   choice.
  1.1215 -
  1.1216 -3.5.  Pipelining
  1.1217 -
  1.1218 -   NNTP is designed to operate over a reliable bi-directional
  1.1219 -   connection, such as TCP.  Therefore, if a command does not depend on
  1.1220 -   the response to the previous one, it should not matter if it is sent
  1.1221 -   before that response is received.  Doing this is called "pipelining".
  1.1222 -   However, certain server implementations throw away all text received
  1.1223 -   from the client following certain commands before sending their
  1.1224 -   response.  If this happens, pipelining will be affected because one
  1.1225 -   or more commands will have been ignored or misinterpreted, and the
  1.1226 -   client will be matching the wrong responses to each command.  Since
  1.1227 -   there are significant benefits to pipelining, but also circumstances
  1.1228 -   where it is reasonable or common for servers to behave in the above
  1.1229 -
  1.1230 -
  1.1231 -
  1.1232 -Feather                     Standards Track                    [Page 22]
  1.1233 -
  1.1234 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.1235 -
  1.1236 -
  1.1237 -   manner, this document puts certain requirements on both clients and
  1.1238 -   servers.
  1.1239 -
  1.1240 -   Except where stated otherwise, a client MAY use pipelining.  That is,
  1.1241 -   it may send a command before receiving the response for the previous
  1.1242 -   command.  The server MUST allow pipelining and MUST NOT throw away
  1.1243 -   any text received after a command.  Irrespective of whether
  1.1244 -   pipelining is used, the server MUST process commands in the order
  1.1245 -   they are sent.
  1.1246 -
  1.1247 -   If the specific description of a command says it "MUST NOT be
  1.1248 -   pipelined", that command MUST end any pipeline of commands.  That is,
  1.1249 -   the client MUST NOT send any following command until it receives the
  1.1250 -   CRLF at the end of the response from the command.  The server MAY
  1.1251 -   ignore any data received after the command and before the CRLF at the
  1.1252 -   end of the response is sent to the client.
  1.1253 -
  1.1254 -   The initial connection must not be part of a pipeline; that is, the
  1.1255 -   client MUST NOT send any command until it receives the CRLF at the
  1.1256 -   end of the greeting.
  1.1257 -
  1.1258 -   If the client uses blocking system calls to send commands, it MUST
  1.1259 -   ensure that the amount of text sent in pipelining does not cause a
  1.1260 -   deadlock between transmission and reception.  The amount of text
  1.1261 -   involved will depend on window sizes in the transmission layer;
  1.1262 -   typically, it is 4k octets for TCP.  (Since the server only sends
  1.1263 -   data in response to commands from the client, the converse problem
  1.1264 -   does not occur.)
  1.1265 -
  1.1266 -3.5.1.  Examples
  1.1267 -
  1.1268 -   Example of correct use of pipelining:
  1.1269 -
  1.1270 -      [C] GROUP misc.test
  1.1271 -      [C] STAT
  1.1272 -      [C] NEXT
  1.1273 -      [S] 211 1234 3000234 3002322 misc.test
  1.1274 -      [S] 223 3000234 <45223423@example.com> retrieved
  1.1275 -      [S] 223 3000237 <668929@example.org> retrieved
  1.1276 -
  1.1277 -   Example of incorrect use of pipelining (the MODE READER command may
  1.1278 -   not be pipelined):
  1.1279 -
  1.1280 -      [C] MODE READER
  1.1281 -      [C] DATE
  1.1282 -      [C] NEXT
  1.1283 -      [S] 200 Server ready, posting allowed
  1.1284 -      [S] 223 3000237 <668929@example.org> retrieved
  1.1285 -
  1.1286 -
  1.1287 -
  1.1288 -Feather                     Standards Track                    [Page 23]
  1.1289 -
  1.1290 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.1291 -
  1.1292 -
  1.1293 -   The DATE command has been thrown away by the server, so there is no
  1.1294 -   111 response to match it.
  1.1295 -
  1.1296 -3.6.  Articles
  1.1297 -
  1.1298 -   NNTP is intended to transfer articles between clients and servers.
  1.1299 -   For the purposes of this specification, articles are required to
  1.1300 -   conform to the rules in this section, and clients and servers MUST
  1.1301 -   correctly process any article received from the other that does so.
  1.1302 -   Note that this requirement applies only to the contents of
  1.1303 -   communications over NNTP; it does not prevent the client or server
  1.1304 -   from subsequently rejecting an article for reasons of local policy.
  1.1305 -   Also see Appendix A for further restrictions on the format of
  1.1306 -   articles in some uses of NNTP.
  1.1307 -
  1.1308 -   An article consists of two parts: the headers and the body.  They are
  1.1309 -   separated by a single empty line, or in other words by two
  1.1310 -   consecutive CRLF pairs (if there is more than one empty line, the
  1.1311 -   second and subsequent ones are part of the body).  In order to meet
  1.1312 -   the general requirements of NNTP, an article MUST NOT include the
  1.1313 -   octet NUL, MUST NOT contain the octets LF and CR other than as part
  1.1314 -   of a CRLF pair, and MUST end with a CRLF pair.  This specification
  1.1315 -   puts no further restrictions on the body; in particular, it MAY be
  1.1316 -   empty.
  1.1317 -
  1.1318 -   The headers of an article consist of one or more header lines.  Each
  1.1319 -   header line consists of a header name, a colon, a space, the header
  1.1320 -   content, and a CRLF, in that order.  The name consists of one or more
  1.1321 -   printable US-ASCII characters other than colon and, for the purposes
  1.1322 -   of this specification, is not case sensitive.  There MAY be more than
  1.1323 -   one header line with the same name.  The content MUST NOT contain
  1.1324 -   CRLF; it MAY be empty.  A header may be "folded"; that is, a CRLF
  1.1325 -   pair may be placed before any TAB or space in the line.  There MUST
  1.1326 -   still be some other octet between any two CRLF pairs in a header
  1.1327 -   line.  (Note that folding means that the header line occupies more
  1.1328 -   than one line when displayed or transmitted; nevertheless, it is
  1.1329 -   still referred to as "a" header line.)  The presence or absence of
  1.1330 -   folding does not affect the meaning of the header line; that is, the
  1.1331 -   CRLF pairs introduced by folding are not considered part of the
  1.1332 -   header content.  Header lines SHOULD NOT be folded before the space
  1.1333 -   after the colon that follows the header name and SHOULD include at
  1.1334 -   least one octet other than %x09 or %x20 between CRLF pairs.  However,
  1.1335 -   if an article that fails to satisfy this requirement has been
  1.1336 -   received from elsewhere, clients and servers MAY transfer it to each
  1.1337 -   other without re-folding it.
  1.1338 -
  1.1339 -
  1.1340 -
  1.1341 -
  1.1342 -
  1.1343 -
  1.1344 -Feather                     Standards Track                    [Page 24]
  1.1345 -
  1.1346 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.1347 -
  1.1348 -
  1.1349 -   The content of a header SHOULD be in UTF-8.  However, if an
  1.1350 -   implementation receives an article from elsewhere that uses octets in
  1.1351 -   the range 128 to 255 in some other manner, it MAY pass it to a client
  1.1352 -   or server without modification.  Therefore, implementations MUST be
  1.1353 -   prepared to receive such headers, and data derived from them (e.g.,
  1.1354 -   in the responses from the OVER command, Section 8.3), and MUST NOT
  1.1355 -   assume that they are always UTF-8.  Any external processing of those
  1.1356 -   headers, including identifying the encoding used, is outside the
  1.1357 -   scope of this document.
  1.1358 -
  1.1359 -   Each article MUST have a unique message-id; two articles offered by
  1.1360 -   an NNTP server MUST NOT have the same message-id.  For the purposes
  1.1361 -   of this specification, message-ids are opaque strings that MUST meet
  1.1362 -   the following requirements:
  1.1363 -
  1.1364 -   o  A message-id MUST begin with "<", end with ">", and MUST NOT
  1.1365 -      contain the latter except at the end.
  1.1366 -
  1.1367 -   o  A message-id MUST be between 3 and 250 octets in length.
  1.1368 -
  1.1369 -   o  A message-id MUST NOT contain octets other than printable US-ASCII
  1.1370 -      characters.
  1.1371 -
  1.1372 -   Two message-ids are the same if and only if they consist of the same
  1.1373 -   sequence of octets.
  1.1374 -
  1.1375 -   This specification does not describe how the message-id of an article
  1.1376 -   is determined.  If the server does not have any way to determine a
  1.1377 -   message-id from the article itself, it MUST synthesize one (this
  1.1378 -   specification does not require that the article be changed as a
  1.1379 -   result).  See also Appendix A.2.
  1.1380 -
  1.1381 -4.  The WILDMAT Format
  1.1382 -
  1.1383 -   The WILDMAT format described here is based on the version first
  1.1384 -   developed by Rich Salz [SALZ1992], which was in turn derived from the
  1.1385 -   format used in the UNIX "find" command to articulate file names.  It
  1.1386 -   was developed to provide a uniform mechanism for matching patterns in
  1.1387 -   the same manner that the UNIX shell matches filenames.
  1.1388 -
  1.1389 -
  1.1390 -
  1.1391 -
  1.1392 -
  1.1393 -
  1.1394 -
  1.1395 -
  1.1396 -
  1.1397 -
  1.1398 -
  1.1399 -
  1.1400 -Feather                     Standards Track                    [Page 25]
  1.1401 -
  1.1402 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.1403 -
  1.1404 -
  1.1405 -4.1.  Wildmat Syntax
  1.1406 -
  1.1407 -   A wildmat is described by the following ABNF [RFC4234] syntax, which
  1.1408 -   is an extract of that in Section 9.8.
  1.1409 -
  1.1410 -     wildmat = wildmat-pattern *("," ["!"] wildmat-pattern)
  1.1411 -     wildmat-pattern = 1*wildmat-item
  1.1412 -     wildmat-item = wildmat-exact / wildmat-wild
  1.1413 -     wildmat-exact = %x22-29 / %x2B / %x2D-3E / %x40-5A / %x5E-7E /
  1.1414 -          UTF8-non-ascii ; exclude ! * , ? [ \ ]
  1.1415 -     wildmat-wild = "*" / "?"
  1.1416 -
  1.1417 -   Note: the characters ",", "\", "[", and "]" are not allowed in
  1.1418 -   wildmats, while * and ? are always wildcards.  This should not be a
  1.1419 -   problem, since these characters cannot occur in newsgroup names,
  1.1420 -   which is the only current use of wildmats.  Backslash is commonly
  1.1421 -   used to suppress the special meaning of characters, whereas brackets
  1.1422 -   are used to introduce sets.  However, these usages are not universal,
  1.1423 -   and interpretation of these characters in the context of UTF-8
  1.1424 -   strings is potentially complex and differs from existing practice, so
  1.1425 -   they were omitted from this specification.  A future extension to
  1.1426 -   this specification may provide semantics for these characters.
  1.1427 -
  1.1428 -4.2.  Wildmat Semantics
  1.1429 -
  1.1430 -   A wildmat is tested against a string and either matches or does not
  1.1431 -   match.  To do this, each constituent <wildmat-pattern> is matched
  1.1432 -   against the string, and the rightmost pattern that matches is
  1.1433 -   identified.  If that <wildmat-pattern> is not preceded with "!", the
  1.1434 -   whole wildmat matches.  If it is preceded by "!", or if no <wildmat-
  1.1435 -   pattern> matches, the whole wildmat does not match.
  1.1436 -
  1.1437 -   For example, consider the wildmat "a*,!*b,*c*":
  1.1438 -
  1.1439 -   o  The string "aaa" matches because the rightmost match is with "a*".
  1.1440 -
  1.1441 -   o  The string "abb" does not match because the rightmost match is
  1.1442 -      with "*b".
  1.1443 -
  1.1444 -   o  The string "ccb" matches because the rightmost match is with
  1.1445 -      "*c*".
  1.1446 -
  1.1447 -   o  The string "xxx" does not match because no <wildmat-pattern>
  1.1448 -      matches.
  1.1449 -
  1.1450 -   A <wildmat-pattern> matches a string if the string can be broken into
  1.1451 -   components, each of which matches the corresponding <wildmat-item> in
  1.1452 -   the pattern.  The matches must be in the same order, and the whole
  1.1453 -
  1.1454 -
  1.1455 -
  1.1456 -Feather                     Standards Track                    [Page 26]
  1.1457 -
  1.1458 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.1459 -
  1.1460 -
  1.1461 -   string must be used in the match.  The pattern is "anchored"; that
  1.1462 -   is, the first and last characters in the string must match the first
  1.1463 -   and last item, respectively (unless that item is an asterisk matching
  1.1464 -   zero characters).
  1.1465 -
  1.1466 -   A <wildmat-exact> matches the same character (which may be more than
  1.1467 -   one octet in UTF-8).
  1.1468 -
  1.1469 -   "?" matches exactly one character (which may be more than one octet).
  1.1470 -
  1.1471 -   "*" matches zero or more characters.  It can match an empty string,
  1.1472 -   but it cannot match a subsequence of a UTF-8 sequence that is not
  1.1473 -   aligned to the character boundaries.
  1.1474 -
  1.1475 -4.3.  Extensions
  1.1476 -
  1.1477 -   An NNTP server or extension MAY extend the syntax or semantics of
  1.1478 -   wildmats provided that all wildmats that meet the requirements of
  1.1479 -   Section 4.1 have the meaning ascribed to them by Section 4.2.  Future
  1.1480 -   editions of this document may also extend wildmats.
  1.1481 -
  1.1482 -4.4.  Examples
  1.1483 -
  1.1484 -   In these examples, $ and @ are used to represent the two octets %xC2
  1.1485 -   and %xA3, respectively; $@ is thus the UTF-8 encoding for the pound
  1.1486 -   sterling symbol, shown as # in the descriptions.
  1.1487 -
  1.1488 -     Wildmat    Description of strings that match
  1.1489 -       abc      The one string "abc"
  1.1490 -       abc,def  The two strings "abc" and "def"
  1.1491 -       $@       The one character string "#"
  1.1492 -       a*       Any string that begins with "a"
  1.1493 -       a*b      Any string that begins with "a" and ends with "b"
  1.1494 -       a*,*b    Any string that begins with "a" or ends with "b"
  1.1495 -       a*,!*b   Any string that begins with "a" and does not end with
  1.1496 -                "b"
  1.1497 -     a*,!*b,c*  Any string that begins with "a" and does not end with
  1.1498 -                "b", and any string that begins with "c" no matter
  1.1499 -                what it ends with
  1.1500 -     a*,c*,!*b  Any string that begins with "a" or "c" and does not
  1.1501 -                end with "b"
  1.1502 -       ?a*      Any string with "a" as its second character
  1.1503 -       ??a*     Any string with "a" as its third character
  1.1504 -       *a?      Any string with "a" as its penultimate character
  1.1505 -       *a??     Any string with "a" as its antepenultimate character
  1.1506 -
  1.1507 -
  1.1508 -
  1.1509 -
  1.1510 -
  1.1511 -
  1.1512 -Feather                     Standards Track                    [Page 27]
  1.1513 -
  1.1514 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.1515 -
  1.1516 -
  1.1517 -5.  Session Administration Commands
  1.1518 -
  1.1519 -5.1.  Initial Connection
  1.1520 -
  1.1521 -5.1.1.  Usage
  1.1522 -
  1.1523 -   This command MUST NOT be pipelined.
  1.1524 -
  1.1525 -   Responses [1]
  1.1526 -     200    Service available, posting allowed
  1.1527 -     201    Service available, posting prohibited
  1.1528 -     400    Service temporarily unavailable [2]
  1.1529 -     502    Service permanently unavailable [2]
  1.1530 -
  1.1531 -   [1] These are the only valid response codes for the initial greeting;
  1.1532 -       the server MUST not return any other generic response code.
  1.1533 -
  1.1534 -   [2] Following a 400 or 502 response, the server MUST immediately
  1.1535 -       close the connection.
  1.1536 -
  1.1537 -5.1.2.  Description
  1.1538 -
  1.1539 -   There is no command presented by the client upon initial connection
  1.1540 -   to the server.  The server MUST present an appropriate response code
  1.1541 -   as a greeting to the client.  This response informs the client
  1.1542 -   whether service is available and whether the client is permitted to
  1.1543 -   post.
  1.1544 -
  1.1545 -   If the server will accept further commands from the client including
  1.1546 -   POST, the server MUST present a 200 greeting code.  If the server
  1.1547 -   will accept further commands from the client, but the client is not
  1.1548 -   authorized to post articles using the POST command, the server MUST
  1.1549 -   present a 201 greeting code.
  1.1550 -
  1.1551 -   Otherwise, the server MUST present a 400 or 502 greeting code and
  1.1552 -   then immediately close the connection. 400 SHOULD be used if the
  1.1553 -   issue is only temporary (for example, because of load) and the client
  1.1554 -   can expect to be able to connect successfully at some point in the
  1.1555 -   future without making any changes. 502 MUST be used if the client is
  1.1556 -   not permitted under any circumstances to interact with the server,
  1.1557 -   and MAY be used if the server has insufficient information to
  1.1558 -   determine whether the issue is temporary or permanent.
  1.1559 -
  1.1560 -   Note: the distinction between the 200 and 201 response codes has
  1.1561 -   turned out in practice to be insufficient; for example, some servers
  1.1562 -   do not allow posting until the client has authenticated, while other
  1.1563 -   clients assume that a 201 response means that posting will never be
  1.1564 -   possible even after authentication.  Therefore, clients SHOULD use
  1.1565 -
  1.1566 -
  1.1567 -
  1.1568 -Feather                     Standards Track                    [Page 28]
  1.1569 -
  1.1570 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.1571 -
  1.1572 -
  1.1573 -   the CAPABILITIES command (Section 5.2) rather than rely on this
  1.1574 -   response.
  1.1575 -
  1.1576 -5.1.3.  Examples
  1.1577 -
  1.1578 -   Example of a normal connection from an authorized client that then
  1.1579 -   terminates the session (see Section 5.4):
  1.1580 -
  1.1581 -      [Initial connection set-up completed.]
  1.1582 -      [S] 200 NNTP Service Ready, posting permitted
  1.1583 -      [C] QUIT
  1.1584 -      [S] 205 NNTP Service exits normally
  1.1585 -      [Server closes connection.]
  1.1586 -
  1.1587 -   Example of a normal connection from an authorized client that is not
  1.1588 -   permitted to post, which also immediately terminates the session:
  1.1589 -
  1.1590 -      [Initial connection set-up completed.]
  1.1591 -      [S] 201 NNTP Service Ready, posting prohibited
  1.1592 -      [C] QUIT
  1.1593 -      [S] 205 NNTP Service exits normally
  1.1594 -      [Server closes connection.]
  1.1595 -
  1.1596 -   Example of a normal connection from an unauthorized client:
  1.1597 -
  1.1598 -      [Initial connection set-up completed.]
  1.1599 -      [S] 502 NNTP Service permanently unavailable
  1.1600 -      [Server closes connection.]
  1.1601 -
  1.1602 -   Example of a connection from a client if the server is unable to
  1.1603 -   provide service:
  1.1604 -
  1.1605 -      [Initial connection set-up completed.]
  1.1606 -      [S] 400 NNTP Service temporarily unavailable
  1.1607 -      [Server closes connection.]
  1.1608 -
  1.1609 -5.2.  CAPABILITIES
  1.1610 -
  1.1611 -5.2.1.  Usage
  1.1612 -
  1.1613 -   This command is mandatory.
  1.1614 -
  1.1615 -   Syntax
  1.1616 -     CAPABILITIES [keyword]
  1.1617 -
  1.1618 -   Responses
  1.1619 -     101    Capability list follows (multi-line)
  1.1620 -
  1.1621 -
  1.1622 -
  1.1623 -
  1.1624 -Feather                     Standards Track                    [Page 29]
  1.1625 -
  1.1626 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.1627 -
  1.1628 -
  1.1629 -   Parameters
  1.1630 -     keyword    additional feature, see description
  1.1631 -
  1.1632 -5.2.2.  Description
  1.1633 -
  1.1634 -   The CAPABILITIES command allows a client to determine the
  1.1635 -   capabilities of the server at any given time.
  1.1636 -
  1.1637 -   This command MAY be issued at any time; the server MUST NOT require
  1.1638 -   it to be issued in order to make use of any capability.  The response
  1.1639 -   generated by this command MAY change during a session because of
  1.1640 -   other state information (which, in turn, may be changed by the
  1.1641 -   effects of other commands or by external events).  An NNTP client is
  1.1642 -   only able to get the current and correct information concerning
  1.1643 -   available capabilities at any point during a session by issuing a
  1.1644 -   CAPABILITIES command at that point of that session and processing the
  1.1645 -   response.
  1.1646 -
  1.1647 -   The capability list is returned as a multi-line data block following
  1.1648 -   the 101 response code.  Each capability is described by a separate
  1.1649 -   capability line.  The server MUST NOT list the same capability twice
  1.1650 -   in the response, even with different arguments.  Except that the
  1.1651 -   VERSION capability MUST be the first line, the order in which the
  1.1652 -   capability lines appears is not significant; the server need not even
  1.1653 -   consistently return the same order.
  1.1654 -
  1.1655 -   While some capabilities are likely to be always available or never
  1.1656 -   available, others (notably extensions) will appear and disappear
  1.1657 -   depending on server state changes within the session or on external
  1.1658 -   events between sessions.  An NNTP client MAY cache the results of
  1.1659 -   this command, but MUST NOT rely on the correctness of any cached
  1.1660 -   results, whether from earlier in this session or from a previous
  1.1661 -   session, MUST cope gracefully with the cached status being out of
  1.1662 -   date, and SHOULD (if caching results) provide a way to force the
  1.1663 -   cached information to be refreshed.  Furthermore, a client MUST NOT
  1.1664 -   use cached results in relation to security, privacy, and
  1.1665 -   authentication extensions.  See Section 12.6 for further discussion
  1.1666 -   of this topic.
  1.1667 -
  1.1668 -   The keyword argument is not used by this specification.  It is
  1.1669 -   provided so that extensions or revisions to this specification can
  1.1670 -   include extra features for this command without requiring the
  1.1671 -   CAPABILITIES command to be used twice (once to determine if the extra
  1.1672 -   features are available, and a second time to make use of them).  If
  1.1673 -   the server does not recognise the argument (and it is a keyword), it
  1.1674 -   MUST respond with the 101 response code as if the argument had been
  1.1675 -   omitted.  If an argument is provided that the server does recognise,
  1.1676 -   it MAY use the 101 response code or MAY use some other response code
  1.1677 -
  1.1678 -
  1.1679 -
  1.1680 -Feather                     Standards Track                    [Page 30]
  1.1681 -
  1.1682 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.1683 -
  1.1684 -
  1.1685 -   (which will be defined in the specification of that feature).  If the
  1.1686 -   argument is not a keyword, the 501 generic response code MUST be
  1.1687 -   returned.  The server MUST NOT generate any other response code to
  1.1688 -   the CAPABILITIES command.
  1.1689 -
  1.1690 -5.2.3.  Examples
  1.1691 -
  1.1692 -   Example of a minimal response (a read-only server):
  1.1693 -
  1.1694 -      [C] CAPABILITIES
  1.1695 -      [S] 101 Capability list:
  1.1696 -      [S] VERSION 2
  1.1697 -      [S] READER
  1.1698 -      [S] LIST ACTIVE NEWSGROUPS
  1.1699 -      [S] .
  1.1700 -
  1.1701 -   Example of a response from a server that has a range of facilities
  1.1702 -   and that also describes itself:
  1.1703 -
  1.1704 -      [C] CAPABILITIES
  1.1705 -      [S] 101 Capability list:
  1.1706 -      [S] VERSION 2
  1.1707 -      [S] READER
  1.1708 -      [S] IHAVE
  1.1709 -      [S] POST
  1.1710 -      [S] NEWNEWS
  1.1711 -      [S] LIST ACTIVE NEWSGROUPS ACTIVE.TIMES OVERVIEW.FMT
  1.1712 -      [S] IMPLEMENTATION INN 4.2 2004-12-25
  1.1713 -      [S] OVER MSGID
  1.1714 -      [S] STREAMING
  1.1715 -      [S] XSECRET
  1.1716 -      [S] .
  1.1717 -
  1.1718 -   Example of a server that supports more than one version of NNTP:
  1.1719 -
  1.1720 -      [C] CAPABILITIES
  1.1721 -      [S] 101 Capability list:
  1.1722 -      [S] VERSION 2 3
  1.1723 -      [S] READER
  1.1724 -      [S] LIST ACTIVE NEWSGROUPS
  1.1725 -      [S] .
  1.1726 -
  1.1727 -
  1.1728 -
  1.1729 -
  1.1730 -
  1.1731 -
  1.1732 -
  1.1733 -
  1.1734 -
  1.1735 -
  1.1736 -Feather                     Standards Track                    [Page 31]
  1.1737 -
  1.1738 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.1739 -
  1.1740 -
  1.1741 -   Example of a client attempting to use a feature of the CAPABILITIES
  1.1742 -   command that the server does not support:
  1.1743 -
  1.1744 -      [C] CAPABILITIES AUTOUPDATE
  1.1745 -      [S] 101 Capability list:
  1.1746 -      [S] VERSION 2
  1.1747 -      [S] READER
  1.1748 -      [S] IHAVE
  1.1749 -      [S] LIST ACTIVE NEWSGROUPS OVERVIEW.FMT HEADERS
  1.1750 -      [S] OVER MSGID
  1.1751 -      [S] HDR
  1.1752 -      [S] NEWNEWS
  1.1753 -      [S] .
  1.1754 -
  1.1755 -5.3.  MODE READER
  1.1756 -
  1.1757 -5.3.1.  Usage
  1.1758 -
  1.1759 -   Indicating capability: MODE-READER
  1.1760 -
  1.1761 -   This command MUST NOT be pipelined.
  1.1762 -
  1.1763 -   Syntax
  1.1764 -     MODE READER
  1.1765 -
  1.1766 -   Responses
  1.1767 -     200    Posting allowed
  1.1768 -     201    Posting prohibited
  1.1769 -     502    Reading service permanently unavailable [1]
  1.1770 -
  1.1771 -   [1] Following a 502 response the server MUST immediately close the
  1.1772 -       connection.
  1.1773 -
  1.1774 -5.3.2.  Description
  1.1775 -
  1.1776 -   The MODE READER command instructs a mode-switching server to switch
  1.1777 -   modes, as described in Section 3.4.2.
  1.1778 -
  1.1779 -   If the server is mode-switching, it switches from its transit mode to
  1.1780 -   its reader mode, indicating this by changing the capability list
  1.1781 -   accordingly.  It MUST then return a 200 or 201 response with the same
  1.1782 -   meaning as for the initial greeting (as described in Section 5.1.1).
  1.1783 -   Note that the response need not be the same as that presented during
  1.1784 -   the initial greeting.  The client MUST NOT issue MODE READER more
  1.1785 -   than once in a session or after any security or privacy commands are
  1.1786 -   issued.  When the MODE READER command is issued, the server MAY reset
  1.1787 -   its state to that immediately after the initial connection before
  1.1788 -   switching mode.
  1.1789 -
  1.1790 -
  1.1791 -
  1.1792 -Feather                     Standards Track                    [Page 32]
  1.1793 -
  1.1794 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.1795 -
  1.1796 -
  1.1797 -   If the server is not mode-switching, then the following apply:
  1.1798 -
  1.1799 -   o  If it advertises the READER capability, it MUST return a 200 or
  1.1800 -      201 response with the same meaning as for the initial greeting; in
  1.1801 -      this case, the command MUST NOT affect the server state in any
  1.1802 -      way.
  1.1803 -
  1.1804 -   o  If it does not advertise the READER capability, it MUST return a
  1.1805 -      502 response and then immediately close the connection.
  1.1806 -
  1.1807 -5.3.3.  Examples
  1.1808 -
  1.1809 -   Example of use of the MODE READER command on a transit-only server
  1.1810 -   (which therefore does not providing reading facilities):
  1.1811 -
  1.1812 -      [C] CAPABILITIES
  1.1813 -      [S] 101 Capability list:
  1.1814 -      [S] VERSION 2
  1.1815 -      [S] IHAVE
  1.1816 -      [S] .
  1.1817 -      [C] MODE READER
  1.1818 -      [S] 502 Transit service only
  1.1819 -      [Server closes connection.]
  1.1820 -
  1.1821 -   Example of use of the MODE READER command on a server that provides
  1.1822 -   reading facilities:
  1.1823 -
  1.1824 -      [C] CAPABILITIES
  1.1825 -      [S] 101 Capability list:
  1.1826 -      [S] VERSION 2
  1.1827 -      [S] READER
  1.1828 -      [S] LIST ACTIVE NEWSGROUPS
  1.1829 -      [S] .
  1.1830 -      [C] MODE READER
  1.1831 -      [S] 200 Reader mode, posting permitted
  1.1832 -      [C] IHAVE <i.am.an.article.you.have@example.com>
  1.1833 -      [S] 500 Permission denied
  1.1834 -      [C] GROUP misc.test
  1.1835 -      [S] 211 1234 3000234 3002322 misc.test
  1.1836 -
  1.1837 -   Note that in both of these situations, the client SHOULD NOT use MODE
  1.1838 -   READER.
  1.1839 -
  1.1840 -
  1.1841 -
  1.1842 -
  1.1843 -
  1.1844 -
  1.1845 -
  1.1846 -
  1.1847 -
  1.1848 -Feather                     Standards Track                    [Page 33]
  1.1849 -
  1.1850 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.1851 -
  1.1852 -
  1.1853 -   Example of use of the MODE READER command on a mode-switching server:
  1.1854 -
  1.1855 -      [C] CAPABILITIES
  1.1856 -      [S] 101 Capability list:
  1.1857 -      [S] VERSION 2
  1.1858 -      [S] IHAVE
  1.1859 -      [S] MODE-READER
  1.1860 -      [S] .
  1.1861 -      [C] MODE READER
  1.1862 -      [S] 200 Reader mode, posting permitted
  1.1863 -      [C] CAPABILITIES
  1.1864 -      [S] 101 Capability list:
  1.1865 -      [S] VERSION 2
  1.1866 -      [S] READER
  1.1867 -      [S] NEWNEWS
  1.1868 -      [S] LIST ACTIVE NEWSGROUPS
  1.1869 -      [S] STARTTLS
  1.1870 -      [S] .
  1.1871 -
  1.1872 -   In this case, the server offers (but does not require) TLS privacy in
  1.1873 -   its reading mode but not in its transit mode.
  1.1874 -
  1.1875 -   Example of use of the MODE READER command where the client is not
  1.1876 -   permitted to post:
  1.1877 -
  1.1878 -      [C] MODE READER
  1.1879 -      [S] 201 NNTP Service Ready, posting prohibited
  1.1880 -
  1.1881 -5.4.  QUIT
  1.1882 -
  1.1883 -5.4.1.  Usage
  1.1884 -
  1.1885 -   This command is mandatory.
  1.1886 -
  1.1887 -   Syntax
  1.1888 -     QUIT
  1.1889 -
  1.1890 -   Responses
  1.1891 -     205    Connection closing
  1.1892 -
  1.1893 -5.4.2.  Description
  1.1894 -
  1.1895 -   The client uses the QUIT command to terminate the session.  The
  1.1896 -   server MUST acknowledge the QUIT command and then close the
  1.1897 -   connection to the client.  This is the preferred method for a client
  1.1898 -   to indicate that it has finished all of its transactions with the
  1.1899 -   NNTP server.
  1.1900 -
  1.1901 -
  1.1902 -
  1.1903 -
  1.1904 -Feather                     Standards Track                    [Page 34]
  1.1905 -
  1.1906 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.1907 -
  1.1908 -
  1.1909 -   If a client simply disconnects (or if the connection times out or
  1.1910 -   some other fault occurs), the server MUST gracefully cease its
  1.1911 -   attempts to service the client, disconnecting from its end if
  1.1912 -   necessary.
  1.1913 -
  1.1914 -   The server MUST NOT generate any response code to the QUIT command
  1.1915 -   other than 205 or, if any arguments are provided, 501.
  1.1916 -
  1.1917 -5.4.3.  Examples
  1.1918 -
  1.1919 -      [C] QUIT
  1.1920 -      [S] 205 closing connection
  1.1921 -      [Server closes connection.]
  1.1922 -
  1.1923 -6.  Article Posting and Retrieval
  1.1924 -
  1.1925 -   News-reading clients have available a variety of mechanisms to
  1.1926 -   retrieve articles via NNTP.  The news articles are stored and indexed
  1.1927 -   using three types of keys.  The first type of key is the message-id
  1.1928 -   of an article and is globally unique.  The second type of key is
  1.1929 -   composed of a newsgroup name and an article number within that
  1.1930 -   newsgroup.  On a particular server, there MUST only be one article
  1.1931 -   with a given number within any newsgroup, and an article MUST NOT
  1.1932 -   have two different numbers in the same newsgroup.  An article can be
  1.1933 -   cross-posted to multiple newsgroups, so there may be multiple keys
  1.1934 -   that point to the same article on the same server; these MAY have
  1.1935 -   different numbers in each newsgroup.  However, this type of key is
  1.1936 -   not required to be globally unique, so the same key MAY refer to
  1.1937 -   different articles on different servers.  (Note that the terms
  1.1938 -   "group" and "newsgroup" are equivalent.)
  1.1939 -
  1.1940 -   The final type of key is the arrival timestamp, giving the time that
  1.1941 -   the article arrived at the server.  The server MUST ensure that
  1.1942 -   article numbers are issued in order of arrival timestamp; that is,
  1.1943 -   articles arriving later MUST have higher numbers than those that
  1.1944 -   arrive earlier.  The server SHOULD allocate the next sequential
  1.1945 -   unused number to each new article.
  1.1946 -
  1.1947 -   Article numbers MUST lie between 1 and 2,147,483,647, inclusive.  The
  1.1948 -   client and server MAY use leading zeroes in specifying article
  1.1949 -   numbers but MUST NOT use more than 16 digits.  In some situations,
  1.1950 -   the value zero replaces an article number to show some special
  1.1951 -   situation.
  1.1952 -
  1.1953 -   Note that it is likely that the article number limit of 2,147,483,647
  1.1954 -   will be increased by a future revision or extension to this
  1.1955 -   specification.  While servers MUST NOT send article numbers greater
  1.1956 -   than this current limit, client and server developers are advised to
  1.1957 -
  1.1958 -
  1.1959 -
  1.1960 -Feather                     Standards Track                    [Page 35]
  1.1961 -
  1.1962 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.1963 -
  1.1964 -
  1.1965 -   use internal structures and datatypes capable of handling larger
  1.1966 -   values in anticipation of such a change.
  1.1967 -
  1.1968 -6.1.  Group and Article Selection
  1.1969 -
  1.1970 -   The following commands are used to set the "currently selected
  1.1971 -   newsgroup" and the "current article number", which are used by
  1.1972 -   various commands.  At the start of an NNTP session, both of these
  1.1973 -   values are set to the special value "invalid".
  1.1974 -
  1.1975 -6.1.1.  GROUP
  1.1976 -
  1.1977 -6.1.1.1.  Usage
  1.1978 -
  1.1979 -   Indicating capability: READER
  1.1980 -
  1.1981 -   Syntax
  1.1982 -     GROUP group
  1.1983 -
  1.1984 -   Responses
  1.1985 -     211 number low high group     Group successfully selected
  1.1986 -     411                           No such newsgroup
  1.1987 -
  1.1988 -   Parameters
  1.1989 -     group     Name of newsgroup
  1.1990 -     number    Estimated number of articles in the group
  1.1991 -     low       Reported low water mark
  1.1992 -     high      Reported high water mark
  1.1993 -
  1.1994 -6.1.1.2.  Description
  1.1995 -
  1.1996 -   The GROUP command selects a newsgroup as the currently selected
  1.1997 -   newsgroup and returns summary information about it.
  1.1998 -
  1.1999 -   The required argument is the name of the newsgroup to be selected
  1.2000 -   (e.g., "news.software.nntp").  A list of valid newsgroups may be
  1.2001 -   obtained by using the LIST ACTIVE command (see Section 7.6.3).
  1.2002 -
  1.2003 -   The successful selection response will return the article numbers of
  1.2004 -   the first and last articles in the group at the moment of selection
  1.2005 -   (these numbers are referred to as the "reported low water mark" and
  1.2006 -   the "reported high water mark") and an estimate of the number of
  1.2007 -   articles in the group currently available.
  1.2008 -
  1.2009 -   If the group is not empty, the estimate MUST be at least the actual
  1.2010 -   number of articles available and MUST be no greater than one more
  1.2011 -   than the difference between the reported low and high water marks.
  1.2012 -   (Some implementations will actually count the number of articles
  1.2013 -
  1.2014 -
  1.2015 -
  1.2016 -Feather                     Standards Track                    [Page 36]
  1.2017 -
  1.2018 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.2019 -
  1.2020 -
  1.2021 -   currently stored.  Others will just subtract the low water mark from
  1.2022 -   the high water mark and add one to get an estimate.)
  1.2023 -
  1.2024 -   If the group is empty, one of the following three situations will
  1.2025 -   occur.  Clients MUST accept all three cases; servers MUST NOT
  1.2026 -   represent an empty group in any other way.
  1.2027 -
  1.2028 -   o  The high water mark will be one less than the low water mark, and
  1.2029 -      the estimated article count will be zero.  Servers SHOULD use this
  1.2030 -      method to show an empty group.  This is the only time that the
  1.2031 -      high water mark can be less than the low water mark.
  1.2032 -
  1.2033 -   o  All three numbers will be zero.
  1.2034 -
  1.2035 -   o  The high water mark is greater than or equal to the low water
  1.2036 -      mark.  The estimated article count might be zero or non-zero; if
  1.2037 -      it is non-zero, the same requirements apply as for a non-empty
  1.2038 -      group.
  1.2039 -
  1.2040 -   The set of articles in a group may change after the GROUP command is
  1.2041 -   carried out:
  1.2042 -
  1.2043 -   o  Articles may be removed from the group.
  1.2044 -
  1.2045 -   o  Articles may be reinstated in the group with the same article
  1.2046 -      number, but those articles MUST have numbers no less than the
  1.2047 -      reported low water mark (note that this is a reinstatement of the
  1.2048 -      previous article, not a new article reusing the number).
  1.2049 -
  1.2050 -   o  New articles may be added with article numbers greater than the
  1.2051 -      reported high water mark.  (If an article that was the one with
  1.2052 -      the highest number has been removed and the high water mark has
  1.2053 -      been adjusted accordingly, the next new article will not have the
  1.2054 -      number one greater than the reported high water mark.)
  1.2055 -
  1.2056 -   Except when the group is empty and all three numbers are zero,
  1.2057 -   whenever a subsequent GROUP command for the same newsgroup is issued,
  1.2058 -   either by the same client or a different client, the reported low
  1.2059 -   water mark in the response MUST be no less than that in any previous
  1.2060 -   response for that newsgroup in this session, and it SHOULD be no less
  1.2061 -   than that in any previous response for that newsgroup ever sent to
  1.2062 -   any client.  Any failure to meet the latter condition SHOULD be
  1.2063 -   transient only.  The client may make use of the low water mark to
  1.2064 -   remove all remembered information about articles with lower numbers,
  1.2065 -   as these will never recur.  This includes the situation when the high
  1.2066 -   water mark is one less than the low water mark.  No similar
  1.2067 -   assumption can be made about the high water mark, as this can
  1.2068 -
  1.2069 -
  1.2070 -
  1.2071 -
  1.2072 -Feather                     Standards Track                    [Page 37]
  1.2073 -
  1.2074 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.2075 -
  1.2076 -
  1.2077 -   decrease if an article is removed and then increase again if it is
  1.2078 -   reinstated or if new articles arrive.
  1.2079 -
  1.2080 -   When a valid group is selected by means of this command, the
  1.2081 -   currently selected newsgroup MUST be set to that group, and the
  1.2082 -   current article number MUST be set to the first article in the group
  1.2083 -   (this applies even if the group is already the currently selected
  1.2084 -   newsgroup).  If an empty newsgroup is selected, the current article
  1.2085 -   number is made invalid.  If an invalid group is specified, the
  1.2086 -   currently selected newsgroup and current article number MUST NOT be
  1.2087 -   changed.
  1.2088 -
  1.2089 -   The GROUP or LISTGROUP command (see Section 6.1.2) MUST be used by a
  1.2090 -   client, and a successful response received, before any other command
  1.2091 -   is used that depends on the value of the currently selected newsgroup
  1.2092 -   or current article number.
  1.2093 -
  1.2094 -   If the group specified is not available on the server, a 411 response
  1.2095 -   MUST be returned.
  1.2096 -
  1.2097 -6.1.1.3.  Examples
  1.2098 -
  1.2099 -   Example for a group known to the server:
  1.2100 -
  1.2101 -      [C] GROUP misc.test
  1.2102 -      [S] 211 1234 3000234 3002322 misc.test
  1.2103 -
  1.2104 -   Example for a group unknown to the server:
  1.2105 -
  1.2106 -      [C] GROUP example.is.sob.bradner.or.barber
  1.2107 -      [S] 411 example.is.sob.bradner.or.barber is unknown
  1.2108 -
  1.2109 -   Example of an empty group using the preferred response:
  1.2110 -
  1.2111 -      [C] GROUP example.currently.empty.newsgroup
  1.2112 -      [S] 211 0 4000 3999 example.currently.empty.newsgroup
  1.2113 -
  1.2114 -   Example of an empty group using an alternative response:
  1.2115 -
  1.2116 -      [C] GROUP example.currently.empty.newsgroup
  1.2117 -      [S] 211 0 0 0 example.currently.empty.newsgroup
  1.2118 -
  1.2119 -   Example of an empty group using a different alternative response:
  1.2120 -
  1.2121 -      [C] GROUP example.currently.empty.newsgroup
  1.2122 -      [S] 211 0 4000 4321 example.currently.empty.newsgroup
  1.2123 -
  1.2124 -
  1.2125 -
  1.2126 -
  1.2127 -
  1.2128 -Feather                     Standards Track                    [Page 38]
  1.2129 -
  1.2130 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.2131 -
  1.2132 -
  1.2133 -   Example reselecting the currently selected newsgroup:
  1.2134 -
  1.2135 -      [C] GROUP misc.test
  1.2136 -      [S] 211 1234 234 567 misc.test
  1.2137 -      [C] STAT 444
  1.2138 -      [S] 223 444 <123456@example.net> retrieved
  1.2139 -      [C] GROUP misc.test
  1.2140 -      [S] 211 1234 234 567 misc.test
  1.2141 -      [C] STAT
  1.2142 -      [S] 223 234 <different@example.net> retrieved
  1.2143 -
  1.2144 -6.1.2.  LISTGROUP
  1.2145 -
  1.2146 -6.1.2.1.  Usage
  1.2147 -
  1.2148 -   Indicating capability: READER
  1.2149 -
  1.2150 -   Syntax
  1.2151 -     LISTGROUP [group [range]]
  1.2152 -
  1.2153 -   Responses
  1.2154 -     211 number low high group     Article numbers follow (multi-line)
  1.2155 -     411                           No such newsgroup
  1.2156 -     412                           No newsgroup selected [1]
  1.2157 -
  1.2158 -   Parameters
  1.2159 -     group     Name of newsgroup
  1.2160 -     range     Range of articles to report
  1.2161 -     number    Estimated number of articles in the group
  1.2162 -     low       Reported low water mark
  1.2163 -     high      Reported high water mark
  1.2164 -
  1.2165 -   [1] The 412 response can only occur if no group has been specified.
  1.2166 -
  1.2167 -6.1.2.2.  Description
  1.2168 -
  1.2169 -   The LISTGROUP command selects a newsgroup in the same manner as the
  1.2170 -   GROUP command (see Section 6.1.1) but also provides a list of article
  1.2171 -   numbers in the newsgroup.  If no group is specified, the currently
  1.2172 -   selected newsgroup is used.
  1.2173 -
  1.2174 -   On success, a list of article numbers is returned as a multi-line
  1.2175 -   data block following the 211 response code (the arguments on the
  1.2176 -   initial response line are the same as for the GROUP command).  The
  1.2177 -   list contains one number per line and is in numerical order.  It
  1.2178 -   lists precisely those articles that exist in the group at the moment
  1.2179 -   of selection (therefore, an empty group produces an empty list).  If
  1.2180 -   the optional range argument is specified, only articles within the
  1.2181 -
  1.2182 -
  1.2183 -
  1.2184 -Feather                     Standards Track                    [Page 39]
  1.2185 -
  1.2186 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.2187 -
  1.2188 -
  1.2189 -   range are included in the list (therefore, the list MAY be empty even
  1.2190 -   if the group is not).
  1.2191 -
  1.2192 -   The range argument may be any of the following:
  1.2193 -
  1.2194 -   o  An article number.
  1.2195 -
  1.2196 -   o  An article number followed by a dash to indicate all following.
  1.2197 -
  1.2198 -   o  An article number followed by a dash followed by another article
  1.2199 -      number.
  1.2200 -
  1.2201 -   In the last case, if the second number is less than the first number,
  1.2202 -   then the range contains no articles.  Omitting the range is
  1.2203 -   equivalent to the range 1- being specified.
  1.2204 -
  1.2205 -   If the group specified is not available on the server, a 411 response
  1.2206 -   MUST be returned.  If no group is specified and the currently
  1.2207 -   selected newsgroup is invalid, a 412 response MUST be returned.
  1.2208 -
  1.2209 -   Except that the group argument is optional, that a range argument can
  1.2210 -   be specified, and that a multi-line data block follows the 211
  1.2211 -   response code, the LISTGROUP command is identical to the GROUP
  1.2212 -   command.  In particular, when successful, the command sets the
  1.2213 -   current article number to the first article in the group, if any,
  1.2214 -   even if this is not within the range specified by the second
  1.2215 -   argument.
  1.2216 -
  1.2217 -   Note that the range argument is a new feature in this specification
  1.2218 -   and servers that do not support CAPABILITIES (and therefore do not
  1.2219 -   conform to this specification) are unlikely to support it.
  1.2220 -
  1.2221 -6.1.2.3.  Examples
  1.2222 -
  1.2223 -   Example of LISTGROUP being used to select a group:
  1.2224 -
  1.2225 -      [C] LISTGROUP misc.test
  1.2226 -      [S] 211 2000 3000234 3002322 misc.test list follows
  1.2227 -      [S] 3000234
  1.2228 -      [S] 3000237
  1.2229 -      [S] 3000238
  1.2230 -      [S] 3000239
  1.2231 -      [S] 3002322
  1.2232 -      [S] .
  1.2233 -
  1.2234 -
  1.2235 -
  1.2236 -
  1.2237 -
  1.2238 -
  1.2239 -
  1.2240 -Feather                     Standards Track                    [Page 40]
  1.2241 -
  1.2242 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.2243 -
  1.2244 -
  1.2245 -   Example of LISTGROUP on an empty group:
  1.2246 -
  1.2247 -      [C] LISTGROUP example.empty.newsgroup
  1.2248 -      [S] 211 0 0 0 example.empty.newsgroup list follows
  1.2249 -      [S] .
  1.2250 -
  1.2251 -   Example of LISTGROUP on a valid, currently selected newsgroup:
  1.2252 -
  1.2253 -      [C] GROUP misc.test
  1.2254 -      [S] 211 2000 3000234 3002322 misc.test
  1.2255 -      [C] LISTGROUP
  1.2256 -      [S] 211 2000 3000234 3002322 misc.test list follows
  1.2257 -      [S] 3000234
  1.2258 -      [S] 3000237
  1.2259 -      [S] 3000238
  1.2260 -      [S] 3000239
  1.2261 -      [S] 3002322
  1.2262 -      [S] .
  1.2263 -
  1.2264 -   Example of LISTGROUP with a range:
  1.2265 -
  1.2266 -      [C] LISTGROUP misc.test 3000238-3000248
  1.2267 -      [S] 211 2000 3000234 3002322 misc.test list follows
  1.2268 -      [S] 3000238
  1.2269 -      [S] 3000239
  1.2270 -      [S] .
  1.2271 -
  1.2272 -   Example of LISTGROUP with an empty range:
  1.2273 -
  1.2274 -      [C] LISTGROUP misc.test 12345678-
  1.2275 -      [S] 211 2000 3000234 3002322 misc.test list follows
  1.2276 -      [S] .
  1.2277 -
  1.2278 -   Example of LISTGROUP with an invalid range:
  1.2279 -
  1.2280 -      [C] LISTGROUP misc.test 9999-111
  1.2281 -      [S] 211 2000 3000234 3002322 misc.test list follows
  1.2282 -      [S] .
  1.2283 -
  1.2284 -
  1.2285 -
  1.2286 -
  1.2287 -
  1.2288 -
  1.2289 -
  1.2290 -
  1.2291 -
  1.2292 -
  1.2293 -
  1.2294 -
  1.2295 -
  1.2296 -Feather                     Standards Track                    [Page 41]
  1.2297 -
  1.2298 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.2299 -
  1.2300 -
  1.2301 -6.1.3.  LAST
  1.2302 -
  1.2303 -6.1.3.1.  Usage
  1.2304 -
  1.2305 -   Indicating capability: READER
  1.2306 -
  1.2307 -   Syntax
  1.2308 -     LAST
  1.2309 -
  1.2310 -   Responses
  1.2311 -     223 n message-id    Article found
  1.2312 -     412                 No newsgroup selected
  1.2313 -     420                 Current article number is invalid
  1.2314 -     422                 No previous article in this group
  1.2315 -
  1.2316 -   Parameters
  1.2317 -     n             Article number
  1.2318 -     message-id    Article message-id
  1.2319 -
  1.2320 -6.1.3.2.  Description
  1.2321 -
  1.2322 -   If the currently selected newsgroup is valid, the current article
  1.2323 -   number MUST be set to the previous article in that newsgroup (that
  1.2324 -   is, the highest existing article number less than the current article
  1.2325 -   number).  If successful, a response indicating the new current
  1.2326 -   article number and the message-id of that article MUST be returned.
  1.2327 -   No article text is sent in response to this command.
  1.2328 -
  1.2329 -   There MAY be no previous article in the group, although the current
  1.2330 -   article number is not the reported low water mark.  There MUST NOT be
  1.2331 -   a previous article when the current article number is the reported
  1.2332 -   low water mark.
  1.2333 -
  1.2334 -   Because articles can be removed and added, the results of multiple
  1.2335 -   LAST and NEXT commands MAY not be consistent over the life of a
  1.2336 -   particular NNTP session.
  1.2337 -
  1.2338 -   If the current article number is already the first article of the
  1.2339 -   newsgroup, a 422 response MUST be returned.  If the current article
  1.2340 -   number is invalid, a 420 response MUST be returned.  If the currently
  1.2341 -   selected newsgroup is invalid, a 412 response MUST be returned.  In
  1.2342 -   all three cases, the currently selected newsgroup and current article
  1.2343 -   number MUST NOT be altered.
  1.2344 -
  1.2345 -
  1.2346 -
  1.2347 -
  1.2348 -
  1.2349 -
  1.2350 -
  1.2351 -
  1.2352 -Feather                     Standards Track                    [Page 42]
  1.2353 -
  1.2354 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.2355 -
  1.2356 -
  1.2357 -6.1.3.3.  Examples
  1.2358 -
  1.2359 -   Example of a successful article retrieval using LAST:
  1.2360 -
  1.2361 -      [C] GROUP misc.test
  1.2362 -      [S] 211 1234 3000234 3002322 misc.test
  1.2363 -      [C] NEXT
  1.2364 -      [S] 223 3000237 <668929@example.org> retrieved
  1.2365 -      [C] LAST
  1.2366 -      [S] 223 3000234 <45223423@example.com> retrieved
  1.2367 -
  1.2368 -   Example of an attempt to retrieve an article without having selected
  1.2369 -   a group (via the GROUP command) first:
  1.2370 -
  1.2371 -      [Assumes currently selected newsgroup is invalid.]
  1.2372 -      [C] LAST
  1.2373 -      [S] 412 no newsgroup selected
  1.2374 -
  1.2375 -   Example of an attempt to retrieve an article using the LAST command
  1.2376 -   when the current article number is that of the first article in the
  1.2377 -   group:
  1.2378 -
  1.2379 -      [C] GROUP misc.test
  1.2380 -      [S] 211 1234 3000234 3002322 misc.test
  1.2381 -      [C] LAST
  1.2382 -      [S] 422 No previous article to retrieve
  1.2383 -
  1.2384 -   Example of an attempt to retrieve an article using the LAST command
  1.2385 -   when the currently selected newsgroup is empty:
  1.2386 -
  1.2387 -      [C] GROUP example.empty.newsgroup
  1.2388 -      [S] 211 0 0 0 example.empty.newsgroup
  1.2389 -      [C] LAST
  1.2390 -      [S] 420 No current article selected
  1.2391 -
  1.2392 -
  1.2393 -
  1.2394 -
  1.2395 -
  1.2396 -
  1.2397 -
  1.2398 -
  1.2399 -
  1.2400 -
  1.2401 -
  1.2402 -
  1.2403 -
  1.2404 -
  1.2405 -
  1.2406 -
  1.2407 -
  1.2408 -Feather                     Standards Track                    [Page 43]
  1.2409 -
  1.2410 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.2411 -
  1.2412 -
  1.2413 -6.1.4.  NEXT
  1.2414 -
  1.2415 -6.1.4.1.  Usage
  1.2416 -
  1.2417 -   Indicating capability: READER
  1.2418 -
  1.2419 -   Syntax
  1.2420 -     NEXT
  1.2421 -
  1.2422 -   Responses
  1.2423 -     223 n message-id    Article found
  1.2424 -     412                 No newsgroup selected
  1.2425 -     420                 Current article number is invalid
  1.2426 -     421                 No next article in this group
  1.2427 -
  1.2428 -   Parameters
  1.2429 -     n             Article number
  1.2430 -     message-id    Article message-id
  1.2431 -
  1.2432 -6.1.4.2.  Description
  1.2433 -
  1.2434 -   If the currently selected newsgroup is valid, the current article
  1.2435 -   number MUST be set to the next article in that newsgroup (that is,
  1.2436 -   the lowest existing article number greater than the current article
  1.2437 -   number).  If successful, a response indicating the new current
  1.2438 -   article number and the message-id of that article MUST be returned.
  1.2439 -   No article text is sent in response to this command.
  1.2440 -
  1.2441 -   If the current article number is already the last article of the
  1.2442 -   newsgroup, a 421 response MUST be returned.  In all other aspects
  1.2443 -   (apart, of course, from the lack of 422 response), this command is
  1.2444 -   identical to the LAST command (Section 6.1.3).
  1.2445 -
  1.2446 -6.1.4.3.  Examples
  1.2447 -
  1.2448 -   Example of a successful article retrieval using NEXT:
  1.2449 -
  1.2450 -      [C] GROUP misc.test
  1.2451 -      [S] 211 1234 3000234 3002322 misc.test
  1.2452 -      [C] NEXT
  1.2453 -      [S] 223 3000237 <668929@example.org> retrieved
  1.2454 -
  1.2455 -
  1.2456 -
  1.2457 -
  1.2458 -
  1.2459 -
  1.2460 -
  1.2461 -
  1.2462 -
  1.2463 -
  1.2464 -Feather                     Standards Track                    [Page 44]
  1.2465 -
  1.2466 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.2467 -
  1.2468 -
  1.2469 -   Example of an attempt to retrieve an article without having selected
  1.2470 -   a group (via the GROUP command) first:
  1.2471 -
  1.2472 -      [Assumes currently selected newsgroup is invalid.]
  1.2473 -      [C] NEXT
  1.2474 -      [S] 412 no newsgroup selected
  1.2475 -
  1.2476 -   Example of an attempt to retrieve an article using the NEXT command
  1.2477 -   when the current article number is that of the last article in the
  1.2478 -   group:
  1.2479 -
  1.2480 -      [C] GROUP misc.test
  1.2481 -      [S] 211 1234 3000234 3002322 misc.test
  1.2482 -      [C] STAT 3002322
  1.2483 -      [S] 223 3002322 <411@example.net> retrieved
  1.2484 -      [C] NEXT
  1.2485 -      [S] 421 No next article to retrieve
  1.2486 -
  1.2487 -   Example of an attempt to retrieve an article using the NEXT command
  1.2488 -   when the currently selected newsgroup is empty:
  1.2489 -
  1.2490 -      [C] GROUP example.empty.newsgroup
  1.2491 -      [S] 211 0 0 0 example.empty.newsgroup
  1.2492 -      [C] NEXT
  1.2493 -      [S] 420 No current article selected
  1.2494 -
  1.2495 -6.2.  Retrieval of Articles and Article Sections
  1.2496 -
  1.2497 -   The ARTICLE, BODY, HEAD, and STAT commands are very similar.  They
  1.2498 -   differ only in the parts of the article that are presented to the
  1.2499 -   client and in the successful response code.  The ARTICLE command is
  1.2500 -   described here in full, while the other three commands are described
  1.2501 -   in terms of the differences.  As specified in Section 3.6, an article
  1.2502 -   consists of two parts: the article headers and the article body.
  1.2503 -
  1.2504 -   When responding to one of these commands, the server MUST present the
  1.2505 -   entire article or appropriate part and MUST NOT attempt to alter or
  1.2506 -   translate it in any way.
  1.2507 -
  1.2508 -
  1.2509 -
  1.2510 -
  1.2511 -
  1.2512 -
  1.2513 -
  1.2514 -
  1.2515 -
  1.2516 -
  1.2517 -
  1.2518 -
  1.2519 -
  1.2520 -Feather                     Standards Track                    [Page 45]
  1.2521 -
  1.2522 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.2523 -
  1.2524 -
  1.2525 -6.2.1.  ARTICLE
  1.2526 -
  1.2527 -6.2.1.1.  Usage
  1.2528 -
  1.2529 -   Indicating capability: READER
  1.2530 -
  1.2531 -   Syntax
  1.2532 -     ARTICLE message-id
  1.2533 -     ARTICLE number
  1.2534 -     ARTICLE
  1.2535 -
  1.2536 -   Responses
  1.2537 -
  1.2538 -   First form (message-id specified)
  1.2539 -     220 0|n message-id    Article follows (multi-line)
  1.2540 -     430                   No article with that message-id
  1.2541 -
  1.2542 -   Second form (article number specified)
  1.2543 -     220 n message-id      Article follows (multi-line)
  1.2544 -     412                   No newsgroup selected
  1.2545 -     423                   No article with that number
  1.2546 -
  1.2547 -   Third form (current article number used)
  1.2548 -     220 n message-id      Article follows (multi-line)
  1.2549 -     412                   No newsgroup selected
  1.2550 -     420                   Current article number is invalid
  1.2551 -
  1.2552 -   Parameters
  1.2553 -     number        Requested article number
  1.2554 -     n             Returned article number
  1.2555 -     message-id    Article message-id
  1.2556 -
  1.2557 -6.2.1.2.  Description
  1.2558 -
  1.2559 -   The ARTICLE command selects an article according to the arguments and
  1.2560 -   presents the entire article (that is, the headers, an empty line, and
  1.2561 -   the body, in that order) to the client.  The command has three forms.
  1.2562 -
  1.2563 -   In the first form, a message-id is specified, and the server presents
  1.2564 -   the article with that message-id.  In this case, the server MUST NOT
  1.2565 -   alter the currently selected newsgroup or current article number.
  1.2566 -   This is both to facilitate the presentation of articles that may be
  1.2567 -   referenced within another article being read, and because of the
  1.2568 -   semantic difficulties of determining the proper sequence and
  1.2569 -   membership of an article that may have been cross-posted to more than
  1.2570 -   one newsgroup.
  1.2571 -
  1.2572 -
  1.2573 -
  1.2574 -
  1.2575 -
  1.2576 -Feather                     Standards Track                    [Page 46]
  1.2577 -
  1.2578 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.2579 -
  1.2580 -
  1.2581 -   In the response, the article number MUST be replaced with zero,
  1.2582 -   unless there is a currently selected newsgroup and the article is
  1.2583 -   present in that group, in which case the server MAY use the article's
  1.2584 -   number in that group.  (The server is not required to determine
  1.2585 -   whether the article is in the currently selected newsgroup or, if so,
  1.2586 -   what article number it has; the client MUST always be prepared for
  1.2587 -   zero to be specified.)  The server MUST NOT provide an article number
  1.2588 -   unless use of that number in a second ARTICLE command immediately
  1.2589 -   following this one would return the same article.  Even if the server
  1.2590 -   chooses to return article numbers in these circumstances, it need not
  1.2591 -   do so consistently; it MAY return zero to any such command (also see
  1.2592 -   the STAT examples, Section 6.2.4.3).
  1.2593 -
  1.2594 -   In the second form, an article number is specified.  If there is an
  1.2595 -   article with that number in the currently selected newsgroup, the
  1.2596 -   server MUST set the current article number to that number.
  1.2597 -
  1.2598 -   In the third form, the article indicated by the current article
  1.2599 -   number in the currently selected newsgroup is used.
  1.2600 -
  1.2601 -   Note that a previously valid article number MAY become invalid if the
  1.2602 -   article has been removed.  A previously invalid article number MAY
  1.2603 -   become valid if the article has been reinstated, but this article
  1.2604 -   number MUST be no less than the reported low water mark for that
  1.2605 -   group.
  1.2606 -
  1.2607 -   The server MUST NOT change the currently selected newsgroup as a
  1.2608 -   result of this command.  The server MUST NOT change the current
  1.2609 -   article number except when an article number argument was provided
  1.2610 -   and the article exists; in particular, it MUST NOT change it
  1.2611 -   following an unsuccessful response.
  1.2612 -
  1.2613 -   Since the message-id is unique for each article, it may be used by a
  1.2614 -   client to skip duplicate displays of articles that have been posted
  1.2615 -   more than once, or to more than one newsgroup.
  1.2616 -
  1.2617 -   The article is returned as a multi-line data block following the 220
  1.2618 -   response code.
  1.2619 -
  1.2620 -   If the argument is a message-id and no such article exists, a 430
  1.2621 -   response MUST be returned.  If the argument is a number or is omitted
  1.2622 -   and the currently selected newsgroup is invalid, a 412 response MUST
  1.2623 -   be returned.  If the argument is a number and that article does not
  1.2624 -   exist in the currently selected newsgroup, a 423 response MUST be
  1.2625 -   returned.  If the argument is omitted and the current article number
  1.2626 -   is invalid, a 420 response MUST be returned.
  1.2627 -
  1.2628 -
  1.2629 -
  1.2630 -
  1.2631 -
  1.2632 -Feather                     Standards Track                    [Page 47]
  1.2633 -
  1.2634 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.2635 -
  1.2636 -
  1.2637 -6.2.1.3.  Examples
  1.2638 -
  1.2639 -   Example of a successful retrieval of an article (explicitly not using
  1.2640 -   an article number):
  1.2641 -
  1.2642 -      [C] GROUP misc.test
  1.2643 -      [S] 211 1234 3000234 3002322 misc.test
  1.2644 -      [C] ARTICLE
  1.2645 -      [S] 220 3000234 <45223423@example.com>
  1.2646 -      [S] Path: pathost!demo!whitehouse!not-for-mail
  1.2647 -      [S] From: "Demo User" <nobody@example.net>
  1.2648 -      [S] Newsgroups: misc.test
  1.2649 -      [S] Subject: I am just a test article
  1.2650 -      [S] Date: 6 Oct 1998 04:38:40 -0500
  1.2651 -      [S] Organization: An Example Net, Uncertain, Texas
  1.2652 -      [S] Message-ID: <45223423@example.com>
  1.2653 -      [S]
  1.2654 -      [S] This is just a test article.
  1.2655 -      [S] .
  1.2656 -
  1.2657 -   Example of a successful retrieval of an article by message-id:
  1.2658 -
  1.2659 -      [C] ARTICLE <45223423@example.com>
  1.2660 -      [S] 220 0 <45223423@example.com>
  1.2661 -      [S] Path: pathost!demo!whitehouse!not-for-mail
  1.2662 -      [S] From: "Demo User" <nobody@example.net>
  1.2663 -      [S] Newsgroups: misc.test
  1.2664 -      [S] Subject: I am just a test article
  1.2665 -      [S] Date: 6 Oct 1998 04:38:40 -0500
  1.2666 -      [S] Organization: An Example Net, Uncertain, Texas
  1.2667 -      [S] Message-ID: <45223423@example.com>
  1.2668 -      [S]
  1.2669 -      [S] This is just a test article.
  1.2670 -      [S] .
  1.2671 -
  1.2672 -   Example of an unsuccessful retrieval of an article by message-id:
  1.2673 -
  1.2674 -      [C] ARTICLE <i.am.not.there@example.com>
  1.2675 -      [S] 430 No Such Article Found
  1.2676 -
  1.2677 -   Example of an unsuccessful retrieval of an article by number:
  1.2678 -
  1.2679 -      [C] GROUP misc.test
  1.2680 -      [S] 211 1234 3000234 3002322 news.groups
  1.2681 -      [C] ARTICLE 300256
  1.2682 -      [S] 423 No article with that number
  1.2683 -
  1.2684 -
  1.2685 -
  1.2686 -
  1.2687 -
  1.2688 -Feather                     Standards Track                    [Page 48]
  1.2689 -
  1.2690 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.2691 -
  1.2692 -
  1.2693 -   Example of an unsuccessful retrieval of an article by number because
  1.2694 -   no newsgroup was selected first:
  1.2695 -
  1.2696 -      [Assumes currently selected newsgroup is invalid.]
  1.2697 -      [C] ARTICLE 300256
  1.2698 -      [S] 412 No newsgroup selected
  1.2699 -
  1.2700 -   Example of an attempt to retrieve an article when the currently
  1.2701 -   selected newsgroup is empty:
  1.2702 -
  1.2703 -      [C] GROUP example.empty.newsgroup
  1.2704 -      [S] 211 0 0 0 example.empty.newsgroup
  1.2705 -      [C] ARTICLE
  1.2706 -      [S] 420 No current article selected
  1.2707 -
  1.2708 -6.2.2.  HEAD
  1.2709 -
  1.2710 -6.2.2.1.  Usage
  1.2711 -
  1.2712 -   This command is mandatory.
  1.2713 -
  1.2714 -   Syntax
  1.2715 -     HEAD message-id
  1.2716 -     HEAD number
  1.2717 -     HEAD
  1.2718 -
  1.2719 -   Responses
  1.2720 -
  1.2721 -   First form (message-id specified)
  1.2722 -     221 0|n message-id    Headers follow (multi-line)
  1.2723 -     430                   No article with that message-id
  1.2724 -
  1.2725 -   Second form (article number specified)
  1.2726 -     221 n message-id      Headers follow (multi-line)
  1.2727 -     412                   No newsgroup selected
  1.2728 -     423                   No article with that number
  1.2729 -
  1.2730 -   Third form (current article number used)
  1.2731 -     221 n message-id      Headers follow (multi-line)
  1.2732 -     412                   No newsgroup selected
  1.2733 -     420                   Current article number is invalid
  1.2734 -
  1.2735 -   Parameters
  1.2736 -     number        Requested article number
  1.2737 -     n             Returned article number
  1.2738 -     message-id    Article message-id
  1.2739 -
  1.2740 -
  1.2741 -
  1.2742 -
  1.2743 -
  1.2744 -Feather                     Standards Track                    [Page 49]
  1.2745 -
  1.2746 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.2747 -
  1.2748 -
  1.2749 -6.2.2.2.  Description
  1.2750 -
  1.2751 -   The HEAD command behaves identically to the ARTICLE command except
  1.2752 -   that, if the article exists, the response code is 221 instead of 220
  1.2753 -   and only the headers are presented (the empty line separating the
  1.2754 -   headers and body MUST NOT be included).
  1.2755 -
  1.2756 -6.2.2.3.  Examples
  1.2757 -
  1.2758 -   Example of a successful retrieval of the headers of an article
  1.2759 -   (explicitly not using an article number):
  1.2760 -
  1.2761 -      [C] GROUP misc.test
  1.2762 -      [S] 211 1234 3000234 3002322 misc.test
  1.2763 -      [C] HEAD
  1.2764 -      [S] 221 3000234 <45223423@example.com>
  1.2765 -      [S] Path: pathost!demo!whitehouse!not-for-mail
  1.2766 -      [S] From: "Demo User" <nobody@example.net>
  1.2767 -      [S] Newsgroups: misc.test
  1.2768 -      [S] Subject: I am just a test article
  1.2769 -      [S] Date: 6 Oct 1998 04:38:40 -0500
  1.2770 -      [S] Organization: An Example Net, Uncertain, Texas
  1.2771 -      [S] Message-ID: <45223423@example.com>
  1.2772 -      [S] .
  1.2773 -
  1.2774 -   Example of a successful retrieval of the headers of an article by
  1.2775 -   message-id:
  1.2776 -
  1.2777 -      [C] HEAD <45223423@example.com>
  1.2778 -      [S] 221 0 <45223423@example.com>
  1.2779 -      [S] Path: pathost!demo!whitehouse!not-for-mail
  1.2780 -      [S] From: "Demo User" <nobody@example.net>
  1.2781 -      [S] Newsgroups: misc.test
  1.2782 -      [S] Subject: I am just a test article
  1.2783 -      [S] Date: 6 Oct 1998 04:38:40 -0500
  1.2784 -      [S] Organization: An Example Net, Uncertain, Texas
  1.2785 -      [S] Message-ID: <45223423@example.com>
  1.2786 -      [S] .
  1.2787 -
  1.2788 -   Example of an unsuccessful retrieval of the headers of an article by
  1.2789 -   message-id:
  1.2790 -
  1.2791 -      [C] HEAD <i.am.not.there@example.com>
  1.2792 -      [S] 430 No Such Article Found
  1.2793 -
  1.2794 -
  1.2795 -
  1.2796 -
  1.2797 -
  1.2798 -
  1.2799 -
  1.2800 -Feather                     Standards Track                    [Page 50]
  1.2801 -
  1.2802 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.2803 -
  1.2804 -
  1.2805 -   Example of an unsuccessful retrieval of the headers of an article by
  1.2806 -   number:
  1.2807 -
  1.2808 -      [C] GROUP misc.test
  1.2809 -      [S] 211 1234 3000234 3002322 misc.test
  1.2810 -      [C] HEAD 300256
  1.2811 -      [S] 423 No article with that number
  1.2812 -
  1.2813 -   Example of an unsuccessful retrieval of the headers of an article by
  1.2814 -   number because no newsgroup was selected first:
  1.2815 -
  1.2816 -      [Assumes currently selected newsgroup is invalid.]
  1.2817 -      [C] HEAD 300256
  1.2818 -      [S] 412 No newsgroup selected
  1.2819 -
  1.2820 -   Example of an attempt to retrieve the headers of an article when the
  1.2821 -   currently selected newsgroup is empty:
  1.2822 -
  1.2823 -      [C] GROUP example.empty.newsgroup
  1.2824 -      [S] 211 0 0 0 example.empty.newsgroup
  1.2825 -      [C] HEAD
  1.2826 -      [S] 420 No current article selected
  1.2827 -
  1.2828 -6.2.3.  BODY
  1.2829 -
  1.2830 -6.2.3.1.  Usage
  1.2831 -
  1.2832 -   Indicating capability: READER
  1.2833 -
  1.2834 -   Syntax
  1.2835 -     BODY message-id
  1.2836 -     BODY number
  1.2837 -     BODY
  1.2838 -
  1.2839 -   Responses
  1.2840 -
  1.2841 -   First form (message-id specified)
  1.2842 -     222 0|n message-id    Body follows (multi-line)
  1.2843 -     430                   No article with that message-id
  1.2844 -
  1.2845 -   Second form (article number specified)
  1.2846 -     222 n message-id      Body follows (multi-line)
  1.2847 -     412                   No newsgroup selected
  1.2848 -     423                   No article with that number
  1.2849 -
  1.2850 -
  1.2851 -
  1.2852 -
  1.2853 -
  1.2854 -
  1.2855 -
  1.2856 -Feather                     Standards Track                    [Page 51]
  1.2857 -
  1.2858 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.2859 -
  1.2860 -
  1.2861 -   Third form (current article number used)
  1.2862 -     222 n message-id      Body follows (multi-line)
  1.2863 -     412                   No newsgroup selected
  1.2864 -     420                   Current article number is invalid
  1.2865 -
  1.2866 -   Parameters
  1.2867 -     number        Requested article number
  1.2868 -     n             Returned article number
  1.2869 -     message-id    Article message-id
  1.2870 -
  1.2871 -6.2.3.2.  Description
  1.2872 -
  1.2873 -   The BODY command behaves identically to the ARTICLE command except
  1.2874 -   that, if the article exists, the response code is 222 instead of 220
  1.2875 -   and only the body is presented (the empty line separating the headers
  1.2876 -   and body MUST NOT be included).
  1.2877 -
  1.2878 -6.2.3.3.  Examples
  1.2879 -
  1.2880 -   Example of a successful retrieval of the body of an article
  1.2881 -   (explicitly not using an article number):
  1.2882 -
  1.2883 -      [C] GROUP misc.test
  1.2884 -      [S] 211 1234 3000234 3002322 misc.test
  1.2885 -      [C] BODY
  1.2886 -      [S] 222 3000234 <45223423@example.com>
  1.2887 -      [S] This is just a test article.
  1.2888 -      [S] .
  1.2889 -
  1.2890 -   Example of a successful retrieval of the body of an article by
  1.2891 -   message-id:
  1.2892 -
  1.2893 -      [C] BODY <45223423@example.com>
  1.2894 -      [S] 222 0 <45223423@example.com>
  1.2895 -      [S] This is just a test article.
  1.2896 -      [S] .
  1.2897 -
  1.2898 -   Example of an unsuccessful retrieval of the body of an article by
  1.2899 -   message-id:
  1.2900 -
  1.2901 -      [C] BODY <i.am.not.there@example.com>
  1.2902 -      [S] 430 No Such Article Found
  1.2903 -
  1.2904 -
  1.2905 -
  1.2906 -
  1.2907 -
  1.2908 -
  1.2909 -
  1.2910 -
  1.2911 -
  1.2912 -Feather                     Standards Track                    [Page 52]
  1.2913 -
  1.2914 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.2915 -
  1.2916 -
  1.2917 -   Example of an unsuccessful retrieval of the body of an article by
  1.2918 -   number:
  1.2919 -
  1.2920 -      [C] GROUP misc.test
  1.2921 -      [S] 211 1234 3000234 3002322 misc.test
  1.2922 -      [C] BODY 300256
  1.2923 -      [S] 423 No article with that number
  1.2924 -
  1.2925 -   Example of an unsuccessful retrieval of the body of an article by
  1.2926 -   number because no newsgroup was selected first:
  1.2927 -
  1.2928 -      [Assumes currently selected newsgroup is invalid.]
  1.2929 -      [C] BODY 300256
  1.2930 -      [S] 412 No newsgroup selected
  1.2931 -
  1.2932 -   Example of an attempt to retrieve the body of an article when the
  1.2933 -   currently selected newsgroup is empty:
  1.2934 -
  1.2935 -      [C] GROUP example.empty.newsgroup
  1.2936 -      [S] 211 0 0 0 example.empty.newsgroup
  1.2937 -      [C] BODY
  1.2938 -      [S] 420 No current article selected
  1.2939 -
  1.2940 -6.2.4.  STAT
  1.2941 -
  1.2942 -6.2.4.1.  Usage
  1.2943 -
  1.2944 -   This command is mandatory.
  1.2945 -
  1.2946 -   Syntax
  1.2947 -     STAT message-id
  1.2948 -     STAT number
  1.2949 -     STAT
  1.2950 -
  1.2951 -   Responses
  1.2952 -
  1.2953 -   First form (message-id specified)
  1.2954 -     223 0|n message-id    Article exists
  1.2955 -     430                   No article with that message-id
  1.2956 -
  1.2957 -   Second form (article number specified)
  1.2958 -     223 n message-id      Article exists
  1.2959 -     412                   No newsgroup selected
  1.2960 -     423                   No article with that number
  1.2961 -
  1.2962 -
  1.2963 -
  1.2964 -
  1.2965 -
  1.2966 -
  1.2967 -
  1.2968 -Feather                     Standards Track                    [Page 53]
  1.2969 -
  1.2970 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.2971 -
  1.2972 -
  1.2973 -   Third form (current article number used)
  1.2974 -     223 n message-id      Article exists
  1.2975 -     412                   No newsgroup selected
  1.2976 -     420                   Current article number is invalid
  1.2977 -
  1.2978 -   Parameters
  1.2979 -     number        Requested article number
  1.2980 -     n             Returned article number
  1.2981 -     message-id    Article message-id
  1.2982 -
  1.2983 -6.2.4.2.  Description
  1.2984 -
  1.2985 -   The STAT command behaves identically to the ARTICLE command except
  1.2986 -   that, if the article exists, it is NOT presented to the client and
  1.2987 -   the response code is 223 instead of 220.  Note that the response is
  1.2988 -   NOT multi-line.
  1.2989 -
  1.2990 -   This command allows the client to determine whether an article exists
  1.2991 -   and, in the second and third forms, what its message-id is, without
  1.2992 -   having to process an arbitrary amount of text.
  1.2993 -
  1.2994 -6.2.4.3.  Examples
  1.2995 -
  1.2996 -   Example of STAT on an existing article (explicitly not using an
  1.2997 -   article number):
  1.2998 -
  1.2999 -      [C] GROUP misc.test
  1.3000 -      [S] 211 1234 3000234 3002322 misc.test
  1.3001 -      [C] STAT
  1.3002 -      [S] 223 3000234 <45223423@example.com>
  1.3003 -
  1.3004 -   Example of STAT on an existing article by message-id:
  1.3005 -
  1.3006 -      [C] STAT <45223423@example.com>
  1.3007 -      [S] 223 0 <45223423@example.com>
  1.3008 -
  1.3009 -   Example of STAT on an article not on the server by message-id:
  1.3010 -
  1.3011 -      [C] STAT <i.am.not.there@example.com>
  1.3012 -      [S] 430 No Such Article Found
  1.3013 -
  1.3014 -   Example of STAT on an article not in the server by number:
  1.3015 -
  1.3016 -      [C] GROUP misc.test
  1.3017 -      [S] 211 1234 3000234 3002322 misc.test
  1.3018 -      [C] STAT 300256
  1.3019 -      [S] 423 No article with that number
  1.3020 -
  1.3021 -
  1.3022 -
  1.3023 -
  1.3024 -Feather                     Standards Track                    [Page 54]
  1.3025 -
  1.3026 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.3027 -
  1.3028 -
  1.3029 -   Example of STAT on an article by number when no newsgroup was
  1.3030 -   selected first:
  1.3031 -
  1.3032 -      [Assumes currently selected newsgroup is invalid.]
  1.3033 -      [C] STAT 300256
  1.3034 -      [S] 412 No newsgroup selected
  1.3035 -
  1.3036 -   Example of STAT on an article when the currently selected newsgroup
  1.3037 -   is empty:
  1.3038 -
  1.3039 -      [C] GROUP example.empty.newsgroup
  1.3040 -      [S] 211 0 0 0 example.empty.newsgroup
  1.3041 -      [C] STAT
  1.3042 -      [S] 420 No current article selected
  1.3043 -
  1.3044 -   Example of STAT by message-id on a server that sometimes reports the
  1.3045 -   actual article number:
  1.3046 -
  1.3047 -      [C] GROUP misc.test
  1.3048 -      [S] 211 1234 3000234 3002322 misc.test
  1.3049 -      [C] STAT
  1.3050 -      [S] 223 3000234 <45223423@example.com>
  1.3051 -      [C] STAT <45223423@example.com>
  1.3052 -      [S] 223 0 <45223423@example.com>
  1.3053 -      [C] STAT <45223423@example.com>
  1.3054 -      [S] 223 3000234 <45223423@example.com>
  1.3055 -      [C] GROUP example.empty.newsgroup
  1.3056 -      [S] 211 0 0 0 example.empty.newsgroup
  1.3057 -      [C] STAT <45223423@example.com>
  1.3058 -      [S] 223 0 <45223423@example.com>
  1.3059 -      [C] GROUP alt.crossposts
  1.3060 -      [S] 211 9999 111111 222222 alt.crossposts
  1.3061 -      [C] STAT <45223423@example.com>
  1.3062 -      [S] 223 123456 <45223423@example.com>
  1.3063 -      [C] STAT
  1.3064 -      [S] 223 111111 <23894720@example.com>
  1.3065 -
  1.3066 -   The first STAT command establishes the identity of an article in the
  1.3067 -   group.  The second and third show that the server may, but need not,
  1.3068 -   give the article number when the message-id is specified.  The fourth
  1.3069 -   STAT command shows that zero must be specified if the article isn't
  1.3070 -   in the currently selected newsgroup.  The fifth shows that the
  1.3071 -   number, if provided, must be that relating to the currently selected
  1.3072 -   newsgroup.  The last one shows that the current article number is
  1.3073 -   still not changed by the use of STAT with a message-id even if it
  1.3074 -   returns an article number.
  1.3075 -
  1.3076 -
  1.3077 -
  1.3078 -
  1.3079 -
  1.3080 -Feather                     Standards Track                    [Page 55]
  1.3081 -
  1.3082 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.3083 -
  1.3084 -
  1.3085 -6.3.  Article Posting
  1.3086 -
  1.3087 -   Article posting is done in one of two ways: individual article
  1.3088 -   posting from news-reading clients using POST, and article transfer
  1.3089 -   from other news servers using IHAVE.
  1.3090 -
  1.3091 -6.3.1.  POST
  1.3092 -
  1.3093 -6.3.1.1.  Usage
  1.3094 -
  1.3095 -   Indicating capability: POST
  1.3096 -
  1.3097 -   This command MUST NOT be pipelined.
  1.3098 -
  1.3099 -   Syntax
  1.3100 -     POST
  1.3101 -
  1.3102 -   Responses
  1.3103 -
  1.3104 -   Initial responses
  1.3105 -     340    Send article to be posted
  1.3106 -     440    Posting not permitted
  1.3107 -
  1.3108 -   Subsequent responses
  1.3109 -     240    Article received OK
  1.3110 -     441    Posting failed
  1.3111 -
  1.3112 -6.3.1.2.  Description
  1.3113 -
  1.3114 -   If posting is allowed, a 340 response MUST be returned to indicate
  1.3115 -   that the article to be posted should be sent.  If posting is
  1.3116 -   prohibited for some installation-dependent reason, a 440 response
  1.3117 -   MUST be returned.
  1.3118 -
  1.3119 -   If posting is permitted, the article MUST be in the format specified
  1.3120 -   in Section 3.6 and MUST be sent by the client to the server as a
  1.3121 -   multi-line data block (see Section 3.1.1).  Thus a single dot (".")
  1.3122 -   on a line indicates the end of the text, and lines starting with a
  1.3123 -   dot in the original text have that dot doubled during transmission.
  1.3124 -
  1.3125 -   Following the presentation of the termination sequence by the client,
  1.3126 -   the server MUST return a response indicating success or failure of
  1.3127 -   the article transfer.  Note that response codes 340 and 440 are used
  1.3128 -   in direct response to the POST command while 240 and 441 are returned
  1.3129 -   after the article is sent.
  1.3130 -
  1.3131 -
  1.3132 -
  1.3133 -
  1.3134 -
  1.3135 -
  1.3136 -Feather                     Standards Track                    [Page 56]
  1.3137 -
  1.3138 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.3139 -
  1.3140 -
  1.3141 -   A response of 240 SHOULD indicate that, barring unforeseen server
  1.3142 -   errors, the posted article will be made available on the server
  1.3143 -   and/or transferred to other servers, as appropriate, possibly
  1.3144 -   following further processing.  In other words, articles not wanted by
  1.3145 -   the server SHOULD be rejected with a 441 response, rather than being
  1.3146 -   accepted and then discarded silently.  However, the client SHOULD NOT
  1.3147 -   assume that the article has been successfully transferred unless it
  1.3148 -   receives an affirmative response from the server and SHOULD NOT
  1.3149 -   assume that it is being made available to other clients without
  1.3150 -   explicitly checking (for example, using the STAT command).
  1.3151 -
  1.3152 -   If the session is interrupted before the response is received, it is
  1.3153 -   possible that an affirmative response was sent but has been lost.
  1.3154 -   Therefore, in any subsequent session, the client SHOULD either check
  1.3155 -   whether the article was successfully posted before resending or
  1.3156 -   ensure that the server will allocate the same message-id to the new
  1.3157 -   attempt (see Appendix A.2).  The latter approach is preferred since
  1.3158 -   the article might not have been made available for reading yet (for
  1.3159 -   example, it may have to go through a moderation process).
  1.3160 -
  1.3161 -6.3.1.3.  Examples
  1.3162 -
  1.3163 -   Example of a successful posting:
  1.3164 -
  1.3165 -      [C] POST
  1.3166 -      [S] 340 Input article; end with <CR-LF>.<CR-LF>
  1.3167 -      [C] From: "Demo User" <nobody@example.net>
  1.3168 -      [C] Newsgroups: misc.test
  1.3169 -      [C] Subject: I am just a test article
  1.3170 -      [C] Organization: An Example Net
  1.3171 -      [C]
  1.3172 -      [C] This is just a test article.
  1.3173 -      [C] .
  1.3174 -      [S] 240 Article received OK
  1.3175 -
  1.3176 -   Example of an unsuccessful posting:
  1.3177 -
  1.3178 -      [C] POST
  1.3179 -      [S] 340 Input article; end with <CR-LF>.<CR-LF>
  1.3180 -      [C] From: "Demo User" <nobody@example.net>
  1.3181 -      [C] Newsgroups: misc.test
  1.3182 -      [C] Subject: I am just a test article
  1.3183 -      [C] Organization: An Example Net
  1.3184 -      [C]
  1.3185 -      [C] This is just a test article.
  1.3186 -      [C] .
  1.3187 -      [S] 441 Posting failed
  1.3188 -
  1.3189 -
  1.3190 -
  1.3191 -
  1.3192 -Feather                     Standards Track                    [Page 57]
  1.3193 -
  1.3194 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.3195 -
  1.3196 -
  1.3197 -   Example of an attempt to post when posting is not allowed:
  1.3198 -
  1.3199 -      [Initial connection set-up completed.]
  1.3200 -      [S] 201 NNTP Service Ready, posting prohibited
  1.3201 -      [C] POST
  1.3202 -      [S] 440 Posting not permitted
  1.3203 -
  1.3204 -6.3.2.  IHAVE
  1.3205 -
  1.3206 -6.3.2.1.  Usage
  1.3207 -
  1.3208 -   Indicating capability: IHAVE
  1.3209 -
  1.3210 -   This command MUST NOT be pipelined.
  1.3211 -
  1.3212 -   Syntax
  1.3213 -     IHAVE message-id
  1.3214 -
  1.3215 -   Responses
  1.3216 -
  1.3217 -   Initial responses
  1.3218 -     335    Send article to be transferred
  1.3219 -     435    Article not wanted
  1.3220 -     436    Transfer not possible; try again later
  1.3221 -
  1.3222 -   Subsequent responses
  1.3223 -     235    Article transferred OK
  1.3224 -     436    Transfer failed; try again later
  1.3225 -     437    Transfer rejected; do not retry
  1.3226 -
  1.3227 -   Parameters
  1.3228 -     message-id    Article message-id
  1.3229 -
  1.3230 -6.3.2.2.  Description
  1.3231 -
  1.3232 -   The IHAVE command informs the server that the client has an article
  1.3233 -   with the specified message-id.  If the server desires a copy of that
  1.3234 -   article, a 335 response MUST be returned, instructing the client to
  1.3235 -   send the entire article.  If the server does not want the article
  1.3236 -   (if, for example, the server already has a copy of it), a 435
  1.3237 -   response MUST be returned, indicating that the article is not wanted.
  1.3238 -   Finally, if the article isn't wanted immediately but the client
  1.3239 -   should retry later if possible (if, for example, another client is in
  1.3240 -   the process of sending the same article to the server), a 436
  1.3241 -   response MUST be returned.
  1.3242 -
  1.3243 -
  1.3244 -
  1.3245 -
  1.3246 -
  1.3247 -
  1.3248 -Feather                     Standards Track                    [Page 58]
  1.3249 -
  1.3250 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.3251 -
  1.3252 -
  1.3253 -   If transmission of the article is requested, the client MUST send the
  1.3254 -   entire article, including headers and body, to the server as a
  1.3255 -   multi-line data block (see Section 3.1.1).  Thus, a single dot (".")
  1.3256 -   on a line indicates the end of the text, and lines starting with a
  1.3257 -   dot in the original text have that dot doubled during transmission.
  1.3258 -   The server MUST return a 235 response, indicating that the article
  1.3259 -   was successfully transferred; a 436 response, indicating that the
  1.3260 -   transfer failed but should be tried again later; or a 437 response,
  1.3261 -   indicating that the article was rejected.
  1.3262 -
  1.3263 -   This function differs from the POST command in that it is intended
  1.3264 -   for use in transferring already-posted articles between hosts.  It
  1.3265 -   SHOULD NOT be used when the client is a personal news-reading
  1.3266 -   program, since use of this command indicates that the article has
  1.3267 -   already been posted at another site and is simply being forwarded
  1.3268 -   from another host.  However, despite this, the server MAY elect not
  1.3269 -   to post or forward the article if, after further examination of the
  1.3270 -   article, it deems it inappropriate to do so.  Reasons for such
  1.3271 -   subsequent rejection of an article may include problems such as
  1.3272 -   inappropriate newsgroups or distributions, disc space limitations,
  1.3273 -   article lengths, garbled headers, and the like.  These are typically
  1.3274 -   restrictions enforced by the server host's news software and not
  1.3275 -   necessarily by the NNTP server itself.
  1.3276 -
  1.3277 -   The client SHOULD NOT assume that the article has been successfully
  1.3278 -   transferred unless it receives an affirmative response from the
  1.3279 -   server.  A lack of response (such as a dropped network connection or
  1.3280 -   a network timeout) SHOULD be treated the same as a 436 response.
  1.3281 -
  1.3282 -   Because some news server software may not immediately be able to
  1.3283 -   determine whether an article is suitable for posting or forwarding,
  1.3284 -   an NNTP server MAY acknowledge the successful transfer of the article
  1.3285 -   (with a 235 response) but later silently discard it.
  1.3286 -
  1.3287 -
  1.3288 -
  1.3289 -
  1.3290 -
  1.3291 -
  1.3292 -
  1.3293 -
  1.3294 -
  1.3295 -
  1.3296 -
  1.3297 -
  1.3298 -
  1.3299 -
  1.3300 -
  1.3301 -
  1.3302 -
  1.3303 -
  1.3304 -Feather                     Standards Track                    [Page 59]
  1.3305 -
  1.3306 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.3307 -
  1.3308 -
  1.3309 -6.3.2.3.  Examples
  1.3310 -
  1.3311 -   Example of successfully sending an article to another site:
  1.3312 -
  1.3313 -      [C] IHAVE <i.am.an.article.you.will.want@example.com>
  1.3314 -      [S] 335 Send it; end with <CR-LF>.<CR-LF>
  1.3315 -      [C] Path: pathost!demo!somewhere!not-for-mail
  1.3316 -      [C] From: "Demo User" <nobody@example.com>
  1.3317 -      [C] Newsgroups: misc.test
  1.3318 -      [C] Subject: I am just a test article
  1.3319 -      [C] Date: 6 Oct 1998 04:38:40 -0500
  1.3320 -      [C] Organization: An Example Com, San Jose, CA
  1.3321 -      [C] Message-ID: <i.am.an.article.you.will.want@example.com>
  1.3322 -      [C]
  1.3323 -      [C] This is just a test article.
  1.3324 -      [C] .
  1.3325 -      [S] 235 Article transferred OK
  1.3326 -
  1.3327 -   Example of sending an article to another site that rejects it.  Note
  1.3328 -   that the message-id in the IHAVE command is not the same as the one
  1.3329 -   in the article headers; while this is bad practice and SHOULD NOT be
  1.3330 -   done, it is not forbidden.
  1.3331 -
  1.3332 -      [C] IHAVE <i.am.an.article.you.will.want@example.com>
  1.3333 -      [S] 335 Send it; end with <CR-LF>.<CR-LF>
  1.3334 -      [C] Path: pathost!demo!somewhere!not-for-mail
  1.3335 -      [C] From: "Demo User" <nobody@example.com>
  1.3336 -      [C] Newsgroups: misc.test
  1.3337 -      [C] Subject: I am just a test article
  1.3338 -      [C] Date: 6 Oct 1998 04:38:40 -0500
  1.3339 -      [C] Organization: An Example Com, San Jose, CA
  1.3340 -      [C] Message-ID: <i.am.an.article.you.have@example.com>
  1.3341 -      [C]
  1.3342 -      [C] This is just a test article.
  1.3343 -      [C] .
  1.3344 -      [S] 437 Article rejected; don't send again
  1.3345 -
  1.3346 -
  1.3347 -
  1.3348 -
  1.3349 -
  1.3350 -
  1.3351 -
  1.3352 -
  1.3353 -
  1.3354 -
  1.3355 -
  1.3356 -
  1.3357 -
  1.3358 -
  1.3359 -
  1.3360 -Feather                     Standards Track                    [Page 60]
  1.3361 -
  1.3362 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.3363 -
  1.3364 -
  1.3365 -   Example of sending an article to another site where the transfer
  1.3366 -   fails:
  1.3367 -
  1.3368 -      [C] IHAVE <i.am.an.article.you.will.want@example.com>
  1.3369 -      [S] 335 Send it; end with <CR-LF>.<CR-LF>
  1.3370 -      [C] Path: pathost!demo!somewhere!not-for-mail
  1.3371 -      [C] From: "Demo User" <nobody@example.com>
  1.3372 -      [C] Newsgroups: misc.test
  1.3373 -      [C] Subject: I am just a test article
  1.3374 -      [C] Date: 6 Oct 1998 04:38:40 -0500
  1.3375 -      [C] Organization: An Example Com, San Jose, CA
  1.3376 -      [C] Message-ID: <i.am.an.article.you.will.want@example.com>
  1.3377 -      [C]
  1.3378 -      [C] This is just a test article.
  1.3379 -      [C] .
  1.3380 -      [S] 436 Transfer failed
  1.3381 -
  1.3382 -   Example of sending an article to a site that already has it:
  1.3383 -
  1.3384 -      [C] IHAVE <i.am.an.article.you.have@example.com>
  1.3385 -      [S] 435 Duplicate
  1.3386 -
  1.3387 -   Example of sending an article to a site that requests that the
  1.3388 -   article be tried again later:
  1.3389 -
  1.3390 -      [C] IHAVE <i.am.an.article.you.defer@example.com>
  1.3391 -      [S] 436 Retry later
  1.3392 -
  1.3393 -7.  Information Commands
  1.3394 -
  1.3395 -   This section lists other commands that may be used at any time
  1.3396 -   between the beginning of a session and its termination.  Using these
  1.3397 -   commands does not alter any state information, but the response
  1.3398 -   generated from their use may provide useful information to clients.
  1.3399 -
  1.3400 -7.1.  DATE
  1.3401 -
  1.3402 -7.1.1.  Usage
  1.3403 -
  1.3404 -   Indicating capability: READER
  1.3405 -
  1.3406 -   Syntax
  1.3407 -     DATE
  1.3408 -
  1.3409 -   Responses
  1.3410 -     111 yyyymmddhhmmss    Server date and time
  1.3411 -
  1.3412 -
  1.3413 -
  1.3414 -
  1.3415 -
  1.3416 -Feather                     Standards Track                    [Page 61]
  1.3417 -
  1.3418 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.3419 -
  1.3420 -
  1.3421 -   Parameters
  1.3422 -     yyyymmddhhmmss    Current UTC date and time on server
  1.3423 -
  1.3424 -7.1.2.  Description
  1.3425 -
  1.3426 -   This command exists to help clients find out the current Coordinated
  1.3427 -   Universal Time [TF.686-1] from the server's perspective.  This
  1.3428 -   command SHOULD NOT be used as a substitute for NTP [RFC1305] but to
  1.3429 -   provide information that might be useful when using the NEWNEWS
  1.3430 -   command (see Section 7.4).
  1.3431 -
  1.3432 -   The DATE command MUST return a timestamp from the same clock as is
  1.3433 -   used for determining article arrival and group creation times (see
  1.3434 -   Section 6).  This clock SHOULD be monotonic, and adjustments SHOULD
  1.3435 -   be made by running it fast or slow compared to "real" time rather
  1.3436 -   than by making sudden jumps.  A system providing NNTP service SHOULD
  1.3437 -   keep the system clock as accurate as possible, either with NTP or by
  1.3438 -   some other method.
  1.3439 -
  1.3440 -   The server MUST return a 111 response specifying the date and time on
  1.3441 -   the server in the form yyyymmddhhmmss.  This date and time is in
  1.3442 -   Coordinated Universal Time.
  1.3443 -
  1.3444 -7.1.3.  Examples
  1.3445 -
  1.3446 -      [C] DATE
  1.3447 -      [S] 111 19990623135624
  1.3448 -
  1.3449 -7.2.  HELP
  1.3450 -
  1.3451 -7.2.1.  Usage
  1.3452 -
  1.3453 -   This command is mandatory.
  1.3454 -
  1.3455 -   Syntax
  1.3456 -     HELP
  1.3457 -
  1.3458 -   Responses
  1.3459 -     100    Help text follows (multi-line)
  1.3460 -
  1.3461 -7.2.2.  Description
  1.3462 -
  1.3463 -   This command provides a short summary of the commands that are
  1.3464 -   understood by this implementation of the server.  The help text will
  1.3465 -   be presented as a multi-line data block following the 100 response
  1.3466 -   code.
  1.3467 -
  1.3468 -
  1.3469 -
  1.3470 -
  1.3471 -
  1.3472 -Feather                     Standards Track                    [Page 62]
  1.3473 -
  1.3474 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.3475 -
  1.3476 -
  1.3477 -   This text is not guaranteed to be in any particular format (but must
  1.3478 -   be UTF-8) and MUST NOT be used by clients as a replacement for the
  1.3479 -   CAPABILITIES command described in Section 5.2.
  1.3480 -
  1.3481 -7.2.3.  Examples
  1.3482 -
  1.3483 -      [C] HELP
  1.3484 -      [S] 100 Help text follows
  1.3485 -      [S] This is some help text.  There is no specific
  1.3486 -      [S] formatting requirement for this test, though
  1.3487 -      [S] it is customary for it to list the valid commands
  1.3488 -      [S] and give a brief definition of what they do.
  1.3489 -      [S] .
  1.3490 -
  1.3491 -7.3.  NEWGROUPS
  1.3492 -
  1.3493 -7.3.1.  Usage
  1.3494 -
  1.3495 -   Indicating capability: READER
  1.3496 -
  1.3497 -   Syntax
  1.3498 -     NEWGROUPS date time [GMT]
  1.3499 -
  1.3500 -   Responses
  1.3501 -     231    List of new newsgroups follows (multi-line)
  1.3502 -
  1.3503 -   Parameters
  1.3504 -     date    Date in yymmdd or yyyymmdd format
  1.3505 -     time    Time in hhmmss format
  1.3506 -
  1.3507 -7.3.2.  Description
  1.3508 -
  1.3509 -   This command returns a list of newsgroups created on the server since
  1.3510 -   the specified date and time.  The results are in the same format as
  1.3511 -   the LIST ACTIVE command (see Section 7.6.3).  However, they MAY
  1.3512 -   include groups not available on the server (and so not returned by
  1.3513 -   LIST ACTIVE) and MAY omit groups for which the creation date is not
  1.3514 -   available.
  1.3515 -
  1.3516 -   The date is specified as 6 or 8 digits in the format [xx]yymmdd,
  1.3517 -   where xx is the first two digits of the year (19-99), yy is the last
  1.3518 -   two digits of the year (00-99), mm is the month (01-12), and dd is
  1.3519 -   the day of the month (01-31).  Clients SHOULD specify all four digits
  1.3520 -   of the year.  If the first two digits of the year are not specified
  1.3521 -   (this is supported only for backward compatibility), the year is to
  1.3522 -   be taken from the current century if yy is smaller than or equal to
  1.3523 -   the current year, and the previous century otherwise.
  1.3524 -
  1.3525 -
  1.3526 -
  1.3527 -
  1.3528 -Feather                     Standards Track                    [Page 63]
  1.3529 -
  1.3530 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.3531 -
  1.3532 -
  1.3533 -   The time is specified as 6 digits in the format hhmmss, where hh is
  1.3534 -   the hours in the 24-hour clock (00-23), mm is the minutes (00-59),
  1.3535 -   and ss is the seconds (00-60, to allow for leap seconds).  The token
  1.3536 -   "GMT" specifies that the date and time are given in Coordinated
  1.3537 -   Universal Time [TF.686-1]; if it is omitted, then the date and time
  1.3538 -   are specified in the server's local timezone.  Note that there is no
  1.3539 -   way of using the protocol specified in this document to establish the
  1.3540 -   server's local timezone.
  1.3541 -
  1.3542 -   Note that an empty list is a possible valid response and indicates
  1.3543 -   that there are no new newsgroups since that date-time.
  1.3544 -
  1.3545 -   Clients SHOULD make all queries using Coordinated Universal Time
  1.3546 -   (i.e., by including the "GMT" argument) when possible.
  1.3547 -
  1.3548 -7.3.3.  Examples
  1.3549 -
  1.3550 -   Example where there are new groups:
  1.3551 -
  1.3552 -      [C] NEWGROUPS 19990624 000000 GMT
  1.3553 -      [S] 231 list of new newsgroups follows
  1.3554 -      [S] alt.rfc-writers.recovery 4 1 y
  1.3555 -      [S] tx.natives.recovery 89 56 y
  1.3556 -      [S] .
  1.3557 -
  1.3558 -   Example where there are no new groups:
  1.3559 -
  1.3560 -      [C] NEWGROUPS 19990624 000000 GMT
  1.3561 -      [S] 231 list of new newsgroups follows
  1.3562 -      [S] .
  1.3563 -
  1.3564 -7.4.  NEWNEWS
  1.3565 -
  1.3566 -7.4.1.  Usage
  1.3567 -
  1.3568 -   Indicating capability: NEWNEWS
  1.3569 -
  1.3570 -   Syntax
  1.3571 -     NEWNEWS wildmat date time [GMT]
  1.3572 -
  1.3573 -   Responses
  1.3574 -     230    List of new articles follows (multi-line)
  1.3575 -
  1.3576 -   Parameters
  1.3577 -     wildmat    Newsgroups of interest
  1.3578 -     date       Date in yymmdd or yyyymmdd format
  1.3579 -     time       Time in hhmmss format
  1.3580 -
  1.3581 -
  1.3582 -
  1.3583 -
  1.3584 -Feather                     Standards Track                    [Page 64]
  1.3585 -
  1.3586 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.3587 -
  1.3588 -
  1.3589 -7.4.2.  Description
  1.3590 -
  1.3591 -   This command returns a list of message-ids of articles posted or
  1.3592 -   received on the server, in the newsgroups whose names match the
  1.3593 -   wildmat, since the specified date and time.  One message-id is sent
  1.3594 -   on each line; the order of the response has no specific significance
  1.3595 -   and may vary from response to response in the same session.  A
  1.3596 -   message-id MAY appear more than once; if it does, it has the same
  1.3597 -   meaning as if it appeared only once.
  1.3598 -
  1.3599 -   Date and time are in the same format as the NEWGROUPS command (see
  1.3600 -   Section 7.3).
  1.3601 -
  1.3602 -   Note that an empty list is a possible valid response and indicates
  1.3603 -   that there is currently no new news in the relevant groups.
  1.3604 -
  1.3605 -   Clients SHOULD make all queries in Coordinated Universal Time (i.e.,
  1.3606 -   by using the "GMT" argument) when possible.
  1.3607 -
  1.3608 -7.4.3.  Examples
  1.3609 -
  1.3610 -   Example where there are new articles:
  1.3611 -
  1.3612 -      [C] NEWNEWS news.*,sci.* 19990624 000000 GMT
  1.3613 -      [S] 230 list of new articles by message-id follows
  1.3614 -      [S] <i.am.a.new.article@example.com>
  1.3615 -      [S] <i.am.another.new.article@example.com>
  1.3616 -      [S] .
  1.3617 -
  1.3618 -   Example where there are no new articles:
  1.3619 -
  1.3620 -      [C] NEWNEWS alt.* 19990624 000000 GMT
  1.3621 -      [S] 230 list of new articles by message-id follows
  1.3622 -      [S] .
  1.3623 -
  1.3624 -7.5.  Time
  1.3625 -
  1.3626 -   As described in Section 6, each article has an arrival timestamp.
  1.3627 -   Each newsgroup also has a creation timestamp.  These timestamps are
  1.3628 -   used by the NEWNEWS and NEWGROUP commands to construct their
  1.3629 -   responses.
  1.3630 -
  1.3631 -   Clients can ensure that they do not have gaps in lists of articles or
  1.3632 -   groups by using the DATE command in the following manner:
  1.3633 -
  1.3634 -   First session:
  1.3635 -      Issue DATE command and record result.
  1.3636 -      Issue NEWNEWS command using a previously chosen timestamp.
  1.3637 -
  1.3638 -
  1.3639 -
  1.3640 -Feather                     Standards Track                    [Page 65]
  1.3641 -
  1.3642 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.3643 -
  1.3644 -
  1.3645 -   Subsequent sessions:
  1.3646 -      Issue DATE command and hold result in temporary storage.
  1.3647 -      Issue NEWNEWS command using timestamp saved from previous session.
  1.3648 -      Overwrite saved timestamp with that currently in temporary
  1.3649 -      storage.
  1.3650 -
  1.3651 -   In order to allow for minor errors, clients MAY want to adjust the
  1.3652 -   timestamp back by two or three minutes before using it in NEWNEWS.
  1.3653 -
  1.3654 -7.5.1.  Examples
  1.3655 -
  1.3656 -   First session:
  1.3657 -
  1.3658 -      [C] DATE
  1.3659 -      [S] 111 20010203112233
  1.3660 -      [C] NEWNEWS local.chat 20001231 235959 GMT
  1.3661 -      [S] 230 list follows
  1.3662 -      [S] <article.1@local.service>
  1.3663 -      [S] <article.2@local.service>
  1.3664 -      [S] <article.3@local.service>
  1.3665 -      [S] .
  1.3666 -
  1.3667 -   Second session (the client has subtracted 3 minutes from the
  1.3668 -   timestamp returned previously):
  1.3669 -
  1.3670 -      [C] DATE
  1.3671 -      [S] 111 20010204003344
  1.3672 -      [C] NEWNEWS local.chat 20010203 111933 GMT
  1.3673 -      [S] 230 list follows
  1.3674 -      [S] <article.3@local.service>
  1.3675 -      [S] <article.4@local.service>
  1.3676 -      [S] <article.5@local.service>
  1.3677 -      [S] .
  1.3678 -
  1.3679 -   Note how <article.3@local.service> arrived in the 3 minute gap and so
  1.3680 -   is listed in both responses.
  1.3681 -
  1.3682 -7.6.  The LIST Commands
  1.3683 -
  1.3684 -   The LIST family of commands all return information that is multi-line
  1.3685 -   and that can, in general, be expected not to change during the
  1.3686 -   session.  Often the information is related to newsgroups, in which
  1.3687 -   case the response has one line per newsgroup and a wildmat MAY be
  1.3688 -   provided to restrict the groups for which information is returned.
  1.3689 -
  1.3690 -   The set of available keywords (including those provided by
  1.3691 -   extensions) is given in the capability list with capability label
  1.3692 -   LIST.
  1.3693 -
  1.3694 -
  1.3695 -
  1.3696 -Feather                     Standards Track                    [Page 66]
  1.3697 -
  1.3698 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.3699 -
  1.3700 -
  1.3701 -7.6.1.  LIST
  1.3702 -
  1.3703 -7.6.1.1.  Usage
  1.3704 -
  1.3705 -   Indicating capability: LIST
  1.3706 -
  1.3707 -   Syntax
  1.3708 -     LIST [keyword [wildmat|argument]]
  1.3709 -
  1.3710 -   Responses
  1.3711 -     215    Information follows (multi-line)
  1.3712 -
  1.3713 -   Parameters
  1.3714 -     keyword     Information requested [1]
  1.3715 -     argument    Specific to keyword
  1.3716 -     wildmat     Groups of interest
  1.3717 -
  1.3718 -   [1] If no keyword is provided, it defaults to ACTIVE.
  1.3719 -
  1.3720 -7.6.1.2.  Description
  1.3721 -
  1.3722 -   The LIST command allows the server to provide blocks of information
  1.3723 -   to the client.  This information may be global or may be related to
  1.3724 -   newsgroups; in the latter case, the information may be returned
  1.3725 -   either for all groups or only for those matching a wildmat.  Each
  1.3726 -   block of information is represented by a different keyword.  The
  1.3727 -   command returns the specific information identified by the keyword.
  1.3728 -
  1.3729 -   If the information is available, it is returned as a multi-line data
  1.3730 -   block following the 215 response code.  The format of the information
  1.3731 -   depends on the keyword.  The information MAY be affected by the
  1.3732 -   additional argument, but the format MUST NOT be.
  1.3733 -
  1.3734 -   If the information is based on newsgroups and the optional wildmat
  1.3735 -   argument is specified, the response is limited to only the groups (if
  1.3736 -   any) whose names match the wildmat and for which the information is
  1.3737 -   available.
  1.3738 -
  1.3739 -   Note that an empty list is a possible valid response; for a
  1.3740 -   newsgroup-based keyword, it indicates that there are no groups
  1.3741 -   meeting the above criteria.
  1.3742 -
  1.3743 -   If the keyword is not recognised, or if an argument is specified and
  1.3744 -   the keyword does not expect one, a 501 response code MUST BE
  1.3745 -   returned.  If the keyword is recognised but the server does not
  1.3746 -   maintain the information, a 503 response code MUST BE returned.
  1.3747 -
  1.3748 -
  1.3749 -
  1.3750 -
  1.3751 -
  1.3752 -Feather                     Standards Track                    [Page 67]
  1.3753 -
  1.3754 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.3755 -
  1.3756 -
  1.3757 -   The LIST command MUST NOT change the visible state of the server in
  1.3758 -   any way; that is, the behaviour of subsequent commands MUST NOT be
  1.3759 -   affected by whether the LIST command was issued.  For example, it
  1.3760 -   MUST NOT make groups available that otherwise would not have been.
  1.3761 -
  1.3762 -7.6.1.3.  Examples
  1.3763 -
  1.3764 -   Example of LIST with the ACTIVE keyword:
  1.3765 -
  1.3766 -      [C] LIST ACTIVE
  1.3767 -      [S] 215 list of newsgroups follows
  1.3768 -      [S] misc.test 3002322 3000234 y
  1.3769 -      [S] comp.risks 442001 441099 m
  1.3770 -      [S] alt.rfc-writers.recovery 4 1 y
  1.3771 -      [S] tx.natives.recovery 89 56 y
  1.3772 -      [S] tx.natives.recovery.d 11 9 n
  1.3773 -      [S] .
  1.3774 -
  1.3775 -   Example of LIST with no keyword:
  1.3776 -
  1.3777 -      [C] LIST
  1.3778 -      [S] 215 list of newsgroups follows
  1.3779 -      [S] misc.test 3002322 3000234 y
  1.3780 -      [S] comp.risks 442001 441099 m
  1.3781 -      [S] alt.rfc-writers.recovery 4 1 y
  1.3782 -      [S] tx.natives.recovery 89 56 y
  1.3783 -      [S] tx.natives.recovery.d 11 9 n
  1.3784 -      [S] .
  1.3785 -
  1.3786 -   The output is identical to that of the previous example.
  1.3787 -
  1.3788 -   Example of LIST on a newsgroup-based keyword with and without
  1.3789 -   wildmat:
  1.3790 -
  1.3791 -      [C] LIST ACTIVE.TIMES
  1.3792 -      [S] 215 information follows
  1.3793 -      [S] misc.test 930445408 <creatme@isc.org>
  1.3794 -      [S] alt.rfc-writers.recovery 930562309 <m@example.com>
  1.3795 -      [S] tx.natives.recovery 930678923 <sob@academ.com>
  1.3796 -      [S] .
  1.3797 -      [C] LIST ACTIVE.TIMES tx.*
  1.3798 -      [S] 215 information follows
  1.3799 -      [S] tx.natives.recovery 930678923 <sob@academ.com>
  1.3800 -      [S] .
  1.3801 -
  1.3802 -
  1.3803 -
  1.3804 -
  1.3805 -
  1.3806 -
  1.3807 -
  1.3808 -Feather                     Standards Track                    [Page 68]
  1.3809 -
  1.3810 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.3811 -
  1.3812 -
  1.3813 -   Example of LIST returning an error where the keyword is recognized
  1.3814 -   but the software does not maintain this information:
  1.3815 -
  1.3816 -      [C] CAPABILITIES
  1.3817 -      [S] 101 Capability list:
  1.3818 -      [S] VERSION 2
  1.3819 -      [S] READER
  1.3820 -      [S] LIST ACTIVE NEWSGROUPS ACTIVE.TIMES XTRA.DATA
  1.3821 -      [S] .
  1.3822 -      [C] LIST XTRA.DATA
  1.3823 -      [S] 503 Data item not stored
  1.3824 -
  1.3825 -   Example of LIST where the keyword is not recognised:
  1.3826 -
  1.3827 -      [C] CAPABILITIES
  1.3828 -      [S] 101 Capability list:
  1.3829 -      [S] VERSION 2
  1.3830 -      [S] READER
  1.3831 -      [S] LIST ACTIVE NEWSGROUPS ACTIVE.TIMES XTRA.DATA
  1.3832 -      [S] .
  1.3833 -      [C] LIST DISTRIB.PATS
  1.3834 -      [S] 501 Syntax Error
  1.3835 -
  1.3836 -7.6.2.  Standard LIST Keywords
  1.3837 -
  1.3838 -   This specification defines the following LIST keywords:
  1.3839 -
  1.3840 -   +--------------+---------------+------------------------------------+
  1.3841 -   | Keyword      | Definition    | Status                             |
  1.3842 -   +--------------+---------------+------------------------------------+
  1.3843 -   | ACTIVE       | Section 7.6.3 | Mandatory if the READER capability |
  1.3844 -   |              |               | is advertised                      |
  1.3845 -   |              |               |                                    |
  1.3846 -   | ACTIVE.TIMES | Section 7.6.4 | Optional                           |
  1.3847 -   |              |               |                                    |
  1.3848 -   | DISTRIB.PATS | Section 7.6.5 | Optional                           |
  1.3849 -   |              |               |                                    |
  1.3850 -   | HEADERS      | Section 8.6   | Mandatory if the HDR capability is |
  1.3851 -   |              |               | advertised                         |
  1.3852 -   |              |               |                                    |
  1.3853 -   | NEWSGROUPS   | Section 7.6.6 | Mandatory if the READER capability |
  1.3854 -   |              |               | is advertised                      |
  1.3855 -   |              |               |                                    |
  1.3856 -   | OVERVIEW.FMT | Section 8.4   | Mandatory if the OVER capability   |
  1.3857 -   |              |               | is advertised                      |
  1.3858 -   +--------------+---------------+------------------------------------+
  1.3859 -
  1.3860 -
  1.3861 -
  1.3862 -
  1.3863 -
  1.3864 -Feather                     Standards Track                    [Page 69]
  1.3865 -
  1.3866 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.3867 -
  1.3868 -
  1.3869 -   Where one of these LIST keywords is supported by a server, it MUST
  1.3870 -   have the meaning given in the relevant sub-section.
  1.3871 -
  1.3872 -7.6.3.  LIST ACTIVE
  1.3873 -
  1.3874 -   This keyword MUST be supported by servers advertising the READER
  1.3875 -   capability.
  1.3876 -
  1.3877 -   LIST ACTIVE returns a list of valid newsgroups and associated
  1.3878 -   information.  If no wildmat is specified, the server MUST include
  1.3879 -   every group that the client is permitted to select with the GROUP
  1.3880 -   command (Section 6.1.1).  Each line of this list consists of four
  1.3881 -   fields separated from each other by one or more spaces:
  1.3882 -
  1.3883 -   o  The name of the newsgroup.
  1.3884 -   o  The reported high water mark for the group.
  1.3885 -   o  The reported low water mark for the group.
  1.3886 -   o  The current status of the group on this server.
  1.3887 -
  1.3888 -   The reported high and low water marks are as described in the GROUP
  1.3889 -   command (see Section 6.1.1), but note that they are in the opposite
  1.3890 -   order to the 211 response to that command.
  1.3891 -
  1.3892 -   The status field is typically one of the following:
  1.3893 -
  1.3894 -   "y" Posting is permitted.
  1.3895 -
  1.3896 -   "n" Posting is not permitted.
  1.3897 -
  1.3898 -   "m" Postings will be forwarded to the newsgroup moderator.
  1.3899 -
  1.3900 -   The server SHOULD use these values when these meanings are required
  1.3901 -   and MUST NOT use them with any other meaning.  Other values for the
  1.3902 -   status may exist; the definition of these other values and the
  1.3903 -   circumstances under which they are returned may be specified in an
  1.3904 -   extension or may be private to the server.  A client SHOULD treat an
  1.3905 -   unrecognized status as giving no information.
  1.3906 -
  1.3907 -   The status of a newsgroup only indicates how posts to that newsgroup
  1.3908 -   are normally processed and is not necessarily customised to the
  1.3909 -   specific client.  For example, if the current client is forbidden
  1.3910 -   from posting, then this will apply equally to groups with status "y".
  1.3911 -   Conversely, a client with special privileges (not defined by this
  1.3912 -   specification) might be able to post to a group with status "n".
  1.3913 -
  1.3914 -
  1.3915 -
  1.3916 -
  1.3917 -
  1.3918 -
  1.3919 -
  1.3920 -Feather                     Standards Track                    [Page 70]
  1.3921 -
  1.3922 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.3923 -
  1.3924 -
  1.3925 -   For example:
  1.3926 -
  1.3927 -      [C] LIST ACTIVE
  1.3928 -      [S] 215 list of newsgroups follows
  1.3929 -      [S] misc.test 3002322 3000234 y
  1.3930 -      [S] comp.risks 442001 441099 m
  1.3931 -      [S] alt.rfc-writers.recovery 4 1 y
  1.3932 -      [S] tx.natives.recovery 89 56 y
  1.3933 -      [S] tx.natives.recovery.d 11 9 n
  1.3934 -      [S] .
  1.3935 -
  1.3936 -   or, on an implementation that includes leading zeroes:
  1.3937 -
  1.3938 -      [C] LIST ACTIVE
  1.3939 -      [S] 215 list of newsgroups follows
  1.3940 -      [S] misc.test 0003002322 0003000234 y
  1.3941 -      [S] comp.risks 0000442001 0000441099 m
  1.3942 -      [S] alt.rfc-writers.recovery 0000000004 0000000001 y
  1.3943 -      [S] tx.natives.recovery 0000000089 0000000056 y
  1.3944 -      [S] tx.natives.recovery.d 0000000011 0000000009 n
  1.3945 -      [S] .
  1.3946 -
  1.3947 -   The information is newsgroup based, and a wildmat MAY be specified,
  1.3948 -   in which case the response is limited to only the groups (if any)
  1.3949 -   whose names match the wildmat.  For example:
  1.3950 -
  1.3951 -      [C] LIST ACTIVE *.recovery
  1.3952 -      [S] 215 list of newsgroups follows
  1.3953 -      [S] alt.rfc-writers.recovery 4 1 y
  1.3954 -      [S] tx.natives.recovery 89 56 y
  1.3955 -      [S] .
  1.3956 -
  1.3957 -7.6.4.  LIST ACTIVE.TIMES
  1.3958 -
  1.3959 -   This keyword is optional.
  1.3960 -
  1.3961 -   The active.times list is maintained by some NNTP servers to contain
  1.3962 -   information about who created a particular newsgroup and when.  Each
  1.3963 -   line of this list consists of three fields separated from each other
  1.3964 -   by one or more spaces.  The first field is the name of the newsgroup.
  1.3965 -   The second is the time when this group was created on this news
  1.3966 -   server, measured in seconds since the start of January 1, 1970.  The
  1.3967 -   third is plain text intended to describe the entity that created the
  1.3968 -   newsgroup; it is often a mailbox as defined in RFC 2822 [RFC2822].
  1.3969 -   For example:
  1.3970 -
  1.3971 -
  1.3972 -
  1.3973 -
  1.3974 -
  1.3975 -
  1.3976 -Feather                     Standards Track                    [Page 71]
  1.3977 -
  1.3978 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.3979 -
  1.3980 -
  1.3981 -      [C] LIST ACTIVE.TIMES
  1.3982 -      [S] 215 information follows
  1.3983 -      [S] misc.test 930445408 <creatme@isc.org>
  1.3984 -      [S] alt.rfc-writers.recovery 930562309 <m@example.com>
  1.3985 -      [S] tx.natives.recovery 930678923 <sob@academ.com>
  1.3986 -      [S] .
  1.3987 -
  1.3988 -   The list MAY omit newsgroups for which the information is unavailable
  1.3989 -   and MAY include groups not available on the server; in particular, it
  1.3990 -   MAY omit all groups created before the date and time of the oldest
  1.3991 -   entry.  The client MUST NOT assume that the list is complete or that
  1.3992 -   it matches the list returned by the LIST ACTIVE command
  1.3993 -   (Section 7.6.3).  The NEWGROUPS command (Section 7.3) may provide a
  1.3994 -   better way to access this information, and the results of the two
  1.3995 -   commands SHOULD be consistent except that, if the latter is invoked
  1.3996 -   with a date and time earlier than the oldest entry in active.times
  1.3997 -   list, its result may include extra groups.
  1.3998 -
  1.3999 -   The information is newsgroup based, and a wildmat MAY be specified,
  1.4000 -   in which case the response is limited to only the groups (if any)
  1.4001 -   whose names match the wildmat.
  1.4002 -
  1.4003 -7.6.5.  LIST DISTRIB.PATS
  1.4004 -
  1.4005 -   This keyword is optional.
  1.4006 -
  1.4007 -   The distrib.pats list is maintained by some NNTP servers to assist
  1.4008 -   clients to choose a value for the content of the Distribution header
  1.4009 -   of a news article being posted.  Each line of this list consists of
  1.4010 -   three fields separated from each other by a colon (":").  The first
  1.4011 -   field is a weight, the second field is a wildmat (which may be a
  1.4012 -   simple newsgroup name), and the third field is a value for the
  1.4013 -   Distribution header content.  For example:
  1.4014 -
  1.4015 -      [C] LIST DISTRIB.PATS
  1.4016 -      [S] 215 information follows
  1.4017 -      [S] 10:local.*:local
  1.4018 -      [S] 5:*:world
  1.4019 -      [S] 20:local.here.*:thissite
  1.4020 -      [S] .
  1.4021 -
  1.4022 -   The client MAY use this information to construct an appropriate
  1.4023 -   Distribution header given the name of a newsgroup.  To do so, it
  1.4024 -   should determine the lines whose second field matches the newsgroup
  1.4025 -   name, select from among them the line with the highest weight (with 0
  1.4026 -   being the lowest), and use the value of the third field to construct
  1.4027 -   the Distribution header.
  1.4028 -
  1.4029 -
  1.4030 -
  1.4031 -
  1.4032 -Feather                     Standards Track                    [Page 72]
  1.4033 -
  1.4034 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.4035 -
  1.4036 -
  1.4037 -   The information is not newsgroup based, and an argument MUST NOT be
  1.4038 -   specified.
  1.4039 -
  1.4040 -7.6.6.  LIST NEWSGROUPS
  1.4041 -
  1.4042 -   This keyword MUST be supported by servers advertising the READER
  1.4043 -   capability.
  1.4044 -
  1.4045 -   The newsgroups list is maintained by NNTP servers to contain the name
  1.4046 -   of each newsgroup that is available on the server and a short
  1.4047 -   description about the purpose of the group.  Each line of this list
  1.4048 -   consists of two fields separated from each other by one or more space
  1.4049 -   or TAB characters (the usual practice is a single TAB).  The first
  1.4050 -   field is the name of the newsgroup, and the second is a short
  1.4051 -   description of the group.  For example:
  1.4052 -
  1.4053 -      [C] LIST NEWSGROUPS
  1.4054 -      [S] 215 information follows
  1.4055 -      [S] misc.test General Usenet testing
  1.4056 -      [S] alt.rfc-writers.recovery RFC Writers Recovery
  1.4057 -      [S] tx.natives.recovery Texas Natives Recovery
  1.4058 -      [S] .
  1.4059 -
  1.4060 -   The list MAY omit newsgroups for which the information is unavailable
  1.4061 -   and MAY include groups not available on the server.  The client MUST
  1.4062 -   NOT assume that the list is complete or that it matches the list
  1.4063 -   returned by LIST ACTIVE.
  1.4064 -
  1.4065 -   The description SHOULD be in UTF-8.  However, servers often obtain
  1.4066 -   the information from external sources.  These sources may have used
  1.4067 -   different encodings (ones that use octets in the range 128 to 255 in
  1.4068 -   some other manner) and, in that case, the server MAY pass it on
  1.4069 -   unchanged.  Therefore, clients MUST be prepared to receive such
  1.4070 -   descriptions.
  1.4071 -
  1.4072 -   The information is newsgroup based, and a wildmat MAY be specified,
  1.4073 -   in which case the response is limited to only the groups (if any)
  1.4074 -   whose names match the wildmat.
  1.4075 -
  1.4076 -8.  Article Field Access Commands
  1.4077 -
  1.4078 -   This section lists commands that may be used to access specific
  1.4079 -   article fields; that is, headers of articles and metadata about
  1.4080 -   articles.  These commands typically fetch data from an "overview
  1.4081 -   database", which is a database of headers extracted from incoming
  1.4082 -   articles plus metadata determined as the article arrives.  Only
  1.4083 -   certain fields are included in the database.
  1.4084 -
  1.4085 -
  1.4086 -
  1.4087 -
  1.4088 -Feather                     Standards Track                    [Page 73]
  1.4089 -
  1.4090 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.4091 -
  1.4092 -
  1.4093 -   This section is based on the Overview/NOV database [ROBE1995]
  1.4094 -   developed by Geoff Collyer.
  1.4095 -
  1.4096 -8.1.  Article Metadata
  1.4097 -
  1.4098 -   Article "metadata" is data about articles that does not occur within
  1.4099 -   the article itself.  Each metadata item has a name that MUST begin
  1.4100 -   with a colon (and that MUST NOT contain a colon elsewhere within it).
  1.4101 -   As with header names, metadata item names are not case sensitive.
  1.4102 -
  1.4103 -   When generating a metadata item, the server MUST compute it for
  1.4104 -   itself and MUST NOT trust any related value provided in the article.
  1.4105 -   (In particular, a Lines or Bytes header in the article MUST NOT be
  1.4106 -   assumed to specify the correct number of lines or bytes in the
  1.4107 -   article.)  If the server has access to several non-identical copies
  1.4108 -   of an article, the value returned MUST be correct for any copy of
  1.4109 -   that article retrieved during the same session.
  1.4110 -
  1.4111 -   This specification defines two metadata items: ":bytes" and ":lines".
  1.4112 -   Other metadata items may be defined by extensions.  The names of
  1.4113 -   metadata items defined by registered extensions MUST NOT begin with
  1.4114 -   ":x-".  To avoid the risk of a clash with a future registered
  1.4115 -   extension, the names of metadata items defined by private extensions
  1.4116 -   SHOULD begin with ":x-".
  1.4117 -
  1.4118 -8.1.1.  The :bytes Metadata Item
  1.4119 -
  1.4120 -   The :bytes metadata item for an article is a decimal integer.  It
  1.4121 -   SHOULD equal the number of octets in the entire article: headers,
  1.4122 -   body, and separating empty line (counting a CRLF pair as two octets,
  1.4123 -   and excluding both the "." CRLF terminating the response and any "."
  1.4124 -   added for "dot-stuffing" purposes).
  1.4125 -
  1.4126 -   Note to client implementers: some existing servers return a value
  1.4127 -   different from that above.  The commonest reasons for this are as
  1.4128 -   follows:
  1.4129 -
  1.4130 -   o  Counting a CRLF pair as one octet.
  1.4131 -
  1.4132 -   o  Including the "." character used for dot-stuffing in the number.
  1.4133 -
  1.4134 -   o  Including the terminating "." CRLF in the number.
  1.4135 -
  1.4136 -   o  Using one copy of an article for counting the octets but then
  1.4137 -      returning another one that differs in some (permitted) manner.
  1.4138 -
  1.4139 -   Implementations should be prepared for such variation and MUST NOT
  1.4140 -   rely on the value being accurate.
  1.4141 -
  1.4142 -
  1.4143 -
  1.4144 -Feather                     Standards Track                    [Page 74]
  1.4145 -
  1.4146 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.4147 -
  1.4148 -
  1.4149 -8.1.2.  The :lines Metadata Item
  1.4150 -
  1.4151 -   The :lines metadata item for an article is a decimal integer.  It
  1.4152 -   MUST equal the number of lines in the article body (excluding the
  1.4153 -   empty line separating headers and body).  Equivalently, it is two
  1.4154 -   less than the number of CRLF pairs that the BODY command would return
  1.4155 -   for that article (the extra two are those following the response code
  1.4156 -   and the termination octet).
  1.4157 -
  1.4158 -8.2.  Database Consistency
  1.4159 -
  1.4160 -   The information stored in the overview database may change over time.
  1.4161 -   If the database records the content or absence of a given field (that
  1.4162 -   is, a header or metadata item) for all articles, it is said to be
  1.4163 -   "consistent" for that field.  If it records the content of a header
  1.4164 -   for some articles but not for others that nevertheless included that
  1.4165 -   header, or if it records a metadata item for some articles but not
  1.4166 -   for others to which that item applies, it is said to be
  1.4167 -   "inconsistent" for that field.
  1.4168 -
  1.4169 -   The LIST OVERVIEW.FMT command SHOULD list all the fields for which
  1.4170 -   the database is consistent at that moment.  It MAY omit such fields
  1.4171 -   (for example, if it is not known whether the database is consistent
  1.4172 -   or inconsistent).  It MUST NOT include fields for which the database
  1.4173 -   is inconsistent or that are not stored in the database.  Therefore,
  1.4174 -   if a header appears in the LIST OVERVIEW.FMT output but not in the
  1.4175 -   OVER output for a given article, that header does not appear in the
  1.4176 -   article (similarly for metadata items).
  1.4177 -
  1.4178 -   These rules assume that the fields being stored in the database
  1.4179 -   remain constant for long periods of time, and therefore the database
  1.4180 -   will be consistent.  When the set of fields to be stored is changed,
  1.4181 -   it will be inconsistent until either the database is rebuilt or the
  1.4182 -   only articles remaining are those received since the change.
  1.4183 -   Therefore, the output from LIST OVERVIEW.FMT needs to be altered
  1.4184 -   twice.  Firstly, before any fields stop being stored they MUST be
  1.4185 -   removed from the output; then, when the database is once more known
  1.4186 -   to be consistent, the new fields SHOULD be added to the output.
  1.4187 -
  1.4188 -   If the HDR command uses the overview database rather than taking
  1.4189 -   information directly from the articles, the same issues of
  1.4190 -   consistency and inconsistency apply, and the LIST HEADERS command
  1.4191 -   SHOULD take the same approach as the LIST OVERVIEW.FMT command in
  1.4192 -   resolving them.
  1.4193 -
  1.4194 -
  1.4195 -
  1.4196 -
  1.4197 -
  1.4198 -
  1.4199 -
  1.4200 -Feather                     Standards Track                    [Page 75]
  1.4201 -
  1.4202 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.4203 -
  1.4204 -
  1.4205 -8.3.  OVER
  1.4206 -
  1.4207 -8.3.1.  Usage
  1.4208 -
  1.4209 -   Indicating capability: OVER
  1.4210 -
  1.4211 -   Syntax
  1.4212 -     OVER message-id
  1.4213 -     OVER range
  1.4214 -     OVER
  1.4215 -
  1.4216 -   Responses
  1.4217 -
  1.4218 -   First form (message-id specified)
  1.4219 -     224    Overview information follows (multi-line)
  1.4220 -     430    No article with that message-id
  1.4221 -
  1.4222 -   Second form (range specified)
  1.4223 -     224    Overview information follows (multi-line)
  1.4224 -     412    No newsgroup selected
  1.4225 -     423    No articles in that range
  1.4226 -
  1.4227 -   Third form (current article number used)
  1.4228 -     224    Overview information follows (multi-line)
  1.4229 -     412    No newsgroup selected
  1.4230 -     420    Current article number is invalid
  1.4231 -
  1.4232 -   Parameters
  1.4233 -     range         Number(s) of articles
  1.4234 -     message-id    Message-id of article
  1.4235 -
  1.4236 -8.3.2.  Description
  1.4237 -
  1.4238 -   The OVER command returns the contents of all the fields in the
  1.4239 -   database for an article specified by message-id, or from a specified
  1.4240 -   article or range of articles in the currently selected newsgroup.
  1.4241 -
  1.4242 -   The message-id argument indicates a specific article.  The range
  1.4243 -   argument may be any of the following:
  1.4244 -
  1.4245 -   o  An article number.
  1.4246 -
  1.4247 -   o  An article number followed by a dash to indicate all following.
  1.4248 -
  1.4249 -   o  An article number followed by a dash followed by another article
  1.4250 -      number.
  1.4251 -
  1.4252 -   If neither is specified, the current article number is used.
  1.4253 -
  1.4254 -
  1.4255 -
  1.4256 -Feather                     Standards Track                    [Page 76]
  1.4257 -
  1.4258 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.4259 -
  1.4260 -
  1.4261 -   Support for the first (message-id) form is optional.  If it is
  1.4262 -   supported, the OVER capability line MUST include the argument
  1.4263 -   "MSGID".  Otherwise, the capability line MUST NOT include this
  1.4264 -   argument, and the OVER command MUST return the generic response code
  1.4265 -   503 when this form is used.
  1.4266 -
  1.4267 -   If the information is available, it is returned as a multi-line data
  1.4268 -   block following the 224 response code and contains one line per
  1.4269 -   article, sorted in numerical order of article number.  (Note that
  1.4270 -   unless the argument is a range including a dash, there will be
  1.4271 -   exactly one line in the data block.)  Each line consists of a number
  1.4272 -   of fields separated by a TAB.  A field may be empty (in which case
  1.4273 -   there will be two adjacent TABs), and a sequence of trailing TABs may
  1.4274 -   be omitted.
  1.4275 -
  1.4276 -   The first 8 fields MUST be the following, in order:
  1.4277 -
  1.4278 -      "0" or article number (see below)
  1.4279 -      Subject header content
  1.4280 -      From header content
  1.4281 -      Date header content
  1.4282 -      Message-ID header content
  1.4283 -      References header content
  1.4284 -      :bytes metadata item
  1.4285 -      :lines metadata item
  1.4286 -
  1.4287 -   If the article is specified by message-id (the first form of the
  1.4288 -   command), the article number MUST be replaced with zero, except that
  1.4289 -   if there is a currently selected newsgroup and the article is present
  1.4290 -   in that group, the server MAY use the article's number in that group.
  1.4291 -   (See the ARTICLE command (Section 6.2.1) and STAT examples
  1.4292 -   (Section 6.2.4.3) for more details.)  In the other two forms of the
  1.4293 -   command, the article number MUST be returned.
  1.4294 -
  1.4295 -   Any subsequent fields are the contents of the other headers and
  1.4296 -   metadata held in the database.
  1.4297 -
  1.4298 -   For the five mandatory headers, the content of each field MUST be
  1.4299 -   based on the content of the header (that is, with the header name and
  1.4300 -   following colon and space removed).  If the article does not contain
  1.4301 -   that header, or if the content is empty, the field MUST be empty.
  1.4302 -   For the two mandatory metadata items, the content of the field MUST
  1.4303 -   be just the value, with no other text.
  1.4304 -
  1.4305 -   For all subsequent fields that contain headers, the content MUST be
  1.4306 -   the entire header line other than the trailing CRLF.  For all
  1.4307 -   subsequent fields that contain metadata, the field consists of the
  1.4308 -   metadata name, a single space, and then the value.
  1.4309 -
  1.4310 -
  1.4311 -
  1.4312 -Feather                     Standards Track                    [Page 77]
  1.4313 -
  1.4314 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.4315 -
  1.4316 -
  1.4317 -   For all fields, the value is processed by first removing all CRLF
  1.4318 -   pairs (that is, undoing any folding and removing the terminating
  1.4319 -   CRLF) and then replacing each TAB with a single space.  If there is
  1.4320 -   no such header in the article, no such metadata item, or no header or
  1.4321 -   item stored in the database for that article, the corresponding field
  1.4322 -   MUST be empty.
  1.4323 -
  1.4324 -   Note that, after unfolding, the characters NUL, LF, and CR cannot
  1.4325 -   occur in the header of an article offered by a conformant server.
  1.4326 -   Nevertheless, servers SHOULD check for these characters and replace
  1.4327 -   each one by a single space (so that, for example, CR LF LF TAB will
  1.4328 -   become two spaces, since the CR and first LF will be removed by the
  1.4329 -   unfolding process).  This will encourage robustness in the face of
  1.4330 -   non-conforming data; it is also possible that future versions of this
  1.4331 -   specification could permit these characters to appear in articles.
  1.4332 -
  1.4333 -   The server SHOULD NOT produce output for articles that no longer
  1.4334 -   exist.
  1.4335 -
  1.4336 -   If the argument is a message-id and no such article exists, a 430
  1.4337 -   response MUST be returned.  If the argument is a range or is omitted
  1.4338 -   and the currently selected newsgroup is invalid, a 412 response MUST
  1.4339 -   be returned.  If the argument is a range and no articles in that
  1.4340 -   number range exist in the currently selected newsgroup, including the
  1.4341 -   case where the second number is less than the first one, a 423
  1.4342 -   response MUST be returned.  If the argument is omitted and the
  1.4343 -   current article number is invalid, a 420 response MUST be returned.
  1.4344 -
  1.4345 -8.3.3.  Examples
  1.4346 -
  1.4347 -   In the first four examples, TAB has been replaced by vertical bar and
  1.4348 -   some lines have been folded for readability.
  1.4349 -
  1.4350 -   Example of a successful retrieval of overview information for an
  1.4351 -   article (explicitly not using an article number):
  1.4352 -
  1.4353 -      [C] GROUP misc.test
  1.4354 -      [S] 211 1234 3000234 3002322 misc.test
  1.4355 -      [C] OVER
  1.4356 -      [S] 224 Overview information follows
  1.4357 -      [S] 3000234|I am just a test article|"Demo User"
  1.4358 -          <nobody@example.com>|6 Oct 1998 04:38:40 -0500|
  1.4359 -          <45223423@example.com>|<45454@example.net>|1234|
  1.4360 -          17|Xref: news.example.com misc.test:3000363
  1.4361 -      [S] .
  1.4362 -
  1.4363 -
  1.4364 -
  1.4365 -
  1.4366 -
  1.4367 -
  1.4368 -Feather                     Standards Track                    [Page 78]
  1.4369 -
  1.4370 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.4371 -
  1.4372 -
  1.4373 -   Example of a successful retrieval of overview information for an
  1.4374 -   article by message-id:
  1.4375 -
  1.4376 -      [C] CAPABILITIES
  1.4377 -      [S] 101 Capability list:
  1.4378 -      [S] VERSION 2
  1.4379 -      [S] READER
  1.4380 -      [S] OVER MSGID
  1.4381 -      [S] LIST ACTIVE NEWSGROUPS OVERVIEW.FMT
  1.4382 -      [S] .
  1.4383 -      [C] OVER <45223423@example.com>
  1.4384 -      [S] 224 Overview information follows
  1.4385 -      [S] 0|I am just a test article|"Demo User"
  1.4386 -          <nobody@example.com>|6 Oct 1998 04:38:40 -0500|
  1.4387 -          <45223423@example.com>|<45454@example.net>|1234|
  1.4388 -          17|Xref: news.example.com misc.test:3000363
  1.4389 -      [S] .
  1.4390 -
  1.4391 -   Note that the article number has been replaced by "0".
  1.4392 -
  1.4393 -   Example of the same commands on a system that does not implement
  1.4394 -   retrieval by message-id:
  1.4395 -
  1.4396 -      [C] CAPABILITIES
  1.4397 -      [S] 101 Capability list:
  1.4398 -      [S] VERSION 2
  1.4399 -      [S] READER
  1.4400 -      [S] OVER
  1.4401 -      [S] LIST ACTIVE NEWSGROUPS OVERVIEW.FMT
  1.4402 -      [S] .
  1.4403 -      [C] OVER <45223423@example.com>
  1.4404 -      [S] 503 Overview by message-id unsupported
  1.4405 -
  1.4406 -
  1.4407 -
  1.4408 -
  1.4409 -
  1.4410 -
  1.4411 -
  1.4412 -
  1.4413 -
  1.4414 -
  1.4415 -
  1.4416 -
  1.4417 -
  1.4418 -
  1.4419 -
  1.4420 -
  1.4421 -
  1.4422 -
  1.4423 -
  1.4424 -Feather                     Standards Track                    [Page 79]
  1.4425 -
  1.4426 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.4427 -
  1.4428 -
  1.4429 -   Example of a successful retrieval of overview information for a range
  1.4430 -   of articles:
  1.4431 -
  1.4432 -      [C] GROUP misc.test
  1.4433 -      [S] 211 1234 3000234 3002322 misc.test
  1.4434 -      [C] OVER 3000234-3000240
  1.4435 -      [S] 224 Overview information follows
  1.4436 -      [S] 3000234|I am just a test article|"Demo User"
  1.4437 -          <nobody@example.com>|6 Oct 1998 04:38:40 -0500|
  1.4438 -          <45223423@example.com>|<45454@example.net>|1234|
  1.4439 -          17|Xref: news.example.com misc.test:3000363
  1.4440 -      [S] 3000235|Another test article|nobody@nowhere.to
  1.4441 -          (Demo User)|6 Oct 1998 04:38:45 -0500|<45223425@to.to>||
  1.4442 -          4818|37||Distribution: fi
  1.4443 -      [S] 3000238|Re: I am just a test article|somebody@elsewhere.to|
  1.4444 -          7 Oct 1998 11:38:40 +1200|<kfwer3v@elsewhere.to>|
  1.4445 -          <45223423@to.to>|9234|51
  1.4446 -      [S] .
  1.4447 -
  1.4448 -   Note the missing "References" and Xref headers in the second line,
  1.4449 -   the missing trailing fields in the first and last lines, and that
  1.4450 -   there are only results for those articles that still exist.
  1.4451 -
  1.4452 -   Example of an unsuccessful retrieval of overview information on an
  1.4453 -   article by number:
  1.4454 -
  1.4455 -      [C] GROUP misc.test
  1.4456 -      [S] 211 1234 3000234 3002322 misc.test
  1.4457 -      [C] OVER 300256
  1.4458 -      [S] 423 No such article in this group
  1.4459 -
  1.4460 -   Example of an invalid range:
  1.4461 -
  1.4462 -      [C] GROUP misc.test
  1.4463 -      [S] 211 1234 3000234 3002322 misc.test
  1.4464 -      [C] OVER 3000444-3000222
  1.4465 -      [S] 423 Empty range
  1.4466 -
  1.4467 -   Example of an unsuccessful retrieval of overview information by
  1.4468 -   number because no newsgroup was selected first:
  1.4469 -
  1.4470 -      [Assumes currently selected newsgroup is invalid.]
  1.4471 -      [C] OVER
  1.4472 -      [S] 412 No newsgroup selected
  1.4473 -
  1.4474 -
  1.4475 -
  1.4476 -
  1.4477 -
  1.4478 -
  1.4479 -
  1.4480 -Feather                     Standards Track                    [Page 80]
  1.4481 -
  1.4482 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.4483 -
  1.4484 -
  1.4485 -   Example of an attempt to retrieve information when the currently
  1.4486 -   selected newsgroup is empty:
  1.4487 -
  1.4488 -      [C] GROUP example.empty.newsgroup
  1.4489 -      [S] 211 0 0 0 example.empty.newsgroup
  1.4490 -      [C] OVER
  1.4491 -      [S] 420 No current article selected
  1.4492 -
  1.4493 -8.4.  LIST OVERVIEW.FMT
  1.4494 -
  1.4495 -8.4.1.  Usage
  1.4496 -
  1.4497 -   Indicating capability: OVER
  1.4498 -
  1.4499 -   Syntax
  1.4500 -     LIST OVERVIEW.FMT
  1.4501 -
  1.4502 -   Responses
  1.4503 -     215    Information follows (multi-line)
  1.4504 -
  1.4505 -8.4.2.  Description
  1.4506 -
  1.4507 -   See Section 7.6.1 for general requirements of the LIST command.
  1.4508 -
  1.4509 -   The LIST OVERVIEW.FMT command returns a description of the fields in
  1.4510 -   the database for which it is consistent (as described above).  The
  1.4511 -   information is returned as a multi-line data block following the 215
  1.4512 -   response code.  The information contains one line per field in the
  1.4513 -   order in which they are returned by the OVER command; the first 7
  1.4514 -   lines MUST (except for the case of letters) be exactly as follows:
  1.4515 -
  1.4516 -       Subject:
  1.4517 -       From:
  1.4518 -       Date:
  1.4519 -       Message-ID:
  1.4520 -       References:
  1.4521 -       :bytes
  1.4522 -       :lines
  1.4523 -
  1.4524 -   For compatibility with existing implementations, the last two lines
  1.4525 -   MAY instead be:
  1.4526 -
  1.4527 -       Bytes:
  1.4528 -       Lines:
  1.4529 -
  1.4530 -   even though they refer to metadata, not headers.
  1.4531 -
  1.4532 -
  1.4533 -
  1.4534 -
  1.4535 -
  1.4536 -Feather                     Standards Track                    [Page 81]
  1.4537 -
  1.4538 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.4539 -
  1.4540 -
  1.4541 -   All subsequent lines MUST consist of either a header name followed by
  1.4542 -   ":full", or the name of a piece of metadata.
  1.4543 -
  1.4544 -   There are no leading or trailing spaces in the output.
  1.4545 -
  1.4546 -   Note that the 7 fixed lines describe the 2nd to 8th fields of the
  1.4547 -   OVER output.  The "full" suffix (which may use either uppercase,
  1.4548 -   lowercase, or a mix) is a reminder that the corresponding fields
  1.4549 -   include the header name.
  1.4550 -
  1.4551 -   This command MAY generate different results if it is used more than
  1.4552 -   once in a session.
  1.4553 -
  1.4554 -   If the OVER command is not implemented, the meaning of the output
  1.4555 -   from this command is not specified, but it must still meet the above
  1.4556 -   syntactic requirements.
  1.4557 -
  1.4558 -8.4.3.  Examples
  1.4559 -
  1.4560 -   Example of LIST OVERVIEW.FMT output corresponding to the example OVER
  1.4561 -   output above, in the preferred format:
  1.4562 -
  1.4563 -      [C] LIST OVERVIEW.FMT
  1.4564 -      [S] 215 Order of fields in overview database.
  1.4565 -      [S] Subject:
  1.4566 -      [S] From:
  1.4567 -      [S] Date:
  1.4568 -      [S] Message-ID:
  1.4569 -      [S] References:
  1.4570 -      [S] :bytes
  1.4571 -      [S] :lines
  1.4572 -      [S] Xref:full
  1.4573 -      [S] Distribution:full
  1.4574 -      [S] .
  1.4575 -
  1.4576 -
  1.4577 -
  1.4578 -
  1.4579 -
  1.4580 -
  1.4581 -
  1.4582 -
  1.4583 -
  1.4584 -
  1.4585 -
  1.4586 -
  1.4587 -
  1.4588 -
  1.4589 -
  1.4590 -
  1.4591 -
  1.4592 -Feather                     Standards Track                    [Page 82]
  1.4593 -
  1.4594 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.4595 -
  1.4596 -
  1.4597 -   Example of LIST OVERVIEW.FMT output corresponding to the example OVER
  1.4598 -   output above, in the alternative format:
  1.4599 -
  1.4600 -      [C] LIST OVERVIEW.FMT
  1.4601 -      [S] 215 Order of fields in overview database.
  1.4602 -      [S] Subject:
  1.4603 -      [S] From:
  1.4604 -      [S] Date:
  1.4605 -      [S] Message-ID:
  1.4606 -      [S] References:
  1.4607 -      [S] Bytes:
  1.4608 -      [S] Lines:
  1.4609 -      [S] Xref:FULL
  1.4610 -      [S] Distribution:FULL
  1.4611 -      [S] .
  1.4612 -
  1.4613 -8.5.  HDR
  1.4614 -
  1.4615 -8.5.1.  Usage
  1.4616 -
  1.4617 -   Indicating capability: HDR
  1.4618 -
  1.4619 -   Syntax
  1.4620 -     HDR field message-id
  1.4621 -     HDR field range
  1.4622 -     HDR field
  1.4623 -
  1.4624 -   Responses
  1.4625 -
  1.4626 -   First form (message-id specified)
  1.4627 -     225    Headers follow (multi-line)
  1.4628 -     430    No article with that message-id
  1.4629 -
  1.4630 -   Second form (range specified)
  1.4631 -     225    Headers follow (multi-line)
  1.4632 -     412    No newsgroup selected
  1.4633 -     423    No articles in that range
  1.4634 -
  1.4635 -   Third form (current article number used)
  1.4636 -     225    Headers follow (multi-line)
  1.4637 -     412    No newsgroup selected
  1.4638 -     420    Current article number is invalid
  1.4639 -
  1.4640 -   Parameters
  1.4641 -     field         Name of field
  1.4642 -     range         Number(s) of articles
  1.4643 -     message-id    Message-id of article
  1.4644 -
  1.4645 -
  1.4646 -
  1.4647 -
  1.4648 -Feather                     Standards Track                    [Page 83]
  1.4649 -
  1.4650 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.4651 -
  1.4652 -
  1.4653 -8.5.2.  Description
  1.4654 -
  1.4655 -   The HDR command provides access to specific fields from an article
  1.4656 -   specified by message-id, or from a specified article or range of
  1.4657 -   articles in the currently selected newsgroup.  It MAY take the
  1.4658 -   information directly from the articles or from the overview database.
  1.4659 -   In the case of headers, an implementation MAY restrict the use of
  1.4660 -   this command to a specific list of headers or MAY allow it to be used
  1.4661 -   with any header; it may behave differently when it is used with a
  1.4662 -   message-id argument and when it is used with a range or no argument.
  1.4663 -
  1.4664 -   The required field argument is the name of a header with the colon
  1.4665 -   omitted (e.g., "subject") or the name of a metadata item including
  1.4666 -   the leading colon (e.g., ":bytes"), and is case insensitive.
  1.4667 -
  1.4668 -   The message-id argument indicates a specific article.  The range
  1.4669 -   argument may be any of the following:
  1.4670 -
  1.4671 -   o  An article number.
  1.4672 -
  1.4673 -   o  An article number followed by a dash to indicate all following.
  1.4674 -
  1.4675 -   o  An article number followed by a dash followed by another article
  1.4676 -      number.
  1.4677 -
  1.4678 -   If neither is specified, the current article number is used.
  1.4679 -
  1.4680 -   If the information is available, it is returned as a multi-line data
  1.4681 -   block following the 225 response code and contains one line for each
  1.4682 -   article in the range that exists.  (Note that unless the argument is
  1.4683 -   a range including a dash, there will be exactly one line in the data
  1.4684 -   block.)  The line consists of the article number, a space, and then
  1.4685 -   the contents of the field.  In the case of a header, the header name,
  1.4686 -   the colon, and the first space after the colon are all omitted.
  1.4687 -
  1.4688 -   If the article is specified by message-id (the first form of the
  1.4689 -   command), the article number MUST be replaced with zero, except that
  1.4690 -   if there is a currently selected newsgroup and the article is present
  1.4691 -   in that group, the server MAY use the article's number in that group.
  1.4692 -   (See the ARTICLE command (Section 6.2.1) and STAT examples
  1.4693 -   (Section 6.2.4.3) for more details.)  In the other two forms of the
  1.4694 -   command, the article number MUST be returned.
  1.4695 -
  1.4696 -   Header contents are modified as follows: all CRLF pairs are removed,
  1.4697 -   and then each TAB is replaced with a single space.  (Note that this
  1.4698 -   is the same transformation as is performed by the OVER command
  1.4699 -   (Section 8.3.2), and the same comment concerning NUL, CR, and LF
  1.4700 -   applies.)
  1.4701 -
  1.4702 -
  1.4703 -
  1.4704 -Feather                     Standards Track                    [Page 84]
  1.4705 -
  1.4706 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.4707 -
  1.4708 -
  1.4709 -   Note the distinction between headers and metadata appearing to have
  1.4710 -   the same meaning.  Headers are always taken unchanged from the
  1.4711 -   article; metadata are always calculated.  For example, a request for
  1.4712 -   "Lines" returns the contents of the "Lines" header of the specified
  1.4713 -   articles, if any, no matter whether they accurately state the number
  1.4714 -   of lines, while a request for ":lines" returns the line count
  1.4715 -   metadata, which is always the actual number of lines irrespective of
  1.4716 -   what any header may state.
  1.4717 -
  1.4718 -   If the requested header is not present in the article, or if it is
  1.4719 -   present but empty, a line for that article is included in the output,
  1.4720 -   but the header content portion of the line is empty (the space after
  1.4721 -   the article number MAY be retained or omitted).  If the header occurs
  1.4722 -   in a given article more than once, only the content of the first
  1.4723 -   occurrence is returned by HDR.  If any article number in the provided
  1.4724 -   range does not exist in the group, no line for that article number is
  1.4725 -   included in the output.
  1.4726 -
  1.4727 -   If the second argument is a message-id and no such article exists, a
  1.4728 -   430 response MUST be returned.  If the second argument is a range or
  1.4729 -   is omitted and the currently selected newsgroup is invalid, a 412
  1.4730 -   response MUST be returned.  If the second argument is a range and no
  1.4731 -   articles in that number range exist in the currently selected
  1.4732 -   newsgroup, including the case where the second number is less than
  1.4733 -   the first one, a 423 response MUST be returned.  If the second
  1.4734 -   argument is omitted and the current article number is invalid, a 420
  1.4735 -   response MUST be returned.
  1.4736 -
  1.4737 -   A server MAY only allow HDR commands for a limited set of fields; it
  1.4738 -   may behave differently in this respect for the first (message-id)
  1.4739 -   form from how it would for the other forms.  If so, it MUST respond
  1.4740 -   with the generic 503 response to attempts to request other fields,
  1.4741 -   rather than return erroneous results, such as a successful empty
  1.4742 -   response.
  1.4743 -
  1.4744 -   If HDR uses the overview database and it is inconsistent for the
  1.4745 -   requested field, the server MAY return what results it can, or it MAY
  1.4746 -   respond with the generic 503 response.  In the latter case, the field
  1.4747 -   MUST NOT appear in the output from LIST HEADERS.
  1.4748 -
  1.4749 -
  1.4750 -
  1.4751 -
  1.4752 -
  1.4753 -
  1.4754 -
  1.4755 -
  1.4756 -
  1.4757 -
  1.4758 -
  1.4759 -
  1.4760 -Feather                     Standards Track                    [Page 85]
  1.4761 -
  1.4762 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.4763 -
  1.4764 -
  1.4765 -8.5.3.  Examples
  1.4766 -
  1.4767 -   Example of a successful retrieval of subject lines from a range of
  1.4768 -   articles (3000235 has no Subject header, and 3000236 is missing):
  1.4769 -
  1.4770 -      [C] GROUP misc.test
  1.4771 -      [S] 211 1234 3000234 3002322 misc.test
  1.4772 -      [C] HDR Subject 3000234-3000238
  1.4773 -      [S] 225 Headers follow
  1.4774 -      [S] 3000234 I am just a test article
  1.4775 -      [S] 3000235
  1.4776 -      [S] 3000237 Re: I am just a test article
  1.4777 -      [S] 3000238 Ditto
  1.4778 -      [S] .
  1.4779 -
  1.4780 -   Example of a successful retrieval of line counts from a range of
  1.4781 -   articles:
  1.4782 -
  1.4783 -      [C] GROUP misc.test
  1.4784 -      [S] 211 1234 3000234 3002322 misc.test
  1.4785 -      [C] HDR :lines 3000234-3000238
  1.4786 -      [S] 225 Headers follow
  1.4787 -      [S] 3000234 42
  1.4788 -      [S] 3000235 5
  1.4789 -      [S] 3000237 11
  1.4790 -      [S] 3000238 2378
  1.4791 -      [S] .
  1.4792 -
  1.4793 -   Example of a successful retrieval of the subject line from an article
  1.4794 -   by message-id:
  1.4795 -
  1.4796 -      [C] GROUP misc.test
  1.4797 -      [S] 211 1234 3000234 3002322 misc.test
  1.4798 -      [C] HDR subject <i.am.a.test.article@example.com>
  1.4799 -      [S] 225 Header information follows
  1.4800 -      [S] 0 I am just a test article
  1.4801 -      [S] .
  1.4802 -
  1.4803 -   Example of a successful retrieval of the subject line from the
  1.4804 -   current article:
  1.4805 -
  1.4806 -      [C] GROUP misc.test
  1.4807 -      [S] 211 1234 3000234 3002322 misc.test
  1.4808 -      [C] HDR subject
  1.4809 -      [S] 225 Header information follows
  1.4810 -      [S] 3000234 I am just a test article
  1.4811 -      [S] .
  1.4812 -
  1.4813 -
  1.4814 -
  1.4815 -
  1.4816 -Feather                     Standards Track                    [Page 86]
  1.4817 -
  1.4818 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.4819 -
  1.4820 -
  1.4821 -   Example of an unsuccessful retrieval of a header from an article by
  1.4822 -   message-id:
  1.4823 -
  1.4824 -      [C] HDR subject <i.am.not.there@example.com>
  1.4825 -      [S] 430 No Such Article Found
  1.4826 -
  1.4827 -   Example of an unsuccessful retrieval of headers from articles by
  1.4828 -   number because no newsgroup was selected first:
  1.4829 -
  1.4830 -      [Assumes currently selected newsgroup is invalid.]
  1.4831 -      [C] HDR subject 300256-
  1.4832 -      [S] 412 No newsgroup selected
  1.4833 -
  1.4834 -   Example of an unsuccessful retrieval of headers because the currently
  1.4835 -   selected newsgroup is empty:
  1.4836 -
  1.4837 -      [C] GROUP example.empty.newsgroup
  1.4838 -      [S] 211 0 0 0 example.empty.newsgroup
  1.4839 -      [C] HDR subject 1-
  1.4840 -      [S] 423 No articles in that range
  1.4841 -
  1.4842 -   Example of an unsuccessful retrieval of headers because the server
  1.4843 -   does not allow HDR commands for that header:
  1.4844 -
  1.4845 -      [C] GROUP misc.test
  1.4846 -      [S] 211 1234 3000234 3002322 misc.test
  1.4847 -      [C] HDR Content-Type 3000234-3000238
  1.4848 -      [S] 503 HDR not permitted on Content-Type
  1.4849 -
  1.4850 -8.6.  LIST HEADERS
  1.4851 -
  1.4852 -8.6.1.  Usage
  1.4853 -
  1.4854 -   Indicating capability: HDR
  1.4855 -
  1.4856 -   Syntax
  1.4857 -     LIST HEADERS [MSGID|RANGE]
  1.4858 -
  1.4859 -   Responses
  1.4860 -     215    Field list follows (multi-line)
  1.4861 -
  1.4862 -   Parameters
  1.4863 -     MSGID    Requests list for access by message-id
  1.4864 -     RANGE    Requests list for access by range
  1.4865 -
  1.4866 -
  1.4867 -
  1.4868 -
  1.4869 -
  1.4870 -
  1.4871 -
  1.4872 -Feather                     Standards Track                    [Page 87]
  1.4873 -
  1.4874 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.4875 -
  1.4876 -
  1.4877 -8.6.2.  Description
  1.4878 -
  1.4879 -   See Section 7.6.1 for general requirements of the LIST command.
  1.4880 -
  1.4881 -   The LIST HEADERS command returns a list of fields that may be
  1.4882 -   retrieved using the HDR command.
  1.4883 -
  1.4884 -   The information is returned as a multi-line data block following the
  1.4885 -   215 response code and contains one line for each field name
  1.4886 -   (excluding the trailing colon for headers and including the leading
  1.4887 -   colon for metadata items).  If the implementation allows any header
  1.4888 -   to be retrieved, it MUST NOT include any header names in the list but
  1.4889 -   MUST include the special entry ":" (a single colon on its own).  It
  1.4890 -   MUST still explicitly list any metadata items that are available.
  1.4891 -   The order of items in the list is not significant; the server need
  1.4892 -   not even consistently return the same order.  The list MAY be empty
  1.4893 -   (though in this circumstance there is little point in providing the
  1.4894 -   HDR command).
  1.4895 -
  1.4896 -   An implementation that also supports the OVER command SHOULD at least
  1.4897 -   permit all the headers and metadata items listed in the output from
  1.4898 -   the LIST OVERVIEW.FMT command.
  1.4899 -
  1.4900 -   If the server treats the first form of the HDR command (message-id
  1.4901 -   specified) differently from the other two forms (range specified or
  1.4902 -   current article number used) in respect of which headers or metadata
  1.4903 -   items are available, then the following apply:
  1.4904 -
  1.4905 -   o  If the MSGID argument is specified, the results MUST be those
  1.4906 -      available for the first form of the HDR command.
  1.4907 -
  1.4908 -   o  If the RANGE argument is specified, the results MUST be those
  1.4909 -      available for the second and third forms of the HDR command.
  1.4910 -
  1.4911 -   o  If no argument is specified, the results MUST be those available
  1.4912 -      in all forms of the HDR command (that is, it MUST only list those
  1.4913 -      items listed in both the previous cases).
  1.4914 -
  1.4915 -   If the server does not treat the various forms differently, then it
  1.4916 -   MUST ignore any argument and always produce the same results (though
  1.4917 -   not necessarily always in the same order).
  1.4918 -
  1.4919 -   If the HDR command is not implemented, the meaning of the output from
  1.4920 -   this command is not specified, but it must still meet the above
  1.4921 -   syntactic requirements.
  1.4922 -
  1.4923 -
  1.4924 -
  1.4925 -
  1.4926 -
  1.4927 -
  1.4928 -Feather                     Standards Track                    [Page 88]
  1.4929 -
  1.4930 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.4931 -
  1.4932 -
  1.4933 -8.6.3.  Examples
  1.4934 -
  1.4935 -   Example of an implementation providing access to only a few headers:
  1.4936 -
  1.4937 -      [C] LIST HEADERS
  1.4938 -      [S] 215 headers supported:
  1.4939 -      [S] Subject
  1.4940 -      [S] Message-ID
  1.4941 -      [S] Xref
  1.4942 -      [S] .
  1.4943 -
  1.4944 -   Example of an implementation providing access to the same fields as
  1.4945 -   the first example in Section 8.4.3:
  1.4946 -
  1.4947 -      [C] CAPABILITIES
  1.4948 -      [S] 101 Capability list:
  1.4949 -      [S] VERSION 2
  1.4950 -      [S] READER
  1.4951 -      [S] OVER
  1.4952 -      [S] HDR
  1.4953 -      [S] LIST ACTIVE NEWSGROUPS HEADERS OVERVIEW.FMT
  1.4954 -      [S] .
  1.4955 -      [C] LIST HEADERS
  1.4956 -      [S] 215 headers and metadata items supported:
  1.4957 -      [S] Date
  1.4958 -      [S] Distribution
  1.4959 -      [S] From
  1.4960 -      [S] Message-ID
  1.4961 -      [S] References
  1.4962 -      [S] Subject
  1.4963 -      [S] Xref
  1.4964 -      [S] :bytes
  1.4965 -      [S] :lines
  1.4966 -      [S] .
  1.4967 -
  1.4968 -   Example of an implementation providing access to all headers:
  1.4969 -
  1.4970 -      [C] LIST HEADERS
  1.4971 -      [S] 215 metadata items supported:
  1.4972 -      [S] :
  1.4973 -      [S] :lines
  1.4974 -      [S] :bytes
  1.4975 -      [S] :x-article-number
  1.4976 -      [S] .
  1.4977 -
  1.4978 -
  1.4979 -
  1.4980 -
  1.4981 -
  1.4982 -
  1.4983 -
  1.4984 -Feather                     Standards Track                    [Page 89]
  1.4985 -
  1.4986 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.4987 -
  1.4988 -
  1.4989 -   Example of an implementation distinguishing the first form of the HDR
  1.4990 -   command from the other two forms:
  1.4991 -
  1.4992 -      [C] LIST HEADERS RANGE
  1.4993 -      [S] 215 metadata items supported:
  1.4994 -      [S] :
  1.4995 -      [S] :lines
  1.4996 -      [S] :bytes
  1.4997 -      [S] .
  1.4998 -      [C] LIST HEADERS MSGID
  1.4999 -      [S] 215 headers and metadata items supported:
  1.5000 -      [S] Date
  1.5001 -      [S] Distribution
  1.5002 -      [S] From
  1.5003 -      [S] Message-ID
  1.5004 -      [S] References
  1.5005 -      [S] Subject
  1.5006 -      [S] :lines
  1.5007 -      [S] :bytes
  1.5008 -      [S] :x-article-number
  1.5009 -      [S] .
  1.5010 -      [C] LIST HEADERS
  1.5011 -      [S] 215 headers and metadata items supported:
  1.5012 -      [S] Date
  1.5013 -      [S] Distribution
  1.5014 -      [S] From
  1.5015 -      [S] Message-ID
  1.5016 -      [S] References
  1.5017 -      [S] Subject
  1.5018 -      [S] :lines
  1.5019 -      [S] :bytes
  1.5020 -      [S] .
  1.5021 -
  1.5022 -   Note that :x-article-number does not appear in the last set of
  1.5023 -   output.
  1.5024 -
  1.5025 -9.  Augmented BNF Syntax for NNTP
  1.5026 -
  1.5027 -9.1.  Introduction
  1.5028 -
  1.5029 -   Each of the following sections describes the syntax of a major
  1.5030 -   element of NNTP.  This syntax extends and refines the descriptions
  1.5031 -   elsewhere in this specification and should be given precedence when
  1.5032 -   resolving apparent conflicts.  Note that ABNF [RFC4234] strings are
  1.5033 -   case insensitive.  Non-terminals used in several places are defined
  1.5034 -   in a separate section at the end.
  1.5035 -
  1.5036 -
  1.5037 -
  1.5038 -
  1.5039 -
  1.5040 -Feather                     Standards Track                    [Page 90]
  1.5041 -
  1.5042 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.5043 -
  1.5044 -
  1.5045 -   Between them, the non-terminals <command-line>, <command-datastream>,
  1.5046 -   <command-continuation>, and <response> specify the text that flows
  1.5047 -   between client and server.  A consistent naming scheme is used in
  1.5048 -   this document for the non-terminals relating to each command, and
  1.5049 -   SHOULD be used by the specification of registered extensions.
  1.5050 -
  1.5051 -   For each command, the sequence is as follows:
  1.5052 -
  1.5053 -   o  The client sends an instance of <command-line>; the syntax for the
  1.5054 -      EXAMPLE command is <example-command>.
  1.5055 -
  1.5056 -   o  If the client is one that immediately streams data, it sends an
  1.5057 -      instance of <command-datastream>; the syntax for the EXAMPLE
  1.5058 -      command is <example-datastream>.
  1.5059 -
  1.5060 -   o  The server sends an instance of <response>.
  1.5061 -
  1.5062 -      *  The initial response line is independent of the command that
  1.5063 -         generated it; if the 000 response has arguments, the syntax of
  1.5064 -         the initial line is <response-000-content>.
  1.5065 -
  1.5066 -      *  If the response is multi-line, the initial line is followed by
  1.5067 -         a <multi-line-data-block>.  The syntax for the contents of this
  1.5068 -         block after "dot-stuffing" has been removed is (for the 000
  1.5069 -         response to the EXAMPLE command) <example-000-ml-content> and
  1.5070 -         is an instance of <multi-line-response-content>.
  1.5071 -
  1.5072 -   o  While the latest response is one that indicates more data is
  1.5073 -      required (in general, a 3xx response):
  1.5074 -
  1.5075 -      *  the client sends an instance of <command-continuation>; the
  1.5076 -         syntax for the EXAMPLE continuation following a 333 response is
  1.5077 -         <example-333-continuation>;
  1.5078 -
  1.5079 -      *  the server sends another instance of <response>, as above.
  1.5080 -
  1.5081 -   (There are no commands in this specification that immediately stream
  1.5082 -   data, but this non-terminal is defined for the convenience of
  1.5083 -   extensions.)
  1.5084 -
  1.5085 -
  1.5086 -
  1.5087 -
  1.5088 -
  1.5089 -
  1.5090 -
  1.5091 -
  1.5092 -
  1.5093 -
  1.5094 -
  1.5095 -
  1.5096 -Feather                     Standards Track                    [Page 91]
  1.5097 -
  1.5098 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.5099 -
  1.5100 -
  1.5101 -9.2.  Commands
  1.5102 -
  1.5103 -   This syntax defines the non-terminal <command-line>, which represents
  1.5104 -   what is sent from the client to the server (see section 3.1 for
  1.5105 -   limits on lengths).
  1.5106 -
  1.5107 -     command-line = command EOL
  1.5108 -     command = X-command
  1.5109 -     X-command = keyword *(WS token)
  1.5110 -
  1.5111 -     command =/ article-command /
  1.5112 -           body-command /
  1.5113 -           capabilities-command /
  1.5114 -           date-command /
  1.5115 -           group-command /
  1.5116 -           hdr-command /
  1.5117 -           head-command /
  1.5118 -           help-command /
  1.5119 -           ihave-command /
  1.5120 -           last-command /
  1.5121 -           list-command /
  1.5122 -           listgroup-command /
  1.5123 -           mode-reader-command /
  1.5124 -           newgroups-command /
  1.5125 -           newnews-command /
  1.5126 -           next-command /
  1.5127 -           over-command /
  1.5128 -           post-command /
  1.5129 -           quit-command /
  1.5130 -           stat-command
  1.5131 -
  1.5132 -     article-command = "ARTICLE" [WS article-ref]
  1.5133 -     body-command = "BODY" [WS article-ref]
  1.5134 -     capabilities-command = "CAPABILITIES" [WS keyword]
  1.5135 -     date-command = "DATE"
  1.5136 -     group-command = "GROUP" [WS newsgroup-name]
  1.5137 -     hdr-command = "HDR" WS header-meta-name [WS range-ref]
  1.5138 -     head-command = "HEAD" [WS article-ref]
  1.5139 -     help-command = "HELP"
  1.5140 -     ihave-command = "IHAVE" WS message-id
  1.5141 -     last-command = "LAST"
  1.5142 -     list-command = "LIST" [WS list-arguments]
  1.5143 -     listgroup-command = "LISTGROUP" [WS newsgroup-name [WS range]]
  1.5144 -     mode-reader-command = "MODE" WS "READER"
  1.5145 -     newgroups-command = "NEWGROUPS" WS date-time
  1.5146 -     newnews-command = "NEWNEWS" WS wildmat WS date-time
  1.5147 -     next-command = "NEXT"
  1.5148 -     over-command = "OVER" [WS range-ref]
  1.5149 -
  1.5150 -
  1.5151 -
  1.5152 -Feather                     Standards Track                    [Page 92]
  1.5153 -
  1.5154 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.5155 -
  1.5156 -
  1.5157 -     post-command = "POST"
  1.5158 -     quit-command = "QUIT"
  1.5159 -     stat-command = "STAT" [WS article-ref]
  1.5160 -
  1.5161 -     article-ref = article-number / message-id
  1.5162 -     date = date2y / date4y
  1.5163 -     date4y = 4DIGIT 2DIGIT 2DIGIT
  1.5164 -     date2y = 2DIGIT 2DIGIT 2DIGIT
  1.5165 -     date-time = date WS time [WS "GMT"]
  1.5166 -     header-meta-name = header-name / metadata-name
  1.5167 -     list-arguments = keyword [WS token]
  1.5168 -     metadata-name = ":" 1*A-NOTCOLON
  1.5169 -     range = article-number ["-" [article-number]]
  1.5170 -     range-ref = range / message-id
  1.5171 -     time = 2DIGIT 2DIGIT 2DIGIT
  1.5172 -
  1.5173 -9.3.  Command Continuation
  1.5174 -
  1.5175 -   This syntax defines the further material sent by the client in the
  1.5176 -   case of multi-stage commands and those that stream data.
  1.5177 -
  1.5178 -     command-datastream = UNDEFINED
  1.5179 -       ; not used, provided as a hook for extensions
  1.5180 -     command-continuation = ihave-335-continuation /
  1.5181 -           post-340-continuation
  1.5182 -
  1.5183 -     ihave-335-continuation = encoded-article
  1.5184 -     post-340-continuation = encoded-article
  1.5185 -
  1.5186 -     encoded-article = multi-line-data-block
  1.5187 -       ; after undoing the "dot-stuffing", this MUST match <article>
  1.5188 -
  1.5189 -9.4.  Responses
  1.5190 -
  1.5191 -9.4.1.  Generic Responses
  1.5192 -
  1.5193 -   This syntax defines the non-terminal <response>, which represents the
  1.5194 -   generic form of responses; that is, what is sent from the server to
  1.5195 -   the client in response to a <command> or a <command-continuation>.
  1.5196 -
  1.5197 -     response = simple-response / multi-line-response
  1.5198 -     simple-response = initial-response-line
  1.5199 -     multi-line-response = initial-response-line multi-line-data-block
  1.5200 -
  1.5201 -     initial-response-line =
  1.5202 -           initial-response-content [SP trailing-comment] CRLF
  1.5203 -     initial-response-content = X-initial-response-content
  1.5204 -     X-initial-response-content = 3DIGIT *(SP response-argument)
  1.5205 -
  1.5206 -
  1.5207 -
  1.5208 -Feather                     Standards Track                    [Page 93]
  1.5209 -
  1.5210 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.5211 -
  1.5212 -
  1.5213 -     response-argument = 1*A-CHAR
  1.5214 -     trailing-comment = *U-CHAR
  1.5215 -
  1.5216 -9.4.2.  Initial Response Line Contents
  1.5217 -
  1.5218 -   This syntax defines the specific initial response lines for the
  1.5219 -   various commands in this specification (see section 3.1 for limits on
  1.5220 -   lengths).  Only those response codes with arguments are listed.
  1.5221 -
  1.5222 -     initial-response-content =/ response-111-content /
  1.5223 -           response-211-content /
  1.5224 -           response-220-content /
  1.5225 -           response-221-content /
  1.5226 -           response-222-content /
  1.5227 -           response-223-content /
  1.5228 -           response-401-content
  1.5229 -
  1.5230 -     response-111-content = "111" SP date4y time
  1.5231 -     response-211-content = "211" 3(SP article-number) SP newsgroup-name
  1.5232 -     response-220-content = "220" SP article-number SP message-id
  1.5233 -     response-221-content = "221" SP article-number SP message-id
  1.5234 -     response-222-content = "222" SP article-number SP message-id
  1.5235 -     response-223-content = "223" SP article-number SP message-id
  1.5236 -     response-401-content = "401" SP capability-label
  1.5237 -
  1.5238 -9.4.3.  Multi-line Response Contents
  1.5239 -
  1.5240 -   This syntax defines the content of the various multi-line responses;
  1.5241 -   more precisely, it defines the part of the response in the multi-line
  1.5242 -   data block after any "dot-stuffing" has been undone.  The numeric
  1.5243 -   portion of each non-terminal name indicates the response code that is
  1.5244 -   followed by this data.
  1.5245 -
  1.5246 -     multi-line-response-content = article-220-ml-content /
  1.5247 -           body-222-ml-content /
  1.5248 -           capabilities-101-ml-content /
  1.5249 -           hdr-225-ml-content /
  1.5250 -           head-221-ml-content /
  1.5251 -           help-100-ml-content /
  1.5252 -           list-215-ml-content /
  1.5253 -           listgroup-211-ml-content /
  1.5254 -           newgroups-231-ml-content /
  1.5255 -           newnews-230-ml-content /
  1.5256 -           over-224-ml-content
  1.5257 -
  1.5258 -     article-220-ml-content = article
  1.5259 -     body-222-ml-content = body
  1.5260 -     capabilities-101-ml-content = version-line CRLF
  1.5261 -
  1.5262 -
  1.5263 -
  1.5264 -Feather                     Standards Track                    [Page 94]
  1.5265 -
  1.5266 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.5267 -
  1.5268 -
  1.5269 -           *(capability-line CRLF)
  1.5270 -     hdr-225-ml-content = *(article-number SP hdr-content CRLF)
  1.5271 -     head-221-ml-content = 1*header
  1.5272 -     help-100-ml-content = *(*U-CHAR CRLF)
  1.5273 -     list-215-ml-content = list-content
  1.5274 -     listgroup-211-ml-content = *(article-number CRLF)
  1.5275 -     newgroups-231-ml-content = active-groups-list
  1.5276 -     newnews-230-ml-content = *(message-id CRLF)
  1.5277 -     over-224-ml-content = *(article-number over-content CRLF)
  1.5278 -
  1.5279 -     active-groups-list = *(newsgroup-name SPA article-number
  1.5280 -           SPA article-number SPA newsgroup-status CRLF)
  1.5281 -     hdr-content = *S-NONTAB
  1.5282 -     hdr-n-content = [(header-name ":" / metadata-name) SP hdr-content]
  1.5283 -     list-content = body
  1.5284 -     newsgroup-status = %x79 / %x6E / %x6D / private-status
  1.5285 -     over-content = 1*6(TAB hdr-content) /
  1.5286 -           7(TAB hdr-content) *(TAB hdr-n-content)
  1.5287 -     private-status = token ; except the values in newsgroup-status
  1.5288 -
  1.5289 -9.5.  Capability Lines
  1.5290 -
  1.5291 -   This syntax defines the generic form of a capability line in the
  1.5292 -   capabilities list (see Section 3.3.1).
  1.5293 -
  1.5294 -     capability-line = capability-entry
  1.5295 -     capability-entry = X-capability-entry
  1.5296 -     X-capability-entry = capability-label *(WS capability-argument)
  1.5297 -     capability-label = keyword
  1.5298 -     capability-argument = token
  1.5299 -
  1.5300 -   This syntax defines the specific capability entries for the
  1.5301 -   capabilities in this specification.
  1.5302 -
  1.5303 -     capability-entry =/
  1.5304 -           hdr-capability /
  1.5305 -           ihave-capability /
  1.5306 -           implementation-capability /
  1.5307 -           list-capability /
  1.5308 -           mode-reader-capability /
  1.5309 -           newnews-capability /
  1.5310 -           over-capability /
  1.5311 -           post-capability /
  1.5312 -           reader-capability
  1.5313 -
  1.5314 -     hdr-capability = "HDR"
  1.5315 -     ihave-capability = "IHAVE"
  1.5316 -     implementation-capability = "IMPLEMENTATION" *(WS token)
  1.5317 -
  1.5318 -
  1.5319 -
  1.5320 -Feather                     Standards Track                    [Page 95]
  1.5321 -
  1.5322 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.5323 -
  1.5324 -
  1.5325 -     list-capability = "LIST" 1*(WS keyword)
  1.5326 -     mode-reader-capability = "MODE-READER"
  1.5327 -     newnews-capability = "NEWNEWS"
  1.5328 -     over-capability = "OVER" [WS "MSGID"]
  1.5329 -     post-capability = "POST"
  1.5330 -     reader-capability = "READER"
  1.5331 -
  1.5332 -     version-line = "VERSION" 1*(WS version-number)
  1.5333 -     version-number = nzDIGIT *5DIGIT
  1.5334 -
  1.5335 -9.6.  LIST Variants
  1.5336 -
  1.5337 -   This section defines more specifically the keywords for the LIST
  1.5338 -   command and the syntax of the corresponding response contents.
  1.5339 -
  1.5340 -     ; active
  1.5341 -     list-arguments =/ "ACTIVE" [WS wildmat]
  1.5342 -     list-content =/ list-active-content
  1.5343 -     list-active-content = active-groups-list
  1.5344 -
  1.5345 -
  1.5346 -     ; active.times
  1.5347 -     list-arguments =/ "ACTIVE.TIMES" [WS wildmat]
  1.5348 -     list-content =/ list-active-times-content
  1.5349 -     list-active-times-content =
  1.5350 -           *(newsgroup-name SPA 1*DIGIT SPA newsgroup-creator CRLF)
  1.5351 -     newsgroup-creator = U-TEXT
  1.5352 -
  1.5353 -
  1.5354 -     ; distrib.pats
  1.5355 -     list-arguments =/ "DISTRIB.PATS"
  1.5356 -     list-content =/ list-distrib-pats-content
  1.5357 -     list-distrib-pats-content =
  1.5358 -           *(1*DIGIT ":" wildmat ":" distribution CRLF)
  1.5359 -     distribution = token
  1.5360 -
  1.5361 -
  1.5362 -     ; headers
  1.5363 -     list-arguments =/ "HEADERS" [WS ("MSGID" / "RANGE")]
  1.5364 -     list-content =/ list-headers-content
  1.5365 -     list-headers-content = *(header-meta-name CRLF) /
  1.5366 -           *((metadata-name / ":") CRLF)
  1.5367 -
  1.5368 -
  1.5369 -     ; newsgroups
  1.5370 -     list-arguments =/ "NEWSGROUPS" [WS wildmat]
  1.5371 -     list-content =/ list-newsgroups-content
  1.5372 -     list-newsgroups-content =
  1.5373 -
  1.5374 -
  1.5375 -
  1.5376 -Feather                     Standards Track                    [Page 96]
  1.5377 -
  1.5378 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.5379 -
  1.5380 -
  1.5381 -           *(newsgroup-name WS newsgroup-description CRLF)
  1.5382 -     newsgroup-description = S-TEXT
  1.5383 -
  1.5384 -
  1.5385 -     ; overview.fmt
  1.5386 -     list-arguments =/ "OVERVIEW.FMT"
  1.5387 -     list-content =/ list-overview-fmt-content
  1.5388 -     list-overview-fmt-content = "Subject:" CRLF
  1.5389 -           "From:" CRLF
  1.5390 -           "Date:" CRLF
  1.5391 -           "Message-ID:" CRLF
  1.5392 -           "References:" CRLF
  1.5393 -           ( ":bytes" CRLF ":lines" / "Bytes:" CRLF "Lines:") CRLF
  1.5394 -           *((header-name ":full" / metadata-name) CRLF)
  1.5395 -
  1.5396 -9.7.  Articles
  1.5397 -
  1.5398 -   This syntax defines the non-terminal <article>, which represents the
  1.5399 -   format of an article as described in Section 3.6.
  1.5400 -
  1.5401 -     article = 1*header CRLF body
  1.5402 -     header = header-name ":" [CRLF] SP header-content CRLF
  1.5403 -     header-content = *(S-CHAR / [CRLF] WS)
  1.5404 -     body = *(*B-CHAR CRLF)
  1.5405 -
  1.5406 -9.8.  General Non-terminals
  1.5407 -
  1.5408 -   These non-terminals are used at various places in the syntax and are
  1.5409 -   collected here for convenience.  A few of these non-terminals are not
  1.5410 -   used in this specification but are provided for the consistency and
  1.5411 -   convenience of extension authors.
  1.5412 -
  1.5413 -     multi-line-data-block = content-lines termination
  1.5414 -     content-lines = *([content-text] CRLF)
  1.5415 -     content-text = (".." / B-NONDOT) *B-CHAR
  1.5416 -     termination = "." CRLF
  1.5417 -
  1.5418 -     article-number = 1*16DIGIT
  1.5419 -     header-name = 1*A-NOTCOLON
  1.5420 -     keyword = ALPHA 2*(ALPHA / DIGIT / "." / "-")
  1.5421 -     message-id = "<" 1*248A-NOTGT ">"
  1.5422 -     newsgroup-name = 1*wildmat-exact
  1.5423 -     token = 1*P-CHAR
  1.5424 -
  1.5425 -     wildmat = wildmat-pattern *("," ["!"] wildmat-pattern)
  1.5426 -     wildmat-pattern = 1*wildmat-item
  1.5427 -     wildmat-item = wildmat-exact / wildmat-wild
  1.5428 -     wildmat-exact = %x22-29 / %x2B / %x2D-3E / %x40-5A / %x5E-7E /
  1.5429 -
  1.5430 -
  1.5431 -
  1.5432 -Feather                     Standards Track                    [Page 97]
  1.5433 -
  1.5434 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.5435 -
  1.5436 -
  1.5437 -          UTF8-non-ascii  ; exclude ! * , ? [ \ ]
  1.5438 -     wildmat-wild = "*" / "?"
  1.5439 -
  1.5440 -     base64 = *(4base64-char) [base64-terminal]
  1.5441 -     base64-char = UPPER / LOWER / DIGIT / "+" / "/"
  1.5442 -     base64-terminal = 2base64-char "==" / 3base64-char "="
  1.5443 -
  1.5444 -     ; Assorted special character sets
  1.5445 -     ;   A- means based on US-ASCII, excluding controls and SP
  1.5446 -     ;   P- means based on UTF-8, excluding controls and SP
  1.5447 -     ;   U- means based on UTF-8, excluding NUL CR and LF
  1.5448 -     ;   B- means based on bytes, excluding NUL CR and LF
  1.5449 -     A-CHAR     = %x21-7E
  1.5450 -     A-NOTCOLON = %x21-39 / %x3B-7E  ; exclude ":"
  1.5451 -     A-NOTGT    = %x21-3D / %x3F-7E  ; exclude ">"
  1.5452 -     P-CHAR     = A-CHAR / UTF8-non-ascii
  1.5453 -     U-CHAR     = CTRL / TAB / SP / A-CHAR / UTF8-non-ascii
  1.5454 -     U-NONTAB   = CTRL /       SP / A-CHAR / UTF8-non-ascii
  1.5455 -     U-TEXT     = P-CHAR *U-CHAR
  1.5456 -     B-CHAR     = CTRL / TAB / SP / %x21-FF
  1.5457 -     B-NONDOT   = CTRL / TAB / SP / %x21-2D / %x2F-FF  ; exclude "."
  1.5458 -
  1.5459 -     ALPHA = UPPER / LOWER   ; use only when case-insensitive
  1.5460 -     CR = %x0D
  1.5461 -     CRLF = CR LF
  1.5462 -     CTRL = %x01-08 / %x0B-0C / %x0E-1F
  1.5463 -     DIGIT = %x30-39
  1.5464 -     nzDIGIT = %x31-39
  1.5465 -     EOL = *(SP / TAB) CRLF
  1.5466 -     LF = %x0A
  1.5467 -     LOWER = %x61-7A
  1.5468 -     SP = %x20
  1.5469 -     SPA = 1*SP
  1.5470 -     TAB = %x09
  1.5471 -     UPPER = %x41-5A
  1.5472 -     UTF8-non-ascii = UTF8-2 / UTF8-3 / UTF8-4
  1.5473 -     UTF8-2    = %xC2-DF UTF8-tail
  1.5474 -     UTF8-3    = %xE0 %xA0-BF UTF8-tail / %xE1-EC 2UTF8-tail /
  1.5475 -                 %xED %x80-9F UTF8-tail / %xEE-EF 2UTF8-tail
  1.5476 -     UTF8-4    = %xF0 %x90-BF 2UTF8-tail / %xF1-F3 3UTF8-tail /
  1.5477 -                 %xF4 %x80-8F 2UTF8-tail
  1.5478 -     UTF8-tail = %x80-BF
  1.5479 -     WS = 1*(SP / TAB)
  1.5480 -
  1.5481 -   The following non-terminals require special consideration.  They
  1.5482 -   represent situations where material SHOULD be restricted to UTF-8,
  1.5483 -   but implementations MUST be able to cope with other character
  1.5484 -   encodings.  Therefore, there are two sets of definitions for them.
  1.5485 -
  1.5486 -
  1.5487 -
  1.5488 -Feather                     Standards Track                    [Page 98]
  1.5489 -
  1.5490 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.5491 -
  1.5492 -
  1.5493 -   Implementations MUST accept any content that meets this syntax:
  1.5494 -
  1.5495 -     S-CHAR   = %x21-FF
  1.5496 -     S-NONTAB = CTRL / SP / S-CHAR
  1.5497 -     S-TEXT   = (CTRL / S-CHAR) *B-CHAR
  1.5498 -
  1.5499 -   and MAY pass such content on unaltered.
  1.5500 -
  1.5501 -   When generating new content or re-encoding existing content,
  1.5502 -   implementations SHOULD conform to this syntax:
  1.5503 -
  1.5504 -     S-CHAR   = P-CHAR
  1.5505 -     S-NONTAB = U-NONTAB
  1.5506 -     S-TEXT   = U-TEXT
  1.5507 -
  1.5508 -9.9.  Extensions and Validation
  1.5509 -
  1.5510 -   The specification of a registered extension MUST include formal
  1.5511 -   syntax that defines additional forms for the following non-terminals:
  1.5512 -
  1.5513 -   command
  1.5514 -      for each new command other than a variant of the LIST command -
  1.5515 -      the syntax of each command MUST be compatible with the definition
  1.5516 -      of <X-command>;
  1.5517 -
  1.5518 -   command-datastream
  1.5519 -      for each new command that immediately streams data;
  1.5520 -
  1.5521 -   command-continuation
  1.5522 -      for each new command that sends further material after the initial
  1.5523 -      command line - the syntax of each continuation MUST be exactly
  1.5524 -      what is sent to the server, including any escape mechanisms such
  1.5525 -      as "dot-stuffing";
  1.5526 -
  1.5527 -   initial-response-content
  1.5528 -      for each new response code that has arguments - the syntax of each
  1.5529 -      response MUST be compatible with the definition of <X-initial-
  1.5530 -      response-content>;
  1.5531 -
  1.5532 -   multi-line-response-content
  1.5533 -      for each new response code that has a multi-line response - the
  1.5534 -      syntax MUST show the response after the lines containing the
  1.5535 -      response code and the terminating octet have been removed and any
  1.5536 -      "dot-stuffing" undone;
  1.5537 -
  1.5538 -   capability-entry
  1.5539 -      for each new capability label - the syntax of each entry MUST be
  1.5540 -      compatible with the definition of <X-capability-entry>;
  1.5541 -
  1.5542 -
  1.5543 -
  1.5544 -Feather                     Standards Track                    [Page 99]
  1.5545 -
  1.5546 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.5547 -
  1.5548 -
  1.5549 -   list-arguments
  1.5550 -      for each new variant of the LIST command - the syntax of each
  1.5551 -      entry MUST be compatible with the definition of <X-command>;
  1.5552 -
  1.5553 -   list-content
  1.5554 -      for each new variant of the LIST command - the syntax MUST show
  1.5555 -      the response after the lines containing the 215 response code and
  1.5556 -      the terminating octet have been removed and any "dot-stuffing"
  1.5557 -      undone.
  1.5558 -
  1.5559 -   The =/ notation of ABNF [RFC4234] and the naming conventions
  1.5560 -   described in Section 9.1 SHOULD be used for this.
  1.5561 -
  1.5562 -   When the syntax in this specification, or syntax based on it, is
  1.5563 -   validated, it should be noted that:
  1.5564 -
  1.5565 -   o  the non-terminals <command-line>, <command-datastream>,
  1.5566 -      <command-continuation>, <response>, and
  1.5567 -      <multi-line-response-content> describe basic concepts of the
  1.5568 -      protocol and are not referred to by any other rule;
  1.5569 -
  1.5570 -   o  the non-terminal <base64> is provided for the convenience of
  1.5571 -      extension authors and is not referred to by any rule in this
  1.5572 -      specification;
  1.5573 -
  1.5574 -   o  for the reasons given above, the non-terminals <S-CHAR>,
  1.5575 -      <S-NONTAB>, and <S-TEXT> each have two definitions; and
  1.5576 -
  1.5577 -   o  the non-terminal <UNDEFINED> is deliberately not defined.
  1.5578 -
  1.5579 -10.  Internationalisation Considerations
  1.5580 -
  1.5581 -10.1.  Introduction and Historical Situation
  1.5582 -
  1.5583 -   RFC 977 [RFC977] was written at a time when internationalisation was
  1.5584 -   not seen as a significant issue.  As such, it was written on the
  1.5585 -   assumption that all communication would be in ASCII and use only a
  1.5586 -   7-bit transport layer, although in practice just about all known
  1.5587 -   implementations are 8-bit clean.
  1.5588 -
  1.5589 -   Since then, Usenet and NNTP have spread throughout the world.  In the
  1.5590 -   absence of standards for handling the issues of language and
  1.5591 -   character sets, countries, newsgroup hierarchies, and individuals
  1.5592 -   have found a variety of solutions that work for them but that are not
  1.5593 -   necessarily appropriate elsewhere.  For example, some have adopted a
  1.5594 -   default 8-bit character set appropriate to their needs (such as
  1.5595 -   ISO/IEC 8859-1 in Western Europe or KOI-8 in Russia), others have
  1.5596 -   used ASCII (either US-ASCII or national variants) in headers but
  1.5597 -
  1.5598 -
  1.5599 -
  1.5600 -Feather                     Standards Track                   [Page 100]
  1.5601 -
  1.5602 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.5603 -
  1.5604 -
  1.5605 -   local 16-bit character sets in article bodies, and still others have
  1.5606 -   gone for a combination of MIME [RFC2045] and UTF-8.  With the
  1.5607 -   increased use of MIME in email, it is becoming more common to find
  1.5608 -   NNTP articles containing MIME headers that identify the character set
  1.5609 -   of the body, but this is far from universal.
  1.5610 -
  1.5611 -   The resulting confusion does not help interoperability.
  1.5612 -
  1.5613 -   One point that has been generally accepted is that articles can
  1.5614 -   contain octets with the top bit set, and NNTP is only expected to
  1.5615 -   operate on 8-bit clean transport paths.
  1.5616 -
  1.5617 -10.2.  This Specification
  1.5618 -
  1.5619 -   Part of the role of this present specification is to eliminate this
  1.5620 -   confusion and promote interoperability as far as possible.  At the
  1.5621 -   same time, it is necessary to accept the existence of the present
  1.5622 -   situation and not break existing implementations and arrangements
  1.5623 -   gratuitously, even if they are less than optimal.  Therefore, the
  1.5624 -   current practice described above has been taken into consideration in
  1.5625 -   producing this specification.
  1.5626 -
  1.5627 -   This specification extends NNTP from US-ASCII [ANSI1986] to UTF-8
  1.5628 -   [RFC3629].  Except in the two areas discussed below, UTF-8 (which is
  1.5629 -   a superset of US-ASCII) is mandatory, and implementations MUST NOT
  1.5630 -   use any other encoding.
  1.5631 -
  1.5632 -   Firstly, the use of MIME for article headers and bodies is strongly
  1.5633 -   recommended.  However, given widely divergent existing practices, an
  1.5634 -   attempt to require a particular encoding and tagging standard would
  1.5635 -   be premature at this time.  Accordingly, this specification allows
  1.5636 -   the use of arbitrary 8-bit data in articles subject to the following
  1.5637 -   requirements and recommendations.
  1.5638 -
  1.5639 -   o  The names of headers (e.g., "From" or "Subject") MUST be in
  1.5640 -      US-ASCII.
  1.5641 -
  1.5642 -   o  Header values SHOULD use US-ASCII or an encoding based on it, such
  1.5643 -      as RFC 2047 [RFC2047], until such time as another approach has
  1.5644 -      been standardised.  At present, 8-bit encodings (including UTF-8)
  1.5645 -      SHOULD NOT be used because they are likely to cause
  1.5646 -      interoperability problems.
  1.5647 -
  1.5648 -   o  The character set of article bodies SHOULD be indicated in the
  1.5649 -      article headers, and this SHOULD be done in accordance with MIME.
  1.5650 -
  1.5651 -   o  Where an article is obtained from an external source, an
  1.5652 -      implementation MAY pass it on and derive data from it (such as the
  1.5653 -
  1.5654 -
  1.5655 -
  1.5656 -Feather                     Standards Track                   [Page 101]
  1.5657 -
  1.5658 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.5659 -
  1.5660 -
  1.5661 -      response to the HDR command), even though the article or the data
  1.5662 -      does not meet the above requirements.  Implementations MUST
  1.5663 -      transfer such articles and data correctly and unchanged; they MUST
  1.5664 -      NOT attempt to convert or re-encode the article or derived data.
  1.5665 -      (Nevertheless, a client or server MAY elect not to post or forward
  1.5666 -      the article if, after further examination of the article, it deems
  1.5667 -      it inappropriate to do so.)
  1.5668 -
  1.5669 -   This requirement affects the ARTICLE (Section 6.2.1), BODY
  1.5670 -   (Section 6.2.3), HDR (Section 8.5), HEAD (Section 6.2.2), IHAVE
  1.5671 -   (Section 6.3.2), OVER (Section 8.3), and POST (Section 6.3.1)
  1.5672 -   commands.
  1.5673 -
  1.5674 -   Secondly, the following requirements are placed on the newsgroups
  1.5675 -   list returned by the LIST NEWSGROUPS command (Section 7.6.6):
  1.5676 -
  1.5677 -   o  Although this specification allows UTF-8 for newsgroup names, they
  1.5678 -      SHOULD be restricted to US-ASCII until a successor to RFC 1036
  1.5679 -      [RFC1036] standardises another approach. 8-bit encodings SHOULD
  1.5680 -      NOT be used because they are likely to cause interoperability
  1.5681 -      problems.
  1.5682 -
  1.5683 -   o  The newsgroup description SHOULD be in US-ASCII or UTF-8 unless
  1.5684 -      and until a successor to RFC 1036 standardises other encoding
  1.5685 -      arrangements.  8-bit encodings other than UTF-8 SHOULD NOT be used
  1.5686 -      because they are likely to cause interoperability problems.
  1.5687 -
  1.5688 -   o  Implementations that obtain this data from an external source MUST
  1.5689 -      handle it correctly even if it does not meet the above
  1.5690 -      requirements.  Implementations (in particular, clients) MUST
  1.5691 -      handle such data correctly.
  1.5692 -
  1.5693 -10.3.  Outstanding Issues
  1.5694 -
  1.5695 -   While the primary use of NNTP is for transmitting articles that
  1.5696 -   conform to RFC 1036 (Netnews articles), it is also used for other
  1.5697 -   formats (see Appendix A).  It is therefore most appropriate that
  1.5698 -   internationalisation issues related to article formats be addressed
  1.5699 -   in the relevant specifications.  For Netnews articles, this is any
  1.5700 -   successor to RFC 1036.  For email messages, it is RFC 2822 [RFC2822].
  1.5701 -
  1.5702 -   Of course, any article transmitted via NNTP needs to conform to this
  1.5703 -   specification as well.
  1.5704 -
  1.5705 -   Restricting newsgroup names to UTF-8 is not a complete solution.  In
  1.5706 -   particular, when new newsgroup names are created or a user is asked
  1.5707 -   to enter a newsgroup name, some scheme of canonicalisation will need
  1.5708 -   to take place.  This specification does not attempt to define that
  1.5709 -
  1.5710 -
  1.5711 -
  1.5712 -Feather                     Standards Track                   [Page 102]
  1.5713 -
  1.5714 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.5715 -
  1.5716 -
  1.5717 -   canonicalization; further work is needed in this area, in conjunction
  1.5718 -   with the article format specifications.  Until such specifications
  1.5719 -   are published, implementations SHOULD match newsgroup names octet by
  1.5720 -   octet.  It is anticipated that any approved scheme will be applied
  1.5721 -   "at the edges", and therefore octet-by-octet comparison will continue
  1.5722 -   to apply to most, if not all, uses of newsgroup names in NNTP.
  1.5723 -
  1.5724 -   In the meantime, any implementation experimenting with UTF-8
  1.5725 -   newsgroup names is strongly cautioned that a future specification may
  1.5726 -   require that those names be canonicalized when used with NNTP in a
  1.5727 -   way that is not compatible with their experiments.
  1.5728 -
  1.5729 -   Since the primary use of NNTP is with Netnews, and since newsgroup
  1.5730 -   descriptions are normally distributed through specially formatted
  1.5731 -   articles, it is recommended that the internationalisation issues
  1.5732 -   related to them be addressed in any successor to RFC 1036.
  1.5733 -
  1.5734 -11.  IANA Considerations
  1.5735 -
  1.5736 -   This specification requires IANA to keep a registry of capability
  1.5737 -   labels.  The initial contents of this registry are specified in
  1.5738 -   Section 3.3.4.  As described in Section 3.3.3, labels beginning with
  1.5739 -   X are reserved for private use, while all other names are expected to
  1.5740 -   be associated with a specification in an RFC on the standards track
  1.5741 -   or defining an IESG-approved experimental protocol.
  1.5742 -
  1.5743 -   Different entries in the registry MUST use different capability
  1.5744 -   labels.
  1.5745 -
  1.5746 -   Different entries in the registry MUST NOT use the same command name.
  1.5747 -   For this purpose, variants distinguished by a second or subsequent
  1.5748 -   keyword (e.g., "LIST HEADERS" and "LIST OVERVIEW.FMT") count as
  1.5749 -   different commands.  If there is a need for two extensions to use the
  1.5750 -   same command, a single harmonised specification MUST be registered.
  1.5751 -
  1.5752 -12.  Security Considerations
  1.5753 -
  1.5754 -   This section is meant to inform application developers, information
  1.5755 -   providers, and users of the security limitations in NNTP as described
  1.5756 -   by this document.  The discussion does not include definitive
  1.5757 -   solutions to the problems revealed, though it does make some
  1.5758 -   suggestions for reducing security risks.
  1.5759 -
  1.5760 -
  1.5761 -
  1.5762 -
  1.5763 -
  1.5764 -
  1.5765 -
  1.5766 -
  1.5767 -
  1.5768 -Feather                     Standards Track                   [Page 103]
  1.5769 -
  1.5770 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.5771 -
  1.5772 -
  1.5773 -12.1.  Personal and Proprietary Information
  1.5774 -
  1.5775 -   NNTP, because it was created to distribute network news articles,
  1.5776 -   will forward whatever information is stored in those articles.
  1.5777 -   Specification of that information is outside this scope of this
  1.5778 -   document, but it is likely that some personal and/or proprietary
  1.5779 -   information is available in some of those articles.  It is very
  1.5780 -   important that designers and implementers provide informative
  1.5781 -   warnings to users so that personal and/or proprietary information in
  1.5782 -   material that is added automatically to articles (e.g., in headers)
  1.5783 -   is not disclosed inadvertently.  Additionally, effective and easily
  1.5784 -   understood mechanisms to manage the distribution of news articles
  1.5785 -   SHOULD be provided to NNTP Server administrators, so that they are
  1.5786 -   able to report with confidence the likely spread of any particular
  1.5787 -   set of news articles.
  1.5788 -
  1.5789 -12.2.  Abuse of Server Log Information
  1.5790 -
  1.5791 -   A server is in the position to save session data about a user's
  1.5792 -   requests that might identify their reading patterns or subjects of
  1.5793 -   interest.  This information is clearly confidential in nature, and
  1.5794 -   its handling can be constrained by law in certain countries.  People
  1.5795 -   using this protocol to provide data are responsible for ensuring that
  1.5796 -   such material is not distributed without the permission of any
  1.5797 -   individuals that are identifiable by the published results.
  1.5798 -
  1.5799 -12.3.  Weak Authentication and Access Control
  1.5800 -
  1.5801 -   There is no user-based or token-based authentication in the basic
  1.5802 -   NNTP specification.  Access is normally controlled by server
  1.5803 -   configuration files.  Those files specify access by using domain
  1.5804 -   names or IP addresses.  However, this specification does permit the
  1.5805 -   creation of extensions to NNTP for such purposes; one such extension
  1.5806 -   is [NNTP-AUTH].  While including such mechanisms is optional, doing
  1.5807 -   so is strongly encouraged.
  1.5808 -
  1.5809 -   Other mechanisms are also available.  For example, a proxy server
  1.5810 -   could be put in place that requires authentication before connecting
  1.5811 -   via the proxy to the NNTP server.
  1.5812 -
  1.5813 -12.4.  DNS Spoofing
  1.5814 -
  1.5815 -   Many existing NNTP implementations authorize incoming connections by
  1.5816 -   checking the IP address of that connection against the IP addresses
  1.5817 -   obtained via DNS lookups of lists of domain names given in local
  1.5818 -   configuration files.  Servers that use this type of authentication
  1.5819 -   and clients that find a server by doing a DNS lookup of the server
  1.5820 -   name rely very heavily on the Domain Name Service, and are thus
  1.5821 -
  1.5822 -
  1.5823 -
  1.5824 -Feather                     Standards Track                   [Page 104]
  1.5825 -
  1.5826 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.5827 -
  1.5828 -
  1.5829 -   generally prone to security attacks based on the deliberate
  1.5830 -   misassociation of IP addresses and DNS names.  Clients and servers
  1.5831 -   need to be cautious in assuming the continuing validity of an IP
  1.5832 -   number/DNS name association.
  1.5833 -
  1.5834 -   In particular, NNTP clients and servers SHOULD rely on their name
  1.5835 -   resolver for confirmation of an IP number/DNS name association,
  1.5836 -   rather than cache the result of previous host name lookups.  Many
  1.5837 -   platforms already can cache host name lookups locally when
  1.5838 -   appropriate, and they SHOULD be configured to do so.  It is proper
  1.5839 -   for these lookups to be cached, however, only when the TTL (Time To
  1.5840 -   Live) information reported by the name server makes it likely that
  1.5841 -   the cached information will remain useful.
  1.5842 -
  1.5843 -   If NNTP clients or servers cache the results of host name lookups in
  1.5844 -   order to achieve a performance improvement, they MUST observe the TTL
  1.5845 -   information reported by DNS.  If NNTP clients or servers do not
  1.5846 -   observe this rule, they could be spoofed when a previously accessed
  1.5847 -   server's IP address changes.  As network renumbering is expected to
  1.5848 -   become increasingly common, the possibility of this form of attack
  1.5849 -   will increase.  Observing this requirement thus reduces this
  1.5850 -   potential security vulnerability.
  1.5851 -
  1.5852 -   This requirement also improves the load-balancing behaviour of
  1.5853 -   clients for replicated servers using the same DNS name and reduces
  1.5854 -   the likelihood of a user's experiencing failure in accessing sites
  1.5855 -   that use that strategy.
  1.5856 -
  1.5857 -12.5.  UTF-8 Issues
  1.5858 -
  1.5859 -   UTF-8 [RFC3629] permits only certain sequences of octets and
  1.5860 -   designates others as either malformed or "illegal".  The Unicode
  1.5861 -   standard identifies a number of security issues related to illegal
  1.5862 -   sequences and forbids their generation by conforming implementations.
  1.5863 -
  1.5864 -   Implementations of this specification MUST NOT generate malformed or
  1.5865 -   illegal sequences and SHOULD detect them and take some appropriate
  1.5866 -   action.  This could include the following:
  1.5867 -
  1.5868 -   o  Generating a 501 response code.
  1.5869 -
  1.5870 -   o  Replacing such sequences by the sequence %xEF.BF.BD, which encodes
  1.5871 -      the "replacement character" U+FFFD.
  1.5872 -
  1.5873 -   o  Closing the connection.
  1.5874 -
  1.5875 -   o  Replacing such sequences by a "guessed" valid sequence (based on
  1.5876 -      properties of the UTF-8 encoding).
  1.5877 -
  1.5878 -
  1.5879 -
  1.5880 -Feather                     Standards Track                   [Page 105]
  1.5881 -
  1.5882 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.5883 -
  1.5884 -
  1.5885 -   In the last case, the implementation MUST ensure that any replacement
  1.5886 -   cannot be used to bypass validity or security checks.  For example,
  1.5887 -   the illegal sequence %xC0.A0 is an over-long encoding for space
  1.5888 -   (%x20).  If it is replaced by the correct encoding in a command line,
  1.5889 -   this needs to happen before the command line is parsed into
  1.5890 -   individual arguments.  If the replacement came after parsing, it
  1.5891 -   would be possible to generate an argument with an embedded space,
  1.5892 -   which is forbidden.  Use of the "replacement character" does not have
  1.5893 -   this problem, since it is permitted wherever non-US-ASCII characters
  1.5894 -   are.  Implementations SHOULD use one of the first two solutions where
  1.5895 -   the general structure of the NNTP stream remains intact and SHOULD
  1.5896 -   close the connection if it is no longer possible to parse it
  1.5897 -   sensibly.
  1.5898 -
  1.5899 -12.6.  Caching of Capability Lists
  1.5900 -
  1.5901 -   The CAPABILITIES command provides a capability list, which is
  1.5902 -   information about the current capabilities of the server.  Whenever
  1.5903 -   there is a relevant change to the server state, the results of this
  1.5904 -   command are required to change accordingly.
  1.5905 -
  1.5906 -   In most situations, the capabilities list in a given server state
  1.5907 -   will not change from session to session; for example, a given
  1.5908 -   extension will be installed permanently on a server.  Some clients
  1.5909 -   may therefore wish to remember which extensions a server supports to
  1.5910 -   avoid the delay of an additional command and response, particularly
  1.5911 -   if they open multiple connections in the same session.
  1.5912 -
  1.5913 -   However, information about extensions related to security and privacy
  1.5914 -   MUST NOT be cached, since this could allow a variety of attacks.
  1.5915 -
  1.5916 -   For example, consider a server that permits the use of cleartext
  1.5917 -   passwords on links that are encrypted but not otherwise:
  1.5918 -
  1.5919 -      [Initial connection set-up completed.]
  1.5920 -      [S] 200 NNTP Service Ready, posting permitted
  1.5921 -      [C] CAPABILITIES
  1.5922 -      [S] 101 Capability list:
  1.5923 -      [S] VERSION 2
  1.5924 -      [S] READER
  1.5925 -      [S] NEWNEWS
  1.5926 -      [S] POST
  1.5927 -      [S] XENCRYPT
  1.5928 -      [S] LIST ACTIVE NEWSGROUPS
  1.5929 -      [S] .
  1.5930 -      [C] XENCRYPT
  1.5931 -      [Client and server negotiate encryption on the link]
  1.5932 -      [S] 283 Encrypted link established
  1.5933 -
  1.5934 -
  1.5935 -
  1.5936 -Feather                     Standards Track                   [Page 106]
  1.5937 -
  1.5938 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.5939 -
  1.5940 -
  1.5941 -      [C] CAPABILITIES
  1.5942 -      [S] 101 Capability list:
  1.5943 -      [S] VERSION 2
  1.5944 -      [S] READER
  1.5945 -      [S] NEWNEWS
  1.5946 -      [S] POST
  1.5947 -      [S] XSECRET
  1.5948 -      [S] LIST ACTIVE NEWSGROUPS
  1.5949 -      [S] .
  1.5950 -      [C] XSECRET fred flintstone
  1.5951 -      [S] 290 Password for fred accepted
  1.5952 -
  1.5953 -   If the client caches the last capabilities list, then on the next
  1.5954 -   session it will attempt to use XSECRET on an unencrypted link:
  1.5955 -
  1.5956 -      [Initial connection set-up completed.]
  1.5957 -      [S] 200 NNTP Service Ready, posting permitted
  1.5958 -      [C] XSECRET fred flintstone
  1.5959 -      [S] 483 Only permitted on secure links
  1.5960 -
  1.5961 -   This exposes the password to any eavesdropper.  While the primary
  1.5962 -   cause of this is passing a secret without first checking the security
  1.5963 -   of the link, caching of capability lists can increase the risk.
  1.5964 -
  1.5965 -   Any security extension should include requirements to check the
  1.5966 -   security state of the link in a manner appropriate to that extension.
  1.5967 -
  1.5968 -   Caching should normally only be considered for anonymous clients that
  1.5969 -   do not use any security or privacy extensions and for which the time
  1.5970 -   required for an additional command and response is a noticeable
  1.5971 -   issue.
  1.5972 -
  1.5973 -13.  Acknowledgements
  1.5974 -
  1.5975 -   This document is the result of much effort by the present and past
  1.5976 -   members of the NNTP Working Group, chaired by Russ Allbery and Ned
  1.5977 -   Freed.  It could not have been produced without them.
  1.5978 -
  1.5979 -   The author acknowledges the original authors of NNTP as documented in
  1.5980 -   RFC 977 [RFC977]: Brian Kantor and Phil Lapsey.
  1.5981 -
  1.5982 -   The author gratefully acknowledges the following:
  1.5983 -
  1.5984 -   o  The work of the NNTP committee chaired by Eliot Lear.  The
  1.5985 -      organization of this document was influenced by the last available
  1.5986 -      version from this working group.  A special thanks to Eliot for
  1.5987 -      generously providing the original machine-readable sources for
  1.5988 -      that document.
  1.5989 -
  1.5990 -
  1.5991 -
  1.5992 -Feather                     Standards Track                   [Page 107]
  1.5993 -
  1.5994 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.5995 -
  1.5996 -
  1.5997 -   o  The work of the DRUMS working group, specifically RFC 1869
  1.5998 -      [RFC1869], that drove the original thinking that led to the
  1.5999 -      CAPABILITIES command and the extensions mechanism detailed in this
  1.6000 -      document.
  1.6001 -
  1.6002 -   o  The authors of RFC 2616 [RFC2616] for providing specific and
  1.6003 -      relevant examples of security issues that should be considered for
  1.6004 -      HTTP.  Since many of the same considerations exist for NNTP, those
  1.6005 -      examples that are relevant have been included here with some minor
  1.6006 -      rewrites.
  1.6007 -
  1.6008 -   o  The comments and additional information provided by the following
  1.6009 -      individuals in preparing one or more of the progenitors of this
  1.6010 -      document:
  1.6011 -
  1.6012 -         Russ Allbery <rra@stanford.edu>
  1.6013 -         Wayne Davison <davison@armory.com>
  1.6014 -         Chris Lewis <clewis@bnr.ca>
  1.6015 -         Tom Limoncelli <tal@mars.superlink.net>
  1.6016 -         Eric Schnoebelen <eric@egsner.cirr.com>
  1.6017 -         Rich Salz <rsalz@osf.org>
  1.6018 -
  1.6019 -   This work was motivated by the work of various news reader authors
  1.6020 -   and news server authors, including those listed below:
  1.6021 -
  1.6022 -   Rick Adams
  1.6023 -      Original author of the NNTP extensions to the RN news reader and
  1.6024 -      last maintainer of Bnews.
  1.6025 -
  1.6026 -   Stan Barber
  1.6027 -      Original author of the NNTP extensions to the news readers that
  1.6028 -      are part of Bnews.
  1.6029 -
  1.6030 -   Geoff Collyer
  1.6031 -      Original author of the OVERVIEW database proposal and one of the
  1.6032 -      original authors of CNEWS.
  1.6033 -
  1.6034 -   Dan Curry
  1.6035 -      Original author of the xvnews news reader.
  1.6036 -
  1.6037 -   Wayne Davison
  1.6038 -      Author of the first threading extensions to the RN news reader
  1.6039 -      (commonly called TRN).
  1.6040 -
  1.6041 -   Geoff Huston
  1.6042 -      Original author of ANU NEWS.
  1.6043 -
  1.6044 -
  1.6045 -
  1.6046 -
  1.6047 -
  1.6048 -Feather                     Standards Track                   [Page 108]
  1.6049 -
  1.6050 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.6051 -
  1.6052 -
  1.6053 -   Phil Lapsey
  1.6054 -      Original author of the UNIX reference implementation for NNTP.
  1.6055 -
  1.6056 -   Iain Lea
  1.6057 -      Original maintainer of the TIN news reader.
  1.6058 -
  1.6059 -   Chris Lewis
  1.6060 -      First known implementer of the AUTHINFO GENERIC extension.
  1.6061 -
  1.6062 -   Rich Salz
  1.6063 -      Original author of INN.
  1.6064 -
  1.6065 -   Henry Spencer
  1.6066 -      One of the original authors of CNEWS.
  1.6067 -
  1.6068 -   Kim Storm
  1.6069 -      Original author of the NN news reader.
  1.6070 -
  1.6071 -   Other people who contributed to this document include:
  1.6072 -
  1.6073 -      Matthias Andree
  1.6074 -      Greg Andruk
  1.6075 -      Daniel Barclay
  1.6076 -      Maurizio Codogno
  1.6077 -      Mark Crispin
  1.6078 -      Andrew Gierth
  1.6079 -      Juergen Helbing
  1.6080 -      Scott Hollenbeck
  1.6081 -      Urs Janssen
  1.6082 -      Charles Lindsey
  1.6083 -      Ade Lovett
  1.6084 -      David Magda
  1.6085 -      Ken Murchison
  1.6086 -      Francois Petillon
  1.6087 -      Peter Robinson
  1.6088 -      Rob Siemborski
  1.6089 -      Howard Swinehart
  1.6090 -      Ruud van Tol
  1.6091 -      Jeffrey Vinocur
  1.6092 -      Erik Warmelink
  1.6093 -
  1.6094 -   The author thanks them all and apologises to anyone omitted.
  1.6095 -
  1.6096 -   Finally, the present author gratefully acknowledges the vast amount
  1.6097 -   of work put into previous versions by the previous author:
  1.6098 -
  1.6099 -      Stan Barber <sob@academ.com>
  1.6100 -
  1.6101 -
  1.6102 -
  1.6103 -
  1.6104 -Feather                     Standards Track                   [Page 109]
  1.6105 -
  1.6106 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.6107 -
  1.6108 -
  1.6109 -14.  References
  1.6110 -
  1.6111 -14.1.  Normative References
  1.6112 -
  1.6113 -   [ANSI1986]    American National Standards Institute, "Coded Character
  1.6114 -                 Set - 7-bit American Standard Code for Information
  1.6115 -                 Interchange", ANSI X3.4, 1986.
  1.6116 -
  1.6117 -   [RFC977]      Kantor, B. and P. Lapsley, "Network News Transfer
  1.6118 -                 Protocol", RFC 977, February 1986.
  1.6119 -
  1.6120 -   [RFC2045]     Freed, N. and N. Borenstein, "Multipurpose Internet
  1.6121 -                 Mail Extensions (MIME) Part One: Format of Internet
  1.6122 -                 Message Bodies", RFC 2045, November 1996.
  1.6123 -
  1.6124 -   [RFC2047]     Moore, K., "MIME (Multipurpose Internet Mail
  1.6125 -                 Extensions) Part Three: Message Header Extensions for
  1.6126 -                 Non-ASCII Text", RFC 2047, November 1996.
  1.6127 -
  1.6128 -   [RFC2119]     Bradner, S., "Key words for use in RFCs to Indicate
  1.6129 -                 Requirement Levels", BCP 14, RFC 2119, March 1997.
  1.6130 -
  1.6131 -   [RFC3629]     Yergeau, F., "UTF-8, a transformation format of ISO
  1.6132 -                 10646", STD 63, RFC 3629, November 2003.
  1.6133 -
  1.6134 -   [RFC4234]     Crocker, D., Ed. and P. Overell, "Augmented BNF for
  1.6135 -                 Syntax Specifications: ABNF", RFC 4234, October 2005.
  1.6136 -
  1.6137 -   [RFC4648]     Josefsson, S., "The Base16, Base32, and Base64 Data
  1.6138 -                 Encodings", RFC 4648, October 2006.
  1.6139 -
  1.6140 -   [TF.686-1]    International Telecommunications Union - Radio,
  1.6141 -                 "Glossary, ITU-R Recommendation TF.686-1",
  1.6142 -                 ITU-R Recommendation TF.686-1, October 1997.
  1.6143 -
  1.6144 -14.2.  Informative References
  1.6145 -
  1.6146 -   [NNTP-AUTH]   Vinocur, J., Murchison, K., and C. Newman, "Network
  1.6147 -                 News Transfer Protocol (NNTP) Extension for
  1.6148 -                 Authentication",
  1.6149 -                 RFC 4643, October 2006.
  1.6150 -
  1.6151 -   [NNTP-STREAM] Vinocur, J. and K. Murchison, "Network News Transfer
  1.6152 -                 Protocol (NNTP) Extension for Streaming Feeds",
  1.6153 -                 RFC 4644, October 2006.
  1.6154 -
  1.6155 -
  1.6156 -
  1.6157 -
  1.6158 -
  1.6159 -
  1.6160 -Feather                     Standards Track                   [Page 110]
  1.6161 -
  1.6162 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.6163 -
  1.6164 -
  1.6165 -   [NNTP-TLS]    Murchison, K., Vinocur, J., and C. Newman, "Using
  1.6166 -                 Transport Layer Security (TLS) with Network News
  1.6167 -                 Transfer Protocol (NNTP)", RFC 4642, October 2006.
  1.6168 -
  1.6169 -   [RFC1036]     Horton, M. and R. Adams, "Standard for interchange of
  1.6170 -                 USENET messages", RFC 1036, December 1987.
  1.6171 -
  1.6172 -   [RFC1305]     Mills, D., "Network Time Protocol (Version 3)
  1.6173 -                 Specification, Implementation and Analysis", RFC 1305,
  1.6174 -                 March 1992.
  1.6175 -
  1.6176 -   [RFC1869]     Klensin, J., Freed, N., Rose, M., Stefferud, E., and D.
  1.6177 -                 Crocker, "SMTP Service Extensions", STD 10, RFC 1869,
  1.6178 -                 November 1995.
  1.6179 -
  1.6180 -   [RFC2616]     Fielding,  R., Gettys, J., Mogul, J., Frystyk, H.,
  1.6181 -                 Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext
  1.6182 -                 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.
  1.6183 -
  1.6184 -   [RFC2629]     Rose, M., "Writing I-Ds and RFCs using XML", RFC 2629,
  1.6185 -                 June 1999.
  1.6186 -
  1.6187 -   [RFC2822]     Resnick, P., "Internet Message Format", RFC 2822, April
  1.6188 -                 2001.
  1.6189 -
  1.6190 -   [RFC2980]     Barber, S., "Common NNTP Extensions", RFC 2980, October
  1.6191 -                 2000.
  1.6192 -
  1.6193 -   [ROBE1995]    Robertson, R., "FAQ: Overview database / NOV General
  1.6194 -                 Information", January 1995.
  1.6195 -
  1.6196 -                 There is no definitive copy of this document known to
  1.6197 -                 the author.  It was previously posted as the Usenet
  1.6198 -                 article <news:nov-faq-1-930909720@agate.Berkeley.EDU>
  1.6199 -
  1.6200 -   [SALZ1992]    Salz, R., "Manual Page for wildmat(3) from the INN 1.4
  1.6201 -                 distribution, Revision 1.10", April 1992.
  1.6202 -
  1.6203 -                 There is no definitive copy of this document known to
  1.6204 -                 the author.
  1.6205 -
  1.6206 -
  1.6207 -
  1.6208 -
  1.6209 -
  1.6210 -
  1.6211 -
  1.6212 -
  1.6213 -
  1.6214 -
  1.6215 -
  1.6216 -Feather                     Standards Track                   [Page 111]
  1.6217 -
  1.6218 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.6219 -
  1.6220 -
  1.6221 -Appendix A.  Interaction with Other Specifications
  1.6222 -
  1.6223 -   NNTP is most often used for transferring articles that conform to
  1.6224 -   RFC 1036 [RFC1036] (such articles are called "Netnews articles"
  1.6225 -   here).  It is also sometimes used for transferring email messages
  1.6226 -   that conform to RFC 2822 [RFC2822] (such articles are called "email
  1.6227 -   articles" here).  In this situation, articles must conform both to
  1.6228 -   this specification and to that other one; this appendix describes
  1.6229 -   some relevant issues.
  1.6230 -
  1.6231 -A.1.  Header Folding
  1.6232 -
  1.6233 -   NNTP allows a header line to be folded (by inserting a CRLF pair)
  1.6234 -   before any space or TAB character.
  1.6235 -
  1.6236 -   Both email and Netnews articles are required to have at least one
  1.6237 -   octet other than space or TAB on each header line.  Thus, folding can
  1.6238 -   only happen at one point in each sequence of consecutive spaces or
  1.6239 -   TABs.  Netnews articles are further required to have the header name,
  1.6240 -   colon, and following space all on the first line; folding may only
  1.6241 -   happen beyond that space.  Finally, some non-conforming software will
  1.6242 -   remove trailing spaces and TABs from a line.  Therefore, it might be
  1.6243 -   inadvisable to fold a header after a space or TAB.
  1.6244 -
  1.6245 -   For maximum safety, header lines SHOULD conform to the following
  1.6246 -   syntax rather than to that in Section 9.7.
  1.6247 -
  1.6248 -
  1.6249 -     header = header-name ":" SP [header-content] CRLF
  1.6250 -     header-content = [WS] token *( [CRLF] WS token )
  1.6251 -
  1.6252 -A.2.  Message-IDs
  1.6253 -
  1.6254 -   Every article handled by an NNTP server MUST have a unique
  1.6255 -   message-id.  For the purposes of this specification, a message-id is
  1.6256 -   an arbitrary opaque string that merely needs to meet certain
  1.6257 -   syntactic requirements and is just a way to refer to the article.
  1.6258 -
  1.6259 -   Because there is a significant risk that old articles will be
  1.6260 -   reinjected into the global Usenet system, RFC 1036 [RFC1036] requires
  1.6261 -   that message-ids are globally unique for all time.
  1.6262 -
  1.6263 -   This specification states that message-ids are the same if and only
  1.6264 -   if they consist of the same sequence of octets.  Other specifications
  1.6265 -   may define two different sequences as being equal because they are
  1.6266 -   putting an interpretation on particular characters.  RFC 2822
  1.6267 -   [RFC2822] has a concept of "quoted" and "escaped" characters.  It
  1.6268 -   therefore considers the three message-ids:
  1.6269 -
  1.6270 -
  1.6271 -
  1.6272 -Feather                     Standards Track                   [Page 112]
  1.6273 -
  1.6274 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.6275 -
  1.6276 -
  1.6277 -      <ab.cd@example.com>
  1.6278 -      <"ab.cd"@example.com>
  1.6279 -      <"ab.\cd"@example.com>
  1.6280 -
  1.6281 -   as being identical.  Therefore, an NNTP implementation handing email
  1.6282 -   articles must ensure that only one of these three appears in the
  1.6283 -   protocol and that the other two are converted to it as and when
  1.6284 -   necessary, such as when a client checks the results of a NEWNEWS
  1.6285 -   command against an internal database of message-ids.  Note that
  1.6286 -   RFC 1036 [RFC1036] never treats two different strings as being
  1.6287 -   identical.  Its successor (as of the time of writing) restricts the
  1.6288 -   syntax of message-ids so that, whenever RFC 2822 would treat two
  1.6289 -   strings as equivalent, only one of them is valid (in the above
  1.6290 -   example, only the first string is valid).
  1.6291 -
  1.6292 -   This specification does not describe how the message-id of an article
  1.6293 -   is determined; it may be deduced from the contents of the article or
  1.6294 -   derived from some external source.  If the server is also conforming
  1.6295 -   to another specification that contains a definition of message-id
  1.6296 -   compatible with this one, the server SHOULD use those message-ids.  A
  1.6297 -   common approach, and one that SHOULD be used for email and Netnews
  1.6298 -   articles, is to extract the message-id from the contents of a header
  1.6299 -   with name "Message-ID".  This may not be as simple as copying the
  1.6300 -   entire header contents; it may be necessary to strip off comments and
  1.6301 -   undo quoting, or to reduce "equivalent" message-ids to a canonical
  1.6302 -   form.
  1.6303 -
  1.6304 -   If an article is obtained through the IHAVE command, there will be a
  1.6305 -   message-id provided with the command.  The server MAY either use it
  1.6306 -   or determine one from the article contents.  However, whichever it
  1.6307 -   does, it SHOULD ensure that, if the IHAVE command is repeated with
  1.6308 -   the same argument and article, it will be recognized as a duplicate.
  1.6309 -
  1.6310 -   If an article does not contain a message-id that the server can
  1.6311 -   identify, it MUST synthesize one.  This could, for example, be a
  1.6312 -   simple sequence number or be based on the date and time when the
  1.6313 -   article arrived.  When email or Netnews articles are handled, a
  1.6314 -   Message-ID header SHOULD be added to ensure global consistency and
  1.6315 -   uniqueness.
  1.6316 -
  1.6317 -   Note that, because the message-id might not have been derived from
  1.6318 -   the Message-ID header in the article, the following example is
  1.6319 -   legitimate (though unusual):
  1.6320 -
  1.6321 -
  1.6322 -
  1.6323 -
  1.6324 -
  1.6325 -
  1.6326 -
  1.6327 -
  1.6328 -Feather                     Standards Track                   [Page 113]
  1.6329 -
  1.6330 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.6331 -
  1.6332 -
  1.6333 -      [C] HEAD <45223423@example.com>
  1.6334 -      [S] 221 0 <45223423@example.com>
  1.6335 -      [S] Path: pathost!demo!whitehouse!not-for-mail
  1.6336 -      [S] Message-ID: <1234@example.net>
  1.6337 -      [S] From: "Demo User" <nobody@example.net>
  1.6338 -      [S] Newsgroups: misc.test
  1.6339 -      [S] Subject: I am just a test article
  1.6340 -      [S] Date: 6 Oct 1998 04:38:40 -0500
  1.6341 -      [S] Organization: An Example Net, Uncertain, Texas
  1.6342 -      [S] .
  1.6343 -
  1.6344 -A.3.  Article Posting
  1.6345 -
  1.6346 -   As far as NNTP is concerned, the POST and IHAVE commands provide the
  1.6347 -   same basic facilities in a slightly different way.  However, they
  1.6348 -   have rather different intentions.
  1.6349 -
  1.6350 -   The IHAVE command is intended for transmitting conforming articles
  1.6351 -   between a system of NNTP servers, with all articles perhaps also
  1.6352 -   conforming to another specification (e.g., all articles are Netnews
  1.6353 -   articles).  It is expected that the client will already have done any
  1.6354 -   necessary validation (or that it has in turn obtained the article
  1.6355 -   from a third party that has done so); therefore, the contents SHOULD
  1.6356 -   be left unchanged.
  1.6357 -
  1.6358 -   In contrast, the POST command is intended for use when an end-user is
  1.6359 -   injecting a newly created article into a such a system.  The article
  1.6360 -   being transferred might not be a conforming email or Netnews article,
  1.6361 -   and the server is expected to validate it and, if necessary, to
  1.6362 -   convert it to the right form for onward distribution.  This is often
  1.6363 -   done by a separate piece of software on the server installation; if
  1.6364 -   so, the NNTP server SHOULD pass the incoming article to that software
  1.6365 -   unaltered, making no attempt to filter characters, to fold or limit
  1.6366 -   lines, or to process the incoming text otherwise.
  1.6367 -
  1.6368 -   The POST command can fail in various ways, and clients should be
  1.6369 -   prepared to re-send an article.  When doing so, however, it is often
  1.6370 -   important to ensure (as far as possible) that the same message-id is
  1.6371 -   allocated to both attempts so that the server, or other servers, can
  1.6372 -   recognize the two articles as duplicates.  In the case of email or
  1.6373 -   Netnews articles, therefore, the posted article SHOULD contain a
  1.6374 -   header with the name "Message-ID", and the contents of this header
  1.6375 -   SHOULD be identical on each attempt.  The server SHOULD ensure that
  1.6376 -   two POSTed articles with the same contents for this header are
  1.6377 -   recognized as identical and that the same message-id is allocated,
  1.6378 -   whether or not those contents are suitable for use as the message-id.
  1.6379 -
  1.6380 -
  1.6381 -
  1.6382 -
  1.6383 -
  1.6384 -Feather                     Standards Track                   [Page 114]
  1.6385 -
  1.6386 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.6387 -
  1.6388 -
  1.6389 -Appendix B.  Summary of Commands
  1.6390 -
  1.6391 -   This section contains a list of every command defined in this
  1.6392 -   document, ordered by command name and by indicating capability.
  1.6393 -
  1.6394 -                         Ordered by command name:
  1.6395 -
  1.6396 -       +-------------------+-----------------------+---------------+
  1.6397 -       | Command           | Indicating capability | Definition    |
  1.6398 -       +-------------------+-----------------------+---------------+
  1.6399 -       | ARTICLE           | READER                | Section 6.2.1 |
  1.6400 -       | BODY              | READER                | Section 6.2.3 |
  1.6401 -       | CAPABILITIES      | mandatory             | Section 5.2   |
  1.6402 -       | DATE              | READER                | Section 7.1   |
  1.6403 -       | GROUP             | READER                | Section 6.1.1 |
  1.6404 -       | HDR               | HDR                   | Section 8.5   |
  1.6405 -       | HEAD              | mandatory             | Section 6.2.2 |
  1.6406 -       | HELP              | mandatory             | Section 7.2   |
  1.6407 -       | IHAVE             | IHAVE                 | Section 6.3.2 |
  1.6408 -       | LAST              | READER                | Section 6.1.3 |
  1.6409 -       | LIST              | LIST                  | Section 7.6.1 |
  1.6410 -       | LIST ACTIVE.TIMES | LIST                  | Section 7.6.4 |
  1.6411 -       | LIST ACTIVE       | LIST                  | Section 7.6.3 |
  1.6412 -       | LIST DISTRIB.PATS | LIST                  | Section 7.6.5 |
  1.6413 -       | LIST HEADERS      | HDR                   | Section 8.6   |
  1.6414 -       | LIST NEWSGROUPS   | LIST                  | Section 7.6.6 |
  1.6415 -       | LIST OVERVIEW.FMT | OVER                  | Section 8.4   |
  1.6416 -       | LISTGROUP         | READER                | Section 6.1.2 |
  1.6417 -       | MODE READER       | MODE-READER           | Section 5.3   |
  1.6418 -       | NEWGROUPS         | READER                | Section 7.3   |
  1.6419 -       | NEWNEWS           | NEWNEWS               | Section 7.4   |
  1.6420 -       | NEXT              | READER                | Section 6.1.4 |
  1.6421 -       | OVER              | OVER                  | Section 8.3   |
  1.6422 -       | POST              | POST                  | Section 6.3.1 |
  1.6423 -       | QUIT              | mandatory             | Section 5.4   |
  1.6424 -       | STAT              | mandatory             | Section 6.2.4 |
  1.6425 -       +-------------------+-----------------------+---------------+
  1.6426 -
  1.6427 -
  1.6428 -
  1.6429 -
  1.6430 -
  1.6431 -
  1.6432 -
  1.6433 -
  1.6434 -
  1.6435 -
  1.6436 -
  1.6437 -
  1.6438 -
  1.6439 -
  1.6440 -Feather                     Standards Track                   [Page 115]
  1.6441 -
  1.6442 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.6443 -
  1.6444 -
  1.6445 -                     Ordered by indicating capability:
  1.6446 -
  1.6447 -       +-------------------+-----------------------+---------------+
  1.6448 -       | Command           | Indicating capability | Definition    |
  1.6449 -       +-------------------+-----------------------+---------------+
  1.6450 -       | CAPABILITIES      | mandatory             | Section 5.2   |
  1.6451 -       | HEAD              | mandatory             | Section 6.2.2 |
  1.6452 -       | HELP              | mandatory             | Section 7.2   |
  1.6453 -       | QUIT              | mandatory             | Section 5.4   |
  1.6454 -       | STAT              | mandatory             | Section 6.2.4 |
  1.6455 -       | HDR               | HDR                   | Section 8.5   |
  1.6456 -       | LIST HEADERS      | HDR                   | Section 8.6   |
  1.6457 -       | IHAVE             | IHAVE                 | Section 6.3.2 |
  1.6458 -       | LIST              | LIST                  | Section 7.6.1 |
  1.6459 -       | LIST ACTIVE       | LIST                  | Section 7.6.3 |
  1.6460 -       | LIST ACTIVE.TIMES | LIST                  | Section 7.6.4 |
  1.6461 -       | LIST DISTRIB.PATS | LIST                  | Section 7.6.5 |
  1.6462 -       | LIST NEWSGROUPS   | LIST                  | Section 7.6.6 |
  1.6463 -       | MODE READER       | MODE-READER           | Section 5.3   |
  1.6464 -       | NEWNEWS           | NEWNEWS               | Section 7.4   |
  1.6465 -       | OVER              | OVER                  | Section 8.3   |
  1.6466 -       | LIST OVERVIEW.FMT | OVER                  | Section 8.4   |
  1.6467 -       | POST              | POST                  | Section 6.3.1 |
  1.6468 -       | ARTICLE           | READER                | Section 6.2.1 |
  1.6469 -       | BODY              | READER                | Section 6.2.3 |
  1.6470 -       | DATE              | READER                | Section 7.1   |
  1.6471 -       | GROUP             | READER                | Section 6.1.1 |
  1.6472 -       | LAST              | READER                | Section 6.1.3 |
  1.6473 -       | LISTGROUP         | READER                | Section 6.1.2 |
  1.6474 -       | NEWGROUPS         | READER                | Section 7.3   |
  1.6475 -       | NEXT              | READER                | Section 6.1.4 |
  1.6476 -       +-------------------+-----------------------+---------------+
  1.6477 -
  1.6478 -
  1.6479 -
  1.6480 -
  1.6481 -
  1.6482 -
  1.6483 -
  1.6484 -
  1.6485 -
  1.6486 -
  1.6487 -
  1.6488 -
  1.6489 -
  1.6490 -
  1.6491 -
  1.6492 -
  1.6493 -
  1.6494 -
  1.6495 -
  1.6496 -Feather                     Standards Track                   [Page 116]
  1.6497 -
  1.6498 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.6499 -
  1.6500 -
  1.6501 -Appendix C.  Summary of Response Codes
  1.6502 -
  1.6503 -   This section contains a list of every response code defined in this
  1.6504 -   document and indicates whether it is multi-line, which commands can
  1.6505 -   generate it, what arguments it has, and what its meaning is.
  1.6506 -
  1.6507 -   Response code 100 (multi-line)
  1.6508 -      Generated by: HELP
  1.6509 -      Meaning: help text follows.
  1.6510 -
  1.6511 -   Response code 101 (multi-line)
  1.6512 -      Generated by: CAPABILITIES
  1.6513 -      Meaning: capabilities list follows.
  1.6514 -
  1.6515 -   Response code 111
  1.6516 -      Generated by: DATE
  1.6517 -      1 argument: yyyymmddhhmmss
  1.6518 -      Meaning: server date and time.
  1.6519 -
  1.6520 -   Response code 200
  1.6521 -      Generated by: initial connection, MODE READER
  1.6522 -      Meaning: service available, posting allowed.
  1.6523 -
  1.6524 -   Response code 201
  1.6525 -      Generated by: initial connection, MODE READER
  1.6526 -      Meaning: service available, posting prohibited.
  1.6527 -
  1.6528 -   Response code 205
  1.6529 -      Generated by: QUIT
  1.6530 -      Meaning: connection closing (the server immediately closes the
  1.6531 -      connection).
  1.6532 -
  1.6533 -   Response code 211
  1.6534 -      The 211 response code has two completely different forms,
  1.6535 -      depending on which command generated it:
  1.6536 -
  1.6537 -         (not multi-line)
  1.6538 -         Generated by: GROUP
  1.6539 -         4 arguments: number low high group
  1.6540 -         Meaning: group selected.
  1.6541 -
  1.6542 -         (multi-line)
  1.6543 -         Generated by: LISTGROUP
  1.6544 -         4 arguments: number low high group
  1.6545 -         Meaning: article numbers follow.
  1.6546 -
  1.6547 -
  1.6548 -
  1.6549 -
  1.6550 -
  1.6551 -
  1.6552 -Feather                     Standards Track                   [Page 117]
  1.6553 -
  1.6554 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.6555 -
  1.6556 -
  1.6557 -   Response code 215 (multi-line)
  1.6558 -      Generated by: LIST
  1.6559 -      Meaning: information follows.
  1.6560 -
  1.6561 -   Response code 220 (multi-line)
  1.6562 -      Generated by: ARTICLE
  1.6563 -      2 arguments: n message-id
  1.6564 -      Meaning: article follows.
  1.6565 -
  1.6566 -   Response code 221 (multi-line)
  1.6567 -      Generated by: HEAD
  1.6568 -      2 arguments: n message-id
  1.6569 -      Meaning: article headers follow.
  1.6570 -
  1.6571 -   Response code 222 (multi-line)
  1.6572 -      Generated by: BODY
  1.6573 -      2 arguments: n message-id
  1.6574 -      Meaning: article body follows.
  1.6575 -
  1.6576 -   Response code 223
  1.6577 -      Generated by: LAST, NEXT, STAT
  1.6578 -      2 arguments: n message-id
  1.6579 -      Meaning: article exists and selected.
  1.6580 -
  1.6581 -   Response code 224 (multi-line)
  1.6582 -      Generated by: OVER
  1.6583 -      Meaning: overview information follows.
  1.6584 -
  1.6585 -   Response code 225 (multi-line)
  1.6586 -      Generated by: HDR
  1.6587 -      Meaning: headers follow.
  1.6588 -
  1.6589 -   Response code 230 (multi-line)
  1.6590 -      Generated by: NEWNEWS
  1.6591 -      Meaning: list of new articles follows.
  1.6592 -
  1.6593 -   Response code 231 (multi-line)
  1.6594 -      Generated by: NEWGROUPS
  1.6595 -      Meaning: list of new newsgroups follows.
  1.6596 -
  1.6597 -   Response code 235
  1.6598 -      Generated by: IHAVE (second stage)
  1.6599 -      Meaning: article transferred OK.
  1.6600 -
  1.6601 -   Response code 240
  1.6602 -      Generated by: POST (second stage)
  1.6603 -      Meaning: article received OK.
  1.6604 -
  1.6605 -
  1.6606 -
  1.6607 -
  1.6608 -Feather                     Standards Track                   [Page 118]
  1.6609 -
  1.6610 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.6611 -
  1.6612 -
  1.6613 -   Response code 335
  1.6614 -      Generated by: IHAVE (first stage)
  1.6615 -      Meaning: send article to be transferred.
  1.6616 -
  1.6617 -   Response code 340
  1.6618 -      Generated by: POST (first stage)
  1.6619 -      Meaning: send article to be posted.
  1.6620 -
  1.6621 -   Response code 400
  1.6622 -      Generic response and generated by initial connection
  1.6623 -      Meaning: service not available or no longer available (the server
  1.6624 -      immediately closes the connection).
  1.6625 -
  1.6626 -   Response code 401
  1.6627 -      Generic response
  1.6628 -      1 argument: capability-label
  1.6629 -      Meaning: the server is in the wrong mode; the indicated capability
  1.6630 -      should be used to change the mode.
  1.6631 -
  1.6632 -   Response code 403
  1.6633 -      Generic response
  1.6634 -      Meaning: internal fault or problem preventing action being taken.
  1.6635 -
  1.6636 -   Response code 411
  1.6637 -      Generated by: GROUP, LISTGROUP
  1.6638 -      Meaning: no such newsgroup.
  1.6639 -
  1.6640 -   Response code 412
  1.6641 -      Generated by: ARTICLE, BODY, GROUP, HDR, HEAD, LAST, LISTGROUP,
  1.6642 -      NEXT, OVER, STAT
  1.6643 -      Meaning: no newsgroup selected.
  1.6644 -
  1.6645 -   Response code 420
  1.6646 -      Generated by: ARTICLE, BODY, HDR, HEAD, LAST, NEXT, OVER, STAT
  1.6647 -      Meaning: current article number is invalid.
  1.6648 -
  1.6649 -   Response code 421
  1.6650 -      Generated by: NEXT
  1.6651 -      Meaning: no next article in this group.
  1.6652 -
  1.6653 -   Response code 422
  1.6654 -      Generated by: LAST
  1.6655 -      Meaning: no previous article in this group.
  1.6656 -
  1.6657 -   Response code 423
  1.6658 -      Generated by: ARTICLE, BODY, HDR, HEAD, OVER, STAT
  1.6659 -      Meaning: no article with that number or in that range.
  1.6660 -
  1.6661 -
  1.6662 -
  1.6663 -
  1.6664 -Feather                     Standards Track                   [Page 119]
  1.6665 -
  1.6666 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.6667 -
  1.6668 -
  1.6669 -   Response code 430
  1.6670 -      Generated by: ARTICLE, BODY, HDR, HEAD, OVER, STAT
  1.6671 -      Meaning: no article with that message-id.
  1.6672 -
  1.6673 -   Response code 435
  1.6674 -      Generated by: IHAVE (first stage)
  1.6675 -      Meaning: article not wanted.
  1.6676 -
  1.6677 -   Response code 436
  1.6678 -      Generated by: IHAVE (either stage)
  1.6679 -      Meaning: transfer not possible (first stage) or failed (second
  1.6680 -      stage); try again later.
  1.6681 -
  1.6682 -   Response code 437
  1.6683 -      Generated by: IHAVE (second stage)
  1.6684 -      Meaning: transfer rejected; do not retry.
  1.6685 -
  1.6686 -   Response code 440
  1.6687 -      Generated by: POST (first stage)
  1.6688 -      Meaning: posting not permitted.
  1.6689 -
  1.6690 -   Response code 441
  1.6691 -      Generated by: POST (second stage)
  1.6692 -      Meaning: posting failed.
  1.6693 -
  1.6694 -   Response code 480
  1.6695 -      Generic response
  1.6696 -      Meaning: command unavailable until the client has authenticated
  1.6697 -      itself.
  1.6698 -
  1.6699 -   Response code 483
  1.6700 -      Generic response
  1.6701 -      Meaning: command unavailable until suitable privacy has been
  1.6702 -      arranged.
  1.6703 -
  1.6704 -   Response code 500
  1.6705 -      Generic response
  1.6706 -      Meaning: unknown command.
  1.6707 -
  1.6708 -   Response code 501
  1.6709 -      Generic response
  1.6710 -      Meaning: syntax error in command.
  1.6711 -
  1.6712 -
  1.6713 -
  1.6714 -
  1.6715 -
  1.6716 -
  1.6717 -
  1.6718 -
  1.6719 -
  1.6720 -Feather                     Standards Track                   [Page 120]
  1.6721 -
  1.6722 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.6723 -
  1.6724 -
  1.6725 -   Response code 502
  1.6726 -      Generic response and generated by initial connection
  1.6727 -
  1.6728 -      Meaning for the initial connection and the MODE READER command:
  1.6729 -      service permanently unavailable (the server immediately closes the
  1.6730 -      connection).
  1.6731 -
  1.6732 -      Meaning for all other commands: command not permitted (and there
  1.6733 -      is no way for the client to change this).
  1.6734 -
  1.6735 -   Response code 503
  1.6736 -      Generic response
  1.6737 -      Meaning: feature not supported.
  1.6738 -
  1.6739 -   Response code 504
  1.6740 -      Generic response
  1.6741 -      Meaning: error in base64-encoding [RFC4648] of an argument.
  1.6742 -
  1.6743 -Appendix D.  Changes from RFC 977
  1.6744 -
  1.6745 -   In general every attempt has been made to ensure that the protocol
  1.6746 -   specification in this document is compatible with the version
  1.6747 -   specified in RFC 977 [RFC977] and the various facilities adopted from
  1.6748 -   RFC 2980 [RFC2980].  However, there have been a number of changes,
  1.6749 -   some compatible and some not.
  1.6750 -
  1.6751 -   This appendix lists these changes.  It is not guaranteed to be
  1.6752 -   exhaustive or correct and MUST NOT be relied on.
  1.6753 -
  1.6754 -   o  A formal syntax specification (Section 9) has been added.
  1.6755 -
  1.6756 -   o  The default character set is changed from US-ASCII [ANSI1986] to
  1.6757 -      UTF-8 [RFC3629] (note that US-ASCII is a subset of UTF-8).  This
  1.6758 -      matter is discussed further in Section 10.
  1.6759 -
  1.6760 -   o  All articles are required to have a message-id, eliminating the
  1.6761 -      "<0>" placeholder used in RFC 977 in some responses.
  1.6762 -
  1.6763 -   o  The newsgroup name matching capabilities already documented in
  1.6764 -      RFC 977 ("wildmats", Section 4) are clarified and extended.  The
  1.6765 -      new facilities (e.g., the use of commas and exclamation marks) are
  1.6766 -      allowed wherever wildmats appear in the protocol.
  1.6767 -
  1.6768 -   o  Support for pipelining of commands (Section 3.5) is made
  1.6769 -      mandatory.
  1.6770 -
  1.6771 -
  1.6772 -
  1.6773 -
  1.6774 -
  1.6775 -
  1.6776 -Feather                     Standards Track                   [Page 121]
  1.6777 -
  1.6778 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.6779 -
  1.6780 -
  1.6781 -   o  The principles behind response codes (Section 3.2) have been
  1.6782 -      tidied up.  In particular:
  1.6783 -
  1.6784 -      *  the x8x response code family, formerly used for private
  1.6785 -         extensions, is now reserved for authentication and privacy
  1.6786 -         extensions;
  1.6787 -
  1.6788 -      *  the x9x response code family, formerly intended for debugging
  1.6789 -         facilities, are now reserved for private extensions;
  1.6790 -
  1.6791 -      *  the 502 and 503 generic response codes (Section 3.2.1) have
  1.6792 -         been redefined;
  1.6793 -
  1.6794 -      *  new 401, 403, 480, 483, and 504 generic response codes have
  1.6795 -         been added.
  1.6796 -
  1.6797 -   o  The rules for article numbering (Section 6) have been clarified
  1.6798 -      (also see Section 6.1.1.2).
  1.6799 -
  1.6800 -   o  The SLAVE command (which was ill-defined) is removed from the
  1.6801 -      protocol.
  1.6802 -
  1.6803 -   o  Four-digit years are permitted in the NEWNEWS (Section 7.4) and
  1.6804 -      NEWGROUPS (Section 7.3) commands (two-digit years are still
  1.6805 -      permitted).  The optional distribution parameter to these commands
  1.6806 -      has been removed.
  1.6807 -
  1.6808 -   o  The LIST command (Section 7.6.1) is greatly extended; the original
  1.6809 -      is available as LIST ACTIVE, while new variants include
  1.6810 -      ACTIVE.TIMES, DISTRIB.PATS, and NEWSGROUPS.  A new "m" status flag
  1.6811 -      is added to the LIST ACTIVE response.
  1.6812 -
  1.6813 -   o  A new CAPABILITIES command (Section 5.2) allows clients to
  1.6814 -      determine what facilities are supported by a server.
  1.6815 -
  1.6816 -   o  The DATE command (Section 7.1) is adopted from RFC 2980
  1.6817 -      effectively unchanged.
  1.6818 -
  1.6819 -   o  The LISTGROUP command (Section 6.1.2) is adopted from RFC 2980.
  1.6820 -      An optional range argument has been added, and the 211 initial
  1.6821 -      response line now has the same format as the 211 response from the
  1.6822 -      GROUP command.
  1.6823 -
  1.6824 -   o  The MODE READER command (Section 5.3) is adopted from RFC 2980 and
  1.6825 -      its meaning and effects clarified.
  1.6826 -
  1.6827 -   o  The XHDR command in RFC 2980 has been formalised as the new HDR
  1.6828 -      (Section 8.5) and LIST HEADERS (Section 8.6) commands.
  1.6829 -
  1.6830 -
  1.6831 -
  1.6832 -Feather                     Standards Track                   [Page 122]
  1.6833 -
  1.6834 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.6835 -
  1.6836 -
  1.6837 -   o  The XOVER command in RFC 2980 has been formalised as the new OVER
  1.6838 -      (Section 8.3) and LIST OVERVIEW.FMT (Section 8.4) commands.  The
  1.6839 -      former can be applied to a message-id as well as to a range.
  1.6840 -
  1.6841 -   o  The concept of article metadata (Section 8.1) has been formalised,
  1.6842 -      allowing the Bytes and Lines pseudo-headers to be deprecated.
  1.6843 -
  1.6844 -   Client authors should note in particular that lack of support for the
  1.6845 -   CAPABILITIES command is a good indication that the server does not
  1.6846 -   support this specification.
  1.6847 -
  1.6848 -
  1.6849 -
  1.6850 -
  1.6851 -
  1.6852 -
  1.6853 -
  1.6854 -
  1.6855 -
  1.6856 -
  1.6857 -
  1.6858 -
  1.6859 -
  1.6860 -
  1.6861 -
  1.6862 -
  1.6863 -
  1.6864 -
  1.6865 -
  1.6866 -
  1.6867 -
  1.6868 -
  1.6869 -
  1.6870 -
  1.6871 -
  1.6872 -
  1.6873 -
  1.6874 -
  1.6875 -
  1.6876 -
  1.6877 -
  1.6878 -
  1.6879 -
  1.6880 -
  1.6881 -
  1.6882 -
  1.6883 -
  1.6884 -
  1.6885 -
  1.6886 -
  1.6887 -
  1.6888 -Feather                     Standards Track                   [Page 123]
  1.6889 -
  1.6890 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.6891 -
  1.6892 -
  1.6893 -Author's Address
  1.6894 -
  1.6895 -   Clive D.W. Feather
  1.6896 -   THUS plc
  1.6897 -   322 Regents Park Road
  1.6898 -   London
  1.6899 -   N3  2QQ
  1.6900 -   United Kingdom
  1.6901 -
  1.6902 -   Phone: +44 20 8495 6138
  1.6903 -   Fax:   +44 870 051 9937
  1.6904 -   EMail: clive@demon.net
  1.6905 -   URI:   http://www.davros.org/
  1.6906 -
  1.6907 -
  1.6908 -
  1.6909 -
  1.6910 -
  1.6911 -
  1.6912 -
  1.6913 -
  1.6914 -
  1.6915 -
  1.6916 -
  1.6917 -
  1.6918 -
  1.6919 -
  1.6920 -
  1.6921 -
  1.6922 -
  1.6923 -
  1.6924 -
  1.6925 -
  1.6926 -
  1.6927 -
  1.6928 -
  1.6929 -
  1.6930 -
  1.6931 -
  1.6932 -
  1.6933 -
  1.6934 -
  1.6935 -
  1.6936 -
  1.6937 -
  1.6938 -
  1.6939 -
  1.6940 -
  1.6941 -
  1.6942 -
  1.6943 -
  1.6944 -Feather                     Standards Track                   [Page 124]
  1.6945 -
  1.6946 -RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  1.6947 -
  1.6948 -
  1.6949 -Full Copyright Statement
  1.6950 -
  1.6951 -Copyright (C) The Internet Society (2006).
  1.6952 -
  1.6953 -   This document is subject to the rights, licenses and restrictions
  1.6954 -   contained in BCP 78, and except as set forth therein, the authors
  1.6955 -   retain all their rights.
  1.6956 -
  1.6957 -   This document and the information contained herein are provided on an
  1.6958 -   "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
  1.6959 -   OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
  1.6960 -   ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED,
  1.6961 -   INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
  1.6962 -   INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
  1.6963 -   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  1.6964 -
  1.6965 -Intellectual Property
  1.6966 -
  1.6967 -   The IETF takes no position regarding the validity or scope of any
  1.6968 -   Intellectual Property Rights or other rights that might be claimed to
  1.6969 -   pertain to the implementation or use of the technology described in
  1.6970 -   this document or the extent to which any license under such rights
  1.6971 -   might or might not be available; nor does it represent that it has
  1.6972 -   made any independent effort to identify any such rights.  Information
  1.6973 -   on the procedures with respect to rights in RFC documents can be
  1.6974 -   found in BCP 78 and BCP 79.
  1.6975 -
  1.6976 -   Copies of IPR disclosures made to the IETF Secretariat and any
  1.6977 -   assurances of licenses to be made available, or the result of an
  1.6978 -   attempt made to obtain a general license or permission for the use of
  1.6979 -   such proprietary rights by implementers or users of this
  1.6980 -   specification can be obtained from the IETF on-line IPR repository at
  1.6981 -   http://www.ietf.org/ipr.
  1.6982 -
  1.6983 -   The IETF invites any interested party to bring to its attention any
  1.6984 -   copyrights, patents or patent applications, or other proprietary
  1.6985 -   rights that may cover technology that may be required to implement
  1.6986 -   this standard.  Please address the information to the IETF at ietf-
  1.6987 -   ipr@ietf.org.
  1.6988 -
  1.6989 -Acknowledgement
  1.6990 -
  1.6991 -   Funding for the RFC Editor function is provided by the IETF
  1.6992 -   Administrative Support Activity (IASA).
  1.6993 -
  1.6994 -
  1.6995 -
  1.6996 -
  1.6997 -
  1.6998 -
  1.6999 -
  1.7000 -Feather                     Standards Track                   [Page 125]
  1.7001 -
     2.1 Binary file RFC3977.pdf has changed
     3.1 --- a/build.xml	Sun Aug 29 17:28:58 2010 +0200
     3.2 +++ b/build.xml	Sun Aug 29 17:43:58 2010 +0200
     3.3 @@ -49,7 +49,7 @@
     3.4                 deprecation="${deprecation}"
     3.5                 optimize="${optimize}"
     3.6                 classpathref="classpath">
     3.7 -            <src path="."/>
     3.8 +            <src path="./src"/>
     3.9                  <include name="org/sonews/**/*.java"/>
    3.10  	</javac>
    3.11  	<javac destdir="${build.class}"
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/doc/RFC3977	Sun Aug 29 17:43:58 2010 +0200
     4.3 @@ -0,0 +1,6998 @@
     4.4 +
     4.5 +Network Working Group                                         C. Feather
     4.6 +Request for Comments: 3977                                      THUS plc
     4.7 +Obsoletes: 977                                              October 2006
     4.8 +Updates: 2980
     4.9 +Category: Standards Track
    4.10 +
    4.11 +
    4.12 +                 Network News Transfer Protocol (NNTP)
    4.13 +
    4.14 +Status of This Memo
    4.15 +
    4.16 +   This document specifies an Internet standards track protocol for the
    4.17 +   Internet community, and requests discussion and suggestions for
    4.18 +   improvements.  Please refer to the current edition of the "Internet
    4.19 +   Official Protocol Standards" (STD 1) for the standardization state
    4.20 +   and status of this protocol.  Distribution of this memo is unlimited.
    4.21 +
    4.22 +Copyright Notice
    4.23 +
    4.24 +   Copyright (C) The Internet Society (2006).
    4.25 +
    4.26 +Abstract
    4.27 +
    4.28 +   The Network News Transfer Protocol (NNTP) has been in use in the
    4.29 +   Internet for a decade, and remains one of the most popular protocols
    4.30 +   (by volume) in use today.  This document is a replacement for
    4.31 +   RFC 977, and officially updates the protocol specification.  It
    4.32 +   clarifies some vagueness in RFC 977, includes some new base
    4.33 +   functionality, and provides a specific mechanism to add standardized
    4.34 +   extensions to NNTP.
    4.35 +
    4.36 +Table of Contents
    4.37 +
    4.38 +   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .  3
    4.39 +     1.1.  Author's Note . . . . . . . . . . . . . . . . . . . . . .  4
    4.40 +   2.  Notation  . . . . . . . . . . . . . . . . . . . . . . . . . .  5
    4.41 +   3.  Basic Concepts  . . . . . . . . . . . . . . . . . . . . . . .  6
    4.42 +     3.1.  Commands and Responses  . . . . . . . . . . . . . . . . .  6
    4.43 +       3.1.1.  Multi-line Data Blocks . . . . . . . . . . . . . . . . 8
    4.44 +     3.2.  Response Codes  . . . . . . . . . . . . . . . . . . . . .  9
    4.45 +       3.2.1.  Generic Response Codes  . . . . . . . . . . . . . . . 10
    4.46 +         3.2.1.1.  Examples  . . . . . . . . . . . . . . . . . . . . 12
    4.47 +     3.3.  Capabilities and Extensions . . . . . . . . . . . . . . . 14
    4.48 +       3.3.1.  Capability Descriptions . . . . . . . . . . . . . . . 14
    4.49 +       3.3.2.  Standard Capabilities . . . . . . . . . . . . . . . . 15
    4.50 +       3.3.3.  Extensions  . . . . . . . . . . . . . . . . . . . . . 16
    4.51 +       3.3.4.  Initial IANA Register . . . . . . . . . . . . . . . . 18
    4.52 +     3.4.  Mandatory and Optional Commands . . . . . . . . . . . . . 20
    4.53 +
    4.54 +
    4.55 +
    4.56 +Feather                     Standards Track                     [Page 1]
    4.57 +
    4.58 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
    4.59 +
    4.60 +
    4.61 +       3.4.1.  Reading and Transit Servers . . . . . . . . . . . . . 21
    4.62 +       3.4.2.  Mode Switching  . . . . . . . . . . . . . . . . . . . 21
    4.63 +     3.5.  Pipelining  . . . . . . . . . . . . . . . . . . . . . . . 22
    4.64 +       3.5.1.  Examples  . . . . . . . . . . . . . . . . . . . . . . 23
    4.65 +     3.6.  Articles  . . . . . . . . . . . . . . . . . . . . . . . . 24
    4.66 +   4.  The WILDMAT Format  . . . . . . . . . . . . . . . . . . . . . 25
    4.67 +     4.1.  Wildmat Syntax  . . . . . . . . . . . . . . . . . . . . . 26
    4.68 +     4.2.  Wildmat Semantics . . . . . . . . . . . . . . . . . . . . 26
    4.69 +     4.3.  Extensions  . . . . . . . . . . . . . . . . . . . . . . . 27
    4.70 +     4.4.  Examples  . . . . . . . . . . . . . . . . . . . . . . . . 27
    4.71 +   5.  Session Administration Commands . . . . . . . . . . . . . . . 28
    4.72 +     5.1.  Initial Connection  . . . . . . . . . . . . . . . . . . . 28
    4.73 +     5.2.  CAPABILITIES  . . . . . . . . . . . . . . . . . . . . . . 29
    4.74 +     5.3.  MODE READER . . . . . . . . . . . . . . . . . . . . . . . 32
    4.75 +     5.4.  QUIT  . . . . . . . . . . . . . . . . . . . . . . . . . . 34
    4.76 +   6.  Article Posting and Retrieval . . . . . . . . . . . . . . . . 35
    4.77 +     6.1.  Group and Article Selection . . . . . . . . . . . . . . . 36
    4.78 +       6.1.1.  GROUP . . . . . . . . . . . . . . . . . . . . . . . . 36
    4.79 +       6.1.2.  LISTGROUP . . . . . . . . . . . . . . . . . . . . . . 39
    4.80 +       6.1.3.  LAST  . . . . . . . . . . . . . . . . . . . . . . . . 42
    4.81 +       6.1.4.  NEXT  . . . . . . . . . . . . . . . . . . . . . . . . 44
    4.82 +     6.2.  Retrieval of Articles and Article Sections  . . . . . . . 45
    4.83 +       6.2.1.  ARTICLE . . . . . . . . . . . . . . . . . . . . . . . 46
    4.84 +       6.2.2.  HEAD  . . . . . . . . . . . . . . . . . . . . . . . . 49
    4.85 +       6.2.3.  BODY  . . . . . . . . . . . . . . . . . . . . . . . . 51
    4.86 +       6.2.4.  STAT  . . . . . . . . . . . . . . . . . . . . . . . . 53
    4.87 +     6.3.  Article Posting . . . . . . . . . . . . . . . . . . . . . 56
    4.88 +       6.3.1.  POST  . . . . . . . . . . . . . . . . . . . . . . . . 56
    4.89 +       6.3.2.  IHAVE . . . . . . . . . . . . . . . . . . . . . . . . 58
    4.90 +   7.  Information Commands  . . . . . . . . . . . . . . . . . . . . 61
    4.91 +     7.1.  DATE  . . . . . . . . . . . . . . . . . . . . . . . . . . 61
    4.92 +     7.2.  HELP  . . . . . . . . . . . . . . . . . . . . . . . . . . 62
    4.93 +     7.3.  NEWGROUPS . . . . . . . . . . . . . . . . . . . . . . . . 63
    4.94 +     7.4.  NEWNEWS . . . . . . . . . . . . . . . . . . . . . . . . . 64
    4.95 +     7.5.  Time  . . . . . . . . . . . . . . . . . . . . . . . . . . 65
    4.96 +       7.5.1.  Examples  . . . . . . . . . . . . . . . . . . . . . . 66
    4.97 +     7.6.  The LIST Commands . . . . . . . . . . . . . . . . . . . . 66
    4.98 +       7.6.1.  LIST  . . . . . . . . . . . . . . . . . . . . . . . . 67
    4.99 +       7.6.2.  Standard LIST Keywords  . . . . . . . . . . . . . . . 69
   4.100 +       7.6.3.  LIST ACTIVE . . . . . . . . . . . . . . . . . . . . . 70
   4.101 +       7.6.4.  LIST ACTIVE.TIMES . . . . . . . . . . . . . . . . . . 71
   4.102 +       7.6.5.  LIST DISTRIB.PATS . . . . . . . . . . . . . . . . . . 72
   4.103 +       7.6.6.  LIST NEWSGROUPS . . . . . . . . . . . . . . . . . . . 73
   4.104 +   8.  Article Field Access Commands . . . . . . . . . . . . . . . . 73
   4.105 +     8.1.  Article Metadata  . . . . . . . . . . . . . . . . . . . . 74
   4.106 +       8.1.1.  The :bytes Metadata Item  . . . . . . . . . . . . . . 74
   4.107 +       8.1.2.  The :lines Metadata Item  . . . . . . . . . . . . . . 75
   4.108 +     8.2.  Database Consistency  . . . . . . . . . . . . . . . . . . 75
   4.109 +
   4.110 +
   4.111 +
   4.112 +Feather                     Standards Track                     [Page 2]
   4.113 +
   4.114 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
   4.115 +
   4.116 +
   4.117 +     8.3.  OVER  . . . . . . . . . . . . . . . . . . . . . . . . . . 76
   4.118 +     8.4.  LIST OVERVIEW.FMT . . . . . . . . . . . . . . . . . . . . 81
   4.119 +     8.5.  HDR . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
   4.120 +     8.6.  LIST HEADERS  . . . . . . . . . . . . . . . . . . . . . . 87
   4.121 +   9.  Augmented BNF Syntax for NNTP . . . . . . . . . . . . . . . . 90
   4.122 +     9.1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . 90
   4.123 +     9.2.  Commands  . . . . . . . . . . . . . . . . . . . . . . . . 92
   4.124 +     9.3.  Command Continuation  . . . . . . . . . . . . . . . . . . 93
   4.125 +     9.4.  Responses . . . . . . . . . . . . . . . . . . . . . . . . 93
   4.126 +       9.4.1.  Generic Responses . . . . . . . . . . . . . . . . . . 93
   4.127 +       9.4.2.  Initial Response Line Contents  . . . . . . . . . . . 94
   4.128 +       9.4.3.  Multi-line Response Contents  . . . . . . . . . . . . 94
   4.129 +     9.5.  Capability Lines  . . . . . . . . . . . . . . . . . . . . 95
   4.130 +     9.6.  LIST Variants . . . . . . . . . . . . . . . . . . . . . . 96
   4.131 +     9.7.  Articles  . . . . . . . . . . . . . . . . . . . . . . . . 97
   4.132 +     9.8.  General Non-terminals . . . . . . . . . . . . . . . . . . 97
   4.133 +     9.9.  Extensions and Validation . . . . . . . . . . . . . . . . 99
   4.134 +   10. Internationalisation Considerations . . . . . . . . . . . . .100
   4.135 +     10.1. Introduction and Historical Situation . . . . . . . . . .100
   4.136 +     10.2. This Specification  . . . . . . . . . . . . . . . . . . .101
   4.137 +     10.3. Outstanding Issues  . . . . . . . . . . . . . . . . . . .102
   4.138 +   11. IANA Considerations . . . . . . . . . . . . . . . . . . . . .103
   4.139 +   12. Security Considerations . . . . . . . . . . . . . . . . . . .103
   4.140 +     12.1. Personal and Proprietary Information  . . . . . . . . . .104
   4.141 +     12.2. Abuse of Server Log Information . . . . . . . . . . . . .104
   4.142 +     12.3. Weak Authentication and Access Control  . . . . . . . . .104
   4.143 +     12.4. DNS Spoofing  . . . . . . . . . . . . . . . . . . . . . .104
   4.144 +     12.5. UTF-8 Issues  . . . . . . . . . . . . . . . . . . . . . .105
   4.145 +     12.6. Caching of Capability Lists . . . . . . . . . . . . . . .106
   4.146 +   13. Acknowledgements  . . . . . . . . . . . . . . . . . . . . . .107
   4.147 +   14. References  . . . . . . . . . . . . . . . . . . . . . . . . .110
   4.148 +     14.1. Normative References  . . . . . . . . . . . . . . . . . .110
   4.149 +     14.2. Informative References  . . . . . . . . . . . . . . . . .110
   4.150 +   A.  Interaction with Other Specifications . . . . . . . . . . . .112
   4.151 +     A.1.  Header Folding  . . . . . . . . . . . . . . . . . . . . .112
   4.152 +     A.2.  Message-IDs . . . . . . . . . . . . . . . . . . . . . . .112
   4.153 +     A.3.  Article Posting . . . . . . . . . . . . . . . . . . . . .114
   4.154 +   B.  Summary of Commands . . . . . . . . . . . . . . . . . . . . .115
   4.155 +   C.  Summary of Response Codes . . . . . . . . . . . . . . . . . .117
   4.156 +   D.  Changes from RFC 977  . . . . . . . . . . . . . . . . . . . .121
   4.157 +
   4.158 +1.  Introduction
   4.159 +
   4.160 +   This document specifies the Network News Transfer Protocol (NNTP),
   4.161 +   which is used for the distribution, inquiry, retrieval, and posting
   4.162 +   of Netnews articles using a reliable stream-based mechanism.  For
   4.163 +   news-reading clients, NNTP enables retrieval of news articles that
   4.164 +
   4.165 +
   4.166 +
   4.167 +
   4.168 +Feather                     Standards Track                     [Page 3]
   4.169 +
   4.170 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
   4.171 +
   4.172 +
   4.173 +   are stored in a central database, giving subscribers the ability to
   4.174 +   select only those articles they wish to read.
   4.175 +
   4.176 +   The Netnews model provides for indexing, cross-referencing, and
   4.177 +   expiration of aged messages.  NNTP is designed for efficient
   4.178 +   transmission of Netnews articles over a reliable full duplex
   4.179 +   communication channel.
   4.180 +
   4.181 +   Although the protocol specification in this document is largely
   4.182 +   compatible with the version specified in RFC 977 [RFC977], a number
   4.183 +   of changes are summarised in Appendix D.  In particular:
   4.184 +
   4.185 +   o  the default character set is changed from US-ASCII [ANSI1986] to
   4.186 +      UTF-8 [RFC3629] (note that US-ASCII is a subset of UTF-8);
   4.187 +
   4.188 +   o  a number of commands that were optional in RFC 977 or that have
   4.189 +      been taken from RFC 2980 [RFC2980] are now mandatory; and
   4.190 +
   4.191 +   o  a CAPABILITIES command has been added to allow clients to
   4.192 +      determine what functionality is available from a server.
   4.193 +
   4.194 +   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   4.195 +   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
   4.196 +   document are to be interpreted as described in RFC 2119 [RFC2119].
   4.197 +
   4.198 +   An implementation is not compliant if it fails to satisfy one or more
   4.199 +   of the MUST requirements for this protocol.  An implementation that
   4.200 +   satisfies all the MUST and all the SHOULD requirements for its
   4.201 +   protocols is said to be "unconditionally compliant"; one that
   4.202 +   satisfies all the MUST requirements but not all the SHOULD
   4.203 +   requirements for NNTP is said to be "conditionally compliant".
   4.204 +
   4.205 +   For the remainder of this document, the terms "client" and "client
   4.206 +   host" refer to a host making use of the NNTP service, while the terms
   4.207 +   "server" and "server host" refer to a host that offers the NNTP
   4.208 +   service.
   4.209 +
   4.210 +1.1.  Author's Note
   4.211 +
   4.212 +   This document is written in XML using an NNTP-specific DTD.  Custom
   4.213 +   software is used to convert this to RFC 2629 [RFC2629] format, and
   4.214 +   then the public "xml2rfc" package to further reduce this to text,
   4.215 +   nroff source, and HTML.
   4.216 +
   4.217 +   No perl was used in producing this document.
   4.218 +
   4.219 +
   4.220 +
   4.221 +
   4.222 +
   4.223 +
   4.224 +Feather                     Standards Track                     [Page 4]
   4.225 +
   4.226 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
   4.227 +
   4.228 +
   4.229 +2.  Notation
   4.230 +
   4.231 +   The following notational conventions are used in this document.
   4.232 +
   4.233 +     UPPERCASE     indicates literal text to be included in the
   4.234 +                   command.
   4.235 +
   4.236 +     lowercase     indicates a token described elsewhere.
   4.237 +
   4.238 +     [brackets]    indicate that the enclosed material is optional.
   4.239 +
   4.240 +     elliptical    indicates that the argument may be repeated any
   4.241 +     ... marks     number of times (it must occur at least once).
   4.242 +
   4.243 +     vertical|bar  indicates a choice of two mutually exclusive
   4.244 +                   arguments (exactly one must be provided).
   4.245 +
   4.246 +   The name "message-id" for a command or response argument indicates
   4.247 +   that it is the message-id of an article as described in Section 3.6,
   4.248 +   including the angle brackets.
   4.249 +
   4.250 +   The name "wildmat" for an argument indicates that it is a wildmat as
   4.251 +   defined in Section 4.  If the argument does not meet the requirements
   4.252 +   of that section (for example, if it does not fit the grammar of
   4.253 +   Section 4.1), the NNTP server MAY place some interpretation on it
   4.254 +   (not specified by this document) or otherwise MUST treat it as a
   4.255 +   syntax error.
   4.256 +
   4.257 +   Responses for each command will be described in tables listing the
   4.258 +   required format of a response followed by the meaning that should be
   4.259 +   ascribed to that response.
   4.260 +
   4.261 +   The terms "NUL", "TAB", "LF", "CR, and "space" refer to the octets
   4.262 +   %x00, %x09, %x0A, %x0D, and %x20, respectively (that is, the octets
   4.263 +   with those codes in US-ASCII [ANSI1986] and thus in UTF-8 [RFC3629]).
   4.264 +   The term "CRLF" or "CRLF pair" means the sequence CR immediately
   4.265 +   followed by LF (that is, %x0D.0A).  A "printable US-ASCII character"
   4.266 +   is an octet in the range %x21-7E.  Quoted characters refer to the
   4.267 +   octets with those codes in US-ASCII (so "." and "<" refer to %x2E and
   4.268 +   %x3C) and will always be printable US-ASCII characters; similarly,
   4.269 +   "digit" refers to the octets %x30-39.
   4.270 +
   4.271 +   A "keyword" MUST consist only of US-ASCII letters, digits, and the
   4.272 +   characters dot (".") and dash ("-") and MUST begin with a letter.
   4.273 +   Keywords MUST be at least three characters in length.
   4.274 +
   4.275 +
   4.276 +
   4.277 +
   4.278 +
   4.279 +
   4.280 +Feather                     Standards Track                     [Page 5]
   4.281 +
   4.282 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
   4.283 +
   4.284 +
   4.285 +   Examples in this document are not normative but serve to illustrate
   4.286 +   usages, arguments, and responses.  In the examples, a "[C]" will be
   4.287 +   used to represent the client host and an "[S]" will be used to
   4.288 +   represent the server host.  Most of the examples do not rely on a
   4.289 +   particular server state.  In some cases, however, they do assume that
   4.290 +   the currently selected newsgroup (see the GROUP command,
   4.291 +   Section 6.1.1) is invalid; when so, this is indicated at the start of
   4.292 +   the example.  Examples may use commands or other keywords not defined
   4.293 +   in this specification (such as an XENCRYPT command).  These will be
   4.294 +   used to illustrate some point and do not imply that any such command
   4.295 +   is defined elsewhere or needs to exist in any particular
   4.296 +   implementation.
   4.297 +
   4.298 +   Terms that might be read as specifying details of a client or server
   4.299 +   implementation, such as "database", are used simply to ease
   4.300 +   description.  Provided that implementations conform to the protocol
   4.301 +   and format specifications in this document, no specific technique is
   4.302 +   mandated.
   4.303 +
   4.304 +3.  Basic Concepts
   4.305 +
   4.306 +3.1.  Commands and Responses
   4.307 +
   4.308 +   NNTP operates over any reliable bi-directional 8-bit-wide data stream
   4.309 +   channel.  When the connection is established, the NNTP server host
   4.310 +   MUST send a greeting.  The client host and server host then exchange
   4.311 +   commands and responses (respectively) until the connection is closed
   4.312 +   or aborted.  If the connection used is TCP, then the server host
   4.313 +   starts the NNTP service by listening on a TCP port.  When a client
   4.314 +   host wishes to make use of the service, it MUST establish a TCP
   4.315 +   connection with the server host by connecting to that host on the
   4.316 +   same port on which the server is listening.
   4.317 +
   4.318 +   The character set for all NNTP commands is UTF-8 [RFC3629].  Commands
   4.319 +   in NNTP MUST consist of a keyword, which MAY be followed by one or
   4.320 +   more arguments.  A CRLF pair MUST terminate all commands.  Multiple
   4.321 +   commands MUST NOT be on the same line.  Unless otherwise noted
   4.322 +   elsewhere in this document, arguments SHOULD consist of printable US-
   4.323 +   ASCII characters.  Keywords and arguments MUST each be separated by
   4.324 +   one or more space or TAB characters.  Command lines MUST NOT exceed
   4.325 +   512 octets, which includes the terminating CRLF pair.  The arguments
   4.326 +   MUST NOT exceed 497 octets.  A server MAY relax these limits for
   4.327 +   commands defined in an extension.
   4.328 +
   4.329 +   Where this specification permits UTF-8 characters outside the range
   4.330 +   of U+0000 to U+007F, implementations MUST NOT use the Byte Order Mark
   4.331 +   (U+FEFF, encoding %xEF.BB.BF) and MUST use the Word Joiner (U+2060,
   4.332 +   encoding %xE2.91.A0) for the meaning Zero Width No-Break Space in
   4.333 +
   4.334 +
   4.335 +
   4.336 +Feather                     Standards Track                     [Page 6]
   4.337 +
   4.338 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
   4.339 +
   4.340 +
   4.341 +   command lines and the initial lines of responses.  Implementations
   4.342 +   SHOULD apply these same principles throughout.
   4.343 +
   4.344 +   The term "character" means a single Unicode code point.
   4.345 +   Implementations are not required to carry out Unicode normalisation.
   4.346 +   Thus, U+0084 (A-dieresis) is one character, while U+0041 U+0308 (A
   4.347 +   composed with dieresis) is two; the two need not be treated as
   4.348 +   equivalent.
   4.349 +
   4.350 +   Commands may have variants; if so, they use a second keyword
   4.351 +   immediately after the first to indicate which variant is required.
   4.352 +   The only such commands in this specification are LIST and MODE.  Note
   4.353 +   that such variants are sometimes referred to as if they were commands
   4.354 +   in their own right: "the LIST ACTIVE" command should be read as
   4.355 +   shorthand for "the ACTIVE variant of the LIST command".
   4.356 +
   4.357 +   Keywords are case insensitive; the case of keywords for commands MUST
   4.358 +   be ignored by the server.  Command and response arguments are case or
   4.359 +   language specific only when stated, either in this document or in
   4.360 +   other relevant specifications.
   4.361 +
   4.362 +   In some cases, a command involves more data than just a single line.
   4.363 +   The further data may be sent either immediately after the command
   4.364 +   line (there are no instances of this in this specification, but there
   4.365 +   are in extensions such as [NNTP-STREAM]) or following a request from
   4.366 +   the server (indicated by a 3xx response).
   4.367 +
   4.368 +   Each response MUST start with a three-digit response code that is
   4.369 +   sufficient to distinguish all responses.  Certain valid responses are
   4.370 +   defined to be multi-line; for all others, the response is contained
   4.371 +   in a single line.  The initial line of the response MUST NOT exceed
   4.372 +   512 octets, which includes the response code and the terminating CRLF
   4.373 +   pair; an extension MAY specify a greater maximum for commands that it
   4.374 +   defines, but not for any other command.  Single-line responses
   4.375 +   consist of an initial line only.  Multi-line responses consist of an
   4.376 +   initial line followed by a multi-line data block.
   4.377 +
   4.378 +   An NNTP server MAY have an inactivity autologout timer.  Such a timer
   4.379 +   SHOULD be of at least three minutes' duration, with the exception
   4.380 +   that there MAY be a shorter limit on how long the server is willing
   4.381 +   to wait for the first command from the client.  The receipt of any
   4.382 +   command from the client during the timer interval SHOULD suffice to
   4.383 +   reset the autologout timer.  Similarly, the receipt of any
   4.384 +   significant amount of data from a client that is sending a multi-line
   4.385 +   data block (such as during a POST or IHAVE command) SHOULD suffice to
   4.386 +   reset the autologout timer.  When the timer expires, the server
   4.387 +   SHOULD close the connection without sending any response to the
   4.388 +   client.
   4.389 +
   4.390 +
   4.391 +
   4.392 +Feather                     Standards Track                     [Page 7]
   4.393 +
   4.394 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
   4.395 +
   4.396 +
   4.397 +3.1.1.  Multi-line Data Blocks
   4.398 +
   4.399 +   A multi-line data block is used in certain commands and responses.
   4.400 +   It MUST adhere to the following rules:
   4.401 +
   4.402 +   1.  The block consists of a sequence of zero or more "lines", each
   4.403 +       being a stream of octets ending with a CRLF pair.  Apart from
   4.404 +       those line endings, the stream MUST NOT include the octets NUL,
   4.405 +       LF, or CR.
   4.406 +
   4.407 +   2.  In a multi-line response, the block immediately follows the CRLF
   4.408 +       at the end of the initial line of the response.  When used in any
   4.409 +       other context, the specific command will define when the block is
   4.410 +       sent.
   4.411 +
   4.412 +   3.  If any line of the data block begins with the "termination octet"
   4.413 +       ("." or %x2E), that line MUST be "dot-stuffed" by prepending an
   4.414 +       additional termination octet to that line of the block.
   4.415 +
   4.416 +   4.  The lines of the block MUST be followed by a terminating line
   4.417 +       consisting of a single termination octet followed by a CRLF pair
   4.418 +       in the normal way.  Thus, unless it is empty, a multi-line block
   4.419 +       is always terminated with the five octets CRLF "." CRLF
   4.420 +       (%x0D.0A.2E.0D.0A).
   4.421 +
   4.422 +   5.  When a multi-line block is interpreted, the "dot-stuffing" MUST
   4.423 +       be undone; i.e., the recipient MUST ensure that, in any line
   4.424 +       beginning with the termination octet followed by octets other
   4.425 +       than a CRLF pair, that initial termination octet is disregarded.
   4.426 +
   4.427 +   6.  Likewise, the terminating line ("." CRLF or %x2E.0D.0A) MUST NOT
   4.428 +       be considered part of the multi-line block; i.e., the recipient
   4.429 +       MUST ensure that any line beginning with the termination octet
   4.430 +       followed immediately by a CRLF pair is disregarded.  (The first
   4.431 +       CRLF pair of the terminating CRLF "." CRLF of a non-empty block
   4.432 +       is, of course, part of the last line of the block.)
   4.433 +
   4.434 +   Note that texts using an encoding (such as UTF-16 or UTF-32) that may
   4.435 +   contain the octets NUL, LF, or CR other than a CRLF pair cannot be
   4.436 +   reliably conveyed in the above format (that is, they violate the MUST
   4.437 +   requirement above).  However, except when stated otherwise, this
   4.438 +   specification does not require the content to be UTF-8, and therefore
   4.439 +   (subject to that same requirement) it MAY include octets above and
   4.440 +   below 128 mixed arbitrarily.
   4.441 +
   4.442 +   This document does not place any limit on the length of a line in a
   4.443 +   multi-line block.  However, the standards that define the format of
   4.444 +   articles may do so.
   4.445 +
   4.446 +
   4.447 +
   4.448 +Feather                     Standards Track                     [Page 8]
   4.449 +
   4.450 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
   4.451 +
   4.452 +
   4.453 +3.2.  Response Codes
   4.454 +
   4.455 +   Each response MUST begin with a three-digit status indicator.  These
   4.456 +   are status reports from the server and indicate the response to the
   4.457 +   last command received from the client.
   4.458 +
   4.459 +   The first digit of the response broadly indicates the success,
   4.460 +   failure, or progress of the previous command:
   4.461 +
   4.462 +      1xx - Informative message
   4.463 +      2xx - Command completed OK
   4.464 +      3xx - Command OK so far; send the rest of it
   4.465 +      4xx - Command was syntactically correct but failed for some reason
   4.466 +      5xx - Command unknown, unsupported, unavailable, or syntax error
   4.467 +
   4.468 +   The next digit in the code indicates the function response category:
   4.469 +
   4.470 +      x0x - Connection, setup, and miscellaneous messages
   4.471 +      x1x - Newsgroup selection
   4.472 +      x2x - Article selection
   4.473 +      x3x - Distribution functions
   4.474 +      x4x - Posting
   4.475 +      x8x - Reserved for authentication and privacy extensions
   4.476 +      x9x - Reserved for private use (non-standard extensions)
   4.477 +
   4.478 +   Certain responses contain arguments such as numbers and names in
   4.479 +   addition to the status indicator.  In those cases, to simplify
   4.480 +   interpretation by the client, the number and type of such arguments
   4.481 +   is fixed for each response code, as is whether the code is
   4.482 +   single-line or multi-line.  Any extension MUST follow this principle
   4.483 +   as well.  Note that, for historical reasons, the 211 response code is
   4.484 +   an exception to this in that the response may be single-line or
   4.485 +   multi-line depending on the command (GROUP or LISTGROUP) that
   4.486 +   generated it.  In all other cases, the client MUST only use the
   4.487 +   status indicator itself to determine the nature of the response.  The
   4.488 +   exact response codes that can be returned by any given command are
   4.489 +   detailed in the description of that command.
   4.490 +
   4.491 +   Arguments MUST be separated from the numeric status indicator and
   4.492 +   from each other by a single space.  All numeric arguments MUST be in
   4.493 +   base 10 (decimal) format and MAY have leading zeros.  String
   4.494 +   arguments MUST contain at least one character and MUST NOT contain
   4.495 +   TAB, LF, CR, or space.  The server MAY add any text after the
   4.496 +   response code or last argument, as appropriate, and the client MUST
   4.497 +   NOT make decisions based on this text.  Such text MUST be separated
   4.498 +   from the numeric status indicator or the last argument by at least
   4.499 +   one space.
   4.500 +
   4.501 +
   4.502 +
   4.503 +
   4.504 +Feather                     Standards Track                     [Page 9]
   4.505 +
   4.506 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
   4.507 +
   4.508 +
   4.509 +   The server MUST respond to any command with the appropriate generic
   4.510 +   response (given in Section 3.2.1) if it represents the situation.
   4.511 +   Otherwise, each recognized command MUST return one of the response
   4.512 +   codes specifically listed in its description or in an extension.  A
   4.513 +   server MAY provide extensions to this specification, including new
   4.514 +   commands, new variants or features of existing commands, and other
   4.515 +   ways of changing the internal state of the server.  However, the
   4.516 +   server MUST NOT produce any other responses to a client that does not
   4.517 +   invoke any of the additional features.  (Therefore, a client that
   4.518 +   restricts itself to this specification will only receive the
   4.519 +   responses that are listed.)
   4.520 +
   4.521 +   If a client receives an unexpected response, it SHOULD use the first
   4.522 +   digit of the response to determine the result.  For example, an
   4.523 +   unexpected 2xx should be taken as success, and an unexpected 4xx or
   4.524 +   5xx as failure.
   4.525 +
   4.526 +   Response codes not specified in this document MAY be used for any
   4.527 +   installation-specific additional commands also not specified.  These
   4.528 +   SHOULD be chosen to fit the pattern of x9x specified above.
   4.529 +
   4.530 +   Neither this document nor any registered extension (see
   4.531 +   Section 3.3.3) will specify any response codes of the x9x pattern.
   4.532 +   (Implementers of extensions are accordingly cautioned not to use such
   4.533 +   responses for extensions that may subsequently be submitted for
   4.534 +   registration.)
   4.535 +
   4.536 +3.2.1.  Generic Response Codes
   4.537 +
   4.538 +   The server MUST respond to any command with the appropriate one of
   4.539 +   the following generic responses if it represents the situation.
   4.540 +
   4.541 +   If the command is not recognized, or if it is an optional command
   4.542 +   that is not implemented by the server, the response code 500 MUST be
   4.543 +   returned.
   4.544 +
   4.545 +   If there is a syntax error in the arguments of a recognized command,
   4.546 +   including the case where more arguments are provided than the command
   4.547 +   specifies or the command line is longer than the server accepts, the
   4.548 +   response code 501 MUST be returned.  The line MUST NOT be truncated
   4.549 +   or split and then interpreted.  Note that where a command has
   4.550 +   variants depending on a second keyword (e.g., LIST ACTIVE and LIST
   4.551 +   NEWSGROUPS), 501 MUST be used when the base command is implemented
   4.552 +   but the requested variant is not, and 500 MUST be used only when the
   4.553 +   base command itself is not implemented.
   4.554 +
   4.555 +   If an argument is required to be a base64-encoded string [RFC4648]
   4.556 +   (there are no such arguments in this specification, but there may be
   4.557 +
   4.558 +
   4.559 +
   4.560 +Feather                     Standards Track                    [Page 10]
   4.561 +
   4.562 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
   4.563 +
   4.564 +
   4.565 +   in extensions) and is not validly encoded, the response code 504 MUST
   4.566 +   be returned.
   4.567 +
   4.568 +   If the server experiences an internal fault or problem that means it
   4.569 +   is unable to carry out the command (for example, a necessary file is
   4.570 +   missing or a necessary service could not be contacted), the response
   4.571 +   code 403 MUST be returned.  If the server recognizes the command but
   4.572 +   does not provide an optional feature (for example, because it does
   4.573 +   not store the required information), or if it only handles a subset
   4.574 +   of legitimate cases (see the HDR command, Section 8.5, for an
   4.575 +   example), the response code 503 MUST be returned.
   4.576 +
   4.577 +   If the client is not authorized to use the specified facility when
   4.578 +   the server is in its current state, then the appropriate one of the
   4.579 +   following response codes MUST be used.
   4.580 +
   4.581 +   502: It is necessary to terminate the connection and to start a new
   4.582 +      one with the appropriate authority before the command can be used.
   4.583 +      Historically, some mode-switching servers (see Section 3.4.1) used
   4.584 +      this response to indicate that this command will become available
   4.585 +      after the MODE READER command (Section 5.3) is used, but this
   4.586 +      usage does not conform to this specification and MUST NOT be used.
   4.587 +      Note that the server MUST NOT close the connection immediately
   4.588 +      after a 502 response except at the initial connection
   4.589 +      (Section 5.1) and with the MODE READER command.
   4.590 +
   4.591 +   480: The client must authenticate itself to the server (that is, it
   4.592 +      must provide information as to the identity of the client) before
   4.593 +      the facility can be used on this connection.  This will involve
   4.594 +      the use of an authentication extension such as [NNTP-AUTH].
   4.595 +
   4.596 +   483: The client must negotiate appropriate privacy protection on the
   4.597 +      connection.  This will involve the use of a privacy extension such
   4.598 +      as [NNTP-TLS].
   4.599 +
   4.600 +   401: The client must change the state of the connection in some other
   4.601 +      manner.  The first argument of the response MUST be the capability
   4.602 +      label (see Section 5.2) of the facility that provides the
   4.603 +      necessary mechanism (usually an extension, which may be a private
   4.604 +      extension).  The server MUST NOT use this response code except as
   4.605 +      specified by the definition of the capability in question.
   4.606 +
   4.607 +   If the server has to terminate the connection for some reason, it
   4.608 +   MUST give a 400 response code to the next command and then
   4.609 +   immediately close the connection.  Following a 400 response, clients
   4.610 +   SHOULD NOT simply reconnect immediately and retry the same actions.
   4.611 +   Rather, a client SHOULD either use an exponentially increasing delay
   4.612 +   between retries (e.g., double the waiting time after each 400
   4.613 +
   4.614 +
   4.615 +
   4.616 +Feather                     Standards Track                    [Page 11]
   4.617 +
   4.618 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
   4.619 +
   4.620 +
   4.621 +   response) or present any associated text to the user for them to
   4.622 +   decide whether and when to retry.
   4.623 +
   4.624 +   The client MUST be prepared to receive any of these responses for any
   4.625 +   command (except, of course, that the server MUST NOT generate a 500
   4.626 +   response code for mandatory commands).
   4.627 +
   4.628 +3.2.1.1.  Examples
   4.629 +
   4.630 +   Example of an unknown command:
   4.631 +
   4.632 +      [C] MAIL
   4.633 +      [S] 500 Unknown command
   4.634 +
   4.635 +   Example of an unsupported command:
   4.636 +
   4.637 +      [C] CAPABILITIES
   4.638 +      [S] 101 Capability list:
   4.639 +      [S] VERSION 2
   4.640 +      [S] READER
   4.641 +      [S] NEWNEWS
   4.642 +      [S] LIST ACTIVE NEWSGROUPS
   4.643 +      [S] .
   4.644 +      [C] OVER
   4.645 +      [S] 500 Unknown command
   4.646 +
   4.647 +   Example of an unsupported variant:
   4.648 +
   4.649 +      [C] MODE POSTER
   4.650 +      [S] 501 Unknown MODE option
   4.651 +
   4.652 +   Example of a syntax error:
   4.653 +
   4.654 +      [C] ARTICLE a.message.id@no.angle.brackets
   4.655 +      [S] 501 Syntax error
   4.656 +
   4.657 +   Example of an overlong command line:
   4.658 +
   4.659 +      [C] HEAD 53 54 55
   4.660 +      [S] 501 Too many arguments
   4.661 +
   4.662 +   Example of a bad wildmat:
   4.663 +
   4.664 +      [C] LIST ACTIVE u[ks].*
   4.665 +      [S] 501 Syntax error
   4.666 +
   4.667 +
   4.668 +
   4.669 +
   4.670 +
   4.671 +
   4.672 +Feather                     Standards Track                    [Page 12]
   4.673 +
   4.674 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
   4.675 +
   4.676 +
   4.677 +   Example of a base64-encoding error (the second argument is meant to
   4.678 +   be base64 encoded):
   4.679 +
   4.680 +      [C] XENCRYPT RSA abcd=efg
   4.681 +      [S] 504 Base64 encoding error
   4.682 +
   4.683 +   Example of an attempt to access a facility not available to this
   4.684 +   connection:
   4.685 +
   4.686 +      [C] MODE READER
   4.687 +      [S] 200 Reader mode, posting permitted
   4.688 +      [C] IHAVE <i.am.an.article.you.will.want@example.com>
   4.689 +      [S] 500 Permission denied
   4.690 +
   4.691 +   Example of an attempt to access a facility requiring authentication:
   4.692 +
   4.693 +      [C] GROUP secret.group
   4.694 +      [S] 480 Permission denied
   4.695 +
   4.696 +   Example of a successful attempt following such authentication:
   4.697 +
   4.698 +      [C] XSECRET fred flintstone
   4.699 +      [S] 290 Password for fred accepted
   4.700 +      [C] GROUP secret.group
   4.701 +      [S] 211 5 1 20 secret.group selected
   4.702 +
   4.703 +   Example of an attempt to access a facility requiring privacy:
   4.704 +
   4.705 +      [C] GROUP secret.group
   4.706 +      [S] 483 Secure connection required
   4.707 +      [C] XENCRYPT
   4.708 +      [Client and server negotiate encryption on the link]
   4.709 +      [S] 283 Encrypted link established
   4.710 +      [C] GROUP secret.group
   4.711 +      [S] 211 5 1 20 secret.group selected
   4.712 +
   4.713 +   Example of a need to change mode before a facility is used:
   4.714 +
   4.715 +      [C] GROUP binary.group
   4.716 +      [S] 401 XHOST Not on this virtual host
   4.717 +      [C] XHOST binary.news.example.org
   4.718 +      [S] 290 binary.news.example.org virtual host selected
   4.719 +      [C] GROUP binary.group
   4.720 +      [S] 211 5 1 77 binary.group selected
   4.721 +
   4.722 +
   4.723 +
   4.724 +
   4.725 +
   4.726 +
   4.727 +
   4.728 +Feather                     Standards Track                    [Page 13]
   4.729 +
   4.730 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
   4.731 +
   4.732 +
   4.733 +   Example of a temporary failure:
   4.734 +
   4.735 +      [C] GROUP archive.local
   4.736 +      [S] 403 Archive server temporarily offline
   4.737 +
   4.738 +   Example of the server needing to close down immediately:
   4.739 +
   4.740 +      [C] ARTICLE 123
   4.741 +      [S] 400 Power supply failed, running on UPS
   4.742 +      [Server closes connection.]
   4.743 +
   4.744 +3.3.  Capabilities and Extensions
   4.745 +
   4.746 +   Not all NNTP servers provide exactly the same facilities, both
   4.747 +   because this specification allows variation and because servers may
   4.748 +   provide extensions.  A set of facilities that are related are called
   4.749 +   a "capability".  This specification provides a way to determine what
   4.750 +   capabilities are available, includes a list of standard capabilities,
   4.751 +   and includes a mechanism (the extension mechanism) for defining new
   4.752 +   capabilities.
   4.753 +
   4.754 +3.3.1.  Capability Descriptions
   4.755 +
   4.756 +   A client can determine the available capabilities of the server by
   4.757 +   using the CAPABILITIES command (Section 5.2).  This returns a
   4.758 +   capability list, which is a list of capability lines.  Each line
   4.759 +   describes one available capability.
   4.760 +
   4.761 +   Each capability line consists of one or more tokens, which MUST be
   4.762 +   separated by one or more space or TAB characters.  A token is a
   4.763 +   string of 1 or more printable UTF-8 characters (that is, either
   4.764 +   printable US-ASCII characters or any UTF-8 sequence outside the US-
   4.765 +   ASCII range, but not space or TAB).  Unless stated otherwise, tokens
   4.766 +   are case insensitive.  Each capability line consists of the
   4.767 +   following:
   4.768 +
   4.769 +   o  The capability label, which is a keyword indicating the
   4.770 +      capability.  A capability label may be defined by this
   4.771 +      specification or a successor, or by an extension.
   4.772 +
   4.773 +   o  The label is then followed by zero or more tokens, which are
   4.774 +      arguments of the capability.  The form and meaning of these tokens
   4.775 +      is specific to each capability.
   4.776 +
   4.777 +   The server MUST ensure that the capability list accurately reflects
   4.778 +   the capabilities (including extensions) currently available.  If a
   4.779 +   capability is only available with the server in a certain state (for
   4.780 +   example, only after authentication), the list MUST only include the
   4.781 +
   4.782 +
   4.783 +
   4.784 +Feather                     Standards Track                    [Page 14]
   4.785 +
   4.786 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
   4.787 +
   4.788 +
   4.789 +   capability label when the server is in that state.  Similarly, if
   4.790 +   only some of the commands in an extension will be available, or if
   4.791 +   the behaviour of the extension will change in some other manner,
   4.792 +   according to the state of the server, this MUST be indicated by
   4.793 +   different arguments in the capability line.
   4.794 +
   4.795 +   Note that a capability line can only begin with a letter.  Lines
   4.796 +   beginning with other characters are reserved for future versions of
   4.797 +   this specification.  In order to interoperate with such versions,
   4.798 +   clients MUST be prepared to receive lines beginning with other
   4.799 +   characters and MUST ignore any they do not understand.
   4.800 +
   4.801 +3.3.2.  Standard Capabilities
   4.802 +
   4.803 +   The following capabilities are defined by this specification.
   4.804 +
   4.805 +   VERSION
   4.806 +      This capability MUST be advertised by all servers and MUST be the
   4.807 +      first capability in the capability list; it indicates the
   4.808 +      version(s) of NNTP that the server supports.  There must be at
   4.809 +      least one argument; each argument is a decimal number and MUST NOT
   4.810 +      have a leading zero.  Version numbers are assigned only in RFCs
   4.811 +      that update or replace this specification; servers MUST NOT create
   4.812 +      their own version numbers.
   4.813 +
   4.814 +      The version number of this specification is 2.
   4.815 +
   4.816 +   READER
   4.817 +      This capability indicates that the server implements the various
   4.818 +      commands useful for reading clients.
   4.819 +
   4.820 +   IHAVE
   4.821 +      This capability indicates that the server implements the IHAVE
   4.822 +      command.
   4.823 +
   4.824 +   POST
   4.825 +      This capability indicates that the server implements the POST
   4.826 +      command.
   4.827 +
   4.828 +   NEWNEWS
   4.829 +      This capability indicates that the server implements the NEWNEWS
   4.830 +      command.
   4.831 +
   4.832 +   HDR
   4.833 +      This capability indicates that the server implements the header
   4.834 +      access commands (HDR and LIST HEADERS).
   4.835 +
   4.836 +
   4.837 +
   4.838 +
   4.839 +
   4.840 +Feather                     Standards Track                    [Page 15]
   4.841 +
   4.842 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
   4.843 +
   4.844 +
   4.845 +   OVER
   4.846 +      This capability indicates that the server implements the overview
   4.847 +      access commands (OVER and LIST OVERVIEW.FMT).  If and only if the
   4.848 +      server supports the message-id form of the OVER command, there
   4.849 +      must be a single argument MSGID.
   4.850 +
   4.851 +   LIST
   4.852 +      This capability indicates that the server implements at least one
   4.853 +      variant of the LIST command.  There MUST be one argument for each
   4.854 +      variant of the LIST command supported by the server, giving the
   4.855 +      keyword for that variant.
   4.856 +
   4.857 +   IMPLEMENTATION
   4.858 +      This capability MAY be provided by a server.  If so, the arguments
   4.859 +      SHOULD be used to provide information such as the server software
   4.860 +      name and version number.  The client MUST NOT use this line to
   4.861 +      determine capabilities of the server.  (While servers often
   4.862 +      provide this information in the initial greeting, clients need to
   4.863 +      guess whether this is the case; this capability makes it clear
   4.864 +      what the information is.)
   4.865 +
   4.866 +   MODE-READER
   4.867 +      This capability indicates that the server is mode-switching
   4.868 +      (Section 3.4.2) and that the MODE READER command needs to be used
   4.869 +      to enable the READER capability.
   4.870 +
   4.871 +3.3.3.  Extensions
   4.872 +
   4.873 +   Although NNTP is widely and robustly deployed, some parts of the
   4.874 +   Internet community might wish to extend the NNTP service.  It must be
   4.875 +   emphasized that any extension to NNTP should not be considered
   4.876 +   lightly.  NNTP's strength comes primarily from its simplicity.
   4.877 +   Experience with many protocols has shown that:
   4.878 +
   4.879 +      Protocols with few options tend towards ubiquity, whilst protocols
   4.880 +      with many options tend towards obscurity.
   4.881 +
   4.882 +   This means that each and every extension, regardless of its benefits,
   4.883 +   must be carefully scrutinized with respect to its implementation,
   4.884 +   deployment, and interoperability costs.  In many cases, the cost of
   4.885 +   extending the NNTP service will likely outweigh the benefit.
   4.886 +
   4.887 +   An extension is a package of associated facilities, often but not
   4.888 +   always including one or more new commands.  Each extension MUST
   4.889 +   define at least one new capability label (this will often, but need
   4.890 +   not, be the name of one of these new commands).  While any additional
   4.891 +   capability information can normally be specified using arguments to
   4.892 +
   4.893 +
   4.894 +
   4.895 +
   4.896 +Feather                     Standards Track                    [Page 16]
   4.897 +
   4.898 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
   4.899 +
   4.900 +
   4.901 +   that label, an extension MAY define more than one capability label.
   4.902 +   However, this SHOULD be limited to exceptional circumstances.
   4.903 +
   4.904 +   An extension is either a private extension, or its capabilities are
   4.905 +   included in the IANA registry of capabilities (see Section 3.3.4) and
   4.906 +   it is defined in an RFC (in which case it is a "registered
   4.907 +   extension").  Such RFCs either must be on the standards track or must
   4.908 +   define an IESG-approved experimental protocol.
   4.909 +
   4.910 +   The definition of an extension must include the following:
   4.911 +
   4.912 +   o  a descriptive name for the extension.
   4.913 +
   4.914 +   o  the capability label or labels defined by the extension (the
   4.915 +      capability label of a registered extension MUST NOT begin with
   4.916 +      "X").
   4.917 +
   4.918 +   o  The syntax, values, and meanings of any arguments for each
   4.919 +      capability label defined by the extension.
   4.920 +
   4.921 +   o  Any new NNTP commands associated with the extension (the names of
   4.922 +      commands associated with registered extensions MUST NOT begin with
   4.923 +      "X").
   4.924 +
   4.925 +   o  The syntax and possible values of arguments associated with the
   4.926 +      new NNTP commands.
   4.927 +
   4.928 +   o  The response codes and possible values of arguments for the
   4.929 +      responses of the new NNTP commands.
   4.930 +
   4.931 +   o  Any new arguments the extension associates with any other
   4.932 +      pre-existing NNTP commands.
   4.933 +
   4.934 +   o  Any increase in the maximum length of commands and initial
   4.935 +      response lines over the value specified in this document.
   4.936 +
   4.937 +   o  A specific statement about the effect on pipelining that this
   4.938 +      extension may have (if any).
   4.939 +
   4.940 +   o  A specific statement about the circumstances when use of this
   4.941 +      extension can alter the contents of the capabilities list (other
   4.942 +      than the new capability labels it defines).
   4.943 +
   4.944 +   o  A specific statement about the circumstances under which the
   4.945 +      extension can cause any pre-existing command to produce a 401,
   4.946 +      480, or 483 response.
   4.947 +
   4.948 +
   4.949 +
   4.950 +
   4.951 +
   4.952 +Feather                     Standards Track                    [Page 17]
   4.953 +
   4.954 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
   4.955 +
   4.956 +
   4.957 +   o  A description of how the use of MODE READER on a mode-switching
   4.958 +      server interacts with the extension.
   4.959 +
   4.960 +   o  A description of how support for the extension affects the
   4.961 +      behaviour of a server and NNTP client in any other manner not
   4.962 +      outlined above.
   4.963 +
   4.964 +   o  Formal syntax as described in Section 9.9.
   4.965 +
   4.966 +   A private extension MAY or MAY NOT be included in the capabilities
   4.967 +   list.  If it is, the capability label MUST begin with "X".  A server
   4.968 +   MAY provide additional keywords (for new commands and also for new
   4.969 +   variants of existing commands) as part of a private extension.  To
   4.970 +   avoid the risk of a clash with a future registered extension, these
   4.971 +   keywords SHOULD begin with "X".
   4.972 +
   4.973 +   If the server advertises a capability defined by a registered
   4.974 +   extension, it MUST implement the extension so as to fully conform
   4.975 +   with the specification (for example, it MUST implement all the
   4.976 +   commands that the extension describes as mandatory).  If it does not
   4.977 +   implement the extension as specified, it MUST NOT list the extension
   4.978 +   in the capabilities list under its registered name.  In that case, it
   4.979 +   MAY, but SHOULD NOT, provide a private extension (not listed, or
   4.980 +   listed with a different name) that implements part of the extension
   4.981 +   or implements the commands of the extension with a different meaning.
   4.982 +
   4.983 +   A server MUST NOT send different response codes to basic NNTP
   4.984 +   commands documented here or to commands documented in registered
   4.985 +   extensions in response to the availability or use of a private
   4.986 +   extension.
   4.987 +
   4.988 +3.3.4.  Initial IANA Register
   4.989 +
   4.990 +   IANA will maintain a registry of NNTP capability labels.  All
   4.991 +   capability labels in the registry MUST be keywords and MUST NOT begin
   4.992 +   with X.
   4.993 +
   4.994 +
   4.995 +
   4.996 +
   4.997 +
   4.998 +
   4.999 +
  4.1000 +
  4.1001 +
  4.1002 +
  4.1003 +
  4.1004 +
  4.1005 +
  4.1006 +
  4.1007 +
  4.1008 +Feather                     Standards Track                    [Page 18]
  4.1009 +
  4.1010 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.1011 +
  4.1012 +
  4.1013 +   The initial content of the registry consists of these entries:
  4.1014 +
  4.1015 +   +-------------------+--------------------------+--------------------+
  4.1016 +   | Label             | Meaning                  | Definition         |
  4.1017 +   +-------------------+--------------------------+--------------------+
  4.1018 +   | AUTHINFO          | Authentication           | [NNTP-AUTH]        |
  4.1019 +   |                   |                          |                    |
  4.1020 +   | HDR               | Batched header retrieval | Section 3.3.2,     |
  4.1021 +   |                   |                          | Section 8.5, and   |
  4.1022 +   |                   |                          | Section 8.6        |
  4.1023 +   |                   |                          |                    |
  4.1024 +   | IHAVE             | IHAVE command available  | Section 3.3.2 and  |
  4.1025 +   |                   |                          | Section 6.3.2      |
  4.1026 +   |                   |                          |                    |
  4.1027 +   | IMPLEMENTATION    | Server                   | Section 3.3.2      |
  4.1028 +   |                   | implementation-specific  |                    |
  4.1029 +   |                   | information              |                    |
  4.1030 +   |                   |                          |                    |
  4.1031 +   | LIST              | LIST command variants    | Section 3.3.2 and  |
  4.1032 +   |                   |                          | Section 7.6.1      |
  4.1033 +   |                   |                          |                    |
  4.1034 +   | MODE-READER       | Mode-switching server    | Section 3.4.2      |
  4.1035 +   |                   | and MODE READER command  |                    |
  4.1036 +   |                   | available                |                    |
  4.1037 +   |                   |                          |                    |
  4.1038 +   | NEWNEWS           | NEWNEWS command          | Section 3.3.2 and  |
  4.1039 +   |                   | available                | Section 7.4        |
  4.1040 +   |                   |                          |                    |
  4.1041 +   | OVER              | Overview support         | Section 3.3.2,     |
  4.1042 +   |                   |                          | Section 8.3, and   |
  4.1043 +   |                   |                          | Section 8.4        |
  4.1044 +   |                   |                          |                    |
  4.1045 +   | POST              | POST command available   | Section 3.3.2 and  |
  4.1046 +   |                   |                          | Section 6.3.1      |
  4.1047 +   |                   |                          |                    |
  4.1048 +   | READER            | Reader commands          | Section 3.3.2      |
  4.1049 +   |                   | available                |                    |
  4.1050 +   |                   |                          |                    |
  4.1051 +   | SASL              | Supported SASL           | [NNTP-AUTH]        |
  4.1052 +   |                   | mechanisms               |                    |
  4.1053 +   |                   |                          |                    |
  4.1054 +   | STARTTLS          | Transport layer security | [NNTP-TLS]         |
  4.1055 +   |                   |                          |                    |
  4.1056 +   | STREAMING         | Streaming feeds          | [NNTP-STREAM]      |
  4.1057 +   |                   |                          |                    |
  4.1058 +   | VERSION           | Supported NNTP versions  | Section 3.3.2      |
  4.1059 +   +-------------------+--------------------------+--------------------+
  4.1060 +
  4.1061 +
  4.1062 +
  4.1063 +
  4.1064 +Feather                     Standards Track                    [Page 19]
  4.1065 +
  4.1066 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.1067 +
  4.1068 +
  4.1069 +3.4.  Mandatory and Optional Commands
  4.1070 +
  4.1071 +   For a number of reasons, not all the commands in this specification
  4.1072 +   are mandatory.  However, it is equally undesirable for every command
  4.1073 +   to be optional, since this means that a client will have no idea what
  4.1074 +   facilities are available.  Therefore, as a compromise, some of the
  4.1075 +   commands in this specification are mandatory (they must be supported
  4.1076 +   by all servers) while the remainder are not.  The latter are then
  4.1077 +   subdivided into bundles, each indicated by a single capability label.
  4.1078 +
  4.1079 +   o  If the label is included in the capability list returned by the
  4.1080 +      server, the server MUST support all commands in that bundle.
  4.1081 +
  4.1082 +   o  If the label is not included, the server MAY support none or some
  4.1083 +      of the commands but SHOULD NOT support all of them.  In general,
  4.1084 +      there will be no way for a client to determine which commands are
  4.1085 +      supported without trying them.
  4.1086 +
  4.1087 +   The bundles have been chosen to provide useful functionality, and
  4.1088 +   therefore server authors are discouraged from implementing only part
  4.1089 +   of a bundle.
  4.1090 +
  4.1091 +   The description of each command will either indicate that it is
  4.1092 +   mandatory, or will give, using the term "indicating capability", the
  4.1093 +   capability label indicating whether the bundle including this command
  4.1094 +   is available.
  4.1095 +
  4.1096 +   Where a server does not implement a command, it MUST always generate
  4.1097 +   a 500 generic response code (or a 501 generic response code in the
  4.1098 +   case of a variant of a command depending on a second keyword where
  4.1099 +   the base command is recognised).  Otherwise, the command MUST be
  4.1100 +   fully implemented as specified; a server MUST NOT only partially
  4.1101 +   implement any of the commands in this specification.  (Client authors
  4.1102 +   should note that some servers not conforming to this specification
  4.1103 +   will return a 502 generic response code to some commands that are not
  4.1104 +   implemented.)
  4.1105 +
  4.1106 +   Note: some commands have cases that require other commands to be used
  4.1107 +   first.  If the former command is implemented but the latter is not,
  4.1108 +   the former MUST still generate the relevant specific response code.
  4.1109 +   For example, if ARTICLE (Section 6.2.1) is implemented but GROUP
  4.1110 +   (Section 6.1.1) is not, the correct response to "ARTICLE 1234"
  4.1111 +   remains 412.
  4.1112 +
  4.1113 +
  4.1114 +
  4.1115 +
  4.1116 +
  4.1117 +
  4.1118 +
  4.1119 +
  4.1120 +Feather                     Standards Track                    [Page 20]
  4.1121 +
  4.1122 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.1123 +
  4.1124 +
  4.1125 +3.4.1.  Reading and Transit Servers
  4.1126 +
  4.1127 +   NNTP is traditionally used in two different ways.  The first use is
  4.1128 +   "reading", where the client fetches articles from a large store
  4.1129 +   maintained by the server for immediate or later presentation to a
  4.1130 +   user and sends articles created by that user back to the server (an
  4.1131 +   action called "posting") to be stored and distributed to other stores
  4.1132 +   and users.  The second use is for the bulk transfer of articles from
  4.1133 +   one store to another.  Since the hosts making this transfer tend to
  4.1134 +   be peers in a network that transmit articles among one another, and
  4.1135 +   not end-user systems, this process is called "peering" or "transit".
  4.1136 +   (Even so, one host is still the client and the other is the server).
  4.1137 +
  4.1138 +   In practice, these two uses are so different that some server
  4.1139 +   implementations are optimised for reading or for transit and, as a
  4.1140 +   result, do not offer the other facility or only offer limited
  4.1141 +   features.  Other implementations are more general and offer both.
  4.1142 +   This specification allows for this by bundling the relevant commands
  4.1143 +   accordingly: the IHAVE command is designed for transit, while the
  4.1144 +   commands indicated by the READER capability are designed for reading
  4.1145 +   clients.
  4.1146 +
  4.1147 +   Except as an effect of the MODE READER command (Section 5.3) on a
  4.1148 +   mode-switching server, once a server advertises either or both of the
  4.1149 +   IHAVE or READER capabilities, it MUST continue to advertise them for
  4.1150 +   the entire session.
  4.1151 +
  4.1152 +   A server MAY provide different modes of behaviour (transit, reader,
  4.1153 +   or a combination) to different client connections and MAY use
  4.1154 +   external information, such as the IP address of the client, to
  4.1155 +   determine which mode to provide to any given connection.
  4.1156 +
  4.1157 +   The official TCP port for the NNTP service is 119.  However, if a
  4.1158 +   host wishes to offer separate servers for transit and reading
  4.1159 +   clients, port 433 SHOULD be used for the transit server and 119 for
  4.1160 +   the reading server.
  4.1161 +
  4.1162 +3.4.2.  Mode Switching
  4.1163 +
  4.1164 +   An implementation MAY, but SHOULD NOT, provide both transit and
  4.1165 +   reader facilities on the same server but require the client to select
  4.1166 +   which it wishes to use.  Such an arrangement is called a
  4.1167 +   "mode-switching" server.
  4.1168 +
  4.1169 +
  4.1170 +
  4.1171 +
  4.1172 +
  4.1173 +
  4.1174 +
  4.1175 +
  4.1176 +Feather                     Standards Track                    [Page 21]
  4.1177 +
  4.1178 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.1179 +
  4.1180 +
  4.1181 +   A mode-switching server has two modes:
  4.1182 +
  4.1183 +   o  Transit mode, which applies after the initial connection.
  4.1184 +
  4.1185 +      *  It MUST advertise the MODE-READER capability.
  4.1186 +
  4.1187 +      *  It MUST NOT advertise the READER capability.
  4.1188 +
  4.1189 +      However, the server MAY cease to advertise the MODE-READER
  4.1190 +      capability after the client uses any command except CAPABILITIES.
  4.1191 +
  4.1192 +   o  Reading mode, after a successful MODE READER command (see Section
  4.1193 +      5.3).
  4.1194 +
  4.1195 +      *  It MUST NOT advertise the MODE-READER capability.
  4.1196 +
  4.1197 +      *  It MUST advertise the READER capability.
  4.1198 +
  4.1199 +      *  It MAY NOT advertise the IHAVE capability, even if it was
  4.1200 +         advertising it in transit mode.
  4.1201 +
  4.1202 +   A client SHOULD only issue a MODE READER command to a server if it is
  4.1203 +   advertising the MODE-READER capability.  If the server does not
  4.1204 +   support CAPABILITIES (and therefore does not conform to this
  4.1205 +   specification), the client MAY use the following heuristic:
  4.1206 +
  4.1207 +   o  If the client wishes to use any "reader" commands, it SHOULD use
  4.1208 +      the MODE READER command immediately after the initial connection.
  4.1209 +
  4.1210 +   o  Otherwise, it SHOULD NOT use the MODE READER command.
  4.1211 +
  4.1212 +   In each case, it should be prepared for some commands to be
  4.1213 +   unavailable that would have been available if it had made the other
  4.1214 +   choice.
  4.1215 +
  4.1216 +3.5.  Pipelining
  4.1217 +
  4.1218 +   NNTP is designed to operate over a reliable bi-directional
  4.1219 +   connection, such as TCP.  Therefore, if a command does not depend on
  4.1220 +   the response to the previous one, it should not matter if it is sent
  4.1221 +   before that response is received.  Doing this is called "pipelining".
  4.1222 +   However, certain server implementations throw away all text received
  4.1223 +   from the client following certain commands before sending their
  4.1224 +   response.  If this happens, pipelining will be affected because one
  4.1225 +   or more commands will have been ignored or misinterpreted, and the
  4.1226 +   client will be matching the wrong responses to each command.  Since
  4.1227 +   there are significant benefits to pipelining, but also circumstances
  4.1228 +   where it is reasonable or common for servers to behave in the above
  4.1229 +
  4.1230 +
  4.1231 +
  4.1232 +Feather                     Standards Track                    [Page 22]
  4.1233 +
  4.1234 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.1235 +
  4.1236 +
  4.1237 +   manner, this document puts certain requirements on both clients and
  4.1238 +   servers.
  4.1239 +
  4.1240 +   Except where stated otherwise, a client MAY use pipelining.  That is,
  4.1241 +   it may send a command before receiving the response for the previous
  4.1242 +   command.  The server MUST allow pipelining and MUST NOT throw away
  4.1243 +   any text received after a command.  Irrespective of whether
  4.1244 +   pipelining is used, the server MUST process commands in the order
  4.1245 +   they are sent.
  4.1246 +
  4.1247 +   If the specific description of a command says it "MUST NOT be
  4.1248 +   pipelined", that command MUST end any pipeline of commands.  That is,
  4.1249 +   the client MUST NOT send any following command until it receives the
  4.1250 +   CRLF at the end of the response from the command.  The server MAY
  4.1251 +   ignore any data received after the command and before the CRLF at the
  4.1252 +   end of the response is sent to the client.
  4.1253 +
  4.1254 +   The initial connection must not be part of a pipeline; that is, the
  4.1255 +   client MUST NOT send any command until it receives the CRLF at the
  4.1256 +   end of the greeting.
  4.1257 +
  4.1258 +   If the client uses blocking system calls to send commands, it MUST
  4.1259 +   ensure that the amount of text sent in pipelining does not cause a
  4.1260 +   deadlock between transmission and reception.  The amount of text
  4.1261 +   involved will depend on window sizes in the transmission layer;
  4.1262 +   typically, it is 4k octets for TCP.  (Since the server only sends
  4.1263 +   data in response to commands from the client, the converse problem
  4.1264 +   does not occur.)
  4.1265 +
  4.1266 +3.5.1.  Examples
  4.1267 +
  4.1268 +   Example of correct use of pipelining:
  4.1269 +
  4.1270 +      [C] GROUP misc.test
  4.1271 +      [C] STAT
  4.1272 +      [C] NEXT
  4.1273 +      [S] 211 1234 3000234 3002322 misc.test
  4.1274 +      [S] 223 3000234 <45223423@example.com> retrieved
  4.1275 +      [S] 223 3000237 <668929@example.org> retrieved
  4.1276 +
  4.1277 +   Example of incorrect use of pipelining (the MODE READER command may
  4.1278 +   not be pipelined):
  4.1279 +
  4.1280 +      [C] MODE READER
  4.1281 +      [C] DATE
  4.1282 +      [C] NEXT
  4.1283 +      [S] 200 Server ready, posting allowed
  4.1284 +      [S] 223 3000237 <668929@example.org> retrieved
  4.1285 +
  4.1286 +
  4.1287 +
  4.1288 +Feather                     Standards Track                    [Page 23]
  4.1289 +
  4.1290 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.1291 +
  4.1292 +
  4.1293 +   The DATE command has been thrown away by the server, so there is no
  4.1294 +   111 response to match it.
  4.1295 +
  4.1296 +3.6.  Articles
  4.1297 +
  4.1298 +   NNTP is intended to transfer articles between clients and servers.
  4.1299 +   For the purposes of this specification, articles are required to
  4.1300 +   conform to the rules in this section, and clients and servers MUST
  4.1301 +   correctly process any article received from the other that does so.
  4.1302 +   Note that this requirement applies only to the contents of
  4.1303 +   communications over NNTP; it does not prevent the client or server
  4.1304 +   from subsequently rejecting an article for reasons of local policy.
  4.1305 +   Also see Appendix A for further restrictions on the format of
  4.1306 +   articles in some uses of NNTP.
  4.1307 +
  4.1308 +   An article consists of two parts: the headers and the body.  They are
  4.1309 +   separated by a single empty line, or in other words by two
  4.1310 +   consecutive CRLF pairs (if there is more than one empty line, the
  4.1311 +   second and subsequent ones are part of the body).  In order to meet
  4.1312 +   the general requirements of NNTP, an article MUST NOT include the
  4.1313 +   octet NUL, MUST NOT contain the octets LF and CR other than as part
  4.1314 +   of a CRLF pair, and MUST end with a CRLF pair.  This specification
  4.1315 +   puts no further restrictions on the body; in particular, it MAY be
  4.1316 +   empty.
  4.1317 +
  4.1318 +   The headers of an article consist of one or more header lines.  Each
  4.1319 +   header line consists of a header name, a colon, a space, the header
  4.1320 +   content, and a CRLF, in that order.  The name consists of one or more
  4.1321 +   printable US-ASCII characters other than colon and, for the purposes
  4.1322 +   of this specification, is not case sensitive.  There MAY be more than
  4.1323 +   one header line with the same name.  The content MUST NOT contain
  4.1324 +   CRLF; it MAY be empty.  A header may be "folded"; that is, a CRLF
  4.1325 +   pair may be placed before any TAB or space in the line.  There MUST
  4.1326 +   still be some other octet between any two CRLF pairs in a header
  4.1327 +   line.  (Note that folding means that the header line occupies more
  4.1328 +   than one line when displayed or transmitted; nevertheless, it is
  4.1329 +   still referred to as "a" header line.)  The presence or absence of
  4.1330 +   folding does not affect the meaning of the header line; that is, the
  4.1331 +   CRLF pairs introduced by folding are not considered part of the
  4.1332 +   header content.  Header lines SHOULD NOT be folded before the space
  4.1333 +   after the colon that follows the header name and SHOULD include at
  4.1334 +   least one octet other than %x09 or %x20 between CRLF pairs.  However,
  4.1335 +   if an article that fails to satisfy this requirement has been
  4.1336 +   received from elsewhere, clients and servers MAY transfer it to each
  4.1337 +   other without re-folding it.
  4.1338 +
  4.1339 +
  4.1340 +
  4.1341 +
  4.1342 +
  4.1343 +
  4.1344 +Feather                     Standards Track                    [Page 24]
  4.1345 +
  4.1346 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.1347 +
  4.1348 +
  4.1349 +   The content of a header SHOULD be in UTF-8.  However, if an
  4.1350 +   implementation receives an article from elsewhere that uses octets in
  4.1351 +   the range 128 to 255 in some other manner, it MAY pass it to a client
  4.1352 +   or server without modification.  Therefore, implementations MUST be
  4.1353 +   prepared to receive such headers, and data derived from them (e.g.,
  4.1354 +   in the responses from the OVER command, Section 8.3), and MUST NOT
  4.1355 +   assume that they are always UTF-8.  Any external processing of those
  4.1356 +   headers, including identifying the encoding used, is outside the
  4.1357 +   scope of this document.
  4.1358 +
  4.1359 +   Each article MUST have a unique message-id; two articles offered by
  4.1360 +   an NNTP server MUST NOT have the same message-id.  For the purposes
  4.1361 +   of this specification, message-ids are opaque strings that MUST meet
  4.1362 +   the following requirements:
  4.1363 +
  4.1364 +   o  A message-id MUST begin with "<", end with ">", and MUST NOT
  4.1365 +      contain the latter except at the end.
  4.1366 +
  4.1367 +   o  A message-id MUST be between 3 and 250 octets in length.
  4.1368 +
  4.1369 +   o  A message-id MUST NOT contain octets other than printable US-ASCII
  4.1370 +      characters.
  4.1371 +
  4.1372 +   Two message-ids are the same if and only if they consist of the same
  4.1373 +   sequence of octets.
  4.1374 +
  4.1375 +   This specification does not describe how the message-id of an article
  4.1376 +   is determined.  If the server does not have any way to determine a
  4.1377 +   message-id from the article itself, it MUST synthesize one (this
  4.1378 +   specification does not require that the article be changed as a
  4.1379 +   result).  See also Appendix A.2.
  4.1380 +
  4.1381 +4.  The WILDMAT Format
  4.1382 +
  4.1383 +   The WILDMAT format described here is based on the version first
  4.1384 +   developed by Rich Salz [SALZ1992], which was in turn derived from the
  4.1385 +   format used in the UNIX "find" command to articulate file names.  It
  4.1386 +   was developed to provide a uniform mechanism for matching patterns in
  4.1387 +   the same manner that the UNIX shell matches filenames.
  4.1388 +
  4.1389 +
  4.1390 +
  4.1391 +
  4.1392 +
  4.1393 +
  4.1394 +
  4.1395 +
  4.1396 +
  4.1397 +
  4.1398 +
  4.1399 +
  4.1400 +Feather                     Standards Track                    [Page 25]
  4.1401 +
  4.1402 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.1403 +
  4.1404 +
  4.1405 +4.1.  Wildmat Syntax
  4.1406 +
  4.1407 +   A wildmat is described by the following ABNF [RFC4234] syntax, which
  4.1408 +   is an extract of that in Section 9.8.
  4.1409 +
  4.1410 +     wildmat = wildmat-pattern *("," ["!"] wildmat-pattern)
  4.1411 +     wildmat-pattern = 1*wildmat-item
  4.1412 +     wildmat-item = wildmat-exact / wildmat-wild
  4.1413 +     wildmat-exact = %x22-29 / %x2B / %x2D-3E / %x40-5A / %x5E-7E /
  4.1414 +          UTF8-non-ascii ; exclude ! * , ? [ \ ]
  4.1415 +     wildmat-wild = "*" / "?"
  4.1416 +
  4.1417 +   Note: the characters ",", "\", "[", and "]" are not allowed in
  4.1418 +   wildmats, while * and ? are always wildcards.  This should not be a
  4.1419 +   problem, since these characters cannot occur in newsgroup names,
  4.1420 +   which is the only current use of wildmats.  Backslash is commonly
  4.1421 +   used to suppress the special meaning of characters, whereas brackets
  4.1422 +   are used to introduce sets.  However, these usages are not universal,
  4.1423 +   and interpretation of these characters in the context of UTF-8
  4.1424 +   strings is potentially complex and differs from existing practice, so
  4.1425 +   they were omitted from this specification.  A future extension to
  4.1426 +   this specification may provide semantics for these characters.
  4.1427 +
  4.1428 +4.2.  Wildmat Semantics
  4.1429 +
  4.1430 +   A wildmat is tested against a string and either matches or does not
  4.1431 +   match.  To do this, each constituent <wildmat-pattern> is matched
  4.1432 +   against the string, and the rightmost pattern that matches is
  4.1433 +   identified.  If that <wildmat-pattern> is not preceded with "!", the
  4.1434 +   whole wildmat matches.  If it is preceded by "!", or if no <wildmat-
  4.1435 +   pattern> matches, the whole wildmat does not match.
  4.1436 +
  4.1437 +   For example, consider the wildmat "a*,!*b,*c*":
  4.1438 +
  4.1439 +   o  The string "aaa" matches because the rightmost match is with "a*".
  4.1440 +
  4.1441 +   o  The string "abb" does not match because the rightmost match is
  4.1442 +      with "*b".
  4.1443 +
  4.1444 +   o  The string "ccb" matches because the rightmost match is with
  4.1445 +      "*c*".
  4.1446 +
  4.1447 +   o  The string "xxx" does not match because no <wildmat-pattern>
  4.1448 +      matches.
  4.1449 +
  4.1450 +   A <wildmat-pattern> matches a string if the string can be broken into
  4.1451 +   components, each of which matches the corresponding <wildmat-item> in
  4.1452 +   the pattern.  The matches must be in the same order, and the whole
  4.1453 +
  4.1454 +
  4.1455 +
  4.1456 +Feather                     Standards Track                    [Page 26]
  4.1457 +
  4.1458 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.1459 +
  4.1460 +
  4.1461 +   string must be used in the match.  The pattern is "anchored"; that
  4.1462 +   is, the first and last characters in the string must match the first
  4.1463 +   and last item, respectively (unless that item is an asterisk matching
  4.1464 +   zero characters).
  4.1465 +
  4.1466 +   A <wildmat-exact> matches the same character (which may be more than
  4.1467 +   one octet in UTF-8).
  4.1468 +
  4.1469 +   "?" matches exactly one character (which may be more than one octet).
  4.1470 +
  4.1471 +   "*" matches zero or more characters.  It can match an empty string,
  4.1472 +   but it cannot match a subsequence of a UTF-8 sequence that is not
  4.1473 +   aligned to the character boundaries.
  4.1474 +
  4.1475 +4.3.  Extensions
  4.1476 +
  4.1477 +   An NNTP server or extension MAY extend the syntax or semantics of
  4.1478 +   wildmats provided that all wildmats that meet the requirements of
  4.1479 +   Section 4.1 have the meaning ascribed to them by Section 4.2.  Future
  4.1480 +   editions of this document may also extend wildmats.
  4.1481 +
  4.1482 +4.4.  Examples
  4.1483 +
  4.1484 +   In these examples, $ and @ are used to represent the two octets %xC2
  4.1485 +   and %xA3, respectively; $@ is thus the UTF-8 encoding for the pound
  4.1486 +   sterling symbol, shown as # in the descriptions.
  4.1487 +
  4.1488 +     Wildmat    Description of strings that match
  4.1489 +       abc      The one string "abc"
  4.1490 +       abc,def  The two strings "abc" and "def"
  4.1491 +       $@       The one character string "#"
  4.1492 +       a*       Any string that begins with "a"
  4.1493 +       a*b      Any string that begins with "a" and ends with "b"
  4.1494 +       a*,*b    Any string that begins with "a" or ends with "b"
  4.1495 +       a*,!*b   Any string that begins with "a" and does not end with
  4.1496 +                "b"
  4.1497 +     a*,!*b,c*  Any string that begins with "a" and does not end with
  4.1498 +                "b", and any string that begins with "c" no matter
  4.1499 +                what it ends with
  4.1500 +     a*,c*,!*b  Any string that begins with "a" or "c" and does not
  4.1501 +                end with "b"
  4.1502 +       ?a*      Any string with "a" as its second character
  4.1503 +       ??a*     Any string with "a" as its third character
  4.1504 +       *a?      Any string with "a" as its penultimate character
  4.1505 +       *a??     Any string with "a" as its antepenultimate character
  4.1506 +
  4.1507 +
  4.1508 +
  4.1509 +
  4.1510 +
  4.1511 +
  4.1512 +Feather                     Standards Track                    [Page 27]
  4.1513 +
  4.1514 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.1515 +
  4.1516 +
  4.1517 +5.  Session Administration Commands
  4.1518 +
  4.1519 +5.1.  Initial Connection
  4.1520 +
  4.1521 +5.1.1.  Usage
  4.1522 +
  4.1523 +   This command MUST NOT be pipelined.
  4.1524 +
  4.1525 +   Responses [1]
  4.1526 +     200    Service available, posting allowed
  4.1527 +     201    Service available, posting prohibited
  4.1528 +     400    Service temporarily unavailable [2]
  4.1529 +     502    Service permanently unavailable [2]
  4.1530 +
  4.1531 +   [1] These are the only valid response codes for the initial greeting;
  4.1532 +       the server MUST not return any other generic response code.
  4.1533 +
  4.1534 +   [2] Following a 400 or 502 response, the server MUST immediately
  4.1535 +       close the connection.
  4.1536 +
  4.1537 +5.1.2.  Description
  4.1538 +
  4.1539 +   There is no command presented by the client upon initial connection
  4.1540 +   to the server.  The server MUST present an appropriate response code
  4.1541 +   as a greeting to the client.  This response informs the client
  4.1542 +   whether service is available and whether the client is permitted to
  4.1543 +   post.
  4.1544 +
  4.1545 +   If the server will accept further commands from the client including
  4.1546 +   POST, the server MUST present a 200 greeting code.  If the server
  4.1547 +   will accept further commands from the client, but the client is not
  4.1548 +   authorized to post articles using the POST command, the server MUST
  4.1549 +   present a 201 greeting code.
  4.1550 +
  4.1551 +   Otherwise, the server MUST present a 400 or 502 greeting code and
  4.1552 +   then immediately close the connection. 400 SHOULD be used if the
  4.1553 +   issue is only temporary (for example, because of load) and the client
  4.1554 +   can expect to be able to connect successfully at some point in the
  4.1555 +   future without making any changes. 502 MUST be used if the client is
  4.1556 +   not permitted under any circumstances to interact with the server,
  4.1557 +   and MAY be used if the server has insufficient information to
  4.1558 +   determine whether the issue is temporary or permanent.
  4.1559 +
  4.1560 +   Note: the distinction between the 200 and 201 response codes has
  4.1561 +   turned out in practice to be insufficient; for example, some servers
  4.1562 +   do not allow posting until the client has authenticated, while other
  4.1563 +   clients assume that a 201 response means that posting will never be
  4.1564 +   possible even after authentication.  Therefore, clients SHOULD use
  4.1565 +
  4.1566 +
  4.1567 +
  4.1568 +Feather                     Standards Track                    [Page 28]
  4.1569 +
  4.1570 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.1571 +
  4.1572 +
  4.1573 +   the CAPABILITIES command (Section 5.2) rather than rely on this
  4.1574 +   response.
  4.1575 +
  4.1576 +5.1.3.  Examples
  4.1577 +
  4.1578 +   Example of a normal connection from an authorized client that then
  4.1579 +   terminates the session (see Section 5.4):
  4.1580 +
  4.1581 +      [Initial connection set-up completed.]
  4.1582 +      [S] 200 NNTP Service Ready, posting permitted
  4.1583 +      [C] QUIT
  4.1584 +      [S] 205 NNTP Service exits normally
  4.1585 +      [Server closes connection.]
  4.1586 +
  4.1587 +   Example of a normal connection from an authorized client that is not
  4.1588 +   permitted to post, which also immediately terminates the session:
  4.1589 +
  4.1590 +      [Initial connection set-up completed.]
  4.1591 +      [S] 201 NNTP Service Ready, posting prohibited
  4.1592 +      [C] QUIT
  4.1593 +      [S] 205 NNTP Service exits normally
  4.1594 +      [Server closes connection.]
  4.1595 +
  4.1596 +   Example of a normal connection from an unauthorized client:
  4.1597 +
  4.1598 +      [Initial connection set-up completed.]
  4.1599 +      [S] 502 NNTP Service permanently unavailable
  4.1600 +      [Server closes connection.]
  4.1601 +
  4.1602 +   Example of a connection from a client if the server is unable to
  4.1603 +   provide service:
  4.1604 +
  4.1605 +      [Initial connection set-up completed.]
  4.1606 +      [S] 400 NNTP Service temporarily unavailable
  4.1607 +      [Server closes connection.]
  4.1608 +
  4.1609 +5.2.  CAPABILITIES
  4.1610 +
  4.1611 +5.2.1.  Usage
  4.1612 +
  4.1613 +   This command is mandatory.
  4.1614 +
  4.1615 +   Syntax
  4.1616 +     CAPABILITIES [keyword]
  4.1617 +
  4.1618 +   Responses
  4.1619 +     101    Capability list follows (multi-line)
  4.1620 +
  4.1621 +
  4.1622 +
  4.1623 +
  4.1624 +Feather                     Standards Track                    [Page 29]
  4.1625 +
  4.1626 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.1627 +
  4.1628 +
  4.1629 +   Parameters
  4.1630 +     keyword    additional feature, see description
  4.1631 +
  4.1632 +5.2.2.  Description
  4.1633 +
  4.1634 +   The CAPABILITIES command allows a client to determine the
  4.1635 +   capabilities of the server at any given time.
  4.1636 +
  4.1637 +   This command MAY be issued at any time; the server MUST NOT require
  4.1638 +   it to be issued in order to make use of any capability.  The response
  4.1639 +   generated by this command MAY change during a session because of
  4.1640 +   other state information (which, in turn, may be changed by the
  4.1641 +   effects of other commands or by external events).  An NNTP client is
  4.1642 +   only able to get the current and correct information concerning
  4.1643 +   available capabilities at any point during a session by issuing a
  4.1644 +   CAPABILITIES command at that point of that session and processing the
  4.1645 +   response.
  4.1646 +
  4.1647 +   The capability list is returned as a multi-line data block following
  4.1648 +   the 101 response code.  Each capability is described by a separate
  4.1649 +   capability line.  The server MUST NOT list the same capability twice
  4.1650 +   in the response, even with different arguments.  Except that the
  4.1651 +   VERSION capability MUST be the first line, the order in which the
  4.1652 +   capability lines appears is not significant; the server need not even
  4.1653 +   consistently return the same order.
  4.1654 +
  4.1655 +   While some capabilities are likely to be always available or never
  4.1656 +   available, others (notably extensions) will appear and disappear
  4.1657 +   depending on server state changes within the session or on external
  4.1658 +   events between sessions.  An NNTP client MAY cache the results of
  4.1659 +   this command, but MUST NOT rely on the correctness of any cached
  4.1660 +   results, whether from earlier in this session or from a previous
  4.1661 +   session, MUST cope gracefully with the cached status being out of
  4.1662 +   date, and SHOULD (if caching results) provide a way to force the
  4.1663 +   cached information to be refreshed.  Furthermore, a client MUST NOT
  4.1664 +   use cached results in relation to security, privacy, and
  4.1665 +   authentication extensions.  See Section 12.6 for further discussion
  4.1666 +   of this topic.
  4.1667 +
  4.1668 +   The keyword argument is not used by this specification.  It is
  4.1669 +   provided so that extensions or revisions to this specification can
  4.1670 +   include extra features for this command without requiring the
  4.1671 +   CAPABILITIES command to be used twice (once to determine if the extra
  4.1672 +   features are available, and a second time to make use of them).  If
  4.1673 +   the server does not recognise the argument (and it is a keyword), it
  4.1674 +   MUST respond with the 101 response code as if the argument had been
  4.1675 +   omitted.  If an argument is provided that the server does recognise,
  4.1676 +   it MAY use the 101 response code or MAY use some other response code
  4.1677 +
  4.1678 +
  4.1679 +
  4.1680 +Feather                     Standards Track                    [Page 30]
  4.1681 +
  4.1682 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.1683 +
  4.1684 +
  4.1685 +   (which will be defined in the specification of that feature).  If the
  4.1686 +   argument is not a keyword, the 501 generic response code MUST be
  4.1687 +   returned.  The server MUST NOT generate any other response code to
  4.1688 +   the CAPABILITIES command.
  4.1689 +
  4.1690 +5.2.3.  Examples
  4.1691 +
  4.1692 +   Example of a minimal response (a read-only server):
  4.1693 +
  4.1694 +      [C] CAPABILITIES
  4.1695 +      [S] 101 Capability list:
  4.1696 +      [S] VERSION 2
  4.1697 +      [S] READER
  4.1698 +      [S] LIST ACTIVE NEWSGROUPS
  4.1699 +      [S] .
  4.1700 +
  4.1701 +   Example of a response from a server that has a range of facilities
  4.1702 +   and that also describes itself:
  4.1703 +
  4.1704 +      [C] CAPABILITIES
  4.1705 +      [S] 101 Capability list:
  4.1706 +      [S] VERSION 2
  4.1707 +      [S] READER
  4.1708 +      [S] IHAVE
  4.1709 +      [S] POST
  4.1710 +      [S] NEWNEWS
  4.1711 +      [S] LIST ACTIVE NEWSGROUPS ACTIVE.TIMES OVERVIEW.FMT
  4.1712 +      [S] IMPLEMENTATION INN 4.2 2004-12-25
  4.1713 +      [S] OVER MSGID
  4.1714 +      [S] STREAMING
  4.1715 +      [S] XSECRET
  4.1716 +      [S] .
  4.1717 +
  4.1718 +   Example of a server that supports more than one version of NNTP:
  4.1719 +
  4.1720 +      [C] CAPABILITIES
  4.1721 +      [S] 101 Capability list:
  4.1722 +      [S] VERSION 2 3
  4.1723 +      [S] READER
  4.1724 +      [S] LIST ACTIVE NEWSGROUPS
  4.1725 +      [S] .
  4.1726 +
  4.1727 +
  4.1728 +
  4.1729 +
  4.1730 +
  4.1731 +
  4.1732 +
  4.1733 +
  4.1734 +
  4.1735 +
  4.1736 +Feather                     Standards Track                    [Page 31]
  4.1737 +
  4.1738 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.1739 +
  4.1740 +
  4.1741 +   Example of a client attempting to use a feature of the CAPABILITIES
  4.1742 +   command that the server does not support:
  4.1743 +
  4.1744 +      [C] CAPABILITIES AUTOUPDATE
  4.1745 +      [S] 101 Capability list:
  4.1746 +      [S] VERSION 2
  4.1747 +      [S] READER
  4.1748 +      [S] IHAVE
  4.1749 +      [S] LIST ACTIVE NEWSGROUPS OVERVIEW.FMT HEADERS
  4.1750 +      [S] OVER MSGID
  4.1751 +      [S] HDR
  4.1752 +      [S] NEWNEWS
  4.1753 +      [S] .
  4.1754 +
  4.1755 +5.3.  MODE READER
  4.1756 +
  4.1757 +5.3.1.  Usage
  4.1758 +
  4.1759 +   Indicating capability: MODE-READER
  4.1760 +
  4.1761 +   This command MUST NOT be pipelined.
  4.1762 +
  4.1763 +   Syntax
  4.1764 +     MODE READER
  4.1765 +
  4.1766 +   Responses
  4.1767 +     200    Posting allowed
  4.1768 +     201    Posting prohibited
  4.1769 +     502    Reading service permanently unavailable [1]
  4.1770 +
  4.1771 +   [1] Following a 502 response the server MUST immediately close the
  4.1772 +       connection.
  4.1773 +
  4.1774 +5.3.2.  Description
  4.1775 +
  4.1776 +   The MODE READER command instructs a mode-switching server to switch
  4.1777 +   modes, as described in Section 3.4.2.
  4.1778 +
  4.1779 +   If the server is mode-switching, it switches from its transit mode to
  4.1780 +   its reader mode, indicating this by changing the capability list
  4.1781 +   accordingly.  It MUST then return a 200 or 201 response with the same
  4.1782 +   meaning as for the initial greeting (as described in Section 5.1.1).
  4.1783 +   Note that the response need not be the same as that presented during
  4.1784 +   the initial greeting.  The client MUST NOT issue MODE READER more
  4.1785 +   than once in a session or after any security or privacy commands are
  4.1786 +   issued.  When the MODE READER command is issued, the server MAY reset
  4.1787 +   its state to that immediately after the initial connection before
  4.1788 +   switching mode.
  4.1789 +
  4.1790 +
  4.1791 +
  4.1792 +Feather                     Standards Track                    [Page 32]
  4.1793 +
  4.1794 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.1795 +
  4.1796 +
  4.1797 +   If the server is not mode-switching, then the following apply:
  4.1798 +
  4.1799 +   o  If it advertises the READER capability, it MUST return a 200 or
  4.1800 +      201 response with the same meaning as for the initial greeting; in
  4.1801 +      this case, the command MUST NOT affect the server state in any
  4.1802 +      way.
  4.1803 +
  4.1804 +   o  If it does not advertise the READER capability, it MUST return a
  4.1805 +      502 response and then immediately close the connection.
  4.1806 +
  4.1807 +5.3.3.  Examples
  4.1808 +
  4.1809 +   Example of use of the MODE READER command on a transit-only server
  4.1810 +   (which therefore does not providing reading facilities):
  4.1811 +
  4.1812 +      [C] CAPABILITIES
  4.1813 +      [S] 101 Capability list:
  4.1814 +      [S] VERSION 2
  4.1815 +      [S] IHAVE
  4.1816 +      [S] .
  4.1817 +      [C] MODE READER
  4.1818 +      [S] 502 Transit service only
  4.1819 +      [Server closes connection.]
  4.1820 +
  4.1821 +   Example of use of the MODE READER command on a server that provides
  4.1822 +   reading facilities:
  4.1823 +
  4.1824 +      [C] CAPABILITIES
  4.1825 +      [S] 101 Capability list:
  4.1826 +      [S] VERSION 2
  4.1827 +      [S] READER
  4.1828 +      [S] LIST ACTIVE NEWSGROUPS
  4.1829 +      [S] .
  4.1830 +      [C] MODE READER
  4.1831 +      [S] 200 Reader mode, posting permitted
  4.1832 +      [C] IHAVE <i.am.an.article.you.have@example.com>
  4.1833 +      [S] 500 Permission denied
  4.1834 +      [C] GROUP misc.test
  4.1835 +      [S] 211 1234 3000234 3002322 misc.test
  4.1836 +
  4.1837 +   Note that in both of these situations, the client SHOULD NOT use MODE
  4.1838 +   READER.
  4.1839 +
  4.1840 +
  4.1841 +
  4.1842 +
  4.1843 +
  4.1844 +
  4.1845 +
  4.1846 +
  4.1847 +
  4.1848 +Feather                     Standards Track                    [Page 33]
  4.1849 +
  4.1850 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.1851 +
  4.1852 +
  4.1853 +   Example of use of the MODE READER command on a mode-switching server:
  4.1854 +
  4.1855 +      [C] CAPABILITIES
  4.1856 +      [S] 101 Capability list:
  4.1857 +      [S] VERSION 2
  4.1858 +      [S] IHAVE
  4.1859 +      [S] MODE-READER
  4.1860 +      [S] .
  4.1861 +      [C] MODE READER
  4.1862 +      [S] 200 Reader mode, posting permitted
  4.1863 +      [C] CAPABILITIES
  4.1864 +      [S] 101 Capability list:
  4.1865 +      [S] VERSION 2
  4.1866 +      [S] READER
  4.1867 +      [S] NEWNEWS
  4.1868 +      [S] LIST ACTIVE NEWSGROUPS
  4.1869 +      [S] STARTTLS
  4.1870 +      [S] .
  4.1871 +
  4.1872 +   In this case, the server offers (but does not require) TLS privacy in
  4.1873 +   its reading mode but not in its transit mode.
  4.1874 +
  4.1875 +   Example of use of the MODE READER command where the client is not
  4.1876 +   permitted to post:
  4.1877 +
  4.1878 +      [C] MODE READER
  4.1879 +      [S] 201 NNTP Service Ready, posting prohibited
  4.1880 +
  4.1881 +5.4.  QUIT
  4.1882 +
  4.1883 +5.4.1.  Usage
  4.1884 +
  4.1885 +   This command is mandatory.
  4.1886 +
  4.1887 +   Syntax
  4.1888 +     QUIT
  4.1889 +
  4.1890 +   Responses
  4.1891 +     205    Connection closing
  4.1892 +
  4.1893 +5.4.2.  Description
  4.1894 +
  4.1895 +   The client uses the QUIT command to terminate the session.  The
  4.1896 +   server MUST acknowledge the QUIT command and then close the
  4.1897 +   connection to the client.  This is the preferred method for a client
  4.1898 +   to indicate that it has finished all of its transactions with the
  4.1899 +   NNTP server.
  4.1900 +
  4.1901 +
  4.1902 +
  4.1903 +
  4.1904 +Feather                     Standards Track                    [Page 34]
  4.1905 +
  4.1906 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.1907 +
  4.1908 +
  4.1909 +   If a client simply disconnects (or if the connection times out or
  4.1910 +   some other fault occurs), the server MUST gracefully cease its
  4.1911 +   attempts to service the client, disconnecting from its end if
  4.1912 +   necessary.
  4.1913 +
  4.1914 +   The server MUST NOT generate any response code to the QUIT command
  4.1915 +   other than 205 or, if any arguments are provided, 501.
  4.1916 +
  4.1917 +5.4.3.  Examples
  4.1918 +
  4.1919 +      [C] QUIT
  4.1920 +      [S] 205 closing connection
  4.1921 +      [Server closes connection.]
  4.1922 +
  4.1923 +6.  Article Posting and Retrieval
  4.1924 +
  4.1925 +   News-reading clients have available a variety of mechanisms to
  4.1926 +   retrieve articles via NNTP.  The news articles are stored and indexed
  4.1927 +   using three types of keys.  The first type of key is the message-id
  4.1928 +   of an article and is globally unique.  The second type of key is
  4.1929 +   composed of a newsgroup name and an article number within that
  4.1930 +   newsgroup.  On a particular server, there MUST only be one article
  4.1931 +   with a given number within any newsgroup, and an article MUST NOT
  4.1932 +   have two different numbers in the same newsgroup.  An article can be
  4.1933 +   cross-posted to multiple newsgroups, so there may be multiple keys
  4.1934 +   that point to the same article on the same server; these MAY have
  4.1935 +   different numbers in each newsgroup.  However, this type of key is
  4.1936 +   not required to be globally unique, so the same key MAY refer to
  4.1937 +   different articles on different servers.  (Note that the terms
  4.1938 +   "group" and "newsgroup" are equivalent.)
  4.1939 +
  4.1940 +   The final type of key is the arrival timestamp, giving the time that
  4.1941 +   the article arrived at the server.  The server MUST ensure that
  4.1942 +   article numbers are issued in order of arrival timestamp; that is,
  4.1943 +   articles arriving later MUST have higher numbers than those that
  4.1944 +   arrive earlier.  The server SHOULD allocate the next sequential
  4.1945 +   unused number to each new article.
  4.1946 +
  4.1947 +   Article numbers MUST lie between 1 and 2,147,483,647, inclusive.  The
  4.1948 +   client and server MAY use leading zeroes in specifying article
  4.1949 +   numbers but MUST NOT use more than 16 digits.  In some situations,
  4.1950 +   the value zero replaces an article number to show some special
  4.1951 +   situation.
  4.1952 +
  4.1953 +   Note that it is likely that the article number limit of 2,147,483,647
  4.1954 +   will be increased by a future revision or extension to this
  4.1955 +   specification.  While servers MUST NOT send article numbers greater
  4.1956 +   than this current limit, client and server developers are advised to
  4.1957 +
  4.1958 +
  4.1959 +
  4.1960 +Feather                     Standards Track                    [Page 35]
  4.1961 +
  4.1962 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.1963 +
  4.1964 +
  4.1965 +   use internal structures and datatypes capable of handling larger
  4.1966 +   values in anticipation of such a change.
  4.1967 +
  4.1968 +6.1.  Group and Article Selection
  4.1969 +
  4.1970 +   The following commands are used to set the "currently selected
  4.1971 +   newsgroup" and the "current article number", which are used by
  4.1972 +   various commands.  At the start of an NNTP session, both of these
  4.1973 +   values are set to the special value "invalid".
  4.1974 +
  4.1975 +6.1.1.  GROUP
  4.1976 +
  4.1977 +6.1.1.1.  Usage
  4.1978 +
  4.1979 +   Indicating capability: READER
  4.1980 +
  4.1981 +   Syntax
  4.1982 +     GROUP group
  4.1983 +
  4.1984 +   Responses
  4.1985 +     211 number low high group     Group successfully selected
  4.1986 +     411                           No such newsgroup
  4.1987 +
  4.1988 +   Parameters
  4.1989 +     group     Name of newsgroup
  4.1990 +     number    Estimated number of articles in the group
  4.1991 +     low       Reported low water mark
  4.1992 +     high      Reported high water mark
  4.1993 +
  4.1994 +6.1.1.2.  Description
  4.1995 +
  4.1996 +   The GROUP command selects a newsgroup as the currently selected
  4.1997 +   newsgroup and returns summary information about it.
  4.1998 +
  4.1999 +   The required argument is the name of the newsgroup to be selected
  4.2000 +   (e.g., "news.software.nntp").  A list of valid newsgroups may be
  4.2001 +   obtained by using the LIST ACTIVE command (see Section 7.6.3).
  4.2002 +
  4.2003 +   The successful selection response will return the article numbers of
  4.2004 +   the first and last articles in the group at the moment of selection
  4.2005 +   (these numbers are referred to as the "reported low water mark" and
  4.2006 +   the "reported high water mark") and an estimate of the number of
  4.2007 +   articles in the group currently available.
  4.2008 +
  4.2009 +   If the group is not empty, the estimate MUST be at least the actual
  4.2010 +   number of articles available and MUST be no greater than one more
  4.2011 +   than the difference between the reported low and high water marks.
  4.2012 +   (Some implementations will actually count the number of articles
  4.2013 +
  4.2014 +
  4.2015 +
  4.2016 +Feather                     Standards Track                    [Page 36]
  4.2017 +
  4.2018 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.2019 +
  4.2020 +
  4.2021 +   currently stored.  Others will just subtract the low water mark from
  4.2022 +   the high water mark and add one to get an estimate.)
  4.2023 +
  4.2024 +   If the group is empty, one of the following three situations will
  4.2025 +   occur.  Clients MUST accept all three cases; servers MUST NOT
  4.2026 +   represent an empty group in any other way.
  4.2027 +
  4.2028 +   o  The high water mark will be one less than the low water mark, and
  4.2029 +      the estimated article count will be zero.  Servers SHOULD use this
  4.2030 +      method to show an empty group.  This is the only time that the
  4.2031 +      high water mark can be less than the low water mark.
  4.2032 +
  4.2033 +   o  All three numbers will be zero.
  4.2034 +
  4.2035 +   o  The high water mark is greater than or equal to the low water
  4.2036 +      mark.  The estimated article count might be zero or non-zero; if
  4.2037 +      it is non-zero, the same requirements apply as for a non-empty
  4.2038 +      group.
  4.2039 +
  4.2040 +   The set of articles in a group may change after the GROUP command is
  4.2041 +   carried out:
  4.2042 +
  4.2043 +   o  Articles may be removed from the group.
  4.2044 +
  4.2045 +   o  Articles may be reinstated in the group with the same article
  4.2046 +      number, but those articles MUST have numbers no less than the
  4.2047 +      reported low water mark (note that this is a reinstatement of the
  4.2048 +      previous article, not a new article reusing the number).
  4.2049 +
  4.2050 +   o  New articles may be added with article numbers greater than the
  4.2051 +      reported high water mark.  (If an article that was the one with
  4.2052 +      the highest number has been removed and the high water mark has
  4.2053 +      been adjusted accordingly, the next new article will not have the
  4.2054 +      number one greater than the reported high water mark.)
  4.2055 +
  4.2056 +   Except when the group is empty and all three numbers are zero,
  4.2057 +   whenever a subsequent GROUP command for the same newsgroup is issued,
  4.2058 +   either by the same client or a different client, the reported low
  4.2059 +   water mark in the response MUST be no less than that in any previous
  4.2060 +   response for that newsgroup in this session, and it SHOULD be no less
  4.2061 +   than that in any previous response for that newsgroup ever sent to
  4.2062 +   any client.  Any failure to meet the latter condition SHOULD be
  4.2063 +   transient only.  The client may make use of the low water mark to
  4.2064 +   remove all remembered information about articles with lower numbers,
  4.2065 +   as these will never recur.  This includes the situation when the high
  4.2066 +   water mark is one less than the low water mark.  No similar
  4.2067 +   assumption can be made about the high water mark, as this can
  4.2068 +
  4.2069 +
  4.2070 +
  4.2071 +
  4.2072 +Feather                     Standards Track                    [Page 37]
  4.2073 +
  4.2074 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.2075 +
  4.2076 +
  4.2077 +   decrease if an article is removed and then increase again if it is
  4.2078 +   reinstated or if new articles arrive.
  4.2079 +
  4.2080 +   When a valid group is selected by means of this command, the
  4.2081 +   currently selected newsgroup MUST be set to that group, and the
  4.2082 +   current article number MUST be set to the first article in the group
  4.2083 +   (this applies even if the group is already the currently selected
  4.2084 +   newsgroup).  If an empty newsgroup is selected, the current article
  4.2085 +   number is made invalid.  If an invalid group is specified, the
  4.2086 +   currently selected newsgroup and current article number MUST NOT be
  4.2087 +   changed.
  4.2088 +
  4.2089 +   The GROUP or LISTGROUP command (see Section 6.1.2) MUST be used by a
  4.2090 +   client, and a successful response received, before any other command
  4.2091 +   is used that depends on the value of the currently selected newsgroup
  4.2092 +   or current article number.
  4.2093 +
  4.2094 +   If the group specified is not available on the server, a 411 response
  4.2095 +   MUST be returned.
  4.2096 +
  4.2097 +6.1.1.3.  Examples
  4.2098 +
  4.2099 +   Example for a group known to the server:
  4.2100 +
  4.2101 +      [C] GROUP misc.test
  4.2102 +      [S] 211 1234 3000234 3002322 misc.test
  4.2103 +
  4.2104 +   Example for a group unknown to the server:
  4.2105 +
  4.2106 +      [C] GROUP example.is.sob.bradner.or.barber
  4.2107 +      [S] 411 example.is.sob.bradner.or.barber is unknown
  4.2108 +
  4.2109 +   Example of an empty group using the preferred response:
  4.2110 +
  4.2111 +      [C] GROUP example.currently.empty.newsgroup
  4.2112 +      [S] 211 0 4000 3999 example.currently.empty.newsgroup
  4.2113 +
  4.2114 +   Example of an empty group using an alternative response:
  4.2115 +
  4.2116 +      [C] GROUP example.currently.empty.newsgroup
  4.2117 +      [S] 211 0 0 0 example.currently.empty.newsgroup
  4.2118 +
  4.2119 +   Example of an empty group using a different alternative response:
  4.2120 +
  4.2121 +      [C] GROUP example.currently.empty.newsgroup
  4.2122 +      [S] 211 0 4000 4321 example.currently.empty.newsgroup
  4.2123 +
  4.2124 +
  4.2125 +
  4.2126 +
  4.2127 +
  4.2128 +Feather                     Standards Track                    [Page 38]
  4.2129 +
  4.2130 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.2131 +
  4.2132 +
  4.2133 +   Example reselecting the currently selected newsgroup:
  4.2134 +
  4.2135 +      [C] GROUP misc.test
  4.2136 +      [S] 211 1234 234 567 misc.test
  4.2137 +      [C] STAT 444
  4.2138 +      [S] 223 444 <123456@example.net> retrieved
  4.2139 +      [C] GROUP misc.test
  4.2140 +      [S] 211 1234 234 567 misc.test
  4.2141 +      [C] STAT
  4.2142 +      [S] 223 234 <different@example.net> retrieved
  4.2143 +
  4.2144 +6.1.2.  LISTGROUP
  4.2145 +
  4.2146 +6.1.2.1.  Usage
  4.2147 +
  4.2148 +   Indicating capability: READER
  4.2149 +
  4.2150 +   Syntax
  4.2151 +     LISTGROUP [group [range]]
  4.2152 +
  4.2153 +   Responses
  4.2154 +     211 number low high group     Article numbers follow (multi-line)
  4.2155 +     411                           No such newsgroup
  4.2156 +     412                           No newsgroup selected [1]
  4.2157 +
  4.2158 +   Parameters
  4.2159 +     group     Name of newsgroup
  4.2160 +     range     Range of articles to report
  4.2161 +     number    Estimated number of articles in the group
  4.2162 +     low       Reported low water mark
  4.2163 +     high      Reported high water mark
  4.2164 +
  4.2165 +   [1] The 412 response can only occur if no group has been specified.
  4.2166 +
  4.2167 +6.1.2.2.  Description
  4.2168 +
  4.2169 +   The LISTGROUP command selects a newsgroup in the same manner as the
  4.2170 +   GROUP command (see Section 6.1.1) but also provides a list of article
  4.2171 +   numbers in the newsgroup.  If no group is specified, the currently
  4.2172 +   selected newsgroup is used.
  4.2173 +
  4.2174 +   On success, a list of article numbers is returned as a multi-line
  4.2175 +   data block following the 211 response code (the arguments on the
  4.2176 +   initial response line are the same as for the GROUP command).  The
  4.2177 +   list contains one number per line and is in numerical order.  It
  4.2178 +   lists precisely those articles that exist in the group at the moment
  4.2179 +   of selection (therefore, an empty group produces an empty list).  If
  4.2180 +   the optional range argument is specified, only articles within the
  4.2181 +
  4.2182 +
  4.2183 +
  4.2184 +Feather                     Standards Track                    [Page 39]
  4.2185 +
  4.2186 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.2187 +
  4.2188 +
  4.2189 +   range are included in the list (therefore, the list MAY be empty even
  4.2190 +   if the group is not).
  4.2191 +
  4.2192 +   The range argument may be any of the following:
  4.2193 +
  4.2194 +   o  An article number.
  4.2195 +
  4.2196 +   o  An article number followed by a dash to indicate all following.
  4.2197 +
  4.2198 +   o  An article number followed by a dash followed by another article
  4.2199 +      number.
  4.2200 +
  4.2201 +   In the last case, if the second number is less than the first number,
  4.2202 +   then the range contains no articles.  Omitting the range is
  4.2203 +   equivalent to the range 1- being specified.
  4.2204 +
  4.2205 +   If the group specified is not available on the server, a 411 response
  4.2206 +   MUST be returned.  If no group is specified and the currently
  4.2207 +   selected newsgroup is invalid, a 412 response MUST be returned.
  4.2208 +
  4.2209 +   Except that the group argument is optional, that a range argument can
  4.2210 +   be specified, and that a multi-line data block follows the 211
  4.2211 +   response code, the LISTGROUP command is identical to the GROUP
  4.2212 +   command.  In particular, when successful, the command sets the
  4.2213 +   current article number to the first article in the group, if any,
  4.2214 +   even if this is not within the range specified by the second
  4.2215 +   argument.
  4.2216 +
  4.2217 +   Note that the range argument is a new feature in this specification
  4.2218 +   and servers that do not support CAPABILITIES (and therefore do not
  4.2219 +   conform to this specification) are unlikely to support it.
  4.2220 +
  4.2221 +6.1.2.3.  Examples
  4.2222 +
  4.2223 +   Example of LISTGROUP being used to select a group:
  4.2224 +
  4.2225 +      [C] LISTGROUP misc.test
  4.2226 +      [S] 211 2000 3000234 3002322 misc.test list follows
  4.2227 +      [S] 3000234
  4.2228 +      [S] 3000237
  4.2229 +      [S] 3000238
  4.2230 +      [S] 3000239
  4.2231 +      [S] 3002322
  4.2232 +      [S] .
  4.2233 +
  4.2234 +
  4.2235 +
  4.2236 +
  4.2237 +
  4.2238 +
  4.2239 +
  4.2240 +Feather                     Standards Track                    [Page 40]
  4.2241 +
  4.2242 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.2243 +
  4.2244 +
  4.2245 +   Example of LISTGROUP on an empty group:
  4.2246 +
  4.2247 +      [C] LISTGROUP example.empty.newsgroup
  4.2248 +      [S] 211 0 0 0 example.empty.newsgroup list follows
  4.2249 +      [S] .
  4.2250 +
  4.2251 +   Example of LISTGROUP on a valid, currently selected newsgroup:
  4.2252 +
  4.2253 +      [C] GROUP misc.test
  4.2254 +      [S] 211 2000 3000234 3002322 misc.test
  4.2255 +      [C] LISTGROUP
  4.2256 +      [S] 211 2000 3000234 3002322 misc.test list follows
  4.2257 +      [S] 3000234
  4.2258 +      [S] 3000237
  4.2259 +      [S] 3000238
  4.2260 +      [S] 3000239
  4.2261 +      [S] 3002322
  4.2262 +      [S] .
  4.2263 +
  4.2264 +   Example of LISTGROUP with a range:
  4.2265 +
  4.2266 +      [C] LISTGROUP misc.test 3000238-3000248
  4.2267 +      [S] 211 2000 3000234 3002322 misc.test list follows
  4.2268 +      [S] 3000238
  4.2269 +      [S] 3000239
  4.2270 +      [S] .
  4.2271 +
  4.2272 +   Example of LISTGROUP with an empty range:
  4.2273 +
  4.2274 +      [C] LISTGROUP misc.test 12345678-
  4.2275 +      [S] 211 2000 3000234 3002322 misc.test list follows
  4.2276 +      [S] .
  4.2277 +
  4.2278 +   Example of LISTGROUP with an invalid range:
  4.2279 +
  4.2280 +      [C] LISTGROUP misc.test 9999-111
  4.2281 +      [S] 211 2000 3000234 3002322 misc.test list follows
  4.2282 +      [S] .
  4.2283 +
  4.2284 +
  4.2285 +
  4.2286 +
  4.2287 +
  4.2288 +
  4.2289 +
  4.2290 +
  4.2291 +
  4.2292 +
  4.2293 +
  4.2294 +
  4.2295 +
  4.2296 +Feather                     Standards Track                    [Page 41]
  4.2297 +
  4.2298 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.2299 +
  4.2300 +
  4.2301 +6.1.3.  LAST
  4.2302 +
  4.2303 +6.1.3.1.  Usage
  4.2304 +
  4.2305 +   Indicating capability: READER
  4.2306 +
  4.2307 +   Syntax
  4.2308 +     LAST
  4.2309 +
  4.2310 +   Responses
  4.2311 +     223 n message-id    Article found
  4.2312 +     412                 No newsgroup selected
  4.2313 +     420                 Current article number is invalid
  4.2314 +     422                 No previous article in this group
  4.2315 +
  4.2316 +   Parameters
  4.2317 +     n             Article number
  4.2318 +     message-id    Article message-id
  4.2319 +
  4.2320 +6.1.3.2.  Description
  4.2321 +
  4.2322 +   If the currently selected newsgroup is valid, the current article
  4.2323 +   number MUST be set to the previous article in that newsgroup (that
  4.2324 +   is, the highest existing article number less than the current article
  4.2325 +   number).  If successful, a response indicating the new current
  4.2326 +   article number and the message-id of that article MUST be returned.
  4.2327 +   No article text is sent in response to this command.
  4.2328 +
  4.2329 +   There MAY be no previous article in the group, although the current
  4.2330 +   article number is not the reported low water mark.  There MUST NOT be
  4.2331 +   a previous article when the current article number is the reported
  4.2332 +   low water mark.
  4.2333 +
  4.2334 +   Because articles can be removed and added, the results of multiple
  4.2335 +   LAST and NEXT commands MAY not be consistent over the life of a
  4.2336 +   particular NNTP session.
  4.2337 +
  4.2338 +   If the current article number is already the first article of the
  4.2339 +   newsgroup, a 422 response MUST be returned.  If the current article
  4.2340 +   number is invalid, a 420 response MUST be returned.  If the currently
  4.2341 +   selected newsgroup is invalid, a 412 response MUST be returned.  In
  4.2342 +   all three cases, the currently selected newsgroup and current article
  4.2343 +   number MUST NOT be altered.
  4.2344 +
  4.2345 +
  4.2346 +
  4.2347 +
  4.2348 +
  4.2349 +
  4.2350 +
  4.2351 +
  4.2352 +Feather                     Standards Track                    [Page 42]
  4.2353 +
  4.2354 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.2355 +
  4.2356 +
  4.2357 +6.1.3.3.  Examples
  4.2358 +
  4.2359 +   Example of a successful article retrieval using LAST:
  4.2360 +
  4.2361 +      [C] GROUP misc.test
  4.2362 +      [S] 211 1234 3000234 3002322 misc.test
  4.2363 +      [C] NEXT
  4.2364 +      [S] 223 3000237 <668929@example.org> retrieved
  4.2365 +      [C] LAST
  4.2366 +      [S] 223 3000234 <45223423@example.com> retrieved
  4.2367 +
  4.2368 +   Example of an attempt to retrieve an article without having selected
  4.2369 +   a group (via the GROUP command) first:
  4.2370 +
  4.2371 +      [Assumes currently selected newsgroup is invalid.]
  4.2372 +      [C] LAST
  4.2373 +      [S] 412 no newsgroup selected
  4.2374 +
  4.2375 +   Example of an attempt to retrieve an article using the LAST command
  4.2376 +   when the current article number is that of the first article in the
  4.2377 +   group:
  4.2378 +
  4.2379 +      [C] GROUP misc.test
  4.2380 +      [S] 211 1234 3000234 3002322 misc.test
  4.2381 +      [C] LAST
  4.2382 +      [S] 422 No previous article to retrieve
  4.2383 +
  4.2384 +   Example of an attempt to retrieve an article using the LAST command
  4.2385 +   when the currently selected newsgroup is empty:
  4.2386 +
  4.2387 +      [C] GROUP example.empty.newsgroup
  4.2388 +      [S] 211 0 0 0 example.empty.newsgroup
  4.2389 +      [C] LAST
  4.2390 +      [S] 420 No current article selected
  4.2391 +
  4.2392 +
  4.2393 +
  4.2394 +
  4.2395 +
  4.2396 +
  4.2397 +
  4.2398 +
  4.2399 +
  4.2400 +
  4.2401 +
  4.2402 +
  4.2403 +
  4.2404 +
  4.2405 +
  4.2406 +
  4.2407 +
  4.2408 +Feather                     Standards Track                    [Page 43]
  4.2409 +
  4.2410 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.2411 +
  4.2412 +
  4.2413 +6.1.4.  NEXT
  4.2414 +
  4.2415 +6.1.4.1.  Usage
  4.2416 +
  4.2417 +   Indicating capability: READER
  4.2418 +
  4.2419 +   Syntax
  4.2420 +     NEXT
  4.2421 +
  4.2422 +   Responses
  4.2423 +     223 n message-id    Article found
  4.2424 +     412                 No newsgroup selected
  4.2425 +     420                 Current article number is invalid
  4.2426 +     421                 No next article in this group
  4.2427 +
  4.2428 +   Parameters
  4.2429 +     n             Article number
  4.2430 +     message-id    Article message-id
  4.2431 +
  4.2432 +6.1.4.2.  Description
  4.2433 +
  4.2434 +   If the currently selected newsgroup is valid, the current article
  4.2435 +   number MUST be set to the next article in that newsgroup (that is,
  4.2436 +   the lowest existing article number greater than the current article
  4.2437 +   number).  If successful, a response indicating the new current
  4.2438 +   article number and the message-id of that article MUST be returned.
  4.2439 +   No article text is sent in response to this command.
  4.2440 +
  4.2441 +   If the current article number is already the last article of the
  4.2442 +   newsgroup, a 421 response MUST be returned.  In all other aspects
  4.2443 +   (apart, of course, from the lack of 422 response), this command is
  4.2444 +   identical to the LAST command (Section 6.1.3).
  4.2445 +
  4.2446 +6.1.4.3.  Examples
  4.2447 +
  4.2448 +   Example of a successful article retrieval using NEXT:
  4.2449 +
  4.2450 +      [C] GROUP misc.test
  4.2451 +      [S] 211 1234 3000234 3002322 misc.test
  4.2452 +      [C] NEXT
  4.2453 +      [S] 223 3000237 <668929@example.org> retrieved
  4.2454 +
  4.2455 +
  4.2456 +
  4.2457 +
  4.2458 +
  4.2459 +
  4.2460 +
  4.2461 +
  4.2462 +
  4.2463 +
  4.2464 +Feather                     Standards Track                    [Page 44]
  4.2465 +
  4.2466 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.2467 +
  4.2468 +
  4.2469 +   Example of an attempt to retrieve an article without having selected
  4.2470 +   a group (via the GROUP command) first:
  4.2471 +
  4.2472 +      [Assumes currently selected newsgroup is invalid.]
  4.2473 +      [C] NEXT
  4.2474 +      [S] 412 no newsgroup selected
  4.2475 +
  4.2476 +   Example of an attempt to retrieve an article using the NEXT command
  4.2477 +   when the current article number is that of the last article in the
  4.2478 +   group:
  4.2479 +
  4.2480 +      [C] GROUP misc.test
  4.2481 +      [S] 211 1234 3000234 3002322 misc.test
  4.2482 +      [C] STAT 3002322
  4.2483 +      [S] 223 3002322 <411@example.net> retrieved
  4.2484 +      [C] NEXT
  4.2485 +      [S] 421 No next article to retrieve
  4.2486 +
  4.2487 +   Example of an attempt to retrieve an article using the NEXT command
  4.2488 +   when the currently selected newsgroup is empty:
  4.2489 +
  4.2490 +      [C] GROUP example.empty.newsgroup
  4.2491 +      [S] 211 0 0 0 example.empty.newsgroup
  4.2492 +      [C] NEXT
  4.2493 +      [S] 420 No current article selected
  4.2494 +
  4.2495 +6.2.  Retrieval of Articles and Article Sections
  4.2496 +
  4.2497 +   The ARTICLE, BODY, HEAD, and STAT commands are very similar.  They
  4.2498 +   differ only in the parts of the article that are presented to the
  4.2499 +   client and in the successful response code.  The ARTICLE command is
  4.2500 +   described here in full, while the other three commands are described
  4.2501 +   in terms of the differences.  As specified in Section 3.6, an article
  4.2502 +   consists of two parts: the article headers and the article body.
  4.2503 +
  4.2504 +   When responding to one of these commands, the server MUST present the
  4.2505 +   entire article or appropriate part and MUST NOT attempt to alter or
  4.2506 +   translate it in any way.
  4.2507 +
  4.2508 +
  4.2509 +
  4.2510 +
  4.2511 +
  4.2512 +
  4.2513 +
  4.2514 +
  4.2515 +
  4.2516 +
  4.2517 +
  4.2518 +
  4.2519 +
  4.2520 +Feather                     Standards Track                    [Page 45]
  4.2521 +
  4.2522 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.2523 +
  4.2524 +
  4.2525 +6.2.1.  ARTICLE
  4.2526 +
  4.2527 +6.2.1.1.  Usage
  4.2528 +
  4.2529 +   Indicating capability: READER
  4.2530 +
  4.2531 +   Syntax
  4.2532 +     ARTICLE message-id
  4.2533 +     ARTICLE number
  4.2534 +     ARTICLE
  4.2535 +
  4.2536 +   Responses
  4.2537 +
  4.2538 +   First form (message-id specified)
  4.2539 +     220 0|n message-id    Article follows (multi-line)
  4.2540 +     430                   No article with that message-id
  4.2541 +
  4.2542 +   Second form (article number specified)
  4.2543 +     220 n message-id      Article follows (multi-line)
  4.2544 +     412                   No newsgroup selected
  4.2545 +     423                   No article with that number
  4.2546 +
  4.2547 +   Third form (current article number used)
  4.2548 +     220 n message-id      Article follows (multi-line)
  4.2549 +     412                   No newsgroup selected
  4.2550 +     420                   Current article number is invalid
  4.2551 +
  4.2552 +   Parameters
  4.2553 +     number        Requested article number
  4.2554 +     n             Returned article number
  4.2555 +     message-id    Article message-id
  4.2556 +
  4.2557 +6.2.1.2.  Description
  4.2558 +
  4.2559 +   The ARTICLE command selects an article according to the arguments and
  4.2560 +   presents the entire article (that is, the headers, an empty line, and
  4.2561 +   the body, in that order) to the client.  The command has three forms.
  4.2562 +
  4.2563 +   In the first form, a message-id is specified, and the server presents
  4.2564 +   the article with that message-id.  In this case, the server MUST NOT
  4.2565 +   alter the currently selected newsgroup or current article number.
  4.2566 +   This is both to facilitate the presentation of articles that may be
  4.2567 +   referenced within another article being read, and because of the
  4.2568 +   semantic difficulties of determining the proper sequence and
  4.2569 +   membership of an article that may have been cross-posted to more than
  4.2570 +   one newsgroup.
  4.2571 +
  4.2572 +
  4.2573 +
  4.2574 +
  4.2575 +
  4.2576 +Feather                     Standards Track                    [Page 46]
  4.2577 +
  4.2578 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.2579 +
  4.2580 +
  4.2581 +   In the response, the article number MUST be replaced with zero,
  4.2582 +   unless there is a currently selected newsgroup and the article is
  4.2583 +   present in that group, in which case the server MAY use the article's
  4.2584 +   number in that group.  (The server is not required to determine
  4.2585 +   whether the article is in the currently selected newsgroup or, if so,
  4.2586 +   what article number it has; the client MUST always be prepared for
  4.2587 +   zero to be specified.)  The server MUST NOT provide an article number
  4.2588 +   unless use of that number in a second ARTICLE command immediately
  4.2589 +   following this one would return the same article.  Even if the server
  4.2590 +   chooses to return article numbers in these circumstances, it need not
  4.2591 +   do so consistently; it MAY return zero to any such command (also see
  4.2592 +   the STAT examples, Section 6.2.4.3).
  4.2593 +
  4.2594 +   In the second form, an article number is specified.  If there is an
  4.2595 +   article with that number in the currently selected newsgroup, the
  4.2596 +   server MUST set the current article number to that number.
  4.2597 +
  4.2598 +   In the third form, the article indicated by the current article
  4.2599 +   number in the currently selected newsgroup is used.
  4.2600 +
  4.2601 +   Note that a previously valid article number MAY become invalid if the
  4.2602 +   article has been removed.  A previously invalid article number MAY
  4.2603 +   become valid if the article has been reinstated, but this article
  4.2604 +   number MUST be no less than the reported low water mark for that
  4.2605 +   group.
  4.2606 +
  4.2607 +   The server MUST NOT change the currently selected newsgroup as a
  4.2608 +   result of this command.  The server MUST NOT change the current
  4.2609 +   article number except when an article number argument was provided
  4.2610 +   and the article exists; in particular, it MUST NOT change it
  4.2611 +   following an unsuccessful response.
  4.2612 +
  4.2613 +   Since the message-id is unique for each article, it may be used by a
  4.2614 +   client to skip duplicate displays of articles that have been posted
  4.2615 +   more than once, or to more than one newsgroup.
  4.2616 +
  4.2617 +   The article is returned as a multi-line data block following the 220
  4.2618 +   response code.
  4.2619 +
  4.2620 +   If the argument is a message-id and no such article exists, a 430
  4.2621 +   response MUST be returned.  If the argument is a number or is omitted
  4.2622 +   and the currently selected newsgroup is invalid, a 412 response MUST
  4.2623 +   be returned.  If the argument is a number and that article does not
  4.2624 +   exist in the currently selected newsgroup, a 423 response MUST be
  4.2625 +   returned.  If the argument is omitted and the current article number
  4.2626 +   is invalid, a 420 response MUST be returned.
  4.2627 +
  4.2628 +
  4.2629 +
  4.2630 +
  4.2631 +
  4.2632 +Feather                     Standards Track                    [Page 47]
  4.2633 +
  4.2634 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.2635 +
  4.2636 +
  4.2637 +6.2.1.3.  Examples
  4.2638 +
  4.2639 +   Example of a successful retrieval of an article (explicitly not using
  4.2640 +   an article number):
  4.2641 +
  4.2642 +      [C] GROUP misc.test
  4.2643 +      [S] 211 1234 3000234 3002322 misc.test
  4.2644 +      [C] ARTICLE
  4.2645 +      [S] 220 3000234 <45223423@example.com>
  4.2646 +      [S] Path: pathost!demo!whitehouse!not-for-mail
  4.2647 +      [S] From: "Demo User" <nobody@example.net>
  4.2648 +      [S] Newsgroups: misc.test
  4.2649 +      [S] Subject: I am just a test article
  4.2650 +      [S] Date: 6 Oct 1998 04:38:40 -0500
  4.2651 +      [S] Organization: An Example Net, Uncertain, Texas
  4.2652 +      [S] Message-ID: <45223423@example.com>
  4.2653 +      [S]
  4.2654 +      [S] This is just a test article.
  4.2655 +      [S] .
  4.2656 +
  4.2657 +   Example of a successful retrieval of an article by message-id:
  4.2658 +
  4.2659 +      [C] ARTICLE <45223423@example.com>
  4.2660 +      [S] 220 0 <45223423@example.com>
  4.2661 +      [S] Path: pathost!demo!whitehouse!not-for-mail
  4.2662 +      [S] From: "Demo User" <nobody@example.net>
  4.2663 +      [S] Newsgroups: misc.test
  4.2664 +      [S] Subject: I am just a test article
  4.2665 +      [S] Date: 6 Oct 1998 04:38:40 -0500
  4.2666 +      [S] Organization: An Example Net, Uncertain, Texas
  4.2667 +      [S] Message-ID: <45223423@example.com>
  4.2668 +      [S]
  4.2669 +      [S] This is just a test article.
  4.2670 +      [S] .
  4.2671 +
  4.2672 +   Example of an unsuccessful retrieval of an article by message-id:
  4.2673 +
  4.2674 +      [C] ARTICLE <i.am.not.there@example.com>
  4.2675 +      [S] 430 No Such Article Found
  4.2676 +
  4.2677 +   Example of an unsuccessful retrieval of an article by number:
  4.2678 +
  4.2679 +      [C] GROUP misc.test
  4.2680 +      [S] 211 1234 3000234 3002322 news.groups
  4.2681 +      [C] ARTICLE 300256
  4.2682 +      [S] 423 No article with that number
  4.2683 +
  4.2684 +
  4.2685 +
  4.2686 +
  4.2687 +
  4.2688 +Feather                     Standards Track                    [Page 48]
  4.2689 +
  4.2690 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.2691 +
  4.2692 +
  4.2693 +   Example of an unsuccessful retrieval of an article by number because
  4.2694 +   no newsgroup was selected first:
  4.2695 +
  4.2696 +      [Assumes currently selected newsgroup is invalid.]
  4.2697 +      [C] ARTICLE 300256
  4.2698 +      [S] 412 No newsgroup selected
  4.2699 +
  4.2700 +   Example of an attempt to retrieve an article when the currently
  4.2701 +   selected newsgroup is empty:
  4.2702 +
  4.2703 +      [C] GROUP example.empty.newsgroup
  4.2704 +      [S] 211 0 0 0 example.empty.newsgroup
  4.2705 +      [C] ARTICLE
  4.2706 +      [S] 420 No current article selected
  4.2707 +
  4.2708 +6.2.2.  HEAD
  4.2709 +
  4.2710 +6.2.2.1.  Usage
  4.2711 +
  4.2712 +   This command is mandatory.
  4.2713 +
  4.2714 +   Syntax
  4.2715 +     HEAD message-id
  4.2716 +     HEAD number
  4.2717 +     HEAD
  4.2718 +
  4.2719 +   Responses
  4.2720 +
  4.2721 +   First form (message-id specified)
  4.2722 +     221 0|n message-id    Headers follow (multi-line)
  4.2723 +     430                   No article with that message-id
  4.2724 +
  4.2725 +   Second form (article number specified)
  4.2726 +     221 n message-id      Headers follow (multi-line)
  4.2727 +     412                   No newsgroup selected
  4.2728 +     423                   No article with that number
  4.2729 +
  4.2730 +   Third form (current article number used)
  4.2731 +     221 n message-id      Headers follow (multi-line)
  4.2732 +     412                   No newsgroup selected
  4.2733 +     420                   Current article number is invalid
  4.2734 +
  4.2735 +   Parameters
  4.2736 +     number        Requested article number
  4.2737 +     n             Returned article number
  4.2738 +     message-id    Article message-id
  4.2739 +
  4.2740 +
  4.2741 +
  4.2742 +
  4.2743 +
  4.2744 +Feather                     Standards Track                    [Page 49]
  4.2745 +
  4.2746 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.2747 +
  4.2748 +
  4.2749 +6.2.2.2.  Description
  4.2750 +
  4.2751 +   The HEAD command behaves identically to the ARTICLE command except
  4.2752 +   that, if the article exists, the response code is 221 instead of 220
  4.2753 +   and only the headers are presented (the empty line separating the
  4.2754 +   headers and body MUST NOT be included).
  4.2755 +
  4.2756 +6.2.2.3.  Examples
  4.2757 +
  4.2758 +   Example of a successful retrieval of the headers of an article
  4.2759 +   (explicitly not using an article number):
  4.2760 +
  4.2761 +      [C] GROUP misc.test
  4.2762 +      [S] 211 1234 3000234 3002322 misc.test
  4.2763 +      [C] HEAD
  4.2764 +      [S] 221 3000234 <45223423@example.com>
  4.2765 +      [S] Path: pathost!demo!whitehouse!not-for-mail
  4.2766 +      [S] From: "Demo User" <nobody@example.net>
  4.2767 +      [S] Newsgroups: misc.test
  4.2768 +      [S] Subject: I am just a test article
  4.2769 +      [S] Date: 6 Oct 1998 04:38:40 -0500
  4.2770 +      [S] Organization: An Example Net, Uncertain, Texas
  4.2771 +      [S] Message-ID: <45223423@example.com>
  4.2772 +      [S] .
  4.2773 +
  4.2774 +   Example of a successful retrieval of the headers of an article by
  4.2775 +   message-id:
  4.2776 +
  4.2777 +      [C] HEAD <45223423@example.com>
  4.2778 +      [S] 221 0 <45223423@example.com>
  4.2779 +      [S] Path: pathost!demo!whitehouse!not-for-mail
  4.2780 +      [S] From: "Demo User" <nobody@example.net>
  4.2781 +      [S] Newsgroups: misc.test
  4.2782 +      [S] Subject: I am just a test article
  4.2783 +      [S] Date: 6 Oct 1998 04:38:40 -0500
  4.2784 +      [S] Organization: An Example Net, Uncertain, Texas
  4.2785 +      [S] Message-ID: <45223423@example.com>
  4.2786 +      [S] .
  4.2787 +
  4.2788 +   Example of an unsuccessful retrieval of the headers of an article by
  4.2789 +   message-id:
  4.2790 +
  4.2791 +      [C] HEAD <i.am.not.there@example.com>
  4.2792 +      [S] 430 No Such Article Found
  4.2793 +
  4.2794 +
  4.2795 +
  4.2796 +
  4.2797 +
  4.2798 +
  4.2799 +
  4.2800 +Feather                     Standards Track                    [Page 50]
  4.2801 +
  4.2802 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.2803 +
  4.2804 +
  4.2805 +   Example of an unsuccessful retrieval of the headers of an article by
  4.2806 +   number:
  4.2807 +
  4.2808 +      [C] GROUP misc.test
  4.2809 +      [S] 211 1234 3000234 3002322 misc.test
  4.2810 +      [C] HEAD 300256
  4.2811 +      [S] 423 No article with that number
  4.2812 +
  4.2813 +   Example of an unsuccessful retrieval of the headers of an article by
  4.2814 +   number because no newsgroup was selected first:
  4.2815 +
  4.2816 +      [Assumes currently selected newsgroup is invalid.]
  4.2817 +      [C] HEAD 300256
  4.2818 +      [S] 412 No newsgroup selected
  4.2819 +
  4.2820 +   Example of an attempt to retrieve the headers of an article when the
  4.2821 +   currently selected newsgroup is empty:
  4.2822 +
  4.2823 +      [C] GROUP example.empty.newsgroup
  4.2824 +      [S] 211 0 0 0 example.empty.newsgroup
  4.2825 +      [C] HEAD
  4.2826 +      [S] 420 No current article selected
  4.2827 +
  4.2828 +6.2.3.  BODY
  4.2829 +
  4.2830 +6.2.3.1.  Usage
  4.2831 +
  4.2832 +   Indicating capability: READER
  4.2833 +
  4.2834 +   Syntax
  4.2835 +     BODY message-id
  4.2836 +     BODY number
  4.2837 +     BODY
  4.2838 +
  4.2839 +   Responses
  4.2840 +
  4.2841 +   First form (message-id specified)
  4.2842 +     222 0|n message-id    Body follows (multi-line)
  4.2843 +     430                   No article with that message-id
  4.2844 +
  4.2845 +   Second form (article number specified)
  4.2846 +     222 n message-id      Body follows (multi-line)
  4.2847 +     412                   No newsgroup selected
  4.2848 +     423                   No article with that number
  4.2849 +
  4.2850 +
  4.2851 +
  4.2852 +
  4.2853 +
  4.2854 +
  4.2855 +
  4.2856 +Feather                     Standards Track                    [Page 51]
  4.2857 +
  4.2858 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.2859 +
  4.2860 +
  4.2861 +   Third form (current article number used)
  4.2862 +     222 n message-id      Body follows (multi-line)
  4.2863 +     412                   No newsgroup selected
  4.2864 +     420                   Current article number is invalid
  4.2865 +
  4.2866 +   Parameters
  4.2867 +     number        Requested article number
  4.2868 +     n             Returned article number
  4.2869 +     message-id    Article message-id
  4.2870 +
  4.2871 +6.2.3.2.  Description
  4.2872 +
  4.2873 +   The BODY command behaves identically to the ARTICLE command except
  4.2874 +   that, if the article exists, the response code is 222 instead of 220
  4.2875 +   and only the body is presented (the empty line separating the headers
  4.2876 +   and body MUST NOT be included).
  4.2877 +
  4.2878 +6.2.3.3.  Examples
  4.2879 +
  4.2880 +   Example of a successful retrieval of the body of an article
  4.2881 +   (explicitly not using an article number):
  4.2882 +
  4.2883 +      [C] GROUP misc.test
  4.2884 +      [S] 211 1234 3000234 3002322 misc.test
  4.2885 +      [C] BODY
  4.2886 +      [S] 222 3000234 <45223423@example.com>
  4.2887 +      [S] This is just a test article.
  4.2888 +      [S] .
  4.2889 +
  4.2890 +   Example of a successful retrieval of the body of an article by
  4.2891 +   message-id:
  4.2892 +
  4.2893 +      [C] BODY <45223423@example.com>
  4.2894 +      [S] 222 0 <45223423@example.com>
  4.2895 +      [S] This is just a test article.
  4.2896 +      [S] .
  4.2897 +
  4.2898 +   Example of an unsuccessful retrieval of the body of an article by
  4.2899 +   message-id:
  4.2900 +
  4.2901 +      [C] BODY <i.am.not.there@example.com>
  4.2902 +      [S] 430 No Such Article Found
  4.2903 +
  4.2904 +
  4.2905 +
  4.2906 +
  4.2907 +
  4.2908 +
  4.2909 +
  4.2910 +
  4.2911 +
  4.2912 +Feather                     Standards Track                    [Page 52]
  4.2913 +
  4.2914 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.2915 +
  4.2916 +
  4.2917 +   Example of an unsuccessful retrieval of the body of an article by
  4.2918 +   number:
  4.2919 +
  4.2920 +      [C] GROUP misc.test
  4.2921 +      [S] 211 1234 3000234 3002322 misc.test
  4.2922 +      [C] BODY 300256
  4.2923 +      [S] 423 No article with that number
  4.2924 +
  4.2925 +   Example of an unsuccessful retrieval of the body of an article by
  4.2926 +   number because no newsgroup was selected first:
  4.2927 +
  4.2928 +      [Assumes currently selected newsgroup is invalid.]
  4.2929 +      [C] BODY 300256
  4.2930 +      [S] 412 No newsgroup selected
  4.2931 +
  4.2932 +   Example of an attempt to retrieve the body of an article when the
  4.2933 +   currently selected newsgroup is empty:
  4.2934 +
  4.2935 +      [C] GROUP example.empty.newsgroup
  4.2936 +      [S] 211 0 0 0 example.empty.newsgroup
  4.2937 +      [C] BODY
  4.2938 +      [S] 420 No current article selected
  4.2939 +
  4.2940 +6.2.4.  STAT
  4.2941 +
  4.2942 +6.2.4.1.  Usage
  4.2943 +
  4.2944 +   This command is mandatory.
  4.2945 +
  4.2946 +   Syntax
  4.2947 +     STAT message-id
  4.2948 +     STAT number
  4.2949 +     STAT
  4.2950 +
  4.2951 +   Responses
  4.2952 +
  4.2953 +   First form (message-id specified)
  4.2954 +     223 0|n message-id    Article exists
  4.2955 +     430                   No article with that message-id
  4.2956 +
  4.2957 +   Second form (article number specified)
  4.2958 +     223 n message-id      Article exists
  4.2959 +     412                   No newsgroup selected
  4.2960 +     423                   No article with that number
  4.2961 +
  4.2962 +
  4.2963 +
  4.2964 +
  4.2965 +
  4.2966 +
  4.2967 +
  4.2968 +Feather                     Standards Track                    [Page 53]
  4.2969 +
  4.2970 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.2971 +
  4.2972 +
  4.2973 +   Third form (current article number used)
  4.2974 +     223 n message-id      Article exists
  4.2975 +     412                   No newsgroup selected
  4.2976 +     420                   Current article number is invalid
  4.2977 +
  4.2978 +   Parameters
  4.2979 +     number        Requested article number
  4.2980 +     n             Returned article number
  4.2981 +     message-id    Article message-id
  4.2982 +
  4.2983 +6.2.4.2.  Description
  4.2984 +
  4.2985 +   The STAT command behaves identically to the ARTICLE command except
  4.2986 +   that, if the article exists, it is NOT presented to the client and
  4.2987 +   the response code is 223 instead of 220.  Note that the response is
  4.2988 +   NOT multi-line.
  4.2989 +
  4.2990 +   This command allows the client to determine whether an article exists
  4.2991 +   and, in the second and third forms, what its message-id is, without
  4.2992 +   having to process an arbitrary amount of text.
  4.2993 +
  4.2994 +6.2.4.3.  Examples
  4.2995 +
  4.2996 +   Example of STAT on an existing article (explicitly not using an
  4.2997 +   article number):
  4.2998 +
  4.2999 +      [C] GROUP misc.test
  4.3000 +      [S] 211 1234 3000234 3002322 misc.test
  4.3001 +      [C] STAT
  4.3002 +      [S] 223 3000234 <45223423@example.com>
  4.3003 +
  4.3004 +   Example of STAT on an existing article by message-id:
  4.3005 +
  4.3006 +      [C] STAT <45223423@example.com>
  4.3007 +      [S] 223 0 <45223423@example.com>
  4.3008 +
  4.3009 +   Example of STAT on an article not on the server by message-id:
  4.3010 +
  4.3011 +      [C] STAT <i.am.not.there@example.com>
  4.3012 +      [S] 430 No Such Article Found
  4.3013 +
  4.3014 +   Example of STAT on an article not in the server by number:
  4.3015 +
  4.3016 +      [C] GROUP misc.test
  4.3017 +      [S] 211 1234 3000234 3002322 misc.test
  4.3018 +      [C] STAT 300256
  4.3019 +      [S] 423 No article with that number
  4.3020 +
  4.3021 +
  4.3022 +
  4.3023 +
  4.3024 +Feather                     Standards Track                    [Page 54]
  4.3025 +
  4.3026 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.3027 +
  4.3028 +
  4.3029 +   Example of STAT on an article by number when no newsgroup was
  4.3030 +   selected first:
  4.3031 +
  4.3032 +      [Assumes currently selected newsgroup is invalid.]
  4.3033 +      [C] STAT 300256
  4.3034 +      [S] 412 No newsgroup selected
  4.3035 +
  4.3036 +   Example of STAT on an article when the currently selected newsgroup
  4.3037 +   is empty:
  4.3038 +
  4.3039 +      [C] GROUP example.empty.newsgroup
  4.3040 +      [S] 211 0 0 0 example.empty.newsgroup
  4.3041 +      [C] STAT
  4.3042 +      [S] 420 No current article selected
  4.3043 +
  4.3044 +   Example of STAT by message-id on a server that sometimes reports the
  4.3045 +   actual article number:
  4.3046 +
  4.3047 +      [C] GROUP misc.test
  4.3048 +      [S] 211 1234 3000234 3002322 misc.test
  4.3049 +      [C] STAT
  4.3050 +      [S] 223 3000234 <45223423@example.com>
  4.3051 +      [C] STAT <45223423@example.com>
  4.3052 +      [S] 223 0 <45223423@example.com>
  4.3053 +      [C] STAT <45223423@example.com>
  4.3054 +      [S] 223 3000234 <45223423@example.com>
  4.3055 +      [C] GROUP example.empty.newsgroup
  4.3056 +      [S] 211 0 0 0 example.empty.newsgroup
  4.3057 +      [C] STAT <45223423@example.com>
  4.3058 +      [S] 223 0 <45223423@example.com>
  4.3059 +      [C] GROUP alt.crossposts
  4.3060 +      [S] 211 9999 111111 222222 alt.crossposts
  4.3061 +      [C] STAT <45223423@example.com>
  4.3062 +      [S] 223 123456 <45223423@example.com>
  4.3063 +      [C] STAT
  4.3064 +      [S] 223 111111 <23894720@example.com>
  4.3065 +
  4.3066 +   The first STAT command establishes the identity of an article in the
  4.3067 +   group.  The second and third show that the server may, but need not,
  4.3068 +   give the article number when the message-id is specified.  The fourth
  4.3069 +   STAT command shows that zero must be specified if the article isn't
  4.3070 +   in the currently selected newsgroup.  The fifth shows that the
  4.3071 +   number, if provided, must be that relating to the currently selected
  4.3072 +   newsgroup.  The last one shows that the current article number is
  4.3073 +   still not changed by the use of STAT with a message-id even if it
  4.3074 +   returns an article number.
  4.3075 +
  4.3076 +
  4.3077 +
  4.3078 +
  4.3079 +
  4.3080 +Feather                     Standards Track                    [Page 55]
  4.3081 +
  4.3082 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.3083 +
  4.3084 +
  4.3085 +6.3.  Article Posting
  4.3086 +
  4.3087 +   Article posting is done in one of two ways: individual article
  4.3088 +   posting from news-reading clients using POST, and article transfer
  4.3089 +   from other news servers using IHAVE.
  4.3090 +
  4.3091 +6.3.1.  POST
  4.3092 +
  4.3093 +6.3.1.1.  Usage
  4.3094 +
  4.3095 +   Indicating capability: POST
  4.3096 +
  4.3097 +   This command MUST NOT be pipelined.
  4.3098 +
  4.3099 +   Syntax
  4.3100 +     POST
  4.3101 +
  4.3102 +   Responses
  4.3103 +
  4.3104 +   Initial responses
  4.3105 +     340    Send article to be posted
  4.3106 +     440    Posting not permitted
  4.3107 +
  4.3108 +   Subsequent responses
  4.3109 +     240    Article received OK
  4.3110 +     441    Posting failed
  4.3111 +
  4.3112 +6.3.1.2.  Description
  4.3113 +
  4.3114 +   If posting is allowed, a 340 response MUST be returned to indicate
  4.3115 +   that the article to be posted should be sent.  If posting is
  4.3116 +   prohibited for some installation-dependent reason, a 440 response
  4.3117 +   MUST be returned.
  4.3118 +
  4.3119 +   If posting is permitted, the article MUST be in the format specified
  4.3120 +   in Section 3.6 and MUST be sent by the client to the server as a
  4.3121 +   multi-line data block (see Section 3.1.1).  Thus a single dot (".")
  4.3122 +   on a line indicates the end of the text, and lines starting with a
  4.3123 +   dot in the original text have that dot doubled during transmission.
  4.3124 +
  4.3125 +   Following the presentation of the termination sequence by the client,
  4.3126 +   the server MUST return a response indicating success or failure of
  4.3127 +   the article transfer.  Note that response codes 340 and 440 are used
  4.3128 +   in direct response to the POST command while 240 and 441 are returned
  4.3129 +   after the article is sent.
  4.3130 +
  4.3131 +
  4.3132 +
  4.3133 +
  4.3134 +
  4.3135 +
  4.3136 +Feather                     Standards Track                    [Page 56]
  4.3137 +
  4.3138 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.3139 +
  4.3140 +
  4.3141 +   A response of 240 SHOULD indicate that, barring unforeseen server
  4.3142 +   errors, the posted article will be made available on the server
  4.3143 +   and/or transferred to other servers, as appropriate, possibly
  4.3144 +   following further processing.  In other words, articles not wanted by
  4.3145 +   the server SHOULD be rejected with a 441 response, rather than being
  4.3146 +   accepted and then discarded silently.  However, the client SHOULD NOT
  4.3147 +   assume that the article has been successfully transferred unless it
  4.3148 +   receives an affirmative response from the server and SHOULD NOT
  4.3149 +   assume that it is being made available to other clients without
  4.3150 +   explicitly checking (for example, using the STAT command).
  4.3151 +
  4.3152 +   If the session is interrupted before the response is received, it is
  4.3153 +   possible that an affirmative response was sent but has been lost.
  4.3154 +   Therefore, in any subsequent session, the client SHOULD either check
  4.3155 +   whether the article was successfully posted before resending or
  4.3156 +   ensure that the server will allocate the same message-id to the new
  4.3157 +   attempt (see Appendix A.2).  The latter approach is preferred since
  4.3158 +   the article might not have been made available for reading yet (for
  4.3159 +   example, it may have to go through a moderation process).
  4.3160 +
  4.3161 +6.3.1.3.  Examples
  4.3162 +
  4.3163 +   Example of a successful posting:
  4.3164 +
  4.3165 +      [C] POST
  4.3166 +      [S] 340 Input article; end with <CR-LF>.<CR-LF>
  4.3167 +      [C] From: "Demo User" <nobody@example.net>
  4.3168 +      [C] Newsgroups: misc.test
  4.3169 +      [C] Subject: I am just a test article
  4.3170 +      [C] Organization: An Example Net
  4.3171 +      [C]
  4.3172 +      [C] This is just a test article.
  4.3173 +      [C] .
  4.3174 +      [S] 240 Article received OK
  4.3175 +
  4.3176 +   Example of an unsuccessful posting:
  4.3177 +
  4.3178 +      [C] POST
  4.3179 +      [S] 340 Input article; end with <CR-LF>.<CR-LF>
  4.3180 +      [C] From: "Demo User" <nobody@example.net>
  4.3181 +      [C] Newsgroups: misc.test
  4.3182 +      [C] Subject: I am just a test article
  4.3183 +      [C] Organization: An Example Net
  4.3184 +      [C]
  4.3185 +      [C] This is just a test article.
  4.3186 +      [C] .
  4.3187 +      [S] 441 Posting failed
  4.3188 +
  4.3189 +
  4.3190 +
  4.3191 +
  4.3192 +Feather                     Standards Track                    [Page 57]
  4.3193 +
  4.3194 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.3195 +
  4.3196 +
  4.3197 +   Example of an attempt to post when posting is not allowed:
  4.3198 +
  4.3199 +      [Initial connection set-up completed.]
  4.3200 +      [S] 201 NNTP Service Ready, posting prohibited
  4.3201 +      [C] POST
  4.3202 +      [S] 440 Posting not permitted
  4.3203 +
  4.3204 +6.3.2.  IHAVE
  4.3205 +
  4.3206 +6.3.2.1.  Usage
  4.3207 +
  4.3208 +   Indicating capability: IHAVE
  4.3209 +
  4.3210 +   This command MUST NOT be pipelined.
  4.3211 +
  4.3212 +   Syntax
  4.3213 +     IHAVE message-id
  4.3214 +
  4.3215 +   Responses
  4.3216 +
  4.3217 +   Initial responses
  4.3218 +     335    Send article to be transferred
  4.3219 +     435    Article not wanted
  4.3220 +     436    Transfer not possible; try again later
  4.3221 +
  4.3222 +   Subsequent responses
  4.3223 +     235    Article transferred OK
  4.3224 +     436    Transfer failed; try again later
  4.3225 +     437    Transfer rejected; do not retry
  4.3226 +
  4.3227 +   Parameters
  4.3228 +     message-id    Article message-id
  4.3229 +
  4.3230 +6.3.2.2.  Description
  4.3231 +
  4.3232 +   The IHAVE command informs the server that the client has an article
  4.3233 +   with the specified message-id.  If the server desires a copy of that
  4.3234 +   article, a 335 response MUST be returned, instructing the client to
  4.3235 +   send the entire article.  If the server does not want the article
  4.3236 +   (if, for example, the server already has a copy of it), a 435
  4.3237 +   response MUST be returned, indicating that the article is not wanted.
  4.3238 +   Finally, if the article isn't wanted immediately but the client
  4.3239 +   should retry later if possible (if, for example, another client is in
  4.3240 +   the process of sending the same article to the server), a 436
  4.3241 +   response MUST be returned.
  4.3242 +
  4.3243 +
  4.3244 +
  4.3245 +
  4.3246 +
  4.3247 +
  4.3248 +Feather                     Standards Track                    [Page 58]
  4.3249 +
  4.3250 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.3251 +
  4.3252 +
  4.3253 +   If transmission of the article is requested, the client MUST send the
  4.3254 +   entire article, including headers and body, to the server as a
  4.3255 +   multi-line data block (see Section 3.1.1).  Thus, a single dot (".")
  4.3256 +   on a line indicates the end of the text, and lines starting with a
  4.3257 +   dot in the original text have that dot doubled during transmission.
  4.3258 +   The server MUST return a 235 response, indicating that the article
  4.3259 +   was successfully transferred; a 436 response, indicating that the
  4.3260 +   transfer failed but should be tried again later; or a 437 response,
  4.3261 +   indicating that the article was rejected.
  4.3262 +
  4.3263 +   This function differs from the POST command in that it is intended
  4.3264 +   for use in transferring already-posted articles between hosts.  It
  4.3265 +   SHOULD NOT be used when the client is a personal news-reading
  4.3266 +   program, since use of this command indicates that the article has
  4.3267 +   already been posted at another site and is simply being forwarded
  4.3268 +   from another host.  However, despite this, the server MAY elect not
  4.3269 +   to post or forward the article if, after further examination of the
  4.3270 +   article, it deems it inappropriate to do so.  Reasons for such
  4.3271 +   subsequent rejection of an article may include problems such as
  4.3272 +   inappropriate newsgroups or distributions, disc space limitations,
  4.3273 +   article lengths, garbled headers, and the like.  These are typically
  4.3274 +   restrictions enforced by the server host's news software and not
  4.3275 +   necessarily by the NNTP server itself.
  4.3276 +
  4.3277 +   The client SHOULD NOT assume that the article has been successfully
  4.3278 +   transferred unless it receives an affirmative response from the
  4.3279 +   server.  A lack of response (such as a dropped network connection or
  4.3280 +   a network timeout) SHOULD be treated the same as a 436 response.
  4.3281 +
  4.3282 +   Because some news server software may not immediately be able to
  4.3283 +   determine whether an article is suitable for posting or forwarding,
  4.3284 +   an NNTP server MAY acknowledge the successful transfer of the article
  4.3285 +   (with a 235 response) but later silently discard it.
  4.3286 +
  4.3287 +
  4.3288 +
  4.3289 +
  4.3290 +
  4.3291 +
  4.3292 +
  4.3293 +
  4.3294 +
  4.3295 +
  4.3296 +
  4.3297 +
  4.3298 +
  4.3299 +
  4.3300 +
  4.3301 +
  4.3302 +
  4.3303 +
  4.3304 +Feather                     Standards Track                    [Page 59]
  4.3305 +
  4.3306 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.3307 +
  4.3308 +
  4.3309 +6.3.2.3.  Examples
  4.3310 +
  4.3311 +   Example of successfully sending an article to another site:
  4.3312 +
  4.3313 +      [C] IHAVE <i.am.an.article.you.will.want@example.com>
  4.3314 +      [S] 335 Send it; end with <CR-LF>.<CR-LF>
  4.3315 +      [C] Path: pathost!demo!somewhere!not-for-mail
  4.3316 +      [C] From: "Demo User" <nobody@example.com>
  4.3317 +      [C] Newsgroups: misc.test
  4.3318 +      [C] Subject: I am just a test article
  4.3319 +      [C] Date: 6 Oct 1998 04:38:40 -0500
  4.3320 +      [C] Organization: An Example Com, San Jose, CA
  4.3321 +      [C] Message-ID: <i.am.an.article.you.will.want@example.com>
  4.3322 +      [C]
  4.3323 +      [C] This is just a test article.
  4.3324 +      [C] .
  4.3325 +      [S] 235 Article transferred OK
  4.3326 +
  4.3327 +   Example of sending an article to another site that rejects it.  Note
  4.3328 +   that the message-id in the IHAVE command is not the same as the one
  4.3329 +   in the article headers; while this is bad practice and SHOULD NOT be
  4.3330 +   done, it is not forbidden.
  4.3331 +
  4.3332 +      [C] IHAVE <i.am.an.article.you.will.want@example.com>
  4.3333 +      [S] 335 Send it; end with <CR-LF>.<CR-LF>
  4.3334 +      [C] Path: pathost!demo!somewhere!not-for-mail
  4.3335 +      [C] From: "Demo User" <nobody@example.com>
  4.3336 +      [C] Newsgroups: misc.test
  4.3337 +      [C] Subject: I am just a test article
  4.3338 +      [C] Date: 6 Oct 1998 04:38:40 -0500
  4.3339 +      [C] Organization: An Example Com, San Jose, CA
  4.3340 +      [C] Message-ID: <i.am.an.article.you.have@example.com>
  4.3341 +      [C]
  4.3342 +      [C] This is just a test article.
  4.3343 +      [C] .
  4.3344 +      [S] 437 Article rejected; don't send again
  4.3345 +
  4.3346 +
  4.3347 +
  4.3348 +
  4.3349 +
  4.3350 +
  4.3351 +
  4.3352 +
  4.3353 +
  4.3354 +
  4.3355 +
  4.3356 +
  4.3357 +
  4.3358 +
  4.3359 +
  4.3360 +Feather                     Standards Track                    [Page 60]
  4.3361 +
  4.3362 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.3363 +
  4.3364 +
  4.3365 +   Example of sending an article to another site where the transfer
  4.3366 +   fails:
  4.3367 +
  4.3368 +      [C] IHAVE <i.am.an.article.you.will.want@example.com>
  4.3369 +      [S] 335 Send it; end with <CR-LF>.<CR-LF>
  4.3370 +      [C] Path: pathost!demo!somewhere!not-for-mail
  4.3371 +      [C] From: "Demo User" <nobody@example.com>
  4.3372 +      [C] Newsgroups: misc.test
  4.3373 +      [C] Subject: I am just a test article
  4.3374 +      [C] Date: 6 Oct 1998 04:38:40 -0500
  4.3375 +      [C] Organization: An Example Com, San Jose, CA
  4.3376 +      [C] Message-ID: <i.am.an.article.you.will.want@example.com>
  4.3377 +      [C]
  4.3378 +      [C] This is just a test article.
  4.3379 +      [C] .
  4.3380 +      [S] 436 Transfer failed
  4.3381 +
  4.3382 +   Example of sending an article to a site that already has it:
  4.3383 +
  4.3384 +      [C] IHAVE <i.am.an.article.you.have@example.com>
  4.3385 +      [S] 435 Duplicate
  4.3386 +
  4.3387 +   Example of sending an article to a site that requests that the
  4.3388 +   article be tried again later:
  4.3389 +
  4.3390 +      [C] IHAVE <i.am.an.article.you.defer@example.com>
  4.3391 +      [S] 436 Retry later
  4.3392 +
  4.3393 +7.  Information Commands
  4.3394 +
  4.3395 +   This section lists other commands that may be used at any time
  4.3396 +   between the beginning of a session and its termination.  Using these
  4.3397 +   commands does not alter any state information, but the response
  4.3398 +   generated from their use may provide useful information to clients.
  4.3399 +
  4.3400 +7.1.  DATE
  4.3401 +
  4.3402 +7.1.1.  Usage
  4.3403 +
  4.3404 +   Indicating capability: READER
  4.3405 +
  4.3406 +   Syntax
  4.3407 +     DATE
  4.3408 +
  4.3409 +   Responses
  4.3410 +     111 yyyymmddhhmmss    Server date and time
  4.3411 +
  4.3412 +
  4.3413 +
  4.3414 +
  4.3415 +
  4.3416 +Feather                     Standards Track                    [Page 61]
  4.3417 +
  4.3418 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.3419 +
  4.3420 +
  4.3421 +   Parameters
  4.3422 +     yyyymmddhhmmss    Current UTC date and time on server
  4.3423 +
  4.3424 +7.1.2.  Description
  4.3425 +
  4.3426 +   This command exists to help clients find out the current Coordinated
  4.3427 +   Universal Time [TF.686-1] from the server's perspective.  This
  4.3428 +   command SHOULD NOT be used as a substitute for NTP [RFC1305] but to
  4.3429 +   provide information that might be useful when using the NEWNEWS
  4.3430 +   command (see Section 7.4).
  4.3431 +
  4.3432 +   The DATE command MUST return a timestamp from the same clock as is
  4.3433 +   used for determining article arrival and group creation times (see
  4.3434 +   Section 6).  This clock SHOULD be monotonic, and adjustments SHOULD
  4.3435 +   be made by running it fast or slow compared to "real" time rather
  4.3436 +   than by making sudden jumps.  A system providing NNTP service SHOULD
  4.3437 +   keep the system clock as accurate as possible, either with NTP or by
  4.3438 +   some other method.
  4.3439 +
  4.3440 +   The server MUST return a 111 response specifying the date and time on
  4.3441 +   the server in the form yyyymmddhhmmss.  This date and time is in
  4.3442 +   Coordinated Universal Time.
  4.3443 +
  4.3444 +7.1.3.  Examples
  4.3445 +
  4.3446 +      [C] DATE
  4.3447 +      [S] 111 19990623135624
  4.3448 +
  4.3449 +7.2.  HELP
  4.3450 +
  4.3451 +7.2.1.  Usage
  4.3452 +
  4.3453 +   This command is mandatory.
  4.3454 +
  4.3455 +   Syntax
  4.3456 +     HELP
  4.3457 +
  4.3458 +   Responses
  4.3459 +     100    Help text follows (multi-line)
  4.3460 +
  4.3461 +7.2.2.  Description
  4.3462 +
  4.3463 +   This command provides a short summary of the commands that are
  4.3464 +   understood by this implementation of the server.  The help text will
  4.3465 +   be presented as a multi-line data block following the 100 response
  4.3466 +   code.
  4.3467 +
  4.3468 +
  4.3469 +
  4.3470 +
  4.3471 +
  4.3472 +Feather                     Standards Track                    [Page 62]
  4.3473 +
  4.3474 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.3475 +
  4.3476 +
  4.3477 +   This text is not guaranteed to be in any particular format (but must
  4.3478 +   be UTF-8) and MUST NOT be used by clients as a replacement for the
  4.3479 +   CAPABILITIES command described in Section 5.2.
  4.3480 +
  4.3481 +7.2.3.  Examples
  4.3482 +
  4.3483 +      [C] HELP
  4.3484 +      [S] 100 Help text follows
  4.3485 +      [S] This is some help text.  There is no specific
  4.3486 +      [S] formatting requirement for this test, though
  4.3487 +      [S] it is customary for it to list the valid commands
  4.3488 +      [S] and give a brief definition of what they do.
  4.3489 +      [S] .
  4.3490 +
  4.3491 +7.3.  NEWGROUPS
  4.3492 +
  4.3493 +7.3.1.  Usage
  4.3494 +
  4.3495 +   Indicating capability: READER
  4.3496 +
  4.3497 +   Syntax
  4.3498 +     NEWGROUPS date time [GMT]
  4.3499 +
  4.3500 +   Responses
  4.3501 +     231    List of new newsgroups follows (multi-line)
  4.3502 +
  4.3503 +   Parameters
  4.3504 +     date    Date in yymmdd or yyyymmdd format
  4.3505 +     time    Time in hhmmss format
  4.3506 +
  4.3507 +7.3.2.  Description
  4.3508 +
  4.3509 +   This command returns a list of newsgroups created on the server since
  4.3510 +   the specified date and time.  The results are in the same format as
  4.3511 +   the LIST ACTIVE command (see Section 7.6.3).  However, they MAY
  4.3512 +   include groups not available on the server (and so not returned by
  4.3513 +   LIST ACTIVE) and MAY omit groups for which the creation date is not
  4.3514 +   available.
  4.3515 +
  4.3516 +   The date is specified as 6 or 8 digits in the format [xx]yymmdd,
  4.3517 +   where xx is the first two digits of the year (19-99), yy is the last
  4.3518 +   two digits of the year (00-99), mm is the month (01-12), and dd is
  4.3519 +   the day of the month (01-31).  Clients SHOULD specify all four digits
  4.3520 +   of the year.  If the first two digits of the year are not specified
  4.3521 +   (this is supported only for backward compatibility), the year is to
  4.3522 +   be taken from the current century if yy is smaller than or equal to
  4.3523 +   the current year, and the previous century otherwise.
  4.3524 +
  4.3525 +
  4.3526 +
  4.3527 +
  4.3528 +Feather                     Standards Track                    [Page 63]
  4.3529 +
  4.3530 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.3531 +
  4.3532 +
  4.3533 +   The time is specified as 6 digits in the format hhmmss, where hh is
  4.3534 +   the hours in the 24-hour clock (00-23), mm is the minutes (00-59),
  4.3535 +   and ss is the seconds (00-60, to allow for leap seconds).  The token
  4.3536 +   "GMT" specifies that the date and time are given in Coordinated
  4.3537 +   Universal Time [TF.686-1]; if it is omitted, then the date and time
  4.3538 +   are specified in the server's local timezone.  Note that there is no
  4.3539 +   way of using the protocol specified in this document to establish the
  4.3540 +   server's local timezone.
  4.3541 +
  4.3542 +   Note that an empty list is a possible valid response and indicates
  4.3543 +   that there are no new newsgroups since that date-time.
  4.3544 +
  4.3545 +   Clients SHOULD make all queries using Coordinated Universal Time
  4.3546 +   (i.e., by including the "GMT" argument) when possible.
  4.3547 +
  4.3548 +7.3.3.  Examples
  4.3549 +
  4.3550 +   Example where there are new groups:
  4.3551 +
  4.3552 +      [C] NEWGROUPS 19990624 000000 GMT
  4.3553 +      [S] 231 list of new newsgroups follows
  4.3554 +      [S] alt.rfc-writers.recovery 4 1 y
  4.3555 +      [S] tx.natives.recovery 89 56 y
  4.3556 +      [S] .
  4.3557 +
  4.3558 +   Example where there are no new groups:
  4.3559 +
  4.3560 +      [C] NEWGROUPS 19990624 000000 GMT
  4.3561 +      [S] 231 list of new newsgroups follows
  4.3562 +      [S] .
  4.3563 +
  4.3564 +7.4.  NEWNEWS
  4.3565 +
  4.3566 +7.4.1.  Usage
  4.3567 +
  4.3568 +   Indicating capability: NEWNEWS
  4.3569 +
  4.3570 +   Syntax
  4.3571 +     NEWNEWS wildmat date time [GMT]
  4.3572 +
  4.3573 +   Responses
  4.3574 +     230    List of new articles follows (multi-line)
  4.3575 +
  4.3576 +   Parameters
  4.3577 +     wildmat    Newsgroups of interest
  4.3578 +     date       Date in yymmdd or yyyymmdd format
  4.3579 +     time       Time in hhmmss format
  4.3580 +
  4.3581 +
  4.3582 +
  4.3583 +
  4.3584 +Feather                     Standards Track                    [Page 64]
  4.3585 +
  4.3586 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.3587 +
  4.3588 +
  4.3589 +7.4.2.  Description
  4.3590 +
  4.3591 +   This command returns a list of message-ids of articles posted or
  4.3592 +   received on the server, in the newsgroups whose names match the
  4.3593 +   wildmat, since the specified date and time.  One message-id is sent
  4.3594 +   on each line; the order of the response has no specific significance
  4.3595 +   and may vary from response to response in the same session.  A
  4.3596 +   message-id MAY appear more than once; if it does, it has the same
  4.3597 +   meaning as if it appeared only once.
  4.3598 +
  4.3599 +   Date and time are in the same format as the NEWGROUPS command (see
  4.3600 +   Section 7.3).
  4.3601 +
  4.3602 +   Note that an empty list is a possible valid response and indicates
  4.3603 +   that there is currently no new news in the relevant groups.
  4.3604 +
  4.3605 +   Clients SHOULD make all queries in Coordinated Universal Time (i.e.,
  4.3606 +   by using the "GMT" argument) when possible.
  4.3607 +
  4.3608 +7.4.3.  Examples
  4.3609 +
  4.3610 +   Example where there are new articles:
  4.3611 +
  4.3612 +      [C] NEWNEWS news.*,sci.* 19990624 000000 GMT
  4.3613 +      [S] 230 list of new articles by message-id follows
  4.3614 +      [S] <i.am.a.new.article@example.com>
  4.3615 +      [S] <i.am.another.new.article@example.com>
  4.3616 +      [S] .
  4.3617 +
  4.3618 +   Example where there are no new articles:
  4.3619 +
  4.3620 +      [C] NEWNEWS alt.* 19990624 000000 GMT
  4.3621 +      [S] 230 list of new articles by message-id follows
  4.3622 +      [S] .
  4.3623 +
  4.3624 +7.5.  Time
  4.3625 +
  4.3626 +   As described in Section 6, each article has an arrival timestamp.
  4.3627 +   Each newsgroup also has a creation timestamp.  These timestamps are
  4.3628 +   used by the NEWNEWS and NEWGROUP commands to construct their
  4.3629 +   responses.
  4.3630 +
  4.3631 +   Clients can ensure that they do not have gaps in lists of articles or
  4.3632 +   groups by using the DATE command in the following manner:
  4.3633 +
  4.3634 +   First session:
  4.3635 +      Issue DATE command and record result.
  4.3636 +      Issue NEWNEWS command using a previously chosen timestamp.
  4.3637 +
  4.3638 +
  4.3639 +
  4.3640 +Feather                     Standards Track                    [Page 65]
  4.3641 +
  4.3642 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.3643 +
  4.3644 +
  4.3645 +   Subsequent sessions:
  4.3646 +      Issue DATE command and hold result in temporary storage.
  4.3647 +      Issue NEWNEWS command using timestamp saved from previous session.
  4.3648 +      Overwrite saved timestamp with that currently in temporary
  4.3649 +      storage.
  4.3650 +
  4.3651 +   In order to allow for minor errors, clients MAY want to adjust the
  4.3652 +   timestamp back by two or three minutes before using it in NEWNEWS.
  4.3653 +
  4.3654 +7.5.1.  Examples
  4.3655 +
  4.3656 +   First session:
  4.3657 +
  4.3658 +      [C] DATE
  4.3659 +      [S] 111 20010203112233
  4.3660 +      [C] NEWNEWS local.chat 20001231 235959 GMT
  4.3661 +      [S] 230 list follows
  4.3662 +      [S] <article.1@local.service>
  4.3663 +      [S] <article.2@local.service>
  4.3664 +      [S] <article.3@local.service>
  4.3665 +      [S] .
  4.3666 +
  4.3667 +   Second session (the client has subtracted 3 minutes from the
  4.3668 +   timestamp returned previously):
  4.3669 +
  4.3670 +      [C] DATE
  4.3671 +      [S] 111 20010204003344
  4.3672 +      [C] NEWNEWS local.chat 20010203 111933 GMT
  4.3673 +      [S] 230 list follows
  4.3674 +      [S] <article.3@local.service>
  4.3675 +      [S] <article.4@local.service>
  4.3676 +      [S] <article.5@local.service>
  4.3677 +      [S] .
  4.3678 +
  4.3679 +   Note how <article.3@local.service> arrived in the 3 minute gap and so
  4.3680 +   is listed in both responses.
  4.3681 +
  4.3682 +7.6.  The LIST Commands
  4.3683 +
  4.3684 +   The LIST family of commands all return information that is multi-line
  4.3685 +   and that can, in general, be expected not to change during the
  4.3686 +   session.  Often the information is related to newsgroups, in which
  4.3687 +   case the response has one line per newsgroup and a wildmat MAY be
  4.3688 +   provided to restrict the groups for which information is returned.
  4.3689 +
  4.3690 +   The set of available keywords (including those provided by
  4.3691 +   extensions) is given in the capability list with capability label
  4.3692 +   LIST.
  4.3693 +
  4.3694 +
  4.3695 +
  4.3696 +Feather                     Standards Track                    [Page 66]
  4.3697 +
  4.3698 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.3699 +
  4.3700 +
  4.3701 +7.6.1.  LIST
  4.3702 +
  4.3703 +7.6.1.1.  Usage
  4.3704 +
  4.3705 +   Indicating capability: LIST
  4.3706 +
  4.3707 +   Syntax
  4.3708 +     LIST [keyword [wildmat|argument]]
  4.3709 +
  4.3710 +   Responses
  4.3711 +     215    Information follows (multi-line)
  4.3712 +
  4.3713 +   Parameters
  4.3714 +     keyword     Information requested [1]
  4.3715 +     argument    Specific to keyword
  4.3716 +     wildmat     Groups of interest
  4.3717 +
  4.3718 +   [1] If no keyword is provided, it defaults to ACTIVE.
  4.3719 +
  4.3720 +7.6.1.2.  Description
  4.3721 +
  4.3722 +   The LIST command allows the server to provide blocks of information
  4.3723 +   to the client.  This information may be global or may be related to
  4.3724 +   newsgroups; in the latter case, the information may be returned
  4.3725 +   either for all groups or only for those matching a wildmat.  Each
  4.3726 +   block of information is represented by a different keyword.  The
  4.3727 +   command returns the specific information identified by the keyword.
  4.3728 +
  4.3729 +   If the information is available, it is returned as a multi-line data
  4.3730 +   block following the 215 response code.  The format of the information
  4.3731 +   depends on the keyword.  The information MAY be affected by the
  4.3732 +   additional argument, but the format MUST NOT be.
  4.3733 +
  4.3734 +   If the information is based on newsgroups and the optional wildmat
  4.3735 +   argument is specified, the response is limited to only the groups (if
  4.3736 +   any) whose names match the wildmat and for which the information is
  4.3737 +   available.
  4.3738 +
  4.3739 +   Note that an empty list is a possible valid response; for a
  4.3740 +   newsgroup-based keyword, it indicates that there are no groups
  4.3741 +   meeting the above criteria.
  4.3742 +
  4.3743 +   If the keyword is not recognised, or if an argument is specified and
  4.3744 +   the keyword does not expect one, a 501 response code MUST BE
  4.3745 +   returned.  If the keyword is recognised but the server does not
  4.3746 +   maintain the information, a 503 response code MUST BE returned.
  4.3747 +
  4.3748 +
  4.3749 +
  4.3750 +
  4.3751 +
  4.3752 +Feather                     Standards Track                    [Page 67]
  4.3753 +
  4.3754 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.3755 +
  4.3756 +
  4.3757 +   The LIST command MUST NOT change the visible state of the server in
  4.3758 +   any way; that is, the behaviour of subsequent commands MUST NOT be
  4.3759 +   affected by whether the LIST command was issued.  For example, it
  4.3760 +   MUST NOT make groups available that otherwise would not have been.
  4.3761 +
  4.3762 +7.6.1.3.  Examples
  4.3763 +
  4.3764 +   Example of LIST with the ACTIVE keyword:
  4.3765 +
  4.3766 +      [C] LIST ACTIVE
  4.3767 +      [S] 215 list of newsgroups follows
  4.3768 +      [S] misc.test 3002322 3000234 y
  4.3769 +      [S] comp.risks 442001 441099 m
  4.3770 +      [S] alt.rfc-writers.recovery 4 1 y
  4.3771 +      [S] tx.natives.recovery 89 56 y
  4.3772 +      [S] tx.natives.recovery.d 11 9 n
  4.3773 +      [S] .
  4.3774 +
  4.3775 +   Example of LIST with no keyword:
  4.3776 +
  4.3777 +      [C] LIST
  4.3778 +      [S] 215 list of newsgroups follows
  4.3779 +      [S] misc.test 3002322 3000234 y
  4.3780 +      [S] comp.risks 442001 441099 m
  4.3781 +      [S] alt.rfc-writers.recovery 4 1 y
  4.3782 +      [S] tx.natives.recovery 89 56 y
  4.3783 +      [S] tx.natives.recovery.d 11 9 n
  4.3784 +      [S] .
  4.3785 +
  4.3786 +   The output is identical to that of the previous example.
  4.3787 +
  4.3788 +   Example of LIST on a newsgroup-based keyword with and without
  4.3789 +   wildmat:
  4.3790 +
  4.3791 +      [C] LIST ACTIVE.TIMES
  4.3792 +      [S] 215 information follows
  4.3793 +      [S] misc.test 930445408 <creatme@isc.org>
  4.3794 +      [S] alt.rfc-writers.recovery 930562309 <m@example.com>
  4.3795 +      [S] tx.natives.recovery 930678923 <sob@academ.com>
  4.3796 +      [S] .
  4.3797 +      [C] LIST ACTIVE.TIMES tx.*
  4.3798 +      [S] 215 information follows
  4.3799 +      [S] tx.natives.recovery 930678923 <sob@academ.com>
  4.3800 +      [S] .
  4.3801 +
  4.3802 +
  4.3803 +
  4.3804 +
  4.3805 +
  4.3806 +
  4.3807 +
  4.3808 +Feather                     Standards Track                    [Page 68]
  4.3809 +
  4.3810 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.3811 +
  4.3812 +
  4.3813 +   Example of LIST returning an error where the keyword is recognized
  4.3814 +   but the software does not maintain this information:
  4.3815 +
  4.3816 +      [C] CAPABILITIES
  4.3817 +      [S] 101 Capability list:
  4.3818 +      [S] VERSION 2
  4.3819 +      [S] READER
  4.3820 +      [S] LIST ACTIVE NEWSGROUPS ACTIVE.TIMES XTRA.DATA
  4.3821 +      [S] .
  4.3822 +      [C] LIST XTRA.DATA
  4.3823 +      [S] 503 Data item not stored
  4.3824 +
  4.3825 +   Example of LIST where the keyword is not recognised:
  4.3826 +
  4.3827 +      [C] CAPABILITIES
  4.3828 +      [S] 101 Capability list:
  4.3829 +      [S] VERSION 2
  4.3830 +      [S] READER
  4.3831 +      [S] LIST ACTIVE NEWSGROUPS ACTIVE.TIMES XTRA.DATA
  4.3832 +      [S] .
  4.3833 +      [C] LIST DISTRIB.PATS
  4.3834 +      [S] 501 Syntax Error
  4.3835 +
  4.3836 +7.6.2.  Standard LIST Keywords
  4.3837 +
  4.3838 +   This specification defines the following LIST keywords:
  4.3839 +
  4.3840 +   +--------------+---------------+------------------------------------+
  4.3841 +   | Keyword      | Definition    | Status                             |
  4.3842 +   +--------------+---------------+------------------------------------+
  4.3843 +   | ACTIVE       | Section 7.6.3 | Mandatory if the READER capability |
  4.3844 +   |              |               | is advertised                      |
  4.3845 +   |              |               |                                    |
  4.3846 +   | ACTIVE.TIMES | Section 7.6.4 | Optional                           |
  4.3847 +   |              |               |                                    |
  4.3848 +   | DISTRIB.PATS | Section 7.6.5 | Optional                           |
  4.3849 +   |              |               |                                    |
  4.3850 +   | HEADERS      | Section 8.6   | Mandatory if the HDR capability is |
  4.3851 +   |              |               | advertised                         |
  4.3852 +   |              |               |                                    |
  4.3853 +   | NEWSGROUPS   | Section 7.6.6 | Mandatory if the READER capability |
  4.3854 +   |              |               | is advertised                      |
  4.3855 +   |              |               |                                    |
  4.3856 +   | OVERVIEW.FMT | Section 8.4   | Mandatory if the OVER capability   |
  4.3857 +   |              |               | is advertised                      |
  4.3858 +   +--------------+---------------+------------------------------------+
  4.3859 +
  4.3860 +
  4.3861 +
  4.3862 +
  4.3863 +
  4.3864 +Feather                     Standards Track                    [Page 69]
  4.3865 +
  4.3866 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.3867 +
  4.3868 +
  4.3869 +   Where one of these LIST keywords is supported by a server, it MUST
  4.3870 +   have the meaning given in the relevant sub-section.
  4.3871 +
  4.3872 +7.6.3.  LIST ACTIVE
  4.3873 +
  4.3874 +   This keyword MUST be supported by servers advertising the READER
  4.3875 +   capability.
  4.3876 +
  4.3877 +   LIST ACTIVE returns a list of valid newsgroups and associated
  4.3878 +   information.  If no wildmat is specified, the server MUST include
  4.3879 +   every group that the client is permitted to select with the GROUP
  4.3880 +   command (Section 6.1.1).  Each line of this list consists of four
  4.3881 +   fields separated from each other by one or more spaces:
  4.3882 +
  4.3883 +   o  The name of the newsgroup.
  4.3884 +   o  The reported high water mark for the group.
  4.3885 +   o  The reported low water mark for the group.
  4.3886 +   o  The current status of the group on this server.
  4.3887 +
  4.3888 +   The reported high and low water marks are as described in the GROUP
  4.3889 +   command (see Section 6.1.1), but note that they are in the opposite
  4.3890 +   order to the 211 response to that command.
  4.3891 +
  4.3892 +   The status field is typically one of the following:
  4.3893 +
  4.3894 +   "y" Posting is permitted.
  4.3895 +
  4.3896 +   "n" Posting is not permitted.
  4.3897 +
  4.3898 +   "m" Postings will be forwarded to the newsgroup moderator.
  4.3899 +
  4.3900 +   The server SHOULD use these values when these meanings are required
  4.3901 +   and MUST NOT use them with any other meaning.  Other values for the
  4.3902 +   status may exist; the definition of these other values and the
  4.3903 +   circumstances under which they are returned may be specified in an
  4.3904 +   extension or may be private to the server.  A client SHOULD treat an
  4.3905 +   unrecognized status as giving no information.
  4.3906 +
  4.3907 +   The status of a newsgroup only indicates how posts to that newsgroup
  4.3908 +   are normally processed and is not necessarily customised to the
  4.3909 +   specific client.  For example, if the current client is forbidden
  4.3910 +   from posting, then this will apply equally to groups with status "y".
  4.3911 +   Conversely, a client with special privileges (not defined by this
  4.3912 +   specification) might be able to post to a group with status "n".
  4.3913 +
  4.3914 +
  4.3915 +
  4.3916 +
  4.3917 +
  4.3918 +
  4.3919 +
  4.3920 +Feather                     Standards Track                    [Page 70]
  4.3921 +
  4.3922 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.3923 +
  4.3924 +
  4.3925 +   For example:
  4.3926 +
  4.3927 +      [C] LIST ACTIVE
  4.3928 +      [S] 215 list of newsgroups follows
  4.3929 +      [S] misc.test 3002322 3000234 y
  4.3930 +      [S] comp.risks 442001 441099 m
  4.3931 +      [S] alt.rfc-writers.recovery 4 1 y
  4.3932 +      [S] tx.natives.recovery 89 56 y
  4.3933 +      [S] tx.natives.recovery.d 11 9 n
  4.3934 +      [S] .
  4.3935 +
  4.3936 +   or, on an implementation that includes leading zeroes:
  4.3937 +
  4.3938 +      [C] LIST ACTIVE
  4.3939 +      [S] 215 list of newsgroups follows
  4.3940 +      [S] misc.test 0003002322 0003000234 y
  4.3941 +      [S] comp.risks 0000442001 0000441099 m
  4.3942 +      [S] alt.rfc-writers.recovery 0000000004 0000000001 y
  4.3943 +      [S] tx.natives.recovery 0000000089 0000000056 y
  4.3944 +      [S] tx.natives.recovery.d 0000000011 0000000009 n
  4.3945 +      [S] .
  4.3946 +
  4.3947 +   The information is newsgroup based, and a wildmat MAY be specified,
  4.3948 +   in which case the response is limited to only the groups (if any)
  4.3949 +   whose names match the wildmat.  For example:
  4.3950 +
  4.3951 +      [C] LIST ACTIVE *.recovery
  4.3952 +      [S] 215 list of newsgroups follows
  4.3953 +      [S] alt.rfc-writers.recovery 4 1 y
  4.3954 +      [S] tx.natives.recovery 89 56 y
  4.3955 +      [S] .
  4.3956 +
  4.3957 +7.6.4.  LIST ACTIVE.TIMES
  4.3958 +
  4.3959 +   This keyword is optional.
  4.3960 +
  4.3961 +   The active.times list is maintained by some NNTP servers to contain
  4.3962 +   information about who created a particular newsgroup and when.  Each
  4.3963 +   line of this list consists of three fields separated from each other
  4.3964 +   by one or more spaces.  The first field is the name of the newsgroup.
  4.3965 +   The second is the time when this group was created on this news
  4.3966 +   server, measured in seconds since the start of January 1, 1970.  The
  4.3967 +   third is plain text intended to describe the entity that created the
  4.3968 +   newsgroup; it is often a mailbox as defined in RFC 2822 [RFC2822].
  4.3969 +   For example:
  4.3970 +
  4.3971 +
  4.3972 +
  4.3973 +
  4.3974 +
  4.3975 +
  4.3976 +Feather                     Standards Track                    [Page 71]
  4.3977 +
  4.3978 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.3979 +
  4.3980 +
  4.3981 +      [C] LIST ACTIVE.TIMES
  4.3982 +      [S] 215 information follows
  4.3983 +      [S] misc.test 930445408 <creatme@isc.org>
  4.3984 +      [S] alt.rfc-writers.recovery 930562309 <m@example.com>
  4.3985 +      [S] tx.natives.recovery 930678923 <sob@academ.com>
  4.3986 +      [S] .
  4.3987 +
  4.3988 +   The list MAY omit newsgroups for which the information is unavailable
  4.3989 +   and MAY include groups not available on the server; in particular, it
  4.3990 +   MAY omit all groups created before the date and time of the oldest
  4.3991 +   entry.  The client MUST NOT assume that the list is complete or that
  4.3992 +   it matches the list returned by the LIST ACTIVE command
  4.3993 +   (Section 7.6.3).  The NEWGROUPS command (Section 7.3) may provide a
  4.3994 +   better way to access this information, and the results of the two
  4.3995 +   commands SHOULD be consistent except that, if the latter is invoked
  4.3996 +   with a date and time earlier than the oldest entry in active.times
  4.3997 +   list, its result may include extra groups.
  4.3998 +
  4.3999 +   The information is newsgroup based, and a wildmat MAY be specified,
  4.4000 +   in which case the response is limited to only the groups (if any)
  4.4001 +   whose names match the wildmat.
  4.4002 +
  4.4003 +7.6.5.  LIST DISTRIB.PATS
  4.4004 +
  4.4005 +   This keyword is optional.
  4.4006 +
  4.4007 +   The distrib.pats list is maintained by some NNTP servers to assist
  4.4008 +   clients to choose a value for the content of the Distribution header
  4.4009 +   of a news article being posted.  Each line of this list consists of
  4.4010 +   three fields separated from each other by a colon (":").  The first
  4.4011 +   field is a weight, the second field is a wildmat (which may be a
  4.4012 +   simple newsgroup name), and the third field is a value for the
  4.4013 +   Distribution header content.  For example:
  4.4014 +
  4.4015 +      [C] LIST DISTRIB.PATS
  4.4016 +      [S] 215 information follows
  4.4017 +      [S] 10:local.*:local
  4.4018 +      [S] 5:*:world
  4.4019 +      [S] 20:local.here.*:thissite
  4.4020 +      [S] .
  4.4021 +
  4.4022 +   The client MAY use this information to construct an appropriate
  4.4023 +   Distribution header given the name of a newsgroup.  To do so, it
  4.4024 +   should determine the lines whose second field matches the newsgroup
  4.4025 +   name, select from among them the line with the highest weight (with 0
  4.4026 +   being the lowest), and use the value of the third field to construct
  4.4027 +   the Distribution header.
  4.4028 +
  4.4029 +
  4.4030 +
  4.4031 +
  4.4032 +Feather                     Standards Track                    [Page 72]
  4.4033 +
  4.4034 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.4035 +
  4.4036 +
  4.4037 +   The information is not newsgroup based, and an argument MUST NOT be
  4.4038 +   specified.
  4.4039 +
  4.4040 +7.6.6.  LIST NEWSGROUPS
  4.4041 +
  4.4042 +   This keyword MUST be supported by servers advertising the READER
  4.4043 +   capability.
  4.4044 +
  4.4045 +   The newsgroups list is maintained by NNTP servers to contain the name
  4.4046 +   of each newsgroup that is available on the server and a short
  4.4047 +   description about the purpose of the group.  Each line of this list
  4.4048 +   consists of two fields separated from each other by one or more space
  4.4049 +   or TAB characters (the usual practice is a single TAB).  The first
  4.4050 +   field is the name of the newsgroup, and the second is a short
  4.4051 +   description of the group.  For example:
  4.4052 +
  4.4053 +      [C] LIST NEWSGROUPS
  4.4054 +      [S] 215 information follows
  4.4055 +      [S] misc.test General Usenet testing
  4.4056 +      [S] alt.rfc-writers.recovery RFC Writers Recovery
  4.4057 +      [S] tx.natives.recovery Texas Natives Recovery
  4.4058 +      [S] .
  4.4059 +
  4.4060 +   The list MAY omit newsgroups for which the information is unavailable
  4.4061 +   and MAY include groups not available on the server.  The client MUST
  4.4062 +   NOT assume that the list is complete or that it matches the list
  4.4063 +   returned by LIST ACTIVE.
  4.4064 +
  4.4065 +   The description SHOULD be in UTF-8.  However, servers often obtain
  4.4066 +   the information from external sources.  These sources may have used
  4.4067 +   different encodings (ones that use octets in the range 128 to 255 in
  4.4068 +   some other manner) and, in that case, the server MAY pass it on
  4.4069 +   unchanged.  Therefore, clients MUST be prepared to receive such
  4.4070 +   descriptions.
  4.4071 +
  4.4072 +   The information is newsgroup based, and a wildmat MAY be specified,
  4.4073 +   in which case the response is limited to only the groups (if any)
  4.4074 +   whose names match the wildmat.
  4.4075 +
  4.4076 +8.  Article Field Access Commands
  4.4077 +
  4.4078 +   This section lists commands that may be used to access specific
  4.4079 +   article fields; that is, headers of articles and metadata about
  4.4080 +   articles.  These commands typically fetch data from an "overview
  4.4081 +   database", which is a database of headers extracted from incoming
  4.4082 +   articles plus metadata determined as the article arrives.  Only
  4.4083 +   certain fields are included in the database.
  4.4084 +
  4.4085 +
  4.4086 +
  4.4087 +
  4.4088 +Feather                     Standards Track                    [Page 73]
  4.4089 +
  4.4090 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.4091 +
  4.4092 +
  4.4093 +   This section is based on the Overview/NOV database [ROBE1995]
  4.4094 +   developed by Geoff Collyer.
  4.4095 +
  4.4096 +8.1.  Article Metadata
  4.4097 +
  4.4098 +   Article "metadata" is data about articles that does not occur within
  4.4099 +   the article itself.  Each metadata item has a name that MUST begin
  4.4100 +   with a colon (and that MUST NOT contain a colon elsewhere within it).
  4.4101 +   As with header names, metadata item names are not case sensitive.
  4.4102 +
  4.4103 +   When generating a metadata item, the server MUST compute it for
  4.4104 +   itself and MUST NOT trust any related value provided in the article.
  4.4105 +   (In particular, a Lines or Bytes header in the article MUST NOT be
  4.4106 +   assumed to specify the correct number of lines or bytes in the
  4.4107 +   article.)  If the server has access to several non-identical copies
  4.4108 +   of an article, the value returned MUST be correct for any copy of
  4.4109 +   that article retrieved during the same session.
  4.4110 +
  4.4111 +   This specification defines two metadata items: ":bytes" and ":lines".
  4.4112 +   Other metadata items may be defined by extensions.  The names of
  4.4113 +   metadata items defined by registered extensions MUST NOT begin with
  4.4114 +   ":x-".  To avoid the risk of a clash with a future registered
  4.4115 +   extension, the names of metadata items defined by private extensions
  4.4116 +   SHOULD begin with ":x-".
  4.4117 +
  4.4118 +8.1.1.  The :bytes Metadata Item
  4.4119 +
  4.4120 +   The :bytes metadata item for an article is a decimal integer.  It
  4.4121 +   SHOULD equal the number of octets in the entire article: headers,
  4.4122 +   body, and separating empty line (counting a CRLF pair as two octets,
  4.4123 +   and excluding both the "." CRLF terminating the response and any "."
  4.4124 +   added for "dot-stuffing" purposes).
  4.4125 +
  4.4126 +   Note to client implementers: some existing servers return a value
  4.4127 +   different from that above.  The commonest reasons for this are as
  4.4128 +   follows:
  4.4129 +
  4.4130 +   o  Counting a CRLF pair as one octet.
  4.4131 +
  4.4132 +   o  Including the "." character used for dot-stuffing in the number.
  4.4133 +
  4.4134 +   o  Including the terminating "." CRLF in the number.
  4.4135 +
  4.4136 +   o  Using one copy of an article for counting the octets but then
  4.4137 +      returning another one that differs in some (permitted) manner.
  4.4138 +
  4.4139 +   Implementations should be prepared for such variation and MUST NOT
  4.4140 +   rely on the value being accurate.
  4.4141 +
  4.4142 +
  4.4143 +
  4.4144 +Feather                     Standards Track                    [Page 74]
  4.4145 +
  4.4146 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.4147 +
  4.4148 +
  4.4149 +8.1.2.  The :lines Metadata Item
  4.4150 +
  4.4151 +   The :lines metadata item for an article is a decimal integer.  It
  4.4152 +   MUST equal the number of lines in the article body (excluding the
  4.4153 +   empty line separating headers and body).  Equivalently, it is two
  4.4154 +   less than the number of CRLF pairs that the BODY command would return
  4.4155 +   for that article (the extra two are those following the response code
  4.4156 +   and the termination octet).
  4.4157 +
  4.4158 +8.2.  Database Consistency
  4.4159 +
  4.4160 +   The information stored in the overview database may change over time.
  4.4161 +   If the database records the content or absence of a given field (that
  4.4162 +   is, a header or metadata item) for all articles, it is said to be
  4.4163 +   "consistent" for that field.  If it records the content of a header
  4.4164 +   for some articles but not for others that nevertheless included that
  4.4165 +   header, or if it records a metadata item for some articles but not
  4.4166 +   for others to which that item applies, it is said to be
  4.4167 +   "inconsistent" for that field.
  4.4168 +
  4.4169 +   The LIST OVERVIEW.FMT command SHOULD list all the fields for which
  4.4170 +   the database is consistent at that moment.  It MAY omit such fields
  4.4171 +   (for example, if it is not known whether the database is consistent
  4.4172 +   or inconsistent).  It MUST NOT include fields for which the database
  4.4173 +   is inconsistent or that are not stored in the database.  Therefore,
  4.4174 +   if a header appears in the LIST OVERVIEW.FMT output but not in the
  4.4175 +   OVER output for a given article, that header does not appear in the
  4.4176 +   article (similarly for metadata items).
  4.4177 +
  4.4178 +   These rules assume that the fields being stored in the database
  4.4179 +   remain constant for long periods of time, and therefore the database
  4.4180 +   will be consistent.  When the set of fields to be stored is changed,
  4.4181 +   it will be inconsistent until either the database is rebuilt or the
  4.4182 +   only articles remaining are those received since the change.
  4.4183 +   Therefore, the output from LIST OVERVIEW.FMT needs to be altered
  4.4184 +   twice.  Firstly, before any fields stop being stored they MUST be
  4.4185 +   removed from the output; then, when the database is once more known
  4.4186 +   to be consistent, the new fields SHOULD be added to the output.
  4.4187 +
  4.4188 +   If the HDR command uses the overview database rather than taking
  4.4189 +   information directly from the articles, the same issues of
  4.4190 +   consistency and inconsistency apply, and the LIST HEADERS command
  4.4191 +   SHOULD take the same approach as the LIST OVERVIEW.FMT command in
  4.4192 +   resolving them.
  4.4193 +
  4.4194 +
  4.4195 +
  4.4196 +
  4.4197 +
  4.4198 +
  4.4199 +
  4.4200 +Feather                     Standards Track                    [Page 75]
  4.4201 +
  4.4202 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.4203 +
  4.4204 +
  4.4205 +8.3.  OVER
  4.4206 +
  4.4207 +8.3.1.  Usage
  4.4208 +
  4.4209 +   Indicating capability: OVER
  4.4210 +
  4.4211 +   Syntax
  4.4212 +     OVER message-id
  4.4213 +     OVER range
  4.4214 +     OVER
  4.4215 +
  4.4216 +   Responses
  4.4217 +
  4.4218 +   First form (message-id specified)
  4.4219 +     224    Overview information follows (multi-line)
  4.4220 +     430    No article with that message-id
  4.4221 +
  4.4222 +   Second form (range specified)
  4.4223 +     224    Overview information follows (multi-line)
  4.4224 +     412    No newsgroup selected
  4.4225 +     423    No articles in that range
  4.4226 +
  4.4227 +   Third form (current article number used)
  4.4228 +     224    Overview information follows (multi-line)
  4.4229 +     412    No newsgroup selected
  4.4230 +     420    Current article number is invalid
  4.4231 +
  4.4232 +   Parameters
  4.4233 +     range         Number(s) of articles
  4.4234 +     message-id    Message-id of article
  4.4235 +
  4.4236 +8.3.2.  Description
  4.4237 +
  4.4238 +   The OVER command returns the contents of all the fields in the
  4.4239 +   database for an article specified by message-id, or from a specified
  4.4240 +   article or range of articles in the currently selected newsgroup.
  4.4241 +
  4.4242 +   The message-id argument indicates a specific article.  The range
  4.4243 +   argument may be any of the following:
  4.4244 +
  4.4245 +   o  An article number.
  4.4246 +
  4.4247 +   o  An article number followed by a dash to indicate all following.
  4.4248 +
  4.4249 +   o  An article number followed by a dash followed by another article
  4.4250 +      number.
  4.4251 +
  4.4252 +   If neither is specified, the current article number is used.
  4.4253 +
  4.4254 +
  4.4255 +
  4.4256 +Feather                     Standards Track                    [Page 76]
  4.4257 +
  4.4258 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.4259 +
  4.4260 +
  4.4261 +   Support for the first (message-id) form is optional.  If it is
  4.4262 +   supported, the OVER capability line MUST include the argument
  4.4263 +   "MSGID".  Otherwise, the capability line MUST NOT include this
  4.4264 +   argument, and the OVER command MUST return the generic response code
  4.4265 +   503 when this form is used.
  4.4266 +
  4.4267 +   If the information is available, it is returned as a multi-line data
  4.4268 +   block following the 224 response code and contains one line per
  4.4269 +   article, sorted in numerical order of article number.  (Note that
  4.4270 +   unless the argument is a range including a dash, there will be
  4.4271 +   exactly one line in the data block.)  Each line consists of a number
  4.4272 +   of fields separated by a TAB.  A field may be empty (in which case
  4.4273 +   there will be two adjacent TABs), and a sequence of trailing TABs may
  4.4274 +   be omitted.
  4.4275 +
  4.4276 +   The first 8 fields MUST be the following, in order:
  4.4277 +
  4.4278 +      "0" or article number (see below)
  4.4279 +      Subject header content
  4.4280 +      From header content
  4.4281 +      Date header content
  4.4282 +      Message-ID header content
  4.4283 +      References header content
  4.4284 +      :bytes metadata item
  4.4285 +      :lines metadata item
  4.4286 +
  4.4287 +   If the article is specified by message-id (the first form of the
  4.4288 +   command), the article number MUST be replaced with zero, except that
  4.4289 +   if there is a currently selected newsgroup and the article is present
  4.4290 +   in that group, the server MAY use the article's number in that group.
  4.4291 +   (See the ARTICLE command (Section 6.2.1) and STAT examples
  4.4292 +   (Section 6.2.4.3) for more details.)  In the other two forms of the
  4.4293 +   command, the article number MUST be returned.
  4.4294 +
  4.4295 +   Any subsequent fields are the contents of the other headers and
  4.4296 +   metadata held in the database.
  4.4297 +
  4.4298 +   For the five mandatory headers, the content of each field MUST be
  4.4299 +   based on the content of the header (that is, with the header name and
  4.4300 +   following colon and space removed).  If the article does not contain
  4.4301 +   that header, or if the content is empty, the field MUST be empty.
  4.4302 +   For the two mandatory metadata items, the content of the field MUST
  4.4303 +   be just the value, with no other text.
  4.4304 +
  4.4305 +   For all subsequent fields that contain headers, the content MUST be
  4.4306 +   the entire header line other than the trailing CRLF.  For all
  4.4307 +   subsequent fields that contain metadata, the field consists of the
  4.4308 +   metadata name, a single space, and then the value.
  4.4309 +
  4.4310 +
  4.4311 +
  4.4312 +Feather                     Standards Track                    [Page 77]
  4.4313 +
  4.4314 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.4315 +
  4.4316 +
  4.4317 +   For all fields, the value is processed by first removing all CRLF
  4.4318 +   pairs (that is, undoing any folding and removing the terminating
  4.4319 +   CRLF) and then replacing each TAB with a single space.  If there is
  4.4320 +   no such header in the article, no such metadata item, or no header or
  4.4321 +   item stored in the database for that article, the corresponding field
  4.4322 +   MUST be empty.
  4.4323 +
  4.4324 +   Note that, after unfolding, the characters NUL, LF, and CR cannot
  4.4325 +   occur in the header of an article offered by a conformant server.
  4.4326 +   Nevertheless, servers SHOULD check for these characters and replace
  4.4327 +   each one by a single space (so that, for example, CR LF LF TAB will
  4.4328 +   become two spaces, since the CR and first LF will be removed by the
  4.4329 +   unfolding process).  This will encourage robustness in the face of
  4.4330 +   non-conforming data; it is also possible that future versions of this
  4.4331 +   specification could permit these characters to appear in articles.
  4.4332 +
  4.4333 +   The server SHOULD NOT produce output for articles that no longer
  4.4334 +   exist.
  4.4335 +
  4.4336 +   If the argument is a message-id and no such article exists, a 430
  4.4337 +   response MUST be returned.  If the argument is a range or is omitted
  4.4338 +   and the currently selected newsgroup is invalid, a 412 response MUST
  4.4339 +   be returned.  If the argument is a range and no articles in that
  4.4340 +   number range exist in the currently selected newsgroup, including the
  4.4341 +   case where the second number is less than the first one, a 423
  4.4342 +   response MUST be returned.  If the argument is omitted and the
  4.4343 +   current article number is invalid, a 420 response MUST be returned.
  4.4344 +
  4.4345 +8.3.3.  Examples
  4.4346 +
  4.4347 +   In the first four examples, TAB has been replaced by vertical bar and
  4.4348 +   some lines have been folded for readability.
  4.4349 +
  4.4350 +   Example of a successful retrieval of overview information for an
  4.4351 +   article (explicitly not using an article number):
  4.4352 +
  4.4353 +      [C] GROUP misc.test
  4.4354 +      [S] 211 1234 3000234 3002322 misc.test
  4.4355 +      [C] OVER
  4.4356 +      [S] 224 Overview information follows
  4.4357 +      [S] 3000234|I am just a test article|"Demo User"
  4.4358 +          <nobody@example.com>|6 Oct 1998 04:38:40 -0500|
  4.4359 +          <45223423@example.com>|<45454@example.net>|1234|
  4.4360 +          17|Xref: news.example.com misc.test:3000363
  4.4361 +      [S] .
  4.4362 +
  4.4363 +
  4.4364 +
  4.4365 +
  4.4366 +
  4.4367 +
  4.4368 +Feather                     Standards Track                    [Page 78]
  4.4369 +
  4.4370 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.4371 +
  4.4372 +
  4.4373 +   Example of a successful retrieval of overview information for an
  4.4374 +   article by message-id:
  4.4375 +
  4.4376 +      [C] CAPABILITIES
  4.4377 +      [S] 101 Capability list:
  4.4378 +      [S] VERSION 2
  4.4379 +      [S] READER
  4.4380 +      [S] OVER MSGID
  4.4381 +      [S] LIST ACTIVE NEWSGROUPS OVERVIEW.FMT
  4.4382 +      [S] .
  4.4383 +      [C] OVER <45223423@example.com>
  4.4384 +      [S] 224 Overview information follows
  4.4385 +      [S] 0|I am just a test article|"Demo User"
  4.4386 +          <nobody@example.com>|6 Oct 1998 04:38:40 -0500|
  4.4387 +          <45223423@example.com>|<45454@example.net>|1234|
  4.4388 +          17|Xref: news.example.com misc.test:3000363
  4.4389 +      [S] .
  4.4390 +
  4.4391 +   Note that the article number has been replaced by "0".
  4.4392 +
  4.4393 +   Example of the same commands on a system that does not implement
  4.4394 +   retrieval by message-id:
  4.4395 +
  4.4396 +      [C] CAPABILITIES
  4.4397 +      [S] 101 Capability list:
  4.4398 +      [S] VERSION 2
  4.4399 +      [S] READER
  4.4400 +      [S] OVER
  4.4401 +      [S] LIST ACTIVE NEWSGROUPS OVERVIEW.FMT
  4.4402 +      [S] .
  4.4403 +      [C] OVER <45223423@example.com>
  4.4404 +      [S] 503 Overview by message-id unsupported
  4.4405 +
  4.4406 +
  4.4407 +
  4.4408 +
  4.4409 +
  4.4410 +
  4.4411 +
  4.4412 +
  4.4413 +
  4.4414 +
  4.4415 +
  4.4416 +
  4.4417 +
  4.4418 +
  4.4419 +
  4.4420 +
  4.4421 +
  4.4422 +
  4.4423 +
  4.4424 +Feather                     Standards Track                    [Page 79]
  4.4425 +
  4.4426 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.4427 +
  4.4428 +
  4.4429 +   Example of a successful retrieval of overview information for a range
  4.4430 +   of articles:
  4.4431 +
  4.4432 +      [C] GROUP misc.test
  4.4433 +      [S] 211 1234 3000234 3002322 misc.test
  4.4434 +      [C] OVER 3000234-3000240
  4.4435 +      [S] 224 Overview information follows
  4.4436 +      [S] 3000234|I am just a test article|"Demo User"
  4.4437 +          <nobody@example.com>|6 Oct 1998 04:38:40 -0500|
  4.4438 +          <45223423@example.com>|<45454@example.net>|1234|
  4.4439 +          17|Xref: news.example.com misc.test:3000363
  4.4440 +      [S] 3000235|Another test article|nobody@nowhere.to
  4.4441 +          (Demo User)|6 Oct 1998 04:38:45 -0500|<45223425@to.to>||
  4.4442 +          4818|37||Distribution: fi
  4.4443 +      [S] 3000238|Re: I am just a test article|somebody@elsewhere.to|
  4.4444 +          7 Oct 1998 11:38:40 +1200|<kfwer3v@elsewhere.to>|
  4.4445 +          <45223423@to.to>|9234|51
  4.4446 +      [S] .
  4.4447 +
  4.4448 +   Note the missing "References" and Xref headers in the second line,
  4.4449 +   the missing trailing fields in the first and last lines, and that
  4.4450 +   there are only results for those articles that still exist.
  4.4451 +
  4.4452 +   Example of an unsuccessful retrieval of overview information on an
  4.4453 +   article by number:
  4.4454 +
  4.4455 +      [C] GROUP misc.test
  4.4456 +      [S] 211 1234 3000234 3002322 misc.test
  4.4457 +      [C] OVER 300256
  4.4458 +      [S] 423 No such article in this group
  4.4459 +
  4.4460 +   Example of an invalid range:
  4.4461 +
  4.4462 +      [C] GROUP misc.test
  4.4463 +      [S] 211 1234 3000234 3002322 misc.test
  4.4464 +      [C] OVER 3000444-3000222
  4.4465 +      [S] 423 Empty range
  4.4466 +
  4.4467 +   Example of an unsuccessful retrieval of overview information by
  4.4468 +   number because no newsgroup was selected first:
  4.4469 +
  4.4470 +      [Assumes currently selected newsgroup is invalid.]
  4.4471 +      [C] OVER
  4.4472 +      [S] 412 No newsgroup selected
  4.4473 +
  4.4474 +
  4.4475 +
  4.4476 +
  4.4477 +
  4.4478 +
  4.4479 +
  4.4480 +Feather                     Standards Track                    [Page 80]
  4.4481 +
  4.4482 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.4483 +
  4.4484 +
  4.4485 +   Example of an attempt to retrieve information when the currently
  4.4486 +   selected newsgroup is empty:
  4.4487 +
  4.4488 +      [C] GROUP example.empty.newsgroup
  4.4489 +      [S] 211 0 0 0 example.empty.newsgroup
  4.4490 +      [C] OVER
  4.4491 +      [S] 420 No current article selected
  4.4492 +
  4.4493 +8.4.  LIST OVERVIEW.FMT
  4.4494 +
  4.4495 +8.4.1.  Usage
  4.4496 +
  4.4497 +   Indicating capability: OVER
  4.4498 +
  4.4499 +   Syntax
  4.4500 +     LIST OVERVIEW.FMT
  4.4501 +
  4.4502 +   Responses
  4.4503 +     215    Information follows (multi-line)
  4.4504 +
  4.4505 +8.4.2.  Description
  4.4506 +
  4.4507 +   See Section 7.6.1 for general requirements of the LIST command.
  4.4508 +
  4.4509 +   The LIST OVERVIEW.FMT command returns a description of the fields in
  4.4510 +   the database for which it is consistent (as described above).  The
  4.4511 +   information is returned as a multi-line data block following the 215
  4.4512 +   response code.  The information contains one line per field in the
  4.4513 +   order in which they are returned by the OVER command; the first 7
  4.4514 +   lines MUST (except for the case of letters) be exactly as follows:
  4.4515 +
  4.4516 +       Subject:
  4.4517 +       From:
  4.4518 +       Date:
  4.4519 +       Message-ID:
  4.4520 +       References:
  4.4521 +       :bytes
  4.4522 +       :lines
  4.4523 +
  4.4524 +   For compatibility with existing implementations, the last two lines
  4.4525 +   MAY instead be:
  4.4526 +
  4.4527 +       Bytes:
  4.4528 +       Lines:
  4.4529 +
  4.4530 +   even though they refer to metadata, not headers.
  4.4531 +
  4.4532 +
  4.4533 +
  4.4534 +
  4.4535 +
  4.4536 +Feather                     Standards Track                    [Page 81]
  4.4537 +
  4.4538 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.4539 +
  4.4540 +
  4.4541 +   All subsequent lines MUST consist of either a header name followed by
  4.4542 +   ":full", or the name of a piece of metadata.
  4.4543 +
  4.4544 +   There are no leading or trailing spaces in the output.
  4.4545 +
  4.4546 +   Note that the 7 fixed lines describe the 2nd to 8th fields of the
  4.4547 +   OVER output.  The "full" suffix (which may use either uppercase,
  4.4548 +   lowercase, or a mix) is a reminder that the corresponding fields
  4.4549 +   include the header name.
  4.4550 +
  4.4551 +   This command MAY generate different results if it is used more than
  4.4552 +   once in a session.
  4.4553 +
  4.4554 +   If the OVER command is not implemented, the meaning of the output
  4.4555 +   from this command is not specified, but it must still meet the above
  4.4556 +   syntactic requirements.
  4.4557 +
  4.4558 +8.4.3.  Examples
  4.4559 +
  4.4560 +   Example of LIST OVERVIEW.FMT output corresponding to the example OVER
  4.4561 +   output above, in the preferred format:
  4.4562 +
  4.4563 +      [C] LIST OVERVIEW.FMT
  4.4564 +      [S] 215 Order of fields in overview database.
  4.4565 +      [S] Subject:
  4.4566 +      [S] From:
  4.4567 +      [S] Date:
  4.4568 +      [S] Message-ID:
  4.4569 +      [S] References:
  4.4570 +      [S] :bytes
  4.4571 +      [S] :lines
  4.4572 +      [S] Xref:full
  4.4573 +      [S] Distribution:full
  4.4574 +      [S] .
  4.4575 +
  4.4576 +
  4.4577 +
  4.4578 +
  4.4579 +
  4.4580 +
  4.4581 +
  4.4582 +
  4.4583 +
  4.4584 +
  4.4585 +
  4.4586 +
  4.4587 +
  4.4588 +
  4.4589 +
  4.4590 +
  4.4591 +
  4.4592 +Feather                     Standards Track                    [Page 82]
  4.4593 +
  4.4594 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.4595 +
  4.4596 +
  4.4597 +   Example of LIST OVERVIEW.FMT output corresponding to the example OVER
  4.4598 +   output above, in the alternative format:
  4.4599 +
  4.4600 +      [C] LIST OVERVIEW.FMT
  4.4601 +      [S] 215 Order of fields in overview database.
  4.4602 +      [S] Subject:
  4.4603 +      [S] From:
  4.4604 +      [S] Date:
  4.4605 +      [S] Message-ID:
  4.4606 +      [S] References:
  4.4607 +      [S] Bytes:
  4.4608 +      [S] Lines:
  4.4609 +      [S] Xref:FULL
  4.4610 +      [S] Distribution:FULL
  4.4611 +      [S] .
  4.4612 +
  4.4613 +8.5.  HDR
  4.4614 +
  4.4615 +8.5.1.  Usage
  4.4616 +
  4.4617 +   Indicating capability: HDR
  4.4618 +
  4.4619 +   Syntax
  4.4620 +     HDR field message-id
  4.4621 +     HDR field range
  4.4622 +     HDR field
  4.4623 +
  4.4624 +   Responses
  4.4625 +
  4.4626 +   First form (message-id specified)
  4.4627 +     225    Headers follow (multi-line)
  4.4628 +     430    No article with that message-id
  4.4629 +
  4.4630 +   Second form (range specified)
  4.4631 +     225    Headers follow (multi-line)
  4.4632 +     412    No newsgroup selected
  4.4633 +     423    No articles in that range
  4.4634 +
  4.4635 +   Third form (current article number used)
  4.4636 +     225    Headers follow (multi-line)
  4.4637 +     412    No newsgroup selected
  4.4638 +     420    Current article number is invalid
  4.4639 +
  4.4640 +   Parameters
  4.4641 +     field         Name of field
  4.4642 +     range         Number(s) of articles
  4.4643 +     message-id    Message-id of article
  4.4644 +
  4.4645 +
  4.4646 +
  4.4647 +
  4.4648 +Feather                     Standards Track                    [Page 83]
  4.4649 +
  4.4650 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.4651 +
  4.4652 +
  4.4653 +8.5.2.  Description
  4.4654 +
  4.4655 +   The HDR command provides access to specific fields from an article
  4.4656 +   specified by message-id, or from a specified article or range of
  4.4657 +   articles in the currently selected newsgroup.  It MAY take the
  4.4658 +   information directly from the articles or from the overview database.
  4.4659 +   In the case of headers, an implementation MAY restrict the use of
  4.4660 +   this command to a specific list of headers or MAY allow it to be used
  4.4661 +   with any header; it may behave differently when it is used with a
  4.4662 +   message-id argument and when it is used with a range or no argument.
  4.4663 +
  4.4664 +   The required field argument is the name of a header with the colon
  4.4665 +   omitted (e.g., "subject") or the name of a metadata item including
  4.4666 +   the leading colon (e.g., ":bytes"), and is case insensitive.
  4.4667 +
  4.4668 +   The message-id argument indicates a specific article.  The range
  4.4669 +   argument may be any of the following:
  4.4670 +
  4.4671 +   o  An article number.
  4.4672 +
  4.4673 +   o  An article number followed by a dash to indicate all following.
  4.4674 +
  4.4675 +   o  An article number followed by a dash followed by another article
  4.4676 +      number.
  4.4677 +
  4.4678 +   If neither is specified, the current article number is used.
  4.4679 +
  4.4680 +   If the information is available, it is returned as a multi-line data
  4.4681 +   block following the 225 response code and contains one line for each
  4.4682 +   article in the range that exists.  (Note that unless the argument is
  4.4683 +   a range including a dash, there will be exactly one line in the data
  4.4684 +   block.)  The line consists of the article number, a space, and then
  4.4685 +   the contents of the field.  In the case of a header, the header name,
  4.4686 +   the colon, and the first space after the colon are all omitted.
  4.4687 +
  4.4688 +   If the article is specified by message-id (the first form of the
  4.4689 +   command), the article number MUST be replaced with zero, except that
  4.4690 +   if there is a currently selected newsgroup and the article is present
  4.4691 +   in that group, the server MAY use the article's number in that group.
  4.4692 +   (See the ARTICLE command (Section 6.2.1) and STAT examples
  4.4693 +   (Section 6.2.4.3) for more details.)  In the other two forms of the
  4.4694 +   command, the article number MUST be returned.
  4.4695 +
  4.4696 +   Header contents are modified as follows: all CRLF pairs are removed,
  4.4697 +   and then each TAB is replaced with a single space.  (Note that this
  4.4698 +   is the same transformation as is performed by the OVER command
  4.4699 +   (Section 8.3.2), and the same comment concerning NUL, CR, and LF
  4.4700 +   applies.)
  4.4701 +
  4.4702 +
  4.4703 +
  4.4704 +Feather                     Standards Track                    [Page 84]
  4.4705 +
  4.4706 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.4707 +
  4.4708 +
  4.4709 +   Note the distinction between headers and metadata appearing to have
  4.4710 +   the same meaning.  Headers are always taken unchanged from the
  4.4711 +   article; metadata are always calculated.  For example, a request for
  4.4712 +   "Lines" returns the contents of the "Lines" header of the specified
  4.4713 +   articles, if any, no matter whether they accurately state the number
  4.4714 +   of lines, while a request for ":lines" returns the line count
  4.4715 +   metadata, which is always the actual number of lines irrespective of
  4.4716 +   what any header may state.
  4.4717 +
  4.4718 +   If the requested header is not present in the article, or if it is
  4.4719 +   present but empty, a line for that article is included in the output,
  4.4720 +   but the header content portion of the line is empty (the space after
  4.4721 +   the article number MAY be retained or omitted).  If the header occurs
  4.4722 +   in a given article more than once, only the content of the first
  4.4723 +   occurrence is returned by HDR.  If any article number in the provided
  4.4724 +   range does not exist in the group, no line for that article number is
  4.4725 +   included in the output.
  4.4726 +
  4.4727 +   If the second argument is a message-id and no such article exists, a
  4.4728 +   430 response MUST be returned.  If the second argument is a range or
  4.4729 +   is omitted and the currently selected newsgroup is invalid, a 412
  4.4730 +   response MUST be returned.  If the second argument is a range and no
  4.4731 +   articles in that number range exist in the currently selected
  4.4732 +   newsgroup, including the case where the second number is less than
  4.4733 +   the first one, a 423 response MUST be returned.  If the second
  4.4734 +   argument is omitted and the current article number is invalid, a 420
  4.4735 +   response MUST be returned.
  4.4736 +
  4.4737 +   A server MAY only allow HDR commands for a limited set of fields; it
  4.4738 +   may behave differently in this respect for the first (message-id)
  4.4739 +   form from how it would for the other forms.  If so, it MUST respond
  4.4740 +   with the generic 503 response to attempts to request other fields,
  4.4741 +   rather than return erroneous results, such as a successful empty
  4.4742 +   response.
  4.4743 +
  4.4744 +   If HDR uses the overview database and it is inconsistent for the
  4.4745 +   requested field, the server MAY return what results it can, or it MAY
  4.4746 +   respond with the generic 503 response.  In the latter case, the field
  4.4747 +   MUST NOT appear in the output from LIST HEADERS.
  4.4748 +
  4.4749 +
  4.4750 +
  4.4751 +
  4.4752 +
  4.4753 +
  4.4754 +
  4.4755 +
  4.4756 +
  4.4757 +
  4.4758 +
  4.4759 +
  4.4760 +Feather                     Standards Track                    [Page 85]
  4.4761 +
  4.4762 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.4763 +
  4.4764 +
  4.4765 +8.5.3.  Examples
  4.4766 +
  4.4767 +   Example of a successful retrieval of subject lines from a range of
  4.4768 +   articles (3000235 has no Subject header, and 3000236 is missing):
  4.4769 +
  4.4770 +      [C] GROUP misc.test
  4.4771 +      [S] 211 1234 3000234 3002322 misc.test
  4.4772 +      [C] HDR Subject 3000234-3000238
  4.4773 +      [S] 225 Headers follow
  4.4774 +      [S] 3000234 I am just a test article
  4.4775 +      [S] 3000235
  4.4776 +      [S] 3000237 Re: I am just a test article
  4.4777 +      [S] 3000238 Ditto
  4.4778 +      [S] .
  4.4779 +
  4.4780 +   Example of a successful retrieval of line counts from a range of
  4.4781 +   articles:
  4.4782 +
  4.4783 +      [C] GROUP misc.test
  4.4784 +      [S] 211 1234 3000234 3002322 misc.test
  4.4785 +      [C] HDR :lines 3000234-3000238
  4.4786 +      [S] 225 Headers follow
  4.4787 +      [S] 3000234 42
  4.4788 +      [S] 3000235 5
  4.4789 +      [S] 3000237 11
  4.4790 +      [S] 3000238 2378
  4.4791 +      [S] .
  4.4792 +
  4.4793 +   Example of a successful retrieval of the subject line from an article
  4.4794 +   by message-id:
  4.4795 +
  4.4796 +      [C] GROUP misc.test
  4.4797 +      [S] 211 1234 3000234 3002322 misc.test
  4.4798 +      [C] HDR subject <i.am.a.test.article@example.com>
  4.4799 +      [S] 225 Header information follows
  4.4800 +      [S] 0 I am just a test article
  4.4801 +      [S] .
  4.4802 +
  4.4803 +   Example of a successful retrieval of the subject line from the
  4.4804 +   current article:
  4.4805 +
  4.4806 +      [C] GROUP misc.test
  4.4807 +      [S] 211 1234 3000234 3002322 misc.test
  4.4808 +      [C] HDR subject
  4.4809 +      [S] 225 Header information follows
  4.4810 +      [S] 3000234 I am just a test article
  4.4811 +      [S] .
  4.4812 +
  4.4813 +
  4.4814 +
  4.4815 +
  4.4816 +Feather                     Standards Track                    [Page 86]
  4.4817 +
  4.4818 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.4819 +
  4.4820 +
  4.4821 +   Example of an unsuccessful retrieval of a header from an article by
  4.4822 +   message-id:
  4.4823 +
  4.4824 +      [C] HDR subject <i.am.not.there@example.com>
  4.4825 +      [S] 430 No Such Article Found
  4.4826 +
  4.4827 +   Example of an unsuccessful retrieval of headers from articles by
  4.4828 +   number because no newsgroup was selected first:
  4.4829 +
  4.4830 +      [Assumes currently selected newsgroup is invalid.]
  4.4831 +      [C] HDR subject 300256-
  4.4832 +      [S] 412 No newsgroup selected
  4.4833 +
  4.4834 +   Example of an unsuccessful retrieval of headers because the currently
  4.4835 +   selected newsgroup is empty:
  4.4836 +
  4.4837 +      [C] GROUP example.empty.newsgroup
  4.4838 +      [S] 211 0 0 0 example.empty.newsgroup
  4.4839 +      [C] HDR subject 1-
  4.4840 +      [S] 423 No articles in that range
  4.4841 +
  4.4842 +   Example of an unsuccessful retrieval of headers because the server
  4.4843 +   does not allow HDR commands for that header:
  4.4844 +
  4.4845 +      [C] GROUP misc.test
  4.4846 +      [S] 211 1234 3000234 3002322 misc.test
  4.4847 +      [C] HDR Content-Type 3000234-3000238
  4.4848 +      [S] 503 HDR not permitted on Content-Type
  4.4849 +
  4.4850 +8.6.  LIST HEADERS
  4.4851 +
  4.4852 +8.6.1.  Usage
  4.4853 +
  4.4854 +   Indicating capability: HDR
  4.4855 +
  4.4856 +   Syntax
  4.4857 +     LIST HEADERS [MSGID|RANGE]
  4.4858 +
  4.4859 +   Responses
  4.4860 +     215    Field list follows (multi-line)
  4.4861 +
  4.4862 +   Parameters
  4.4863 +     MSGID    Requests list for access by message-id
  4.4864 +     RANGE    Requests list for access by range
  4.4865 +
  4.4866 +
  4.4867 +
  4.4868 +
  4.4869 +
  4.4870 +
  4.4871 +
  4.4872 +Feather                     Standards Track                    [Page 87]
  4.4873 +
  4.4874 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.4875 +
  4.4876 +
  4.4877 +8.6.2.  Description
  4.4878 +
  4.4879 +   See Section 7.6.1 for general requirements of the LIST command.
  4.4880 +
  4.4881 +   The LIST HEADERS command returns a list of fields that may be
  4.4882 +   retrieved using the HDR command.
  4.4883 +
  4.4884 +   The information is returned as a multi-line data block following the
  4.4885 +   215 response code and contains one line for each field name
  4.4886 +   (excluding the trailing colon for headers and including the leading
  4.4887 +   colon for metadata items).  If the implementation allows any header
  4.4888 +   to be retrieved, it MUST NOT include any header names in the list but
  4.4889 +   MUST include the special entry ":" (a single colon on its own).  It
  4.4890 +   MUST still explicitly list any metadata items that are available.
  4.4891 +   The order of items in the list is not significant; the server need
  4.4892 +   not even consistently return the same order.  The list MAY be empty
  4.4893 +   (though in this circumstance there is little point in providing the
  4.4894 +   HDR command).
  4.4895 +
  4.4896 +   An implementation that also supports the OVER command SHOULD at least
  4.4897 +   permit all the headers and metadata items listed in the output from
  4.4898 +   the LIST OVERVIEW.FMT command.
  4.4899 +
  4.4900 +   If the server treats the first form of the HDR command (message-id
  4.4901 +   specified) differently from the other two forms (range specified or
  4.4902 +   current article number used) in respect of which headers or metadata
  4.4903 +   items are available, then the following apply:
  4.4904 +
  4.4905 +   o  If the MSGID argument is specified, the results MUST be those
  4.4906 +      available for the first form of the HDR command.
  4.4907 +
  4.4908 +   o  If the RANGE argument is specified, the results MUST be those
  4.4909 +      available for the second and third forms of the HDR command.
  4.4910 +
  4.4911 +   o  If no argument is specified, the results MUST be those available
  4.4912 +      in all forms of the HDR command (that is, it MUST only list those
  4.4913 +      items listed in both the previous cases).
  4.4914 +
  4.4915 +   If the server does not treat the various forms differently, then it
  4.4916 +   MUST ignore any argument and always produce the same results (though
  4.4917 +   not necessarily always in the same order).
  4.4918 +
  4.4919 +   If the HDR command is not implemented, the meaning of the output from
  4.4920 +   this command is not specified, but it must still meet the above
  4.4921 +   syntactic requirements.
  4.4922 +
  4.4923 +
  4.4924 +
  4.4925 +
  4.4926 +
  4.4927 +
  4.4928 +Feather                     Standards Track                    [Page 88]
  4.4929 +
  4.4930 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.4931 +
  4.4932 +
  4.4933 +8.6.3.  Examples
  4.4934 +
  4.4935 +   Example of an implementation providing access to only a few headers:
  4.4936 +
  4.4937 +      [C] LIST HEADERS
  4.4938 +      [S] 215 headers supported:
  4.4939 +      [S] Subject
  4.4940 +      [S] Message-ID
  4.4941 +      [S] Xref
  4.4942 +      [S] .
  4.4943 +
  4.4944 +   Example of an implementation providing access to the same fields as
  4.4945 +   the first example in Section 8.4.3:
  4.4946 +
  4.4947 +      [C] CAPABILITIES
  4.4948 +      [S] 101 Capability list:
  4.4949 +      [S] VERSION 2
  4.4950 +      [S] READER
  4.4951 +      [S] OVER
  4.4952 +      [S] HDR
  4.4953 +      [S] LIST ACTIVE NEWSGROUPS HEADERS OVERVIEW.FMT
  4.4954 +      [S] .
  4.4955 +      [C] LIST HEADERS
  4.4956 +      [S] 215 headers and metadata items supported:
  4.4957 +      [S] Date
  4.4958 +      [S] Distribution
  4.4959 +      [S] From
  4.4960 +      [S] Message-ID
  4.4961 +      [S] References
  4.4962 +      [S] Subject
  4.4963 +      [S] Xref
  4.4964 +      [S] :bytes
  4.4965 +      [S] :lines
  4.4966 +      [S] .
  4.4967 +
  4.4968 +   Example of an implementation providing access to all headers:
  4.4969 +
  4.4970 +      [C] LIST HEADERS
  4.4971 +      [S] 215 metadata items supported:
  4.4972 +      [S] :
  4.4973 +      [S] :lines
  4.4974 +      [S] :bytes
  4.4975 +      [S] :x-article-number
  4.4976 +      [S] .
  4.4977 +
  4.4978 +
  4.4979 +
  4.4980 +
  4.4981 +
  4.4982 +
  4.4983 +
  4.4984 +Feather                     Standards Track                    [Page 89]
  4.4985 +
  4.4986 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.4987 +
  4.4988 +
  4.4989 +   Example of an implementation distinguishing the first form of the HDR
  4.4990 +   command from the other two forms:
  4.4991 +
  4.4992 +      [C] LIST HEADERS RANGE
  4.4993 +      [S] 215 metadata items supported:
  4.4994 +      [S] :
  4.4995 +      [S] :lines
  4.4996 +      [S] :bytes
  4.4997 +      [S] .
  4.4998 +      [C] LIST HEADERS MSGID
  4.4999 +      [S] 215 headers and metadata items supported:
  4.5000 +      [S] Date
  4.5001 +      [S] Distribution
  4.5002 +      [S] From
  4.5003 +      [S] Message-ID
  4.5004 +      [S] References
  4.5005 +      [S] Subject
  4.5006 +      [S] :lines
  4.5007 +      [S] :bytes
  4.5008 +      [S] :x-article-number
  4.5009 +      [S] .
  4.5010 +      [C] LIST HEADERS
  4.5011 +      [S] 215 headers and metadata items supported:
  4.5012 +      [S] Date
  4.5013 +      [S] Distribution
  4.5014 +      [S] From
  4.5015 +      [S] Message-ID
  4.5016 +      [S] References
  4.5017 +      [S] Subject
  4.5018 +      [S] :lines
  4.5019 +      [S] :bytes
  4.5020 +      [S] .
  4.5021 +
  4.5022 +   Note that :x-article-number does not appear in the last set of
  4.5023 +   output.
  4.5024 +
  4.5025 +9.  Augmented BNF Syntax for NNTP
  4.5026 +
  4.5027 +9.1.  Introduction
  4.5028 +
  4.5029 +   Each of the following sections describes the syntax of a major
  4.5030 +   element of NNTP.  This syntax extends and refines the descriptions
  4.5031 +   elsewhere in this specification and should be given precedence when
  4.5032 +   resolving apparent conflicts.  Note that ABNF [RFC4234] strings are
  4.5033 +   case insensitive.  Non-terminals used in several places are defined
  4.5034 +   in a separate section at the end.
  4.5035 +
  4.5036 +
  4.5037 +
  4.5038 +
  4.5039 +
  4.5040 +Feather                     Standards Track                    [Page 90]
  4.5041 +
  4.5042 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.5043 +
  4.5044 +
  4.5045 +   Between them, the non-terminals <command-line>, <command-datastream>,
  4.5046 +   <command-continuation>, and <response> specify the text that flows
  4.5047 +   between client and server.  A consistent naming scheme is used in
  4.5048 +   this document for the non-terminals relating to each command, and
  4.5049 +   SHOULD be used by the specification of registered extensions.
  4.5050 +
  4.5051 +   For each command, the sequence is as follows:
  4.5052 +
  4.5053 +   o  The client sends an instance of <command-line>; the syntax for the
  4.5054 +      EXAMPLE command is <example-command>.
  4.5055 +
  4.5056 +   o  If the client is one that immediately streams data, it sends an
  4.5057 +      instance of <command-datastream>; the syntax for the EXAMPLE
  4.5058 +      command is <example-datastream>.
  4.5059 +
  4.5060 +   o  The server sends an instance of <response>.
  4.5061 +
  4.5062 +      *  The initial response line is independent of the command that
  4.5063 +         generated it; if the 000 response has arguments, the syntax of
  4.5064 +         the initial line is <response-000-content>.
  4.5065 +
  4.5066 +      *  If the response is multi-line, the initial line is followed by
  4.5067 +         a <multi-line-data-block>.  The syntax for the contents of this
  4.5068 +         block after "dot-stuffing" has been removed is (for the 000
  4.5069 +         response to the EXAMPLE command) <example-000-ml-content> and
  4.5070 +         is an instance of <multi-line-response-content>.
  4.5071 +
  4.5072 +   o  While the latest response is one that indicates more data is
  4.5073 +      required (in general, a 3xx response):
  4.5074 +
  4.5075 +      *  the client sends an instance of <command-continuation>; the
  4.5076 +         syntax for the EXAMPLE continuation following a 333 response is
  4.5077 +         <example-333-continuation>;
  4.5078 +
  4.5079 +      *  the server sends another instance of <response>, as above.
  4.5080 +
  4.5081 +   (There are no commands in this specification that immediately stream
  4.5082 +   data, but this non-terminal is defined for the convenience of
  4.5083 +   extensions.)
  4.5084 +
  4.5085 +
  4.5086 +
  4.5087 +
  4.5088 +
  4.5089 +
  4.5090 +
  4.5091 +
  4.5092 +
  4.5093 +
  4.5094 +
  4.5095 +
  4.5096 +Feather                     Standards Track                    [Page 91]
  4.5097 +
  4.5098 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.5099 +
  4.5100 +
  4.5101 +9.2.  Commands
  4.5102 +
  4.5103 +   This syntax defines the non-terminal <command-line>, which represents
  4.5104 +   what is sent from the client to the server (see section 3.1 for
  4.5105 +   limits on lengths).
  4.5106 +
  4.5107 +     command-line = command EOL
  4.5108 +     command = X-command
  4.5109 +     X-command = keyword *(WS token)
  4.5110 +
  4.5111 +     command =/ article-command /
  4.5112 +           body-command /
  4.5113 +           capabilities-command /
  4.5114 +           date-command /
  4.5115 +           group-command /
  4.5116 +           hdr-command /
  4.5117 +           head-command /
  4.5118 +           help-command /
  4.5119 +           ihave-command /
  4.5120 +           last-command /
  4.5121 +           list-command /
  4.5122 +           listgroup-command /
  4.5123 +           mode-reader-command /
  4.5124 +           newgroups-command /
  4.5125 +           newnews-command /
  4.5126 +           next-command /
  4.5127 +           over-command /
  4.5128 +           post-command /
  4.5129 +           quit-command /
  4.5130 +           stat-command
  4.5131 +
  4.5132 +     article-command = "ARTICLE" [WS article-ref]
  4.5133 +     body-command = "BODY" [WS article-ref]
  4.5134 +     capabilities-command = "CAPABILITIES" [WS keyword]
  4.5135 +     date-command = "DATE"
  4.5136 +     group-command = "GROUP" [WS newsgroup-name]
  4.5137 +     hdr-command = "HDR" WS header-meta-name [WS range-ref]
  4.5138 +     head-command = "HEAD" [WS article-ref]
  4.5139 +     help-command = "HELP"
  4.5140 +     ihave-command = "IHAVE" WS message-id
  4.5141 +     last-command = "LAST"
  4.5142 +     list-command = "LIST" [WS list-arguments]
  4.5143 +     listgroup-command = "LISTGROUP" [WS newsgroup-name [WS range]]
  4.5144 +     mode-reader-command = "MODE" WS "READER"
  4.5145 +     newgroups-command = "NEWGROUPS" WS date-time
  4.5146 +     newnews-command = "NEWNEWS" WS wildmat WS date-time
  4.5147 +     next-command = "NEXT"
  4.5148 +     over-command = "OVER" [WS range-ref]
  4.5149 +
  4.5150 +
  4.5151 +
  4.5152 +Feather                     Standards Track                    [Page 92]
  4.5153 +
  4.5154 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.5155 +
  4.5156 +
  4.5157 +     post-command = "POST"
  4.5158 +     quit-command = "QUIT"
  4.5159 +     stat-command = "STAT" [WS article-ref]
  4.5160 +
  4.5161 +     article-ref = article-number / message-id
  4.5162 +     date = date2y / date4y
  4.5163 +     date4y = 4DIGIT 2DIGIT 2DIGIT
  4.5164 +     date2y = 2DIGIT 2DIGIT 2DIGIT
  4.5165 +     date-time = date WS time [WS "GMT"]
  4.5166 +     header-meta-name = header-name / metadata-name
  4.5167 +     list-arguments = keyword [WS token]
  4.5168 +     metadata-name = ":" 1*A-NOTCOLON
  4.5169 +     range = article-number ["-" [article-number]]
  4.5170 +     range-ref = range / message-id
  4.5171 +     time = 2DIGIT 2DIGIT 2DIGIT
  4.5172 +
  4.5173 +9.3.  Command Continuation
  4.5174 +
  4.5175 +   This syntax defines the further material sent by the client in the
  4.5176 +   case of multi-stage commands and those that stream data.
  4.5177 +
  4.5178 +     command-datastream = UNDEFINED
  4.5179 +       ; not used, provided as a hook for extensions
  4.5180 +     command-continuation = ihave-335-continuation /
  4.5181 +           post-340-continuation
  4.5182 +
  4.5183 +     ihave-335-continuation = encoded-article
  4.5184 +     post-340-continuation = encoded-article
  4.5185 +
  4.5186 +     encoded-article = multi-line-data-block
  4.5187 +       ; after undoing the "dot-stuffing", this MUST match <article>
  4.5188 +
  4.5189 +9.4.  Responses
  4.5190 +
  4.5191 +9.4.1.  Generic Responses
  4.5192 +
  4.5193 +   This syntax defines the non-terminal <response>, which represents the
  4.5194 +   generic form of responses; that is, what is sent from the server to
  4.5195 +   the client in response to a <command> or a <command-continuation>.
  4.5196 +
  4.5197 +     response = simple-response / multi-line-response
  4.5198 +     simple-response = initial-response-line
  4.5199 +     multi-line-response = initial-response-line multi-line-data-block
  4.5200 +
  4.5201 +     initial-response-line =
  4.5202 +           initial-response-content [SP trailing-comment] CRLF
  4.5203 +     initial-response-content = X-initial-response-content
  4.5204 +     X-initial-response-content = 3DIGIT *(SP response-argument)
  4.5205 +
  4.5206 +
  4.5207 +
  4.5208 +Feather                     Standards Track                    [Page 93]
  4.5209 +
  4.5210 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.5211 +
  4.5212 +
  4.5213 +     response-argument = 1*A-CHAR
  4.5214 +     trailing-comment = *U-CHAR
  4.5215 +
  4.5216 +9.4.2.  Initial Response Line Contents
  4.5217 +
  4.5218 +   This syntax defines the specific initial response lines for the
  4.5219 +   various commands in this specification (see section 3.1 for limits on
  4.5220 +   lengths).  Only those response codes with arguments are listed.
  4.5221 +
  4.5222 +     initial-response-content =/ response-111-content /
  4.5223 +           response-211-content /
  4.5224 +           response-220-content /
  4.5225 +           response-221-content /
  4.5226 +           response-222-content /
  4.5227 +           response-223-content /
  4.5228 +           response-401-content
  4.5229 +
  4.5230 +     response-111-content = "111" SP date4y time
  4.5231 +     response-211-content = "211" 3(SP article-number) SP newsgroup-name
  4.5232 +     response-220-content = "220" SP article-number SP message-id
  4.5233 +     response-221-content = "221" SP article-number SP message-id
  4.5234 +     response-222-content = "222" SP article-number SP message-id
  4.5235 +     response-223-content = "223" SP article-number SP message-id
  4.5236 +     response-401-content = "401" SP capability-label
  4.5237 +
  4.5238 +9.4.3.  Multi-line Response Contents
  4.5239 +
  4.5240 +   This syntax defines the content of the various multi-line responses;
  4.5241 +   more precisely, it defines the part of the response in the multi-line
  4.5242 +   data block after any "dot-stuffing" has been undone.  The numeric
  4.5243 +   portion of each non-terminal name indicates the response code that is
  4.5244 +   followed by this data.
  4.5245 +
  4.5246 +     multi-line-response-content = article-220-ml-content /
  4.5247 +           body-222-ml-content /
  4.5248 +           capabilities-101-ml-content /
  4.5249 +           hdr-225-ml-content /
  4.5250 +           head-221-ml-content /
  4.5251 +           help-100-ml-content /
  4.5252 +           list-215-ml-content /
  4.5253 +           listgroup-211-ml-content /
  4.5254 +           newgroups-231-ml-content /
  4.5255 +           newnews-230-ml-content /
  4.5256 +           over-224-ml-content
  4.5257 +
  4.5258 +     article-220-ml-content = article
  4.5259 +     body-222-ml-content = body
  4.5260 +     capabilities-101-ml-content = version-line CRLF
  4.5261 +
  4.5262 +
  4.5263 +
  4.5264 +Feather                     Standards Track                    [Page 94]
  4.5265 +
  4.5266 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.5267 +
  4.5268 +
  4.5269 +           *(capability-line CRLF)
  4.5270 +     hdr-225-ml-content = *(article-number SP hdr-content CRLF)
  4.5271 +     head-221-ml-content = 1*header
  4.5272 +     help-100-ml-content = *(*U-CHAR CRLF)
  4.5273 +     list-215-ml-content = list-content
  4.5274 +     listgroup-211-ml-content = *(article-number CRLF)
  4.5275 +     newgroups-231-ml-content = active-groups-list
  4.5276 +     newnews-230-ml-content = *(message-id CRLF)
  4.5277 +     over-224-ml-content = *(article-number over-content CRLF)
  4.5278 +
  4.5279 +     active-groups-list = *(newsgroup-name SPA article-number
  4.5280 +           SPA article-number SPA newsgroup-status CRLF)
  4.5281 +     hdr-content = *S-NONTAB
  4.5282 +     hdr-n-content = [(header-name ":" / metadata-name) SP hdr-content]
  4.5283 +     list-content = body
  4.5284 +     newsgroup-status = %x79 / %x6E / %x6D / private-status
  4.5285 +     over-content = 1*6(TAB hdr-content) /
  4.5286 +           7(TAB hdr-content) *(TAB hdr-n-content)
  4.5287 +     private-status = token ; except the values in newsgroup-status
  4.5288 +
  4.5289 +9.5.  Capability Lines
  4.5290 +
  4.5291 +   This syntax defines the generic form of a capability line in the
  4.5292 +   capabilities list (see Section 3.3.1).
  4.5293 +
  4.5294 +     capability-line = capability-entry
  4.5295 +     capability-entry = X-capability-entry
  4.5296 +     X-capability-entry = capability-label *(WS capability-argument)
  4.5297 +     capability-label = keyword
  4.5298 +     capability-argument = token
  4.5299 +
  4.5300 +   This syntax defines the specific capability entries for the
  4.5301 +   capabilities in this specification.
  4.5302 +
  4.5303 +     capability-entry =/
  4.5304 +           hdr-capability /
  4.5305 +           ihave-capability /
  4.5306 +           implementation-capability /
  4.5307 +           list-capability /
  4.5308 +           mode-reader-capability /
  4.5309 +           newnews-capability /
  4.5310 +           over-capability /
  4.5311 +           post-capability /
  4.5312 +           reader-capability
  4.5313 +
  4.5314 +     hdr-capability = "HDR"
  4.5315 +     ihave-capability = "IHAVE"
  4.5316 +     implementation-capability = "IMPLEMENTATION" *(WS token)
  4.5317 +
  4.5318 +
  4.5319 +
  4.5320 +Feather                     Standards Track                    [Page 95]
  4.5321 +
  4.5322 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.5323 +
  4.5324 +
  4.5325 +     list-capability = "LIST" 1*(WS keyword)
  4.5326 +     mode-reader-capability = "MODE-READER"
  4.5327 +     newnews-capability = "NEWNEWS"
  4.5328 +     over-capability = "OVER" [WS "MSGID"]
  4.5329 +     post-capability = "POST"
  4.5330 +     reader-capability = "READER"
  4.5331 +
  4.5332 +     version-line = "VERSION" 1*(WS version-number)
  4.5333 +     version-number = nzDIGIT *5DIGIT
  4.5334 +
  4.5335 +9.6.  LIST Variants
  4.5336 +
  4.5337 +   This section defines more specifically the keywords for the LIST
  4.5338 +   command and the syntax of the corresponding response contents.
  4.5339 +
  4.5340 +     ; active
  4.5341 +     list-arguments =/ "ACTIVE" [WS wildmat]
  4.5342 +     list-content =/ list-active-content
  4.5343 +     list-active-content = active-groups-list
  4.5344 +
  4.5345 +
  4.5346 +     ; active.times
  4.5347 +     list-arguments =/ "ACTIVE.TIMES" [WS wildmat]
  4.5348 +     list-content =/ list-active-times-content
  4.5349 +     list-active-times-content =
  4.5350 +           *(newsgroup-name SPA 1*DIGIT SPA newsgroup-creator CRLF)
  4.5351 +     newsgroup-creator = U-TEXT
  4.5352 +
  4.5353 +
  4.5354 +     ; distrib.pats
  4.5355 +     list-arguments =/ "DISTRIB.PATS"
  4.5356 +     list-content =/ list-distrib-pats-content
  4.5357 +     list-distrib-pats-content =
  4.5358 +           *(1*DIGIT ":" wildmat ":" distribution CRLF)
  4.5359 +     distribution = token
  4.5360 +
  4.5361 +
  4.5362 +     ; headers
  4.5363 +     list-arguments =/ "HEADERS" [WS ("MSGID" / "RANGE")]
  4.5364 +     list-content =/ list-headers-content
  4.5365 +     list-headers-content = *(header-meta-name CRLF) /
  4.5366 +           *((metadata-name / ":") CRLF)
  4.5367 +
  4.5368 +
  4.5369 +     ; newsgroups
  4.5370 +     list-arguments =/ "NEWSGROUPS" [WS wildmat]
  4.5371 +     list-content =/ list-newsgroups-content
  4.5372 +     list-newsgroups-content =
  4.5373 +
  4.5374 +
  4.5375 +
  4.5376 +Feather                     Standards Track                    [Page 96]
  4.5377 +
  4.5378 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.5379 +
  4.5380 +
  4.5381 +           *(newsgroup-name WS newsgroup-description CRLF)
  4.5382 +     newsgroup-description = S-TEXT
  4.5383 +
  4.5384 +
  4.5385 +     ; overview.fmt
  4.5386 +     list-arguments =/ "OVERVIEW.FMT"
  4.5387 +     list-content =/ list-overview-fmt-content
  4.5388 +     list-overview-fmt-content = "Subject:" CRLF
  4.5389 +           "From:" CRLF
  4.5390 +           "Date:" CRLF
  4.5391 +           "Message-ID:" CRLF
  4.5392 +           "References:" CRLF
  4.5393 +           ( ":bytes" CRLF ":lines" / "Bytes:" CRLF "Lines:") CRLF
  4.5394 +           *((header-name ":full" / metadata-name) CRLF)
  4.5395 +
  4.5396 +9.7.  Articles
  4.5397 +
  4.5398 +   This syntax defines the non-terminal <article>, which represents the
  4.5399 +   format of an article as described in Section 3.6.
  4.5400 +
  4.5401 +     article = 1*header CRLF body
  4.5402 +     header = header-name ":" [CRLF] SP header-content CRLF
  4.5403 +     header-content = *(S-CHAR / [CRLF] WS)
  4.5404 +     body = *(*B-CHAR CRLF)
  4.5405 +
  4.5406 +9.8.  General Non-terminals
  4.5407 +
  4.5408 +   These non-terminals are used at various places in the syntax and are
  4.5409 +   collected here for convenience.  A few of these non-terminals are not
  4.5410 +   used in this specification but are provided for the consistency and
  4.5411 +   convenience of extension authors.
  4.5412 +
  4.5413 +     multi-line-data-block = content-lines termination
  4.5414 +     content-lines = *([content-text] CRLF)
  4.5415 +     content-text = (".." / B-NONDOT) *B-CHAR
  4.5416 +     termination = "." CRLF
  4.5417 +
  4.5418 +     article-number = 1*16DIGIT
  4.5419 +     header-name = 1*A-NOTCOLON
  4.5420 +     keyword = ALPHA 2*(ALPHA / DIGIT / "." / "-")
  4.5421 +     message-id = "<" 1*248A-NOTGT ">"
  4.5422 +     newsgroup-name = 1*wildmat-exact
  4.5423 +     token = 1*P-CHAR
  4.5424 +
  4.5425 +     wildmat = wildmat-pattern *("," ["!"] wildmat-pattern)
  4.5426 +     wildmat-pattern = 1*wildmat-item
  4.5427 +     wildmat-item = wildmat-exact / wildmat-wild
  4.5428 +     wildmat-exact = %x22-29 / %x2B / %x2D-3E / %x40-5A / %x5E-7E /
  4.5429 +
  4.5430 +
  4.5431 +
  4.5432 +Feather                     Standards Track                    [Page 97]
  4.5433 +
  4.5434 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.5435 +
  4.5436 +
  4.5437 +          UTF8-non-ascii  ; exclude ! * , ? [ \ ]
  4.5438 +     wildmat-wild = "*" / "?"
  4.5439 +
  4.5440 +     base64 = *(4base64-char) [base64-terminal]
  4.5441 +     base64-char = UPPER / LOWER / DIGIT / "+" / "/"
  4.5442 +     base64-terminal = 2base64-char "==" / 3base64-char "="
  4.5443 +
  4.5444 +     ; Assorted special character sets
  4.5445 +     ;   A- means based on US-ASCII, excluding controls and SP
  4.5446 +     ;   P- means based on UTF-8, excluding controls and SP
  4.5447 +     ;   U- means based on UTF-8, excluding NUL CR and LF
  4.5448 +     ;   B- means based on bytes, excluding NUL CR and LF
  4.5449 +     A-CHAR     = %x21-7E
  4.5450 +     A-NOTCOLON = %x21-39 / %x3B-7E  ; exclude ":"
  4.5451 +     A-NOTGT    = %x21-3D / %x3F-7E  ; exclude ">"
  4.5452 +     P-CHAR     = A-CHAR / UTF8-non-ascii
  4.5453 +     U-CHAR     = CTRL / TAB / SP / A-CHAR / UTF8-non-ascii
  4.5454 +     U-NONTAB   = CTRL /       SP / A-CHAR / UTF8-non-ascii
  4.5455 +     U-TEXT     = P-CHAR *U-CHAR
  4.5456 +     B-CHAR     = CTRL / TAB / SP / %x21-FF
  4.5457 +     B-NONDOT   = CTRL / TAB / SP / %x21-2D / %x2F-FF  ; exclude "."
  4.5458 +
  4.5459 +     ALPHA = UPPER / LOWER   ; use only when case-insensitive
  4.5460 +     CR = %x0D
  4.5461 +     CRLF = CR LF
  4.5462 +     CTRL = %x01-08 / %x0B-0C / %x0E-1F
  4.5463 +     DIGIT = %x30-39
  4.5464 +     nzDIGIT = %x31-39
  4.5465 +     EOL = *(SP / TAB) CRLF
  4.5466 +     LF = %x0A
  4.5467 +     LOWER = %x61-7A
  4.5468 +     SP = %x20
  4.5469 +     SPA = 1*SP
  4.5470 +     TAB = %x09
  4.5471 +     UPPER = %x41-5A
  4.5472 +     UTF8-non-ascii = UTF8-2 / UTF8-3 / UTF8-4
  4.5473 +     UTF8-2    = %xC2-DF UTF8-tail
  4.5474 +     UTF8-3    = %xE0 %xA0-BF UTF8-tail / %xE1-EC 2UTF8-tail /
  4.5475 +                 %xED %x80-9F UTF8-tail / %xEE-EF 2UTF8-tail
  4.5476 +     UTF8-4    = %xF0 %x90-BF 2UTF8-tail / %xF1-F3 3UTF8-tail /
  4.5477 +                 %xF4 %x80-8F 2UTF8-tail
  4.5478 +     UTF8-tail = %x80-BF
  4.5479 +     WS = 1*(SP / TAB)
  4.5480 +
  4.5481 +   The following non-terminals require special consideration.  They
  4.5482 +   represent situations where material SHOULD be restricted to UTF-8,
  4.5483 +   but implementations MUST be able to cope with other character
  4.5484 +   encodings.  Therefore, there are two sets of definitions for them.
  4.5485 +
  4.5486 +
  4.5487 +
  4.5488 +Feather                     Standards Track                    [Page 98]
  4.5489 +
  4.5490 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.5491 +
  4.5492 +
  4.5493 +   Implementations MUST accept any content that meets this syntax:
  4.5494 +
  4.5495 +     S-CHAR   = %x21-FF
  4.5496 +     S-NONTAB = CTRL / SP / S-CHAR
  4.5497 +     S-TEXT   = (CTRL / S-CHAR) *B-CHAR
  4.5498 +
  4.5499 +   and MAY pass such content on unaltered.
  4.5500 +
  4.5501 +   When generating new content or re-encoding existing content,
  4.5502 +   implementations SHOULD conform to this syntax:
  4.5503 +
  4.5504 +     S-CHAR   = P-CHAR
  4.5505 +     S-NONTAB = U-NONTAB
  4.5506 +     S-TEXT   = U-TEXT
  4.5507 +
  4.5508 +9.9.  Extensions and Validation
  4.5509 +
  4.5510 +   The specification of a registered extension MUST include formal
  4.5511 +   syntax that defines additional forms for the following non-terminals:
  4.5512 +
  4.5513 +   command
  4.5514 +      for each new command other than a variant of the LIST command -
  4.5515 +      the syntax of each command MUST be compatible with the definition
  4.5516 +      of <X-command>;
  4.5517 +
  4.5518 +   command-datastream
  4.5519 +      for each new command that immediately streams data;
  4.5520 +
  4.5521 +   command-continuation
  4.5522 +      for each new command that sends further material after the initial
  4.5523 +      command line - the syntax of each continuation MUST be exactly
  4.5524 +      what is sent to the server, including any escape mechanisms such
  4.5525 +      as "dot-stuffing";
  4.5526 +
  4.5527 +   initial-response-content
  4.5528 +      for each new response code that has arguments - the syntax of each
  4.5529 +      response MUST be compatible with the definition of <X-initial-
  4.5530 +      response-content>;
  4.5531 +
  4.5532 +   multi-line-response-content
  4.5533 +      for each new response code that has a multi-line response - the
  4.5534 +      syntax MUST show the response after the lines containing the
  4.5535 +      response code and the terminating octet have been removed and any
  4.5536 +      "dot-stuffing" undone;
  4.5537 +
  4.5538 +   capability-entry
  4.5539 +      for each new capability label - the syntax of each entry MUST be
  4.5540 +      compatible with the definition of <X-capability-entry>;
  4.5541 +
  4.5542 +
  4.5543 +
  4.5544 +Feather                     Standards Track                    [Page 99]
  4.5545 +
  4.5546 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.5547 +
  4.5548 +
  4.5549 +   list-arguments
  4.5550 +      for each new variant of the LIST command - the syntax of each
  4.5551 +      entry MUST be compatible with the definition of <X-command>;
  4.5552 +
  4.5553 +   list-content
  4.5554 +      for each new variant of the LIST command - the syntax MUST show
  4.5555 +      the response after the lines containing the 215 response code and
  4.5556 +      the terminating octet have been removed and any "dot-stuffing"
  4.5557 +      undone.
  4.5558 +
  4.5559 +   The =/ notation of ABNF [RFC4234] and the naming conventions
  4.5560 +   described in Section 9.1 SHOULD be used for this.
  4.5561 +
  4.5562 +   When the syntax in this specification, or syntax based on it, is
  4.5563 +   validated, it should be noted that:
  4.5564 +
  4.5565 +   o  the non-terminals <command-line>, <command-datastream>,
  4.5566 +      <command-continuation>, <response>, and
  4.5567 +      <multi-line-response-content> describe basic concepts of the
  4.5568 +      protocol and are not referred to by any other rule;
  4.5569 +
  4.5570 +   o  the non-terminal <base64> is provided for the convenience of
  4.5571 +      extension authors and is not referred to by any rule in this
  4.5572 +      specification;
  4.5573 +
  4.5574 +   o  for the reasons given above, the non-terminals <S-CHAR>,
  4.5575 +      <S-NONTAB>, and <S-TEXT> each have two definitions; and
  4.5576 +
  4.5577 +   o  the non-terminal <UNDEFINED> is deliberately not defined.
  4.5578 +
  4.5579 +10.  Internationalisation Considerations
  4.5580 +
  4.5581 +10.1.  Introduction and Historical Situation
  4.5582 +
  4.5583 +   RFC 977 [RFC977] was written at a time when internationalisation was
  4.5584 +   not seen as a significant issue.  As such, it was written on the
  4.5585 +   assumption that all communication would be in ASCII and use only a
  4.5586 +   7-bit transport layer, although in practice just about all known
  4.5587 +   implementations are 8-bit clean.
  4.5588 +
  4.5589 +   Since then, Usenet and NNTP have spread throughout the world.  In the
  4.5590 +   absence of standards for handling the issues of language and
  4.5591 +   character sets, countries, newsgroup hierarchies, and individuals
  4.5592 +   have found a variety of solutions that work for them but that are not
  4.5593 +   necessarily appropriate elsewhere.  For example, some have adopted a
  4.5594 +   default 8-bit character set appropriate to their needs (such as
  4.5595 +   ISO/IEC 8859-1 in Western Europe or KOI-8 in Russia), others have
  4.5596 +   used ASCII (either US-ASCII or national variants) in headers but
  4.5597 +
  4.5598 +
  4.5599 +
  4.5600 +Feather                     Standards Track                   [Page 100]
  4.5601 +
  4.5602 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.5603 +
  4.5604 +
  4.5605 +   local 16-bit character sets in article bodies, and still others have
  4.5606 +   gone for a combination of MIME [RFC2045] and UTF-8.  With the
  4.5607 +   increased use of MIME in email, it is becoming more common to find
  4.5608 +   NNTP articles containing MIME headers that identify the character set
  4.5609 +   of the body, but this is far from universal.
  4.5610 +
  4.5611 +   The resulting confusion does not help interoperability.
  4.5612 +
  4.5613 +   One point that has been generally accepted is that articles can
  4.5614 +   contain octets with the top bit set, and NNTP is only expected to
  4.5615 +   operate on 8-bit clean transport paths.
  4.5616 +
  4.5617 +10.2.  This Specification
  4.5618 +
  4.5619 +   Part of the role of this present specification is to eliminate this
  4.5620 +   confusion and promote interoperability as far as possible.  At the
  4.5621 +   same time, it is necessary to accept the existence of the present
  4.5622 +   situation and not break existing implementations and arrangements
  4.5623 +   gratuitously, even if they are less than optimal.  Therefore, the
  4.5624 +   current practice described above has been taken into consideration in
  4.5625 +   producing this specification.
  4.5626 +
  4.5627 +   This specification extends NNTP from US-ASCII [ANSI1986] to UTF-8
  4.5628 +   [RFC3629].  Except in the two areas discussed below, UTF-8 (which is
  4.5629 +   a superset of US-ASCII) is mandatory, and implementations MUST NOT
  4.5630 +   use any other encoding.
  4.5631 +
  4.5632 +   Firstly, the use of MIME for article headers and bodies is strongly
  4.5633 +   recommended.  However, given widely divergent existing practices, an
  4.5634 +   attempt to require a particular encoding and tagging standard would
  4.5635 +   be premature at this time.  Accordingly, this specification allows
  4.5636 +   the use of arbitrary 8-bit data in articles subject to the following
  4.5637 +   requirements and recommendations.
  4.5638 +
  4.5639 +   o  The names of headers (e.g., "From" or "Subject") MUST be in
  4.5640 +      US-ASCII.
  4.5641 +
  4.5642 +   o  Header values SHOULD use US-ASCII or an encoding based on it, such
  4.5643 +      as RFC 2047 [RFC2047], until such time as another approach has
  4.5644 +      been standardised.  At present, 8-bit encodings (including UTF-8)
  4.5645 +      SHOULD NOT be used because they are likely to cause
  4.5646 +      interoperability problems.
  4.5647 +
  4.5648 +   o  The character set of article bodies SHOULD be indicated in the
  4.5649 +      article headers, and this SHOULD be done in accordance with MIME.
  4.5650 +
  4.5651 +   o  Where an article is obtained from an external source, an
  4.5652 +      implementation MAY pass it on and derive data from it (such as the
  4.5653 +
  4.5654 +
  4.5655 +
  4.5656 +Feather                     Standards Track                   [Page 101]
  4.5657 +
  4.5658 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.5659 +
  4.5660 +
  4.5661 +      response to the HDR command), even though the article or the data
  4.5662 +      does not meet the above requirements.  Implementations MUST
  4.5663 +      transfer such articles and data correctly and unchanged; they MUST
  4.5664 +      NOT attempt to convert or re-encode the article or derived data.
  4.5665 +      (Nevertheless, a client or server MAY elect not to post or forward
  4.5666 +      the article if, after further examination of the article, it deems
  4.5667 +      it inappropriate to do so.)
  4.5668 +
  4.5669 +   This requirement affects the ARTICLE (Section 6.2.1), BODY
  4.5670 +   (Section 6.2.3), HDR (Section 8.5), HEAD (Section 6.2.2), IHAVE
  4.5671 +   (Section 6.3.2), OVER (Section 8.3), and POST (Section 6.3.1)
  4.5672 +   commands.
  4.5673 +
  4.5674 +   Secondly, the following requirements are placed on the newsgroups
  4.5675 +   list returned by the LIST NEWSGROUPS command (Section 7.6.6):
  4.5676 +
  4.5677 +   o  Although this specification allows UTF-8 for newsgroup names, they
  4.5678 +      SHOULD be restricted to US-ASCII until a successor to RFC 1036
  4.5679 +      [RFC1036] standardises another approach. 8-bit encodings SHOULD
  4.5680 +      NOT be used because they are likely to cause interoperability
  4.5681 +      problems.
  4.5682 +
  4.5683 +   o  The newsgroup description SHOULD be in US-ASCII or UTF-8 unless
  4.5684 +      and until a successor to RFC 1036 standardises other encoding
  4.5685 +      arrangements.  8-bit encodings other than UTF-8 SHOULD NOT be used
  4.5686 +      because they are likely to cause interoperability problems.
  4.5687 +
  4.5688 +   o  Implementations that obtain this data from an external source MUST
  4.5689 +      handle it correctly even if it does not meet the above
  4.5690 +      requirements.  Implementations (in particular, clients) MUST
  4.5691 +      handle such data correctly.
  4.5692 +
  4.5693 +10.3.  Outstanding Issues
  4.5694 +
  4.5695 +   While the primary use of NNTP is for transmitting articles that
  4.5696 +   conform to RFC 1036 (Netnews articles), it is also used for other
  4.5697 +   formats (see Appendix A).  It is therefore most appropriate that
  4.5698 +   internationalisation issues related to article formats be addressed
  4.5699 +   in the relevant specifications.  For Netnews articles, this is any
  4.5700 +   successor to RFC 1036.  For email messages, it is RFC 2822 [RFC2822].
  4.5701 +
  4.5702 +   Of course, any article transmitted via NNTP needs to conform to this
  4.5703 +   specification as well.
  4.5704 +
  4.5705 +   Restricting newsgroup names to UTF-8 is not a complete solution.  In
  4.5706 +   particular, when new newsgroup names are created or a user is asked
  4.5707 +   to enter a newsgroup name, some scheme of canonicalisation will need
  4.5708 +   to take place.  This specification does not attempt to define that
  4.5709 +
  4.5710 +
  4.5711 +
  4.5712 +Feather                     Standards Track                   [Page 102]
  4.5713 +
  4.5714 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.5715 +
  4.5716 +
  4.5717 +   canonicalization; further work is needed in this area, in conjunction
  4.5718 +   with the article format specifications.  Until such specifications
  4.5719 +   are published, implementations SHOULD match newsgroup names octet by
  4.5720 +   octet.  It is anticipated that any approved scheme will be applied
  4.5721 +   "at the edges", and therefore octet-by-octet comparison will continue
  4.5722 +   to apply to most, if not all, uses of newsgroup names in NNTP.
  4.5723 +
  4.5724 +   In the meantime, any implementation experimenting with UTF-8
  4.5725 +   newsgroup names is strongly cautioned that a future specification may
  4.5726 +   require that those names be canonicalized when used with NNTP in a
  4.5727 +   way that is not compatible with their experiments.
  4.5728 +
  4.5729 +   Since the primary use of NNTP is with Netnews, and since newsgroup
  4.5730 +   descriptions are normally distributed through specially formatted
  4.5731 +   articles, it is recommended that the internationalisation issues
  4.5732 +   related to them be addressed in any successor to RFC 1036.
  4.5733 +
  4.5734 +11.  IANA Considerations
  4.5735 +
  4.5736 +   This specification requires IANA to keep a registry of capability
  4.5737 +   labels.  The initial contents of this registry are specified in
  4.5738 +   Section 3.3.4.  As described in Section 3.3.3, labels beginning with
  4.5739 +   X are reserved for private use, while all other names are expected to
  4.5740 +   be associated with a specification in an RFC on the standards track
  4.5741 +   or defining an IESG-approved experimental protocol.
  4.5742 +
  4.5743 +   Different entries in the registry MUST use different capability
  4.5744 +   labels.
  4.5745 +
  4.5746 +   Different entries in the registry MUST NOT use the same command name.
  4.5747 +   For this purpose, variants distinguished by a second or subsequent
  4.5748 +   keyword (e.g., "LIST HEADERS" and "LIST OVERVIEW.FMT") count as
  4.5749 +   different commands.  If there is a need for two extensions to use the
  4.5750 +   same command, a single harmonised specification MUST be registered.
  4.5751 +
  4.5752 +12.  Security Considerations
  4.5753 +
  4.5754 +   This section is meant to inform application developers, information
  4.5755 +   providers, and users of the security limitations in NNTP as described
  4.5756 +   by this document.  The discussion does not include definitive
  4.5757 +   solutions to the problems revealed, though it does make some
  4.5758 +   suggestions for reducing security risks.
  4.5759 +
  4.5760 +
  4.5761 +
  4.5762 +
  4.5763 +
  4.5764 +
  4.5765 +
  4.5766 +
  4.5767 +
  4.5768 +Feather                     Standards Track                   [Page 103]
  4.5769 +
  4.5770 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.5771 +
  4.5772 +
  4.5773 +12.1.  Personal and Proprietary Information
  4.5774 +
  4.5775 +   NNTP, because it was created to distribute network news articles,
  4.5776 +   will forward whatever information is stored in those articles.
  4.5777 +   Specification of that information is outside this scope of this
  4.5778 +   document, but it is likely that some personal and/or proprietary
  4.5779 +   information is available in some of those articles.  It is very
  4.5780 +   important that designers and implementers provide informative
  4.5781 +   warnings to users so that personal and/or proprietary information in
  4.5782 +   material that is added automatically to articles (e.g., in headers)
  4.5783 +   is not disclosed inadvertently.  Additionally, effective and easily
  4.5784 +   understood mechanisms to manage the distribution of news articles
  4.5785 +   SHOULD be provided to NNTP Server administrators, so that they are
  4.5786 +   able to report with confidence the likely spread of any particular
  4.5787 +   set of news articles.
  4.5788 +
  4.5789 +12.2.  Abuse of Server Log Information
  4.5790 +
  4.5791 +   A server is in the position to save session data about a user's
  4.5792 +   requests that might identify their reading patterns or subjects of
  4.5793 +   interest.  This information is clearly confidential in nature, and
  4.5794 +   its handling can be constrained by law in certain countries.  People
  4.5795 +   using this protocol to provide data are responsible for ensuring that
  4.5796 +   such material is not distributed without the permission of any
  4.5797 +   individuals that are identifiable by the published results.
  4.5798 +
  4.5799 +12.3.  Weak Authentication and Access Control
  4.5800 +
  4.5801 +   There is no user-based or token-based authentication in the basic
  4.5802 +   NNTP specification.  Access is normally controlled by server
  4.5803 +   configuration files.  Those files specify access by using domain
  4.5804 +   names or IP addresses.  However, this specification does permit the
  4.5805 +   creation of extensions to NNTP for such purposes; one such extension
  4.5806 +   is [NNTP-AUTH].  While including such mechanisms is optional, doing
  4.5807 +   so is strongly encouraged.
  4.5808 +
  4.5809 +   Other mechanisms are also available.  For example, a proxy server
  4.5810 +   could be put in place that requires authentication before connecting
  4.5811 +   via the proxy to the NNTP server.
  4.5812 +
  4.5813 +12.4.  DNS Spoofing
  4.5814 +
  4.5815 +   Many existing NNTP implementations authorize incoming connections by
  4.5816 +   checking the IP address of that connection against the IP addresses
  4.5817 +   obtained via DNS lookups of lists of domain names given in local
  4.5818 +   configuration files.  Servers that use this type of authentication
  4.5819 +   and clients that find a server by doing a DNS lookup of the server
  4.5820 +   name rely very heavily on the Domain Name Service, and are thus
  4.5821 +
  4.5822 +
  4.5823 +
  4.5824 +Feather                     Standards Track                   [Page 104]
  4.5825 +
  4.5826 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.5827 +
  4.5828 +
  4.5829 +   generally prone to security attacks based on the deliberate
  4.5830 +   misassociation of IP addresses and DNS names.  Clients and servers
  4.5831 +   need to be cautious in assuming the continuing validity of an IP
  4.5832 +   number/DNS name association.
  4.5833 +
  4.5834 +   In particular, NNTP clients and servers SHOULD rely on their name
  4.5835 +   resolver for confirmation of an IP number/DNS name association,
  4.5836 +   rather than cache the result of previous host name lookups.  Many
  4.5837 +   platforms already can cache host name lookups locally when
  4.5838 +   appropriate, and they SHOULD be configured to do so.  It is proper
  4.5839 +   for these lookups to be cached, however, only when the TTL (Time To
  4.5840 +   Live) information reported by the name server makes it likely that
  4.5841 +   the cached information will remain useful.
  4.5842 +
  4.5843 +   If NNTP clients or servers cache the results of host name lookups in
  4.5844 +   order to achieve a performance improvement, they MUST observe the TTL
  4.5845 +   information reported by DNS.  If NNTP clients or servers do not
  4.5846 +   observe this rule, they could be spoofed when a previously accessed
  4.5847 +   server's IP address changes.  As network renumbering is expected to
  4.5848 +   become increasingly common, the possibility of this form of attack
  4.5849 +   will increase.  Observing this requirement thus reduces this
  4.5850 +   potential security vulnerability.
  4.5851 +
  4.5852 +   This requirement also improves the load-balancing behaviour of
  4.5853 +   clients for replicated servers using the same DNS name and reduces
  4.5854 +   the likelihood of a user's experiencing failure in accessing sites
  4.5855 +   that use that strategy.
  4.5856 +
  4.5857 +12.5.  UTF-8 Issues
  4.5858 +
  4.5859 +   UTF-8 [RFC3629] permits only certain sequences of octets and
  4.5860 +   designates others as either malformed or "illegal".  The Unicode
  4.5861 +   standard identifies a number of security issues related to illegal
  4.5862 +   sequences and forbids their generation by conforming implementations.
  4.5863 +
  4.5864 +   Implementations of this specification MUST NOT generate malformed or
  4.5865 +   illegal sequences and SHOULD detect them and take some appropriate
  4.5866 +   action.  This could include the following:
  4.5867 +
  4.5868 +   o  Generating a 501 response code.
  4.5869 +
  4.5870 +   o  Replacing such sequences by the sequence %xEF.BF.BD, which encodes
  4.5871 +      the "replacement character" U+FFFD.
  4.5872 +
  4.5873 +   o  Closing the connection.
  4.5874 +
  4.5875 +   o  Replacing such sequences by a "guessed" valid sequence (based on
  4.5876 +      properties of the UTF-8 encoding).
  4.5877 +
  4.5878 +
  4.5879 +
  4.5880 +Feather                     Standards Track                   [Page 105]
  4.5881 +
  4.5882 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.5883 +
  4.5884 +
  4.5885 +   In the last case, the implementation MUST ensure that any replacement
  4.5886 +   cannot be used to bypass validity or security checks.  For example,
  4.5887 +   the illegal sequence %xC0.A0 is an over-long encoding for space
  4.5888 +   (%x20).  If it is replaced by the correct encoding in a command line,
  4.5889 +   this needs to happen before the command line is parsed into
  4.5890 +   individual arguments.  If the replacement came after parsing, it
  4.5891 +   would be possible to generate an argument with an embedded space,
  4.5892 +   which is forbidden.  Use of the "replacement character" does not have
  4.5893 +   this problem, since it is permitted wherever non-US-ASCII characters
  4.5894 +   are.  Implementations SHOULD use one of the first two solutions where
  4.5895 +   the general structure of the NNTP stream remains intact and SHOULD
  4.5896 +   close the connection if it is no longer possible to parse it
  4.5897 +   sensibly.
  4.5898 +
  4.5899 +12.6.  Caching of Capability Lists
  4.5900 +
  4.5901 +   The CAPABILITIES command provides a capability list, which is
  4.5902 +   information about the current capabilities of the server.  Whenever
  4.5903 +   there is a relevant change to the server state, the results of this
  4.5904 +   command are required to change accordingly.
  4.5905 +
  4.5906 +   In most situations, the capabilities list in a given server state
  4.5907 +   will not change from session to session; for example, a given
  4.5908 +   extension will be installed permanently on a server.  Some clients
  4.5909 +   may therefore wish to remember which extensions a server supports to
  4.5910 +   avoid the delay of an additional command and response, particularly
  4.5911 +   if they open multiple connections in the same session.
  4.5912 +
  4.5913 +   However, information about extensions related to security and privacy
  4.5914 +   MUST NOT be cached, since this could allow a variety of attacks.
  4.5915 +
  4.5916 +   For example, consider a server that permits the use of cleartext
  4.5917 +   passwords on links that are encrypted but not otherwise:
  4.5918 +
  4.5919 +      [Initial connection set-up completed.]
  4.5920 +      [S] 200 NNTP Service Ready, posting permitted
  4.5921 +      [C] CAPABILITIES
  4.5922 +      [S] 101 Capability list:
  4.5923 +      [S] VERSION 2
  4.5924 +      [S] READER
  4.5925 +      [S] NEWNEWS
  4.5926 +      [S] POST
  4.5927 +      [S] XENCRYPT
  4.5928 +      [S] LIST ACTIVE NEWSGROUPS
  4.5929 +      [S] .
  4.5930 +      [C] XENCRYPT
  4.5931 +      [Client and server negotiate encryption on the link]
  4.5932 +      [S] 283 Encrypted link established
  4.5933 +
  4.5934 +
  4.5935 +
  4.5936 +Feather                     Standards Track                   [Page 106]
  4.5937 +
  4.5938 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.5939 +
  4.5940 +
  4.5941 +      [C] CAPABILITIES
  4.5942 +      [S] 101 Capability list:
  4.5943 +      [S] VERSION 2
  4.5944 +      [S] READER
  4.5945 +      [S] NEWNEWS
  4.5946 +      [S] POST
  4.5947 +      [S] XSECRET
  4.5948 +      [S] LIST ACTIVE NEWSGROUPS
  4.5949 +      [S] .
  4.5950 +      [C] XSECRET fred flintstone
  4.5951 +      [S] 290 Password for fred accepted
  4.5952 +
  4.5953 +   If the client caches the last capabilities list, then on the next
  4.5954 +   session it will attempt to use XSECRET on an unencrypted link:
  4.5955 +
  4.5956 +      [Initial connection set-up completed.]
  4.5957 +      [S] 200 NNTP Service Ready, posting permitted
  4.5958 +      [C] XSECRET fred flintstone
  4.5959 +      [S] 483 Only permitted on secure links
  4.5960 +
  4.5961 +   This exposes the password to any eavesdropper.  While the primary
  4.5962 +   cause of this is passing a secret without first checking the security
  4.5963 +   of the link, caching of capability lists can increase the risk.
  4.5964 +
  4.5965 +   Any security extension should include requirements to check the
  4.5966 +   security state of the link in a manner appropriate to that extension.
  4.5967 +
  4.5968 +   Caching should normally only be considered for anonymous clients that
  4.5969 +   do not use any security or privacy extensions and for which the time
  4.5970 +   required for an additional command and response is a noticeable
  4.5971 +   issue.
  4.5972 +
  4.5973 +13.  Acknowledgements
  4.5974 +
  4.5975 +   This document is the result of much effort by the present and past
  4.5976 +   members of the NNTP Working Group, chaired by Russ Allbery and Ned
  4.5977 +   Freed.  It could not have been produced without them.
  4.5978 +
  4.5979 +   The author acknowledges the original authors of NNTP as documented in
  4.5980 +   RFC 977 [RFC977]: Brian Kantor and Phil Lapsey.
  4.5981 +
  4.5982 +   The author gratefully acknowledges the following:
  4.5983 +
  4.5984 +   o  The work of the NNTP committee chaired by Eliot Lear.  The
  4.5985 +      organization of this document was influenced by the last available
  4.5986 +      version from this working group.  A special thanks to Eliot for
  4.5987 +      generously providing the original machine-readable sources for
  4.5988 +      that document.
  4.5989 +
  4.5990 +
  4.5991 +
  4.5992 +Feather                     Standards Track                   [Page 107]
  4.5993 +
  4.5994 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.5995 +
  4.5996 +
  4.5997 +   o  The work of the DRUMS working group, specifically RFC 1869
  4.5998 +      [RFC1869], that drove the original thinking that led to the
  4.5999 +      CAPABILITIES command and the extensions mechanism detailed in this
  4.6000 +      document.
  4.6001 +
  4.6002 +   o  The authors of RFC 2616 [RFC2616] for providing specific and
  4.6003 +      relevant examples of security issues that should be considered for
  4.6004 +      HTTP.  Since many of the same considerations exist for NNTP, those
  4.6005 +      examples that are relevant have been included here with some minor
  4.6006 +      rewrites.
  4.6007 +
  4.6008 +   o  The comments and additional information provided by the following
  4.6009 +      individuals in preparing one or more of the progenitors of this
  4.6010 +      document:
  4.6011 +
  4.6012 +         Russ Allbery <rra@stanford.edu>
  4.6013 +         Wayne Davison <davison@armory.com>
  4.6014 +         Chris Lewis <clewis@bnr.ca>
  4.6015 +         Tom Limoncelli <tal@mars.superlink.net>
  4.6016 +         Eric Schnoebelen <eric@egsner.cirr.com>
  4.6017 +         Rich Salz <rsalz@osf.org>
  4.6018 +
  4.6019 +   This work was motivated by the work of various news reader authors
  4.6020 +   and news server authors, including those listed below:
  4.6021 +
  4.6022 +   Rick Adams
  4.6023 +      Original author of the NNTP extensions to the RN news reader and
  4.6024 +      last maintainer of Bnews.
  4.6025 +
  4.6026 +   Stan Barber
  4.6027 +      Original author of the NNTP extensions to the news readers that
  4.6028 +      are part of Bnews.
  4.6029 +
  4.6030 +   Geoff Collyer
  4.6031 +      Original author of the OVERVIEW database proposal and one of the
  4.6032 +      original authors of CNEWS.
  4.6033 +
  4.6034 +   Dan Curry
  4.6035 +      Original author of the xvnews news reader.
  4.6036 +
  4.6037 +   Wayne Davison
  4.6038 +      Author of the first threading extensions to the RN news reader
  4.6039 +      (commonly called TRN).
  4.6040 +
  4.6041 +   Geoff Huston
  4.6042 +      Original author of ANU NEWS.
  4.6043 +
  4.6044 +
  4.6045 +
  4.6046 +
  4.6047 +
  4.6048 +Feather                     Standards Track                   [Page 108]
  4.6049 +
  4.6050 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.6051 +
  4.6052 +
  4.6053 +   Phil Lapsey
  4.6054 +      Original author of the UNIX reference implementation for NNTP.
  4.6055 +
  4.6056 +   Iain Lea
  4.6057 +      Original maintainer of the TIN news reader.
  4.6058 +
  4.6059 +   Chris Lewis
  4.6060 +      First known implementer of the AUTHINFO GENERIC extension.
  4.6061 +
  4.6062 +   Rich Salz
  4.6063 +      Original author of INN.
  4.6064 +
  4.6065 +   Henry Spencer
  4.6066 +      One of the original authors of CNEWS.
  4.6067 +
  4.6068 +   Kim Storm
  4.6069 +      Original author of the NN news reader.
  4.6070 +
  4.6071 +   Other people who contributed to this document include:
  4.6072 +
  4.6073 +      Matthias Andree
  4.6074 +      Greg Andruk
  4.6075 +      Daniel Barclay
  4.6076 +      Maurizio Codogno
  4.6077 +      Mark Crispin
  4.6078 +      Andrew Gierth
  4.6079 +      Juergen Helbing
  4.6080 +      Scott Hollenbeck
  4.6081 +      Urs Janssen
  4.6082 +      Charles Lindsey
  4.6083 +      Ade Lovett
  4.6084 +      David Magda
  4.6085 +      Ken Murchison
  4.6086 +      Francois Petillon
  4.6087 +      Peter Robinson
  4.6088 +      Rob Siemborski
  4.6089 +      Howard Swinehart
  4.6090 +      Ruud van Tol
  4.6091 +      Jeffrey Vinocur
  4.6092 +      Erik Warmelink
  4.6093 +
  4.6094 +   The author thanks them all and apologises to anyone omitted.
  4.6095 +
  4.6096 +   Finally, the present author gratefully acknowledges the vast amount
  4.6097 +   of work put into previous versions by the previous author:
  4.6098 +
  4.6099 +      Stan Barber <sob@academ.com>
  4.6100 +
  4.6101 +
  4.6102 +
  4.6103 +
  4.6104 +Feather                     Standards Track                   [Page 109]
  4.6105 +
  4.6106 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.6107 +
  4.6108 +
  4.6109 +14.  References
  4.6110 +
  4.6111 +14.1.  Normative References
  4.6112 +
  4.6113 +   [ANSI1986]    American National Standards Institute, "Coded Character
  4.6114 +                 Set - 7-bit American Standard Code for Information
  4.6115 +                 Interchange", ANSI X3.4, 1986.
  4.6116 +
  4.6117 +   [RFC977]      Kantor, B. and P. Lapsley, "Network News Transfer
  4.6118 +                 Protocol", RFC 977, February 1986.
  4.6119 +
  4.6120 +   [RFC2045]     Freed, N. and N. Borenstein, "Multipurpose Internet
  4.6121 +                 Mail Extensions (MIME) Part One: Format of Internet
  4.6122 +                 Message Bodies", RFC 2045, November 1996.
  4.6123 +
  4.6124 +   [RFC2047]     Moore, K., "MIME (Multipurpose Internet Mail
  4.6125 +                 Extensions) Part Three: Message Header Extensions for
  4.6126 +                 Non-ASCII Text", RFC 2047, November 1996.
  4.6127 +
  4.6128 +   [RFC2119]     Bradner, S., "Key words for use in RFCs to Indicate
  4.6129 +                 Requirement Levels", BCP 14, RFC 2119, March 1997.
  4.6130 +
  4.6131 +   [RFC3629]     Yergeau, F., "UTF-8, a transformation format of ISO
  4.6132 +                 10646", STD 63, RFC 3629, November 2003.
  4.6133 +
  4.6134 +   [RFC4234]     Crocker, D., Ed. and P. Overell, "Augmented BNF for
  4.6135 +                 Syntax Specifications: ABNF", RFC 4234, October 2005.
  4.6136 +
  4.6137 +   [RFC4648]     Josefsson, S., "The Base16, Base32, and Base64 Data
  4.6138 +                 Encodings", RFC 4648, October 2006.
  4.6139 +
  4.6140 +   [TF.686-1]    International Telecommunications Union - Radio,
  4.6141 +                 "Glossary, ITU-R Recommendation TF.686-1",
  4.6142 +                 ITU-R Recommendation TF.686-1, October 1997.
  4.6143 +
  4.6144 +14.2.  Informative References
  4.6145 +
  4.6146 +   [NNTP-AUTH]   Vinocur, J., Murchison, K., and C. Newman, "Network
  4.6147 +                 News Transfer Protocol (NNTP) Extension for
  4.6148 +                 Authentication",
  4.6149 +                 RFC 4643, October 2006.
  4.6150 +
  4.6151 +   [NNTP-STREAM] Vinocur, J. and K. Murchison, "Network News Transfer
  4.6152 +                 Protocol (NNTP) Extension for Streaming Feeds",
  4.6153 +                 RFC 4644, October 2006.
  4.6154 +
  4.6155 +
  4.6156 +
  4.6157 +
  4.6158 +
  4.6159 +
  4.6160 +Feather                     Standards Track                   [Page 110]
  4.6161 +
  4.6162 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.6163 +
  4.6164 +
  4.6165 +   [NNTP-TLS]    Murchison, K., Vinocur, J., and C. Newman, "Using
  4.6166 +                 Transport Layer Security (TLS) with Network News
  4.6167 +                 Transfer Protocol (NNTP)", RFC 4642, October 2006.
  4.6168 +
  4.6169 +   [RFC1036]     Horton, M. and R. Adams, "Standard for interchange of
  4.6170 +                 USENET messages", RFC 1036, December 1987.
  4.6171 +
  4.6172 +   [RFC1305]     Mills, D., "Network Time Protocol (Version 3)
  4.6173 +                 Specification, Implementation and Analysis", RFC 1305,
  4.6174 +                 March 1992.
  4.6175 +
  4.6176 +   [RFC1869]     Klensin, J., Freed, N., Rose, M., Stefferud, E., and D.
  4.6177 +                 Crocker, "SMTP Service Extensions", STD 10, RFC 1869,
  4.6178 +                 November 1995.
  4.6179 +
  4.6180 +   [RFC2616]     Fielding,  R., Gettys, J., Mogul, J., Frystyk, H.,
  4.6181 +                 Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext
  4.6182 +                 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.
  4.6183 +
  4.6184 +   [RFC2629]     Rose, M., "Writing I-Ds and RFCs using XML", RFC 2629,
  4.6185 +                 June 1999.
  4.6186 +
  4.6187 +   [RFC2822]     Resnick, P., "Internet Message Format", RFC 2822, April
  4.6188 +                 2001.
  4.6189 +
  4.6190 +   [RFC2980]     Barber, S., "Common NNTP Extensions", RFC 2980, October
  4.6191 +                 2000.
  4.6192 +
  4.6193 +   [ROBE1995]    Robertson, R., "FAQ: Overview database / NOV General
  4.6194 +                 Information", January 1995.
  4.6195 +
  4.6196 +                 There is no definitive copy of this document known to
  4.6197 +                 the author.  It was previously posted as the Usenet
  4.6198 +                 article <news:nov-faq-1-930909720@agate.Berkeley.EDU>
  4.6199 +
  4.6200 +   [SALZ1992]    Salz, R., "Manual Page for wildmat(3) from the INN 1.4
  4.6201 +                 distribution, Revision 1.10", April 1992.
  4.6202 +
  4.6203 +                 There is no definitive copy of this document known to
  4.6204 +                 the author.
  4.6205 +
  4.6206 +
  4.6207 +
  4.6208 +
  4.6209 +
  4.6210 +
  4.6211 +
  4.6212 +
  4.6213 +
  4.6214 +
  4.6215 +
  4.6216 +Feather                     Standards Track                   [Page 111]
  4.6217 +
  4.6218 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.6219 +
  4.6220 +
  4.6221 +Appendix A.  Interaction with Other Specifications
  4.6222 +
  4.6223 +   NNTP is most often used for transferring articles that conform to
  4.6224 +   RFC 1036 [RFC1036] (such articles are called "Netnews articles"
  4.6225 +   here).  It is also sometimes used for transferring email messages
  4.6226 +   that conform to RFC 2822 [RFC2822] (such articles are called "email
  4.6227 +   articles" here).  In this situation, articles must conform both to
  4.6228 +   this specification and to that other one; this appendix describes
  4.6229 +   some relevant issues.
  4.6230 +
  4.6231 +A.1.  Header Folding
  4.6232 +
  4.6233 +   NNTP allows a header line to be folded (by inserting a CRLF pair)
  4.6234 +   before any space or TAB character.
  4.6235 +
  4.6236 +   Both email and Netnews articles are required to have at least one
  4.6237 +   octet other than space or TAB on each header line.  Thus, folding can
  4.6238 +   only happen at one point in each sequence of consecutive spaces or
  4.6239 +   TABs.  Netnews articles are further required to have the header name,
  4.6240 +   colon, and following space all on the first line; folding may only
  4.6241 +   happen beyond that space.  Finally, some non-conforming software will
  4.6242 +   remove trailing spaces and TABs from a line.  Therefore, it might be
  4.6243 +   inadvisable to fold a header after a space or TAB.
  4.6244 +
  4.6245 +   For maximum safety, header lines SHOULD conform to the following
  4.6246 +   syntax rather than to that in Section 9.7.
  4.6247 +
  4.6248 +
  4.6249 +     header = header-name ":" SP [header-content] CRLF
  4.6250 +     header-content = [WS] token *( [CRLF] WS token )
  4.6251 +
  4.6252 +A.2.  Message-IDs
  4.6253 +
  4.6254 +   Every article handled by an NNTP server MUST have a unique
  4.6255 +   message-id.  For the purposes of this specification, a message-id is
  4.6256 +   an arbitrary opaque string that merely needs to meet certain
  4.6257 +   syntactic requirements and is just a way to refer to the article.
  4.6258 +
  4.6259 +   Because there is a significant risk that old articles will be
  4.6260 +   reinjected into the global Usenet system, RFC 1036 [RFC1036] requires
  4.6261 +   that message-ids are globally unique for all time.
  4.6262 +
  4.6263 +   This specification states that message-ids are the same if and only
  4.6264 +   if they consist of the same sequence of octets.  Other specifications
  4.6265 +   may define two different sequences as being equal because they are
  4.6266 +   putting an interpretation on particular characters.  RFC 2822
  4.6267 +   [RFC2822] has a concept of "quoted" and "escaped" characters.  It
  4.6268 +   therefore considers the three message-ids:
  4.6269 +
  4.6270 +
  4.6271 +
  4.6272 +Feather                     Standards Track                   [Page 112]
  4.6273 +
  4.6274 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.6275 +
  4.6276 +
  4.6277 +      <ab.cd@example.com>
  4.6278 +      <"ab.cd"@example.com>
  4.6279 +      <"ab.\cd"@example.com>
  4.6280 +
  4.6281 +   as being identical.  Therefore, an NNTP implementation handing email
  4.6282 +   articles must ensure that only one of these three appears in the
  4.6283 +   protocol and that the other two are converted to it as and when
  4.6284 +   necessary, such as when a client checks the results of a NEWNEWS
  4.6285 +   command against an internal database of message-ids.  Note that
  4.6286 +   RFC 1036 [RFC1036] never treats two different strings as being
  4.6287 +   identical.  Its successor (as of the time of writing) restricts the
  4.6288 +   syntax of message-ids so that, whenever RFC 2822 would treat two
  4.6289 +   strings as equivalent, only one of them is valid (in the above
  4.6290 +   example, only the first string is valid).
  4.6291 +
  4.6292 +   This specification does not describe how the message-id of an article
  4.6293 +   is determined; it may be deduced from the contents of the article or
  4.6294 +   derived from some external source.  If the server is also conforming
  4.6295 +   to another specification that contains a definition of message-id
  4.6296 +   compatible with this one, the server SHOULD use those message-ids.  A
  4.6297 +   common approach, and one that SHOULD be used for email and Netnews
  4.6298 +   articles, is to extract the message-id from the contents of a header
  4.6299 +   with name "Message-ID".  This may not be as simple as copying the
  4.6300 +   entire header contents; it may be necessary to strip off comments and
  4.6301 +   undo quoting, or to reduce "equivalent" message-ids to a canonical
  4.6302 +   form.
  4.6303 +
  4.6304 +   If an article is obtained through the IHAVE command, there will be a
  4.6305 +   message-id provided with the command.  The server MAY either use it
  4.6306 +   or determine one from the article contents.  However, whichever it
  4.6307 +   does, it SHOULD ensure that, if the IHAVE command is repeated with
  4.6308 +   the same argument and article, it will be recognized as a duplicate.
  4.6309 +
  4.6310 +   If an article does not contain a message-id that the server can
  4.6311 +   identify, it MUST synthesize one.  This could, for example, be a
  4.6312 +   simple sequence number or be based on the date and time when the
  4.6313 +   article arrived.  When email or Netnews articles are handled, a
  4.6314 +   Message-ID header SHOULD be added to ensure global consistency and
  4.6315 +   uniqueness.
  4.6316 +
  4.6317 +   Note that, because the message-id might not have been derived from
  4.6318 +   the Message-ID header in the article, the following example is
  4.6319 +   legitimate (though unusual):
  4.6320 +
  4.6321 +
  4.6322 +
  4.6323 +
  4.6324 +
  4.6325 +
  4.6326 +
  4.6327 +
  4.6328 +Feather                     Standards Track                   [Page 113]
  4.6329 +
  4.6330 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.6331 +
  4.6332 +
  4.6333 +      [C] HEAD <45223423@example.com>
  4.6334 +      [S] 221 0 <45223423@example.com>
  4.6335 +      [S] Path: pathost!demo!whitehouse!not-for-mail
  4.6336 +      [S] Message-ID: <1234@example.net>
  4.6337 +      [S] From: "Demo User" <nobody@example.net>
  4.6338 +      [S] Newsgroups: misc.test
  4.6339 +      [S] Subject: I am just a test article
  4.6340 +      [S] Date: 6 Oct 1998 04:38:40 -0500
  4.6341 +      [S] Organization: An Example Net, Uncertain, Texas
  4.6342 +      [S] .
  4.6343 +
  4.6344 +A.3.  Article Posting
  4.6345 +
  4.6346 +   As far as NNTP is concerned, the POST and IHAVE commands provide the
  4.6347 +   same basic facilities in a slightly different way.  However, they
  4.6348 +   have rather different intentions.
  4.6349 +
  4.6350 +   The IHAVE command is intended for transmitting conforming articles
  4.6351 +   between a system of NNTP servers, with all articles perhaps also
  4.6352 +   conforming to another specification (e.g., all articles are Netnews
  4.6353 +   articles).  It is expected that the client will already have done any
  4.6354 +   necessary validation (or that it has in turn obtained the article
  4.6355 +   from a third party that has done so); therefore, the contents SHOULD
  4.6356 +   be left unchanged.
  4.6357 +
  4.6358 +   In contrast, the POST command is intended for use when an end-user is
  4.6359 +   injecting a newly created article into a such a system.  The article
  4.6360 +   being transferred might not be a conforming email or Netnews article,
  4.6361 +   and the server is expected to validate it and, if necessary, to
  4.6362 +   convert it to the right form for onward distribution.  This is often
  4.6363 +   done by a separate piece of software on the server installation; if
  4.6364 +   so, the NNTP server SHOULD pass the incoming article to that software
  4.6365 +   unaltered, making no attempt to filter characters, to fold or limit
  4.6366 +   lines, or to process the incoming text otherwise.
  4.6367 +
  4.6368 +   The POST command can fail in various ways, and clients should be
  4.6369 +   prepared to re-send an article.  When doing so, however, it is often
  4.6370 +   important to ensure (as far as possible) that the same message-id is
  4.6371 +   allocated to both attempts so that the server, or other servers, can
  4.6372 +   recognize the two articles as duplicates.  In the case of email or
  4.6373 +   Netnews articles, therefore, the posted article SHOULD contain a
  4.6374 +   header with the name "Message-ID", and the contents of this header
  4.6375 +   SHOULD be identical on each attempt.  The server SHOULD ensure that
  4.6376 +   two POSTed articles with the same contents for this header are
  4.6377 +   recognized as identical and that the same message-id is allocated,
  4.6378 +   whether or not those contents are suitable for use as the message-id.
  4.6379 +
  4.6380 +
  4.6381 +
  4.6382 +
  4.6383 +
  4.6384 +Feather                     Standards Track                   [Page 114]
  4.6385 +
  4.6386 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.6387 +
  4.6388 +
  4.6389 +Appendix B.  Summary of Commands
  4.6390 +
  4.6391 +   This section contains a list of every command defined in this
  4.6392 +   document, ordered by command name and by indicating capability.
  4.6393 +
  4.6394 +                         Ordered by command name:
  4.6395 +
  4.6396 +       +-------------------+-----------------------+---------------+
  4.6397 +       | Command           | Indicating capability | Definition    |
  4.6398 +       +-------------------+-----------------------+---------------+
  4.6399 +       | ARTICLE           | READER                | Section 6.2.1 |
  4.6400 +       | BODY              | READER                | Section 6.2.3 |
  4.6401 +       | CAPABILITIES      | mandatory             | Section 5.2   |
  4.6402 +       | DATE              | READER                | Section 7.1   |
  4.6403 +       | GROUP             | READER                | Section 6.1.1 |
  4.6404 +       | HDR               | HDR                   | Section 8.5   |
  4.6405 +       | HEAD              | mandatory             | Section 6.2.2 |
  4.6406 +       | HELP              | mandatory             | Section 7.2   |
  4.6407 +       | IHAVE             | IHAVE                 | Section 6.3.2 |
  4.6408 +       | LAST              | READER                | Section 6.1.3 |
  4.6409 +       | LIST              | LIST                  | Section 7.6.1 |
  4.6410 +       | LIST ACTIVE.TIMES | LIST                  | Section 7.6.4 |
  4.6411 +       | LIST ACTIVE       | LIST                  | Section 7.6.3 |
  4.6412 +       | LIST DISTRIB.PATS | LIST                  | Section 7.6.5 |
  4.6413 +       | LIST HEADERS      | HDR                   | Section 8.6   |
  4.6414 +       | LIST NEWSGROUPS   | LIST                  | Section 7.6.6 |
  4.6415 +       | LIST OVERVIEW.FMT | OVER                  | Section 8.4   |
  4.6416 +       | LISTGROUP         | READER                | Section 6.1.2 |
  4.6417 +       | MODE READER       | MODE-READER           | Section 5.3   |
  4.6418 +       | NEWGROUPS         | READER                | Section 7.3   |
  4.6419 +       | NEWNEWS           | NEWNEWS               | Section 7.4   |
  4.6420 +       | NEXT              | READER                | Section 6.1.4 |
  4.6421 +       | OVER              | OVER                  | Section 8.3   |
  4.6422 +       | POST              | POST                  | Section 6.3.1 |
  4.6423 +       | QUIT              | mandatory             | Section 5.4   |
  4.6424 +       | STAT              | mandatory             | Section 6.2.4 |
  4.6425 +       +-------------------+-----------------------+---------------+
  4.6426 +
  4.6427 +
  4.6428 +
  4.6429 +
  4.6430 +
  4.6431 +
  4.6432 +
  4.6433 +
  4.6434 +
  4.6435 +
  4.6436 +
  4.6437 +
  4.6438 +
  4.6439 +
  4.6440 +Feather                     Standards Track                   [Page 115]
  4.6441 +
  4.6442 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.6443 +
  4.6444 +
  4.6445 +                     Ordered by indicating capability:
  4.6446 +
  4.6447 +       +-------------------+-----------------------+---------------+
  4.6448 +       | Command           | Indicating capability | Definition    |
  4.6449 +       +-------------------+-----------------------+---------------+
  4.6450 +       | CAPABILITIES      | mandatory             | Section 5.2   |
  4.6451 +       | HEAD              | mandatory             | Section 6.2.2 |
  4.6452 +       | HELP              | mandatory             | Section 7.2   |
  4.6453 +       | QUIT              | mandatory             | Section 5.4   |
  4.6454 +       | STAT              | mandatory             | Section 6.2.4 |
  4.6455 +       | HDR               | HDR                   | Section 8.5   |
  4.6456 +       | LIST HEADERS      | HDR                   | Section 8.6   |
  4.6457 +       | IHAVE             | IHAVE                 | Section 6.3.2 |
  4.6458 +       | LIST              | LIST                  | Section 7.6.1 |
  4.6459 +       | LIST ACTIVE       | LIST                  | Section 7.6.3 |
  4.6460 +       | LIST ACTIVE.TIMES | LIST                  | Section 7.6.4 |
  4.6461 +       | LIST DISTRIB.PATS | LIST                  | Section 7.6.5 |
  4.6462 +       | LIST NEWSGROUPS   | LIST                  | Section 7.6.6 |
  4.6463 +       | MODE READER       | MODE-READER           | Section 5.3   |
  4.6464 +       | NEWNEWS           | NEWNEWS               | Section 7.4   |
  4.6465 +       | OVER              | OVER                  | Section 8.3   |
  4.6466 +       | LIST OVERVIEW.FMT | OVER                  | Section 8.4   |
  4.6467 +       | POST              | POST                  | Section 6.3.1 |
  4.6468 +       | ARTICLE           | READER                | Section 6.2.1 |
  4.6469 +       | BODY              | READER                | Section 6.2.3 |
  4.6470 +       | DATE              | READER                | Section 7.1   |
  4.6471 +       | GROUP             | READER                | Section 6.1.1 |
  4.6472 +       | LAST              | READER                | Section 6.1.3 |
  4.6473 +       | LISTGROUP         | READER                | Section 6.1.2 |
  4.6474 +       | NEWGROUPS         | READER                | Section 7.3   |
  4.6475 +       | NEXT              | READER                | Section 6.1.4 |
  4.6476 +       +-------------------+-----------------------+---------------+
  4.6477 +
  4.6478 +
  4.6479 +
  4.6480 +
  4.6481 +
  4.6482 +
  4.6483 +
  4.6484 +
  4.6485 +
  4.6486 +
  4.6487 +
  4.6488 +
  4.6489 +
  4.6490 +
  4.6491 +
  4.6492 +
  4.6493 +
  4.6494 +
  4.6495 +
  4.6496 +Feather                     Standards Track                   [Page 116]
  4.6497 +
  4.6498 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.6499 +
  4.6500 +
  4.6501 +Appendix C.  Summary of Response Codes
  4.6502 +
  4.6503 +   This section contains a list of every response code defined in this
  4.6504 +   document and indicates whether it is multi-line, which commands can
  4.6505 +   generate it, what arguments it has, and what its meaning is.
  4.6506 +
  4.6507 +   Response code 100 (multi-line)
  4.6508 +      Generated by: HELP
  4.6509 +      Meaning: help text follows.
  4.6510 +
  4.6511 +   Response code 101 (multi-line)
  4.6512 +      Generated by: CAPABILITIES
  4.6513 +      Meaning: capabilities list follows.
  4.6514 +
  4.6515 +   Response code 111
  4.6516 +      Generated by: DATE
  4.6517 +      1 argument: yyyymmddhhmmss
  4.6518 +      Meaning: server date and time.
  4.6519 +
  4.6520 +   Response code 200
  4.6521 +      Generated by: initial connection, MODE READER
  4.6522 +      Meaning: service available, posting allowed.
  4.6523 +
  4.6524 +   Response code 201
  4.6525 +      Generated by: initial connection, MODE READER
  4.6526 +      Meaning: service available, posting prohibited.
  4.6527 +
  4.6528 +   Response code 205
  4.6529 +      Generated by: QUIT
  4.6530 +      Meaning: connection closing (the server immediately closes the
  4.6531 +      connection).
  4.6532 +
  4.6533 +   Response code 211
  4.6534 +      The 211 response code has two completely different forms,
  4.6535 +      depending on which command generated it:
  4.6536 +
  4.6537 +         (not multi-line)
  4.6538 +         Generated by: GROUP
  4.6539 +         4 arguments: number low high group
  4.6540 +         Meaning: group selected.
  4.6541 +
  4.6542 +         (multi-line)
  4.6543 +         Generated by: LISTGROUP
  4.6544 +         4 arguments: number low high group
  4.6545 +         Meaning: article numbers follow.
  4.6546 +
  4.6547 +
  4.6548 +
  4.6549 +
  4.6550 +
  4.6551 +
  4.6552 +Feather                     Standards Track                   [Page 117]
  4.6553 +
  4.6554 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.6555 +
  4.6556 +
  4.6557 +   Response code 215 (multi-line)
  4.6558 +      Generated by: LIST
  4.6559 +      Meaning: information follows.
  4.6560 +
  4.6561 +   Response code 220 (multi-line)
  4.6562 +      Generated by: ARTICLE
  4.6563 +      2 arguments: n message-id
  4.6564 +      Meaning: article follows.
  4.6565 +
  4.6566 +   Response code 221 (multi-line)
  4.6567 +      Generated by: HEAD
  4.6568 +      2 arguments: n message-id
  4.6569 +      Meaning: article headers follow.
  4.6570 +
  4.6571 +   Response code 222 (multi-line)
  4.6572 +      Generated by: BODY
  4.6573 +      2 arguments: n message-id
  4.6574 +      Meaning: article body follows.
  4.6575 +
  4.6576 +   Response code 223
  4.6577 +      Generated by: LAST, NEXT, STAT
  4.6578 +      2 arguments: n message-id
  4.6579 +      Meaning: article exists and selected.
  4.6580 +
  4.6581 +   Response code 224 (multi-line)
  4.6582 +      Generated by: OVER
  4.6583 +      Meaning: overview information follows.
  4.6584 +
  4.6585 +   Response code 225 (multi-line)
  4.6586 +      Generated by: HDR
  4.6587 +      Meaning: headers follow.
  4.6588 +
  4.6589 +   Response code 230 (multi-line)
  4.6590 +      Generated by: NEWNEWS
  4.6591 +      Meaning: list of new articles follows.
  4.6592 +
  4.6593 +   Response code 231 (multi-line)
  4.6594 +      Generated by: NEWGROUPS
  4.6595 +      Meaning: list of new newsgroups follows.
  4.6596 +
  4.6597 +   Response code 235
  4.6598 +      Generated by: IHAVE (second stage)
  4.6599 +      Meaning: article transferred OK.
  4.6600 +
  4.6601 +   Response code 240
  4.6602 +      Generated by: POST (second stage)
  4.6603 +      Meaning: article received OK.
  4.6604 +
  4.6605 +
  4.6606 +
  4.6607 +
  4.6608 +Feather                     Standards Track                   [Page 118]
  4.6609 +
  4.6610 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.6611 +
  4.6612 +
  4.6613 +   Response code 335
  4.6614 +      Generated by: IHAVE (first stage)
  4.6615 +      Meaning: send article to be transferred.
  4.6616 +
  4.6617 +   Response code 340
  4.6618 +      Generated by: POST (first stage)
  4.6619 +      Meaning: send article to be posted.
  4.6620 +
  4.6621 +   Response code 400
  4.6622 +      Generic response and generated by initial connection
  4.6623 +      Meaning: service not available or no longer available (the server
  4.6624 +      immediately closes the connection).
  4.6625 +
  4.6626 +   Response code 401
  4.6627 +      Generic response
  4.6628 +      1 argument: capability-label
  4.6629 +      Meaning: the server is in the wrong mode; the indicated capability
  4.6630 +      should be used to change the mode.
  4.6631 +
  4.6632 +   Response code 403
  4.6633 +      Generic response
  4.6634 +      Meaning: internal fault or problem preventing action being taken.
  4.6635 +
  4.6636 +   Response code 411
  4.6637 +      Generated by: GROUP, LISTGROUP
  4.6638 +      Meaning: no such newsgroup.
  4.6639 +
  4.6640 +   Response code 412
  4.6641 +      Generated by: ARTICLE, BODY, GROUP, HDR, HEAD, LAST, LISTGROUP,
  4.6642 +      NEXT, OVER, STAT
  4.6643 +      Meaning: no newsgroup selected.
  4.6644 +
  4.6645 +   Response code 420
  4.6646 +      Generated by: ARTICLE, BODY, HDR, HEAD, LAST, NEXT, OVER, STAT
  4.6647 +      Meaning: current article number is invalid.
  4.6648 +
  4.6649 +   Response code 421
  4.6650 +      Generated by: NEXT
  4.6651 +      Meaning: no next article in this group.
  4.6652 +
  4.6653 +   Response code 422
  4.6654 +      Generated by: LAST
  4.6655 +      Meaning: no previous article in this group.
  4.6656 +
  4.6657 +   Response code 423
  4.6658 +      Generated by: ARTICLE, BODY, HDR, HEAD, OVER, STAT
  4.6659 +      Meaning: no article with that number or in that range.
  4.6660 +
  4.6661 +
  4.6662 +
  4.6663 +
  4.6664 +Feather                     Standards Track                   [Page 119]
  4.6665 +
  4.6666 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.6667 +
  4.6668 +
  4.6669 +   Response code 430
  4.6670 +      Generated by: ARTICLE, BODY, HDR, HEAD, OVER, STAT
  4.6671 +      Meaning: no article with that message-id.
  4.6672 +
  4.6673 +   Response code 435
  4.6674 +      Generated by: IHAVE (first stage)
  4.6675 +      Meaning: article not wanted.
  4.6676 +
  4.6677 +   Response code 436
  4.6678 +      Generated by: IHAVE (either stage)
  4.6679 +      Meaning: transfer not possible (first stage) or failed (second
  4.6680 +      stage); try again later.
  4.6681 +
  4.6682 +   Response code 437
  4.6683 +      Generated by: IHAVE (second stage)
  4.6684 +      Meaning: transfer rejected; do not retry.
  4.6685 +
  4.6686 +   Response code 440
  4.6687 +      Generated by: POST (first stage)
  4.6688 +      Meaning: posting not permitted.
  4.6689 +
  4.6690 +   Response code 441
  4.6691 +      Generated by: POST (second stage)
  4.6692 +      Meaning: posting failed.
  4.6693 +
  4.6694 +   Response code 480
  4.6695 +      Generic response
  4.6696 +      Meaning: command unavailable until the client has authenticated
  4.6697 +      itself.
  4.6698 +
  4.6699 +   Response code 483
  4.6700 +      Generic response
  4.6701 +      Meaning: command unavailable until suitable privacy has been
  4.6702 +      arranged.
  4.6703 +
  4.6704 +   Response code 500
  4.6705 +      Generic response
  4.6706 +      Meaning: unknown command.
  4.6707 +
  4.6708 +   Response code 501
  4.6709 +      Generic response
  4.6710 +      Meaning: syntax error in command.
  4.6711 +
  4.6712 +
  4.6713 +
  4.6714 +
  4.6715 +
  4.6716 +
  4.6717 +
  4.6718 +
  4.6719 +
  4.6720 +Feather                     Standards Track                   [Page 120]
  4.6721 +
  4.6722 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.6723 +
  4.6724 +
  4.6725 +   Response code 502
  4.6726 +      Generic response and generated by initial connection
  4.6727 +
  4.6728 +      Meaning for the initial connection and the MODE READER command:
  4.6729 +      service permanently unavailable (the server immediately closes the
  4.6730 +      connection).
  4.6731 +
  4.6732 +      Meaning for all other commands: command not permitted (and there
  4.6733 +      is no way for the client to change this).
  4.6734 +
  4.6735 +   Response code 503
  4.6736 +      Generic response
  4.6737 +      Meaning: feature not supported.
  4.6738 +
  4.6739 +   Response code 504
  4.6740 +      Generic response
  4.6741 +      Meaning: error in base64-encoding [RFC4648] of an argument.
  4.6742 +
  4.6743 +Appendix D.  Changes from RFC 977
  4.6744 +
  4.6745 +   In general every attempt has been made to ensure that the protocol
  4.6746 +   specification in this document is compatible with the version
  4.6747 +   specified in RFC 977 [RFC977] and the various facilities adopted from
  4.6748 +   RFC 2980 [RFC2980].  However, there have been a number of changes,
  4.6749 +   some compatible and some not.
  4.6750 +
  4.6751 +   This appendix lists these changes.  It is not guaranteed to be
  4.6752 +   exhaustive or correct and MUST NOT be relied on.
  4.6753 +
  4.6754 +   o  A formal syntax specification (Section 9) has been added.
  4.6755 +
  4.6756 +   o  The default character set is changed from US-ASCII [ANSI1986] to
  4.6757 +      UTF-8 [RFC3629] (note that US-ASCII is a subset of UTF-8).  This
  4.6758 +      matter is discussed further in Section 10.
  4.6759 +
  4.6760 +   o  All articles are required to have a message-id, eliminating the
  4.6761 +      "<0>" placeholder used in RFC 977 in some responses.
  4.6762 +
  4.6763 +   o  The newsgroup name matching capabilities already documented in
  4.6764 +      RFC 977 ("wildmats", Section 4) are clarified and extended.  The
  4.6765 +      new facilities (e.g., the use of commas and exclamation marks) are
  4.6766 +      allowed wherever wildmats appear in the protocol.
  4.6767 +
  4.6768 +   o  Support for pipelining of commands (Section 3.5) is made
  4.6769 +      mandatory.
  4.6770 +
  4.6771 +
  4.6772 +
  4.6773 +
  4.6774 +
  4.6775 +
  4.6776 +Feather                     Standards Track                   [Page 121]
  4.6777 +
  4.6778 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.6779 +
  4.6780 +
  4.6781 +   o  The principles behind response codes (Section 3.2) have been
  4.6782 +      tidied up.  In particular:
  4.6783 +
  4.6784 +      *  the x8x response code family, formerly used for private
  4.6785 +         extensions, is now reserved for authentication and privacy
  4.6786 +         extensions;
  4.6787 +
  4.6788 +      *  the x9x response code family, formerly intended for debugging
  4.6789 +         facilities, are now reserved for private extensions;
  4.6790 +
  4.6791 +      *  the 502 and 503 generic response codes (Section 3.2.1) have
  4.6792 +         been redefined;
  4.6793 +
  4.6794 +      *  new 401, 403, 480, 483, and 504 generic response codes have
  4.6795 +         been added.
  4.6796 +
  4.6797 +   o  The rules for article numbering (Section 6) have been clarified
  4.6798 +      (also see Section 6.1.1.2).
  4.6799 +
  4.6800 +   o  The SLAVE command (which was ill-defined) is removed from the
  4.6801 +      protocol.
  4.6802 +
  4.6803 +   o  Four-digit years are permitted in the NEWNEWS (Section 7.4) and
  4.6804 +      NEWGROUPS (Section 7.3) commands (two-digit years are still
  4.6805 +      permitted).  The optional distribution parameter to these commands
  4.6806 +      has been removed.
  4.6807 +
  4.6808 +   o  The LIST command (Section 7.6.1) is greatly extended; the original
  4.6809 +      is available as LIST ACTIVE, while new variants include
  4.6810 +      ACTIVE.TIMES, DISTRIB.PATS, and NEWSGROUPS.  A new "m" status flag
  4.6811 +      is added to the LIST ACTIVE response.
  4.6812 +
  4.6813 +   o  A new CAPABILITIES command (Section 5.2) allows clients to
  4.6814 +      determine what facilities are supported by a server.
  4.6815 +
  4.6816 +   o  The DATE command (Section 7.1) is adopted from RFC 2980
  4.6817 +      effectively unchanged.
  4.6818 +
  4.6819 +   o  The LISTGROUP command (Section 6.1.2) is adopted from RFC 2980.
  4.6820 +      An optional range argument has been added, and the 211 initial
  4.6821 +      response line now has the same format as the 211 response from the
  4.6822 +      GROUP command.
  4.6823 +
  4.6824 +   o  The MODE READER command (Section 5.3) is adopted from RFC 2980 and
  4.6825 +      its meaning and effects clarified.
  4.6826 +
  4.6827 +   o  The XHDR command in RFC 2980 has been formalised as the new HDR
  4.6828 +      (Section 8.5) and LIST HEADERS (Section 8.6) commands.
  4.6829 +
  4.6830 +
  4.6831 +
  4.6832 +Feather                     Standards Track                   [Page 122]
  4.6833 +
  4.6834 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.6835 +
  4.6836 +
  4.6837 +   o  The XOVER command in RFC 2980 has been formalised as the new OVER
  4.6838 +      (Section 8.3) and LIST OVERVIEW.FMT (Section 8.4) commands.  The
  4.6839 +      former can be applied to a message-id as well as to a range.
  4.6840 +
  4.6841 +   o  The concept of article metadata (Section 8.1) has been formalised,
  4.6842 +      allowing the Bytes and Lines pseudo-headers to be deprecated.
  4.6843 +
  4.6844 +   Client authors should note in particular that lack of support for the
  4.6845 +   CAPABILITIES command is a good indication that the server does not
  4.6846 +   support this specification.
  4.6847 +
  4.6848 +
  4.6849 +
  4.6850 +
  4.6851 +
  4.6852 +
  4.6853 +
  4.6854 +
  4.6855 +
  4.6856 +
  4.6857 +
  4.6858 +
  4.6859 +
  4.6860 +
  4.6861 +
  4.6862 +
  4.6863 +
  4.6864 +
  4.6865 +
  4.6866 +
  4.6867 +
  4.6868 +
  4.6869 +
  4.6870 +
  4.6871 +
  4.6872 +
  4.6873 +
  4.6874 +
  4.6875 +
  4.6876 +
  4.6877 +
  4.6878 +
  4.6879 +
  4.6880 +
  4.6881 +
  4.6882 +
  4.6883 +
  4.6884 +
  4.6885 +
  4.6886 +
  4.6887 +
  4.6888 +Feather                     Standards Track                   [Page 123]
  4.6889 +
  4.6890 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.6891 +
  4.6892 +
  4.6893 +Author's Address
  4.6894 +
  4.6895 +   Clive D.W. Feather
  4.6896 +   THUS plc
  4.6897 +   322 Regents Park Road
  4.6898 +   London
  4.6899 +   N3  2QQ
  4.6900 +   United Kingdom
  4.6901 +
  4.6902 +   Phone: +44 20 8495 6138
  4.6903 +   Fax:   +44 870 051 9937
  4.6904 +   EMail: clive@demon.net
  4.6905 +   URI:   http://www.davros.org/
  4.6906 +
  4.6907 +
  4.6908 +
  4.6909 +
  4.6910 +
  4.6911 +
  4.6912 +
  4.6913 +
  4.6914 +
  4.6915 +
  4.6916 +
  4.6917 +
  4.6918 +
  4.6919 +
  4.6920 +
  4.6921 +
  4.6922 +
  4.6923 +
  4.6924 +
  4.6925 +
  4.6926 +
  4.6927 +
  4.6928 +
  4.6929 +
  4.6930 +
  4.6931 +
  4.6932 +
  4.6933 +
  4.6934 +
  4.6935 +
  4.6936 +
  4.6937 +
  4.6938 +
  4.6939 +
  4.6940 +
  4.6941 +
  4.6942 +
  4.6943 +
  4.6944 +Feather                     Standards Track                   [Page 124]
  4.6945 +
  4.6946 +RFC 3977         Network News Transfer Protocol (NNTP)      October 2006
  4.6947 +
  4.6948 +
  4.6949 +Full Copyright Statement
  4.6950 +
  4.6951 +Copyright (C) The Internet Society (2006).
  4.6952 +
  4.6953 +   This document is subject to the rights, licenses and restrictions
  4.6954 +   contained in BCP 78, and except as set forth therein, the authors
  4.6955 +   retain all their rights.
  4.6956 +
  4.6957 +   This document and the information contained herein are provided on an
  4.6958 +   "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
  4.6959 +   OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
  4.6960 +   ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED,
  4.6961 +   INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
  4.6962 +   INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
  4.6963 +   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  4.6964 +
  4.6965 +Intellectual Property
  4.6966 +
  4.6967 +   The IETF takes no position regarding the validity or scope of any
  4.6968 +   Intellectual Property Rights or other rights that might be claimed to
  4.6969 +   pertain to the implementation or use of the technology described in
  4.6970 +   this document or the extent to which any license under such rights
  4.6971 +   might or might not be available; nor does it represent that it has
  4.6972 +   made any independent effort to identify any such rights.  Information
  4.6973 +   on the procedures with respect to rights in RFC documents can be
  4.6974 +   found in BCP 78 and BCP 79.
  4.6975 +
  4.6976 +   Copies of IPR disclosures made to the IETF Secretariat and any
  4.6977 +   assurances of licenses to be made available, or the result of an
  4.6978 +   attempt made to obtain a general license or permission for the use of
  4.6979 +   such proprietary rights by implementers or users of this
  4.6980 +   specification can be obtained from the IETF on-line IPR repository at
  4.6981 +   http://www.ietf.org/ipr.
  4.6982 +
  4.6983 +   The IETF invites any interested party to bring to its attention any
  4.6984 +   copyrights, patents or patent applications, or other proprietary
  4.6985 +   rights that may cover technology that may be required to implement
  4.6986 +   this standard.  Please address the information to the IETF at ietf-
  4.6987 +   ipr@ietf.org.
  4.6988 +
  4.6989 +Acknowledgement
  4.6990 +
  4.6991 +   Funding for the RFC Editor function is provided by the IETF
  4.6992 +   Administrative Support Activity (IASA).
  4.6993 +
  4.6994 +
  4.6995 +
  4.6996 +
  4.6997 +
  4.6998 +
  4.6999 +
  4.7000 +Feather                     Standards Track                   [Page 125]
  4.7001 +
     5.1 Binary file doc/RFC3977.pdf has changed
     6.1 --- a/src/org/sonews/mlgw/Dispatcher.java	Sun Aug 29 17:28:58 2010 +0200
     6.2 +++ b/src/org/sonews/mlgw/Dispatcher.java	Sun Aug 29 17:43:58 2010 +0200
     6.3 @@ -143,6 +143,11 @@
     6.4     */
     6.5    public static boolean toGroup(final Message msg)
     6.6    {
     6.7 +    if(msg == null)
     6.8 +	{
     6.9 +      throw new IllegalArgumentException("Argument 'msg' must not be null!");
    6.10 +    }
    6.11 +
    6.12      try
    6.13      {
    6.14        // Create new Article object
    6.15 @@ -159,14 +164,17 @@
    6.16        {
    6.17          // Check for duplicate entries of the same group
    6.18          Article oldArticle = StorageManager.current().getArticle(article.getMessageID());
    6.19 -        List<Group> oldGroups = oldArticle.getGroups();
    6.20 -        for(Group oldGroup : oldGroups)
    6.21 -        {
    6.22 -          if(!newsgroups.contains(oldGroup.getName()))
    6.23 +        if(oldArticle != null)
    6.24 +		{
    6.25 +          List<Group> oldGroups = oldArticle.getGroups();
    6.26 +          for(Group oldGroup : oldGroups)
    6.27            {
    6.28 -            oldgroups.add(oldGroup.getName());
    6.29 +            if(!newsgroups.contains(oldGroup.getName()))
    6.30 +            {
    6.31 +              oldgroups.add(oldGroup.getName());
    6.32 +            }
    6.33            }
    6.34 -        }
    6.35 +		}
    6.36        }
    6.37  
    6.38        if(newsgroups.size() > 0)
     7.1 --- a/src/org/sonews/util/Purger.java	Sun Aug 29 17:28:58 2010 +0200
     7.2 +++ b/src/org/sonews/util/Purger.java	Sun Aug 29 17:43:58 2010 +0200
     7.3 @@ -18,12 +18,12 @@
     7.4  
     7.5  package org.sonews.util;
     7.6  
     7.7 +import java.util.Date;
     7.8 +import java.util.List;
     7.9  import org.sonews.daemon.AbstractDaemon;
    7.10  import org.sonews.config.Config;
    7.11  import org.sonews.storage.Article;
    7.12  import org.sonews.storage.Headers;
    7.13 -import java.util.Date;
    7.14 -import java.util.List;
    7.15  import org.sonews.storage.Channel;
    7.16  import org.sonews.storage.Group;
    7.17  import org.sonews.storage.StorageBackendException;