Network Working Group                                         C. Feather
Request for Comments: 3977                                      THUS plc
Obsoletes: 977                                              October 2006
Updates: 2980
Category: Standards Track
        
Network Working Group                                         C. Feather
Request for Comments: 3977                                      THUS plc
Obsoletes: 977                                              October 2006
Updates: 2980
Category: Standards Track
        

Network News Transfer Protocol (NNTP)

网络新闻传输协议(NNTP)

Status of This Memo

关于下段备忘

This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for improvements. Please refer to the current edition of the "Internet Official Protocol Standards" (STD 1) for the standardization state and status of this protocol. Distribution of this memo is unlimited.

本文件规定了互联网社区的互联网标准跟踪协议,并要求进行讨论和提出改进建议。有关本协议的标准化状态和状态,请参考当前版本的“互联网官方协议标准”(STD 1)。本备忘录的分发不受限制。

Copyright Notice

版权公告

Copyright (C) The Internet Society (2006).

版权所有(C)互联网协会(2006年)。

Abstract

摘要

The Network News Transfer Protocol (NNTP) has been in use in the Internet for a decade, and remains one of the most popular protocols (by volume) in use today. This document is a replacement for RFC 977, and officially updates the protocol specification. It clarifies some vagueness in RFC 977, includes some new base functionality, and provides a specific mechanism to add standardized extensions to NNTP.

网络新闻传输协议(NNTP)已经在互联网上使用了十年,并且仍然是当今使用的最流行的协议之一(按数量)。本文件取代了RFC 977,并正式更新了协议规范。它澄清了RFC977中的一些模糊之处,包括一些新的基本功能,并提供了一种特定的机制来向NNTP添加标准化扩展。

Table of Contents

目录

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .  3
     1.1.  Author's Note . . . . . . . . . . . . . . . . . . . . . .  4
   2.  Notation  . . . . . . . . . . . . . . . . . . . . . . . . . .  5
   3.  Basic Concepts  . . . . . . . . . . . . . . . . . . . . . . .  6
     3.1.  Commands and Responses  . . . . . . . . . . . . . . . . .  6
       3.1.1.  Multi-line Data Blocks . . . . . . . . . . . . . . . . 8
     3.2.  Response Codes  . . . . . . . . . . . . . . . . . . . . .  9
       3.2.1.  Generic Response Codes  . . . . . . . . . . . . . . . 10
         3.2.1.1.  Examples  . . . . . . . . . . . . . . . . . . . . 12
     3.3.  Capabilities and Extensions . . . . . . . . . . . . . . . 14
       3.3.1.  Capability Descriptions . . . . . . . . . . . . . . . 14
       3.3.2.  Standard Capabilities . . . . . . . . . . . . . . . . 15
       3.3.3.  Extensions  . . . . . . . . . . . . . . . . . . . . . 16
       3.3.4.  Initial IANA Register . . . . . . . . . . . . . . . . 18
     3.4.  Mandatory and Optional Commands . . . . . . . . . . . . . 20
        
   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .  3
     1.1.  Author's Note . . . . . . . . . . . . . . . . . . . . . .  4
   2.  Notation  . . . . . . . . . . . . . . . . . . . . . . . . . .  5
   3.  Basic Concepts  . . . . . . . . . . . . . . . . . . . . . . .  6
     3.1.  Commands and Responses  . . . . . . . . . . . . . . . . .  6
       3.1.1.  Multi-line Data Blocks . . . . . . . . . . . . . . . . 8
     3.2.  Response Codes  . . . . . . . . . . . . . . . . . . . . .  9
       3.2.1.  Generic Response Codes  . . . . . . . . . . . . . . . 10
         3.2.1.1.  Examples  . . . . . . . . . . . . . . . . . . . . 12
     3.3.  Capabilities and Extensions . . . . . . . . . . . . . . . 14
       3.3.1.  Capability Descriptions . . . . . . . . . . . . . . . 14
       3.3.2.  Standard Capabilities . . . . . . . . . . . . . . . . 15
       3.3.3.  Extensions  . . . . . . . . . . . . . . . . . . . . . 16
       3.3.4.  Initial IANA Register . . . . . . . . . . . . . . . . 18
     3.4.  Mandatory and Optional Commands . . . . . . . . . . . . . 20
        
       3.4.1.  Reading and Transit Servers . . . . . . . . . . . . . 21
       3.4.2.  Mode Switching  . . . . . . . . . . . . . . . . . . . 21
     3.5.  Pipelining  . . . . . . . . . . . . . . . . . . . . . . . 22
       3.5.1.  Examples  . . . . . . . . . . . . . . . . . . . . . . 23
     3.6.  Articles  . . . . . . . . . . . . . . . . . . . . . . . . 24
   4.  The WILDMAT Format  . . . . . . . . . . . . . . . . . . . . . 25
     4.1.  Wildmat Syntax  . . . . . . . . . . . . . . . . . . . . . 26
     4.2.  Wildmat Semantics . . . . . . . . . . . . . . . . . . . . 26
     4.3.  Extensions  . . . . . . . . . . . . . . . . . . . . . . . 27
     4.4.  Examples  . . . . . . . . . . . . . . . . . . . . . . . . 27
   5.  Session Administration Commands . . . . . . . . . . . . . . . 28
     5.1.  Initial Connection  . . . . . . . . . . . . . . . . . . . 28
     5.2.  CAPABILITIES  . . . . . . . . . . . . . . . . . . . . . . 29
     5.3.  MODE READER . . . . . . . . . . . . . . . . . . . . . . . 32
     5.4.  QUIT  . . . . . . . . . . . . . . . . . . . . . . . . . . 34
   6.  Article Posting and Retrieval . . . . . . . . . . . . . . . . 35
     6.1.  Group and Article Selection . . . . . . . . . . . . . . . 36
       6.1.1.  GROUP . . . . . . . . . . . . . . . . . . . . . . . . 36
       6.1.2.  LISTGROUP . . . . . . . . . . . . . . . . . . . . . . 39
       6.1.3.  LAST  . . . . . . . . . . . . . . . . . . . . . . . . 42
       6.1.4.  NEXT  . . . . . . . . . . . . . . . . . . . . . . . . 44
     6.2.  Retrieval of Articles and Article Sections  . . . . . . . 45
       6.2.1.  ARTICLE . . . . . . . . . . . . . . . . . . . . . . . 46
       6.2.2.  HEAD  . . . . . . . . . . . . . . . . . . . . . . . . 49
       6.2.3.  BODY  . . . . . . . . . . . . . . . . . . . . . . . . 51
       6.2.4.  STAT  . . . . . . . . . . . . . . . . . . . . . . . . 53
     6.3.  Article Posting . . . . . . . . . . . . . . . . . . . . . 56
       6.3.1.  POST  . . . . . . . . . . . . . . . . . . . . . . . . 56
       6.3.2.  IHAVE . . . . . . . . . . . . . . . . . . . . . . . . 58
   7.  Information Commands  . . . . . . . . . . . . . . . . . . . . 61
     7.1.  DATE  . . . . . . . . . . . . . . . . . . . . . . . . . . 61
     7.2.  HELP  . . . . . . . . . . . . . . . . . . . . . . . . . . 62
     7.3.  NEWGROUPS . . . . . . . . . . . . . . . . . . . . . . . . 63
     7.4.  NEWNEWS . . . . . . . . . . . . . . . . . . . . . . . . . 64
     7.5.  Time  . . . . . . . . . . . . . . . . . . . . . . . . . . 65
       7.5.1.  Examples  . . . . . . . . . . . . . . . . . . . . . . 66
     7.6.  The LIST Commands . . . . . . . . . . . . . . . . . . . . 66
       7.6.1.  LIST  . . . . . . . . . . . . . . . . . . . . . . . . 67
       7.6.2.  Standard LIST Keywords  . . . . . . . . . . . . . . . 69
       7.6.3.  LIST ACTIVE . . . . . . . . . . . . . . . . . . . . . 70
       7.6.4.  LIST ACTIVE.TIMES . . . . . . . . . . . . . . . . . . 71
       7.6.5.  LIST DISTRIB.PATS . . . . . . . . . . . . . . . . . . 72
       7.6.6.  LIST NEWSGROUPS . . . . . . . . . . . . . . . . . . . 73
   8.  Article Field Access Commands . . . . . . . . . . . . . . . . 73
     8.1.  Article Metadata  . . . . . . . . . . . . . . . . . . . . 74
       8.1.1.  The :bytes Metadata Item  . . . . . . . . . . . . . . 74
       8.1.2.  The :lines Metadata Item  . . . . . . . . . . . . . . 75
     8.2.  Database Consistency  . . . . . . . . . . . . . . . . . . 75
        
       3.4.1.  Reading and Transit Servers . . . . . . . . . . . . . 21
       3.4.2.  Mode Switching  . . . . . . . . . . . . . . . . . . . 21
     3.5.  Pipelining  . . . . . . . . . . . . . . . . . . . . . . . 22
       3.5.1.  Examples  . . . . . . . . . . . . . . . . . . . . . . 23
     3.6.  Articles  . . . . . . . . . . . . . . . . . . . . . . . . 24
   4.  The WILDMAT Format  . . . . . . . . . . . . . . . . . . . . . 25
     4.1.  Wildmat Syntax  . . . . . . . . . . . . . . . . . . . . . 26
     4.2.  Wildmat Semantics . . . . . . . . . . . . . . . . . . . . 26
     4.3.  Extensions  . . . . . . . . . . . . . . . . . . . . . . . 27
     4.4.  Examples  . . . . . . . . . . . . . . . . . . . . . . . . 27
   5.  Session Administration Commands . . . . . . . . . . . . . . . 28
     5.1.  Initial Connection  . . . . . . . . . . . . . . . . . . . 28
     5.2.  CAPABILITIES  . . . . . . . . . . . . . . . . . . . . . . 29
     5.3.  MODE READER . . . . . . . . . . . . . . . . . . . . . . . 32
     5.4.  QUIT  . . . . . . . . . . . . . . . . . . . . . . . . . . 34
   6.  Article Posting and Retrieval . . . . . . . . . . . . . . . . 35
     6.1.  Group and Article Selection . . . . . . . . . . . . . . . 36
       6.1.1.  GROUP . . . . . . . . . . . . . . . . . . . . . . . . 36
       6.1.2.  LISTGROUP . . . . . . . . . . . . . . . . . . . . . . 39
       6.1.3.  LAST  . . . . . . . . . . . . . . . . . . . . . . . . 42
       6.1.4.  NEXT  . . . . . . . . . . . . . . . . . . . . . . . . 44
     6.2.  Retrieval of Articles and Article Sections  . . . . . . . 45
       6.2.1.  ARTICLE . . . . . . . . . . . . . . . . . . . . . . . 46
       6.2.2.  HEAD  . . . . . . . . . . . . . . . . . . . . . . . . 49
       6.2.3.  BODY  . . . . . . . . . . . . . . . . . . . . . . . . 51
       6.2.4.  STAT  . . . . . . . . . . . . . . . . . . . . . . . . 53
     6.3.  Article Posting . . . . . . . . . . . . . . . . . . . . . 56
       6.3.1.  POST  . . . . . . . . . . . . . . . . . . . . . . . . 56
       6.3.2.  IHAVE . . . . . . . . . . . . . . . . . . . . . . . . 58
   7.  Information Commands  . . . . . . . . . . . . . . . . . . . . 61
     7.1.  DATE  . . . . . . . . . . . . . . . . . . . . . . . . . . 61
     7.2.  HELP  . . . . . . . . . . . . . . . . . . . . . . . . . . 62
     7.3.  NEWGROUPS . . . . . . . . . . . . . . . . . . . . . . . . 63
     7.4.  NEWNEWS . . . . . . . . . . . . . . . . . . . . . . . . . 64
     7.5.  Time  . . . . . . . . . . . . . . . . . . . . . . . . . . 65
       7.5.1.  Examples  . . . . . . . . . . . . . . . . . . . . . . 66
     7.6.  The LIST Commands . . . . . . . . . . . . . . . . . . . . 66
       7.6.1.  LIST  . . . . . . . . . . . . . . . . . . . . . . . . 67
       7.6.2.  Standard LIST Keywords  . . . . . . . . . . . . . . . 69
       7.6.3.  LIST ACTIVE . . . . . . . . . . . . . . . . . . . . . 70
       7.6.4.  LIST ACTIVE.TIMES . . . . . . . . . . . . . . . . . . 71
       7.6.5.  LIST DISTRIB.PATS . . . . . . . . . . . . . . . . . . 72
       7.6.6.  LIST NEWSGROUPS . . . . . . . . . . . . . . . . . . . 73
   8.  Article Field Access Commands . . . . . . . . . . . . . . . . 73
     8.1.  Article Metadata  . . . . . . . . . . . . . . . . . . . . 74
       8.1.1.  The :bytes Metadata Item  . . . . . . . . . . . . . . 74
       8.1.2.  The :lines Metadata Item  . . . . . . . . . . . . . . 75
     8.2.  Database Consistency  . . . . . . . . . . . . . . . . . . 75
        
     8.3.  OVER  . . . . . . . . . . . . . . . . . . . . . . . . . . 76
     8.4.  LIST OVERVIEW.FMT . . . . . . . . . . . . . . . . . . . . 81
     8.5.  HDR . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
     8.6.  LIST HEADERS  . . . . . . . . . . . . . . . . . . . . . . 87
   9.  Augmented BNF Syntax for NNTP . . . . . . . . . . . . . . . . 90
     9.1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . 90
     9.2.  Commands  . . . . . . . . . . . . . . . . . . . . . . . . 92
     9.3.  Command Continuation  . . . . . . . . . . . . . . . . . . 93
     9.4.  Responses . . . . . . . . . . . . . . . . . . . . . . . . 93
       9.4.1.  Generic Responses . . . . . . . . . . . . . . . . . . 93
       9.4.2.  Initial Response Line Contents  . . . . . . . . . . . 94
       9.4.3.  Multi-line Response Contents  . . . . . . . . . . . . 94
     9.5.  Capability Lines  . . . . . . . . . . . . . . . . . . . . 95
     9.6.  LIST Variants . . . . . . . . . . . . . . . . . . . . . . 96
     9.7.  Articles  . . . . . . . . . . . . . . . . . . . . . . . . 97
     9.8.  General Non-terminals . . . . . . . . . . . . . . . . . . 97
     9.9.  Extensions and Validation . . . . . . . . . . . . . . . . 99
   10. Internationalisation Considerations . . . . . . . . . . . . .100
     10.1. Introduction and Historical Situation . . . . . . . . . .100
     10.2. This Specification  . . . . . . . . . . . . . . . . . . .101
     10.3. Outstanding Issues  . . . . . . . . . . . . . . . . . . .102
   11. IANA Considerations . . . . . . . . . . . . . . . . . . . . .103
   12. Security Considerations . . . . . . . . . . . . . . . . . . .103
     12.1. Personal and Proprietary Information  . . . . . . . . . .104
     12.2. Abuse of Server Log Information . . . . . . . . . . . . .104
     12.3. Weak Authentication and Access Control  . . . . . . . . .104
     12.4. DNS Spoofing  . . . . . . . . . . . . . . . . . . . . . .104
     12.5. UTF-8 Issues  . . . . . . . . . . . . . . . . . . . . . .105
     12.6. Caching of Capability Lists . . . . . . . . . . . . . . .106
   13. Acknowledgements  . . . . . . . . . . . . . . . . . . . . . .107
   14. References  . . . . . . . . . . . . . . . . . . . . . . . . .110
     14.1. Normative References  . . . . . . . . . . . . . . . . . .110
     14.2. Informative References  . . . . . . . . . . . . . . . . .110
   A.  Interaction with Other Specifications . . . . . . . . . . . .112
     A.1.  Header Folding  . . . . . . . . . . . . . . . . . . . . .112
     A.2.  Message-IDs . . . . . . . . . . . . . . . . . . . . . . .112
     A.3.  Article Posting . . . . . . . . . . . . . . . . . . . . .114
   B.  Summary of Commands . . . . . . . . . . . . . . . . . . . . .115
   C.  Summary of Response Codes . . . . . . . . . . . . . . . . . .117
   D.  Changes from RFC 977  . . . . . . . . . . . . . . . . . . . .121
        
     8.3.  OVER  . . . . . . . . . . . . . . . . . . . . . . . . . . 76
     8.4.  LIST OVERVIEW.FMT . . . . . . . . . . . . . . . . . . . . 81
     8.5.  HDR . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
     8.6.  LIST HEADERS  . . . . . . . . . . . . . . . . . . . . . . 87
   9.  Augmented BNF Syntax for NNTP . . . . . . . . . . . . . . . . 90
     9.1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . 90
     9.2.  Commands  . . . . . . . . . . . . . . . . . . . . . . . . 92
     9.3.  Command Continuation  . . . . . . . . . . . . . . . . . . 93
     9.4.  Responses . . . . . . . . . . . . . . . . . . . . . . . . 93
       9.4.1.  Generic Responses . . . . . . . . . . . . . . . . . . 93
       9.4.2.  Initial Response Line Contents  . . . . . . . . . . . 94
       9.4.3.  Multi-line Response Contents  . . . . . . . . . . . . 94
     9.5.  Capability Lines  . . . . . . . . . . . . . . . . . . . . 95
     9.6.  LIST Variants . . . . . . . . . . . . . . . . . . . . . . 96
     9.7.  Articles  . . . . . . . . . . . . . . . . . . . . . . . . 97
     9.8.  General Non-terminals . . . . . . . . . . . . . . . . . . 97
     9.9.  Extensions and Validation . . . . . . . . . . . . . . . . 99
   10. Internationalisation Considerations . . . . . . . . . . . . .100
     10.1. Introduction and Historical Situation . . . . . . . . . .100
     10.2. This Specification  . . . . . . . . . . . . . . . . . . .101
     10.3. Outstanding Issues  . . . . . . . . . . . . . . . . . . .102
   11. IANA Considerations . . . . . . . . . . . . . . . . . . . . .103
   12. Security Considerations . . . . . . . . . . . . . . . . . . .103
     12.1. Personal and Proprietary Information  . . . . . . . . . .104
     12.2. Abuse of Server Log Information . . . . . . . . . . . . .104
     12.3. Weak Authentication and Access Control  . . . . . . . . .104
     12.4. DNS Spoofing  . . . . . . . . . . . . . . . . . . . . . .104
     12.5. UTF-8 Issues  . . . . . . . . . . . . . . . . . . . . . .105
     12.6. Caching of Capability Lists . . . . . . . . . . . . . . .106
   13. Acknowledgements  . . . . . . . . . . . . . . . . . . . . . .107
   14. References  . . . . . . . . . . . . . . . . . . . . . . . . .110
     14.1. Normative References  . . . . . . . . . . . . . . . . . .110
     14.2. Informative References  . . . . . . . . . . . . . . . . .110
   A.  Interaction with Other Specifications . . . . . . . . . . . .112
     A.1.  Header Folding  . . . . . . . . . . . . . . . . . . . . .112
     A.2.  Message-IDs . . . . . . . . . . . . . . . . . . . . . . .112
     A.3.  Article Posting . . . . . . . . . . . . . . . . . . . . .114
   B.  Summary of Commands . . . . . . . . . . . . . . . . . . . . .115
   C.  Summary of Response Codes . . . . . . . . . . . . . . . . . .117
   D.  Changes from RFC 977  . . . . . . . . . . . . . . . . . . . .121
        
1. Introduction
1. 介绍

This document specifies the Network News Transfer Protocol (NNTP), which is used for the distribution, inquiry, retrieval, and posting of Netnews articles using a reliable stream-based mechanism. For news-reading clients, NNTP enables retrieval of news articles that

本文档规定了网络新闻传输协议(NNTP),该协议用于使用可靠的基于流的机制分发、查询、检索和发布网络新闻文章。对于新闻阅读客户端,NNTP支持检索

are stored in a central database, giving subscribers the ability to select only those articles they wish to read.

存储在中央数据库中,使订阅者能够仅选择他们希望阅读的文章。

The Netnews model provides for indexing, cross-referencing, and expiration of aged messages. NNTP is designed for efficient transmission of Netnews articles over a reliable full duplex communication channel.

Netnews模型提供索引、交叉引用和过期消息。NNTP旨在通过可靠的全双工通信信道高效传输Netnews文章。

Although the protocol specification in this document is largely compatible with the version specified in RFC 977 [RFC977], a number of changes are summarised in Appendix D. In particular:

尽管本文件中的协议规范在很大程度上与RFC 977[RFC977]中规定的版本兼容,但附录D中总结了一些变更。特别是:

o the default character set is changed from US-ASCII [ANSI1986] to UTF-8 [RFC3629] (note that US-ASCII is a subset of UTF-8);

o 默认字符集从US-ASCII[ANSI1986]更改为UTF-8[RFC3629](注意US-ASCII是UTF-8的子集);

o a number of commands that were optional in RFC 977 or that have been taken from RFC 2980 [RFC2980] are now mandatory; and

o RFC 977中可选的或从RFC 2980[RFC2980]获取的许多命令现在是强制性的;和

o a CAPABILITIES command has been added to allow clients to determine what functionality is available from a server.

o 添加了一个CAPABILITIES命令,以允许客户端确定服务器提供的功能。

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119].

本文件中的关键词“必须”、“不得”、“要求”、“应”、“不应”、“应”、“不应”、“建议”、“可”和“可选”应按照RFC 2119[RFC2119]中所述进行解释。

An implementation is not compliant if it fails to satisfy one or more of the MUST requirements for this protocol. An implementation that satisfies all the MUST and all the SHOULD requirements for its protocols is said to be "unconditionally compliant"; one that satisfies all the MUST requirements but not all the SHOULD requirements for NNTP is said to be "conditionally compliant".

如果实现未能满足此协议的一个或多个必需要求,则该实现是不兼容的。满足其协议所有必须和应该要求的实现称为“无条件兼容”;满足NNTP所有必须要求但并非所有应该要求的被称为“有条件符合”。

For the remainder of this document, the terms "client" and "client host" refer to a host making use of the NNTP service, while the terms "server" and "server host" refer to a host that offers the NNTP service.

对于本文档的其余部分,术语“客户端”和“客户端主机”指使用NNTP服务的主机,而术语“服务器”和“服务器主机”指提供NNTP服务的主机。

1.1. Author's Note
1.1. 作者说明

This document is written in XML using an NNTP-specific DTD. Custom software is used to convert this to RFC 2629 [RFC2629] format, and then the public "xml2rfc" package to further reduce this to text, nroff source, and HTML.

本文档使用NNTP特定的DTD以XML编写。使用自定义软件将其转换为RFC 2629[RFC2629]格式,然后使用公共“xml2rfc”包将其进一步简化为文本、nroff源代码和HTML。

No perl was used in producing this document.

生成此文档时未使用perl。

2. Notation
2. 符号

The following notational conventions are used in this document.

本文件中使用了以下符号约定。

UPPERCASE indicates literal text to be included in the command.

大写表示要包含在命令中的文本。

lowercase indicates a token described elsewhere.

小写表示别处描述的标记。

[brackets] indicate that the enclosed material is optional.

[括号]表示所附材料为可选材料。

elliptical indicates that the argument may be repeated any ... marks number of times (it must occur at least once).

椭圆表示该参数可以在任何。。。标记次数(必须至少出现一次)。

vertical|bar indicates a choice of two mutually exclusive arguments (exactly one must be provided).

垂直|条表示两个互斥参数的选择(必须提供一个)。

The name "message-id" for a command or response argument indicates that it is the message-id of an article as described in Section 3.6, including the angle brackets.

命令或响应参数的名称“message id”表示它是第3.6节所述的物品的message id,包括尖括号。

The name "wildmat" for an argument indicates that it is a wildmat as defined in Section 4. If the argument does not meet the requirements of that section (for example, if it does not fit the grammar of Section 4.1), the NNTP server MAY place some interpretation on it (not specified by this document) or otherwise MUST treat it as a syntax error.

参数的名称“wildmat”表示它是第4节中定义的wildmat。如果参数不符合该节的要求(例如,如果它不符合第4.1节的语法),NNTP服务器可能会对其进行一些解释(本文档未指定),或者必须将其视为语法错误。

Responses for each command will be described in tables listing the required format of a response followed by the meaning that should be ascribed to that response.

每个命令的响应将在表中描述,表中列出了响应所需的格式,后跟该响应的含义。

The terms "NUL", "TAB", "LF", "CR, and "space" refer to the octets %x00, %x09, %x0A, %x0D, and %x20, respectively (that is, the octets with those codes in US-ASCII [ANSI1986] and thus in UTF-8 [RFC3629]). The term "CRLF" or "CRLF pair" means the sequence CR immediately followed by LF (that is, %x0D.0A). A "printable US-ASCII character" is an octet in the range %x21-7E. Quoted characters refer to the octets with those codes in US-ASCII (so "." and "<" refer to %x2E and %x3C) and will always be printable US-ASCII characters; similarly, "digit" refers to the octets %x30-39.

术语“NUL”、“TAB”、“LF”、“CR”和“space”分别指八位字节%x00、%x09、%x0A、%x0D和%x20(即,具有US-ASCII[ANSI1986]和UTF-8[RFC3629]中代码的八位字节)。术语“CRLF”或“CRLF对”表示紧跟LF的序列CR(即,%x0D.0A)。可打印的US-ASCII字符“是范围为%x21-7E的八位字节。带引号的字符是指带有US-ASCII代码的八位字节(因此“.”和“<”是指%x2E和%x3C),并且始终是可打印的US-ASCII字符;同样,“数字”指的是八位字节%x30-39。

A "keyword" MUST consist only of US-ASCII letters, digits, and the characters dot (".") and dash ("-") and MUST begin with a letter. Keywords MUST be at least three characters in length.

“关键字”必须仅由US-ASCII字母、数字和字符点(“.”)和破折号(“-”)组成,并且必须以字母开头。关键字的长度必须至少为三个字符。

Examples in this document are not normative but serve to illustrate usages, arguments, and responses. In the examples, a "[C]" will be used to represent the client host and an "[S]" will be used to represent the server host. Most of the examples do not rely on a particular server state. In some cases, however, they do assume that the currently selected newsgroup (see the GROUP command, Section 6.1.1) is invalid; when so, this is indicated at the start of the example. Examples may use commands or other keywords not defined in this specification (such as an XENCRYPT command). These will be used to illustrate some point and do not imply that any such command is defined elsewhere or needs to exist in any particular implementation.

本文件中的示例不是规范性的,但用于说明用法、论点和响应。在示例中,将使用“[C]”表示客户机主机,使用“[S]”表示服务器主机。大多数示例并不依赖于特定的服务器状态。但是,在某些情况下,他们确实假设当前选择的新闻组(请参阅GROUP命令,第6.1.1节)无效;如果是这样,则在示例的开头指出这一点。示例可能使用本规范中未定义的命令或其他关键字(例如XENCRYPT命令)。这些将用于说明某些要点,并不意味着任何此类命令在其他地方定义或需要存在于任何特定实现中。

Terms that might be read as specifying details of a client or server implementation, such as "database", are used simply to ease description. Provided that implementations conform to the protocol and format specifications in this document, no specific technique is mandated.

可以理解为指定客户机或服务器实现细节的术语,如“数据库”,仅用于简化描述。如果实现符合本文档中的协议和格式规范,则不强制使用特定技术。

3. Basic Concepts
3. 基本概念
3.1. Commands and Responses
3.1. 命令和响应

NNTP operates over any reliable bi-directional 8-bit-wide data stream channel. When the connection is established, the NNTP server host MUST send a greeting. The client host and server host then exchange commands and responses (respectively) until the connection is closed or aborted. If the connection used is TCP, then the server host starts the NNTP service by listening on a TCP port. When a client host wishes to make use of the service, it MUST establish a TCP connection with the server host by connecting to that host on the same port on which the server is listening.

NNTP在任何可靠的双向8位宽数据流信道上运行。建立连接后,NNTP服务器主机必须发送问候语。然后,客户端主机和服务器主机(分别)交换命令和响应,直到连接关闭或中止。如果使用的连接是TCP,则服务器主机通过侦听TCP端口来启动NNTP服务。当客户机主机希望使用该服务时,它必须通过在服务器正在侦听的同一端口上连接到该主机来与服务器主机建立TCP连接。

The character set for all NNTP commands is UTF-8 [RFC3629]. Commands in NNTP MUST consist of a keyword, which MAY be followed by one or more arguments. A CRLF pair MUST terminate all commands. Multiple commands MUST NOT be on the same line. Unless otherwise noted elsewhere in this document, arguments SHOULD consist of printable US-ASCII characters. Keywords and arguments MUST each be separated by one or more space or TAB characters. Command lines MUST NOT exceed 512 octets, which includes the terminating CRLF pair. The arguments MUST NOT exceed 497 octets. A server MAY relax these limits for commands defined in an extension.

所有NNTP命令的字符集均为UTF-8[RFC3629]。NNTP中的命令必须由关键字组成,关键字后面可以跟一个或多个参数。CRLF对必须终止所有命令。多个命令不能在同一行上。除非本文档其他地方另有说明,参数应包括可打印的US-ASCII字符。关键字和参数必须用一个或多个空格或制表符分隔。命令行不得超过512个八位字节,包括终止CRLF对。参数不得超过497个八位字节。对于扩展中定义的命令,服务器可以放宽这些限制。

Where this specification permits UTF-8 characters outside the range of U+0000 to U+007F, implementations MUST NOT use the Byte Order Mark (U+FEFF, encoding %xEF.BB.BF) and MUST use the Word Joiner (U+2060, encoding %xE2.91.A0) for the meaning Zero Width No-Break Space in

如果本规范允许UTF-8字符超出U+0000到U+007F的范围,则实现不得使用字节顺序标记(U+FEFF,编码%xEF.BB.BF),并且必须使用Joiner(U+2060,编码%xE2.91.A0)一词表示零宽度无中断空间

command lines and the initial lines of responses. Implementations SHOULD apply these same principles throughout.

命令行和响应的初始行。实现应该在整个过程中应用这些相同的原则。

The term "character" means a single Unicode code point. Implementations are not required to carry out Unicode normalisation. Thus, U+0084 (A-dieresis) is one character, while U+0041 U+0308 (A composed with dieresis) is two; the two need not be treated as equivalent.

术语“字符”表示单个Unicode代码点。执行Unicode规范化不需要实现。因此,U+0084(A-dieresis)是一个字符,而U+0041 U+0308(由dieresis组成的A)是两个字符;这两者不必被视为等价物。

Commands may have variants; if so, they use a second keyword immediately after the first to indicate which variant is required. The only such commands in this specification are LIST and MODE. Note that such variants are sometimes referred to as if they were commands in their own right: "the LIST ACTIVE" command should be read as shorthand for "the ACTIVE variant of the LIST command".

命令可能有变体;如果是这样,他们会在第一个关键字之后立即使用第二个关键字来指示需要哪个变量。本规范中仅有的此类命令是LIST和MODE。请注意,此类变体有时被称为其自身的命令:“列表活动”命令应理解为“列表命令的活动变体”的缩写。

Keywords are case insensitive; the case of keywords for commands MUST be ignored by the server. Command and response arguments are case or language specific only when stated, either in this document or in other relevant specifications.

关键词不区分大小写;服务器必须忽略命令关键字的情况。命令和响应参数只有在本文档或其他相关规范中规定时才是特定于大小写或语言的。

In some cases, a command involves more data than just a single line. The further data may be sent either immediately after the command line (there are no instances of this in this specification, but there are in extensions such as [NNTP-STREAM]) or following a request from the server (indicated by a 3xx response).

在某些情况下,一个命令所涉及的数据不仅仅是一行。进一步的数据可以在命令行之后立即发送(本规范中没有此类实例,但有[NNTP-STREAM]等扩展),也可以在服务器请求之后发送(由3xx响应指示)。

Each response MUST start with a three-digit response code that is sufficient to distinguish all responses. Certain valid responses are defined to be multi-line; for all others, the response is contained in a single line. The initial line of the response MUST NOT exceed 512 octets, which includes the response code and the terminating CRLF pair; an extension MAY specify a greater maximum for commands that it defines, but not for any other command. Single-line responses consist of an initial line only. Multi-line responses consist of an initial line followed by a multi-line data block.

每个响应必须以足以区分所有响应的三位数响应代码开头。某些有效响应被定义为多行;对于所有其他人,响应包含在一行中。响应的初始行不得超过512个八位字节,其中包括响应代码和终止CRLF对;扩展可以为其定义的命令指定更大的最大值,但不能为任何其他命令指定。单行响应仅由初始行组成。多行响应由初始行和多行数据块组成。

An NNTP server MAY have an inactivity autologout timer. Such a timer SHOULD be of at least three minutes' duration, with the exception that there MAY be a shorter limit on how long the server is willing to wait for the first command from the client. The receipt of any command from the client during the timer interval SHOULD suffice to reset the autologout timer. Similarly, the receipt of any significant amount of data from a client that is sending a multi-line data block (such as during a POST or IHAVE command) SHOULD suffice to reset the autologout timer. When the timer expires, the server SHOULD close the connection without sending any response to the client.

NNTP服务器可能具有非活动自动启动计时器。此类计时器的持续时间应至少为三分钟,但服务器愿意等待来自客户端的第一个命令的时间可能有较短的限制。在定时器间隔期间从客户端接收到任何命令都应足以重置自动定时器。类似地,从发送多行数据块的客户端接收任何大量数据(例如在POST或IHAVE命令期间)应足以重置自动定时器。计时器过期时,服务器应关闭连接,而不向客户端发送任何响应。

3.1.1. Multi-line Data Blocks
3.1.1. 多行数据块

A multi-line data block is used in certain commands and responses. It MUST adhere to the following rules:

在某些命令和响应中使用多行数据块。它必须遵守以下规则:

1. The block consists of a sequence of zero or more "lines", each being a stream of octets ending with a CRLF pair. Apart from those line endings, the stream MUST NOT include the octets NUL, LF, or CR.

1. 该块由零条或多条“线”组成,每一条线都是以CRLF对结尾的八位字节流。除了这些行尾,流不能包括八位字节NUL、LF或CR。

2. In a multi-line response, the block immediately follows the CRLF at the end of the initial line of the response. When used in any other context, the specific command will define when the block is sent.

2. 在多行响应中,块紧跟在响应初始行末尾的CRLF之后。在任何其他上下文中使用时,特定命令将定义发送块的时间。

3. If any line of the data block begins with the "termination octet" ("." or %x2E), that line MUST be "dot-stuffed" by prepending an additional termination octet to that line of the block.

3. 如果数据块的任何一行以“终止八位字节”(“.”或%x2E)开头,则该行必须通过在该数据块的该行前面附加一个终止八位字节来“填充点”。

4. The lines of the block MUST be followed by a terminating line consisting of a single termination octet followed by a CRLF pair in the normal way. Thus, unless it is empty, a multi-line block is always terminated with the five octets CRLF "." CRLF (%x0D.0A.2E.0D.0A).

4. 块的行后面必须有一条端接线,该端接线由一个单端接八位组和一个正常方式的CRLF对组成。因此,除非它是空的,否则多行块总是以五个八位字节CRLF“.”CRLF(%x0D.0A.2E.0D.0A)终止。

5. When a multi-line block is interpreted, the "dot-stuffing" MUST be undone; i.e., the recipient MUST ensure that, in any line beginning with the termination octet followed by octets other than a CRLF pair, that initial termination octet is disregarded.

5. 解释多行块时,“点填充”必须撤消;i、 例如,接收方必须确保,在任何一行中,从终止八位字节开始,然后是除CRLF对以外的八位字节,忽略初始终止八位字节。

6. Likewise, the terminating line ("." CRLF or %x2E.0D.0A) MUST NOT be considered part of the multi-line block; i.e., the recipient MUST ensure that any line beginning with the termination octet followed immediately by a CRLF pair is disregarded. (The first CRLF pair of the terminating CRLF "." CRLF of a non-empty block is, of course, part of the last line of the block.)

6. 同样,终止线(“.”CRLF或%x2E.0D.0A)不得视为多线块的一部分;i、 例如,接收方必须确保忽略任何以终止八位字节开始,紧接着CRLF对的行。(非空块的终止CRLF“.”CRLF的第一个CRLF对当然是块的最后一行的一部分。)

Note that texts using an encoding (such as UTF-16 or UTF-32) that may contain the octets NUL, LF, or CR other than a CRLF pair cannot be reliably conveyed in the above format (that is, they violate the MUST requirement above). However, except when stated otherwise, this specification does not require the content to be UTF-8, and therefore (subject to that same requirement) it MAY include octets above and below 128 mixed arbitrarily.

请注意,使用编码(如UTF-16或UTF-32)的文本(可能包含CRLF对以外的八位字节NUL、LF或CR)无法以上述格式可靠地传输(即,它们违反了上述必须要求)。但是,除非另有说明,本规范不要求内容为UTF-8,因此(根据相同要求)可包括128以上和128以下任意混合的八位字节。

This document does not place any limit on the length of a line in a multi-line block. However, the standards that define the format of articles may do so.

本文档对多行块中的行长度没有任何限制。但是,定义条款格式的标准可能会这样做。

3.2. Response Codes
3.2. 响应代码

Each response MUST begin with a three-digit status indicator. These are status reports from the server and indicate the response to the last command received from the client.

每个响应必须以一个三位数的状态指示器开始。这些是来自服务器的状态报告,指示对从客户端接收的最后一个命令的响应。

The first digit of the response broadly indicates the success, failure, or progress of the previous command:

响应的第一位数字大致表示上一个命令的成功、失败或进度:

1xx - Informative message 2xx - Command completed OK 3xx - Command OK so far; send the rest of it 4xx - Command was syntactically correct but failed for some reason 5xx - Command unknown, unsupported, unavailable, or syntax error

1xx-信息消息2xx-命令完成OK 3xx-命令目前OK;发送其余部分4xx-命令语法正确,但由于某些原因失败5xx-命令未知、不受支持、不可用或语法错误

The next digit in the code indicates the function response category:

代码中的下一位数字表示功能响应类别:

x0x - Connection, setup, and miscellaneous messages x1x - Newsgroup selection x2x - Article selection x3x - Distribution functions x4x - Posting x8x - Reserved for authentication and privacy extensions x9x - Reserved for private use (non-standard extensions)

x0x-连接、设置和杂项消息x1x-新闻组选择x2x-文章选择x3x-分发功能x4x-发布x8x-保留用于身份验证和隐私扩展x9x-保留用于私人使用(非标准扩展)

Certain responses contain arguments such as numbers and names in addition to the status indicator. In those cases, to simplify interpretation by the client, the number and type of such arguments is fixed for each response code, as is whether the code is single-line or multi-line. Any extension MUST follow this principle as well. Note that, for historical reasons, the 211 response code is an exception to this in that the response may be single-line or multi-line depending on the command (GROUP or LISTGROUP) that generated it. In all other cases, the client MUST only use the status indicator itself to determine the nature of the response. The exact response codes that can be returned by any given command are detailed in the description of that command.

除了状态指示器之外,某些响应还包含数字和名称等参数。在这些情况下,为了简化客户机的解释,每个响应代码的此类参数的数量和类型是固定的,就像代码是单行还是多行一样。任何扩展也必须遵循这一原则。注意,由于历史原因,211响应代码是一个例外,因为响应可以是单行或多行,具体取决于生成它的命令(组或列表组)。在所有其他情况下,客户端必须仅使用状态指示器本身来确定响应的性质。任何给定命令均可返回的确切响应代码在该命令的说明中有详细说明。

Arguments MUST be separated from the numeric status indicator and from each other by a single space. All numeric arguments MUST be in base 10 (decimal) format and MAY have leading zeros. String arguments MUST contain at least one character and MUST NOT contain TAB, LF, CR, or space. The server MAY add any text after the response code or last argument, as appropriate, and the client MUST NOT make decisions based on this text. Such text MUST be separated from the numeric status indicator or the last argument by at least one space.

参数必须与数字状态指示器分开,并且必须用单个空格彼此分开。所有数值参数必须为十进制格式,并且可以有前导零。字符串参数必须至少包含一个字符,并且不能包含制表符、LF、CR或空格。服务器可以在响应代码或最后一个参数之后添加任何文本(视情况而定),客户端不得基于此文本做出决策。此类文本必须与数字状态指示器或最后一个参数至少间隔一个空格。

The server MUST respond to any command with the appropriate generic response (given in Section 3.2.1) if it represents the situation. Otherwise, each recognized command MUST return one of the response codes specifically listed in its description or in an extension. A server MAY provide extensions to this specification, including new commands, new variants or features of existing commands, and other ways of changing the internal state of the server. However, the server MUST NOT produce any other responses to a client that does not invoke any of the additional features. (Therefore, a client that restricts itself to this specification will only receive the responses that are listed.)

如果代表情况,服务器必须以适当的通用响应(第3.2.1节中给出)响应任何命令。否则,每个已识别的命令必须返回其说明或扩展名中特别列出的响应代码之一。服务器可以提供此规范的扩展,包括新命令、现有命令的新变体或功能,以及更改服务器内部状态的其他方式。但是,服务器不得向未调用任何附加功能的客户端生成任何其他响应。(因此,仅限于此规范的客户端将只接收列出的响应。)

If a client receives an unexpected response, it SHOULD use the first digit of the response to determine the result. For example, an unexpected 2xx should be taken as success, and an unexpected 4xx or 5xx as failure.

如果客户端收到意外响应,则应使用响应的第一位数字来确定结果。例如,意外的2xx应视为成功,意外的4xx或5xx应视为失败。

Response codes not specified in this document MAY be used for any installation-specific additional commands also not specified. These SHOULD be chosen to fit the pattern of x9x specified above.

本文档中未指定的响应代码可用于任何未指定的安装特定附加命令。应选择适合以上指定的x9x模式。

Neither this document nor any registered extension (see Section 3.3.3) will specify any response codes of the x9x pattern. (Implementers of extensions are accordingly cautioned not to use such responses for extensions that may subsequently be submitted for registration.)

本文件和任何注册的扩展(见第3.3.3节)都不会指定x9x模式的任何响应代码。(因此,应提醒扩展的实施者不要将此类响应用于随后可能提交注册的扩展。)

3.2.1. Generic Response Codes
3.2.1. 通用响应码

The server MUST respond to any command with the appropriate one of the following generic responses if it represents the situation.

服务器必须使用以下适当的通用响应之一响应任何命令(如果它代表该情况)。

If the command is not recognized, or if it is an optional command that is not implemented by the server, the response code 500 MUST be returned.

如果无法识别该命令,或者该命令是服务器未实现的可选命令,则必须返回响应代码500。

If there is a syntax error in the arguments of a recognized command, including the case where more arguments are provided than the command specifies or the command line is longer than the server accepts, the response code 501 MUST be returned. The line MUST NOT be truncated or split and then interpreted. Note that where a command has variants depending on a second keyword (e.g., LIST ACTIVE and LIST NEWSGROUPS), 501 MUST be used when the base command is implemented but the requested variant is not, and 500 MUST be used only when the base command itself is not implemented.

如果已识别命令的参数中存在语法错误,包括提供的参数多于命令指定的参数或命令行长于服务器接受的长度,则必须返回响应代码501。该行不能被截断或拆分,然后再进行解释。请注意,如果命令具有依赖于第二个关键字的变体(例如,LIST ACTIVE和LIST NEWSGROUPS),则在执行基本命令但未执行请求的变体时必须使用501,并且只有在未执行基本命令时才必须使用500。

If an argument is required to be a base64-encoded string [RFC4648] (there are no such arguments in this specification, but there may be

如果参数必须是base64编码字符串[RFC4648](本规范中没有此类参数,但可能有

in extensions) and is not validly encoded, the response code 504 MUST be returned.

在扩展名中)且未有效编码,则必须返回响应代码504。

If the server experiences an internal fault or problem that means it is unable to carry out the command (for example, a necessary file is missing or a necessary service could not be contacted), the response code 403 MUST be returned. If the server recognizes the command but does not provide an optional feature (for example, because it does not store the required information), or if it only handles a subset of legitimate cases (see the HDR command, Section 8.5, for an example), the response code 503 MUST be returned.

如果服务器遇到内部故障或问题,这意味着它无法执行命令(例如,缺少必要的文件或无法联系到必要的服务),则必须返回响应代码403。如果服务器识别该命令但不提供可选功能(例如,因为它不存储所需的信息),或者如果它只处理合法案例的子集(例如,请参阅HDR命令,第8.5节),则必须返回响应代码503。

If the client is not authorized to use the specified facility when the server is in its current state, then the appropriate one of the following response codes MUST be used.

如果在服务器处于当前状态时,客户端未被授权使用指定的设施,则必须使用以下相应的响应代码之一。

502: It is necessary to terminate the connection and to start a new one with the appropriate authority before the command can be used. Historically, some mode-switching servers (see Section 3.4.1) used this response to indicate that this command will become available after the MODE READER command (Section 5.3) is used, but this usage does not conform to this specification and MUST NOT be used. Note that the server MUST NOT close the connection immediately after a 502 response except at the initial connection (Section 5.1) and with the MODE READER command.

502:在使用命令之前,必须终止连接并使用适当的权限启动一个新的连接。历史上,一些模式切换服务器(见第3.4.1节)使用此响应表示在使用模式读取器命令(第5.3节)后,此命令将变为可用命令,但此用法不符合本规范,不得使用。请注意,服务器不得在502响应后立即关闭连接,除非在初始连接(第5.1节)和使用MODE READER命令。

480: The client must authenticate itself to the server (that is, it must provide information as to the identity of the client) before the facility can be used on this connection. This will involve the use of an authentication extension such as [NNTP-AUTH].

480:客户端必须向服务器进行自身身份验证(即,它必须提供有关客户端身份的信息),然后才能在此连接上使用该设施。这将涉及使用身份验证扩展,如[NNTP-AUTH]。

483: The client must negotiate appropriate privacy protection on the connection. This will involve the use of a privacy extension such as [NNTP-TLS].

483:客户端必须协商连接的适当隐私保护。这将涉及使用隐私扩展,如[NNTP-TLS]。

401: The client must change the state of the connection in some other manner. The first argument of the response MUST be the capability label (see Section 5.2) of the facility that provides the necessary mechanism (usually an extension, which may be a private extension). The server MUST NOT use this response code except as specified by the definition of the capability in question.

401:客户端必须以其他方式更改连接的状态。响应的第一个参数必须是提供必要机制(通常是扩展,可能是专用扩展)的设施的能力标签(见第5.2节)。服务器不得使用此响应代码,除非相关功能的定义中另有规定。

If the server has to terminate the connection for some reason, it MUST give a 400 response code to the next command and then immediately close the connection. Following a 400 response, clients SHOULD NOT simply reconnect immediately and retry the same actions. Rather, a client SHOULD either use an exponentially increasing delay between retries (e.g., double the waiting time after each 400

如果服务器由于某种原因必须终止连接,它必须向下一个命令提供400响应代码,然后立即关闭连接。在400响应之后,客户端不应该简单地立即重新连接并重试相同的操作。相反,客户机应该在重试之间使用指数级增加的延迟(例如,每400次之后等待时间增加一倍)

response) or present any associated text to the user for them to decide whether and when to retry.

响应)或向用户提供任何相关文本,以便用户决定是否重试以及何时重试。

The client MUST be prepared to receive any of these responses for any command (except, of course, that the server MUST NOT generate a 500 response code for mandatory commands).

客户机必须准备好接收任何命令的任何响应(当然,服务器不得为强制命令生成500响应代码除外)。

3.2.1.1. Examples
3.2.1.1. 例子

Example of an unknown command:

未知命令的示例:

[C] MAIL [S] 500 Unknown command

[C] 邮件[S]500未知命令

Example of an unsupported command:

不受支持的命令示例:

      [C] CAPABILITIES
      [S] 101 Capability list:
      [S] VERSION 2
      [S] READER
      [S] NEWNEWS
      [S] LIST ACTIVE NEWSGROUPS
      [S] .
      [C] OVER
      [S] 500 Unknown command
        
      [C] CAPABILITIES
      [S] 101 Capability list:
      [S] VERSION 2
      [S] READER
      [S] NEWNEWS
      [S] LIST ACTIVE NEWSGROUPS
      [S] .
      [C] OVER
      [S] 500 Unknown command
        

Example of an unsupported variant:

不受支持的变体示例:

[C] MODE POSTER [S] 501 Unknown MODE option

[C] 模式海报[S]501未知模式选项

Example of a syntax error:

语法错误示例:

[C] ARTICLE a.message.id@no.angle.brackets [S] 501 Syntax error

[C] 第a条.信息。id@no.angle.brackets[S]501语法错误

Example of an overlong command line:

超长命令行的示例:

[C] HEAD 53 54 55 [S] 501 Too many arguments

[C] 54[501]头太多

Example of a bad wildmat:

坏的wildmat示例:

[C] LIST ACTIVE u[ks].* [S] 501 Syntax error

[C] 列出活动u[ks].[S]501语法错误

Example of a base64-encoding error (the second argument is meant to be base64 encoded):

base64编码错误示例(第二个参数表示为base64编码):

[C] XENCRYPT RSA abcd=efg [S] 504 Base64 encoding error

[C] XENCRYPT RSA abcd=efg[S]504 Base64编码错误

Example of an attempt to access a facility not available to this connection:

尝试访问此连接不可用的设施的示例:

      [C] MODE READER
      [S] 200 Reader mode, posting permitted
      [C] IHAVE <i.am.an.article.you.will.want@example.com>
      [S] 500 Permission denied
        
      [C] MODE READER
      [S] 200 Reader mode, posting permitted
      [C] IHAVE <i.am.an.article.you.will.want@example.com>
      [S] 500 Permission denied
        

Example of an attempt to access a facility requiring authentication:

尝试访问需要身份验证的设施的示例:

[C] GROUP secret.group [S] 480 Permission denied

[C] GROUP secret.GROUP[S]480权限被拒绝

Example of a successful attempt following such authentication:

此类身份验证后的成功尝试示例:

      [C] XSECRET fred flintstone
      [S] 290 Password for fred accepted
      [C] GROUP secret.group
      [S] 211 5 1 20 secret.group selected
        
      [C] XSECRET fred flintstone
      [S] 290 Password for fred accepted
      [C] GROUP secret.group
      [S] 211 5 1 20 secret.group selected
        

Example of an attempt to access a facility requiring privacy:

试图访问需要隐私的设施的示例:

      [C] GROUP secret.group
      [S] 483 Secure connection required
      [C] XENCRYPT
      [Client and server negotiate encryption on the link]
      [S] 283 Encrypted link established
      [C] GROUP secret.group
      [S] 211 5 1 20 secret.group selected
        
      [C] GROUP secret.group
      [S] 483 Secure connection required
      [C] XENCRYPT
      [Client and server negotiate encryption on the link]
      [S] 283 Encrypted link established
      [C] GROUP secret.group
      [S] 211 5 1 20 secret.group selected
        

Example of a need to change mode before a facility is used:

使用设施前需要更改模式的示例:

      [C] GROUP binary.group
      [S] 401 XHOST Not on this virtual host
      [C] XHOST binary.news.example.org
      [S] 290 binary.news.example.org virtual host selected
      [C] GROUP binary.group
      [S] 211 5 1 77 binary.group selected
        
      [C] GROUP binary.group
      [S] 401 XHOST Not on this virtual host
      [C] XHOST binary.news.example.org
      [S] 290 binary.news.example.org virtual host selected
      [C] GROUP binary.group
      [S] 211 5 1 77 binary.group selected
        

Example of a temporary failure:

临时故障的示例:

[C] GROUP archive.local [S] 403 Archive server temporarily offline

[C] 组archive.local[S]403存档服务器暂时脱机

Example of the server needing to close down immediately:

需要立即关闭的服务器示例:

      [C] ARTICLE 123
      [S] 400 Power supply failed, running on UPS
      [Server closes connection.]
        
      [C] ARTICLE 123
      [S] 400 Power supply failed, running on UPS
      [Server closes connection.]
        
3.3. Capabilities and Extensions
3.3. 功能和扩展

Not all NNTP servers provide exactly the same facilities, both because this specification allows variation and because servers may provide extensions. A set of facilities that are related are called a "capability". This specification provides a way to determine what capabilities are available, includes a list of standard capabilities, and includes a mechanism (the extension mechanism) for defining new capabilities.

并非所有NNTP服务器都提供完全相同的设施,这既是因为该规范允许变化,也是因为服务器可能提供扩展。一组相关的设施称为“能力”。本规范提供了一种确定可用功能的方法,包括标准功能的列表,以及定义新功能的机制(扩展机制)。

3.3.1. Capability Descriptions
3.3.1. 能力描述

A client can determine the available capabilities of the server by using the CAPABILITIES command (Section 5.2). This returns a capability list, which is a list of capability lines. Each line describes one available capability.

客户机可以使用capabilities命令(第5.2节)确定服务器的可用功能。这将返回一个功能列表,它是一个功能行列表。每行描述一个可用的功能。

Each capability line consists of one or more tokens, which MUST be separated by one or more space or TAB characters. A token is a string of 1 or more printable UTF-8 characters (that is, either printable US-ASCII characters or any UTF-8 sequence outside the US-ASCII range, but not space or TAB). Unless stated otherwise, tokens are case insensitive. Each capability line consists of the following:

每个功能行由一个或多个标记组成,这些标记必须由一个或多个空格或制表符分隔。令牌是由1个或多个可打印UTF-8字符组成的字符串(即,可打印的US-ASCII字符或US-ASCII范围之外的任何UTF-8序列,但不是空格或制表符)。除非另有说明,令牌不区分大小写。每个能力线包括以下内容:

o The capability label, which is a keyword indicating the capability. A capability label may be defined by this specification or a successor, or by an extension.

o 功能标签,它是指示功能的关键字。能力标签可由本规范或后续规范或扩展规范定义。

o The label is then followed by zero or more tokens, which are arguments of the capability. The form and meaning of these tokens is specific to each capability.

o 标签后面跟着零个或多个标记,这些标记是功能的参数。这些标记的形式和含义特定于每个功能。

The server MUST ensure that the capability list accurately reflects the capabilities (including extensions) currently available. If a capability is only available with the server in a certain state (for example, only after authentication), the list MUST only include the

服务器必须确保功能列表准确反映当前可用的功能(包括扩展)。如果某项功能仅在服务器处于特定状态时可用(例如,仅在身份验证后可用),则该列表必须仅包括

capability label when the server is in that state. Similarly, if only some of the commands in an extension will be available, or if the behaviour of the extension will change in some other manner, according to the state of the server, this MUST be indicated by different arguments in the capability line.

服务器处于该状态时的功能标签。类似地,如果扩展中只有一些命令可用,或者扩展的行为将根据服务器的状态以其他方式改变,则必须通过功能行中的不同参数来指示。

Note that a capability line can only begin with a letter. Lines beginning with other characters are reserved for future versions of this specification. In order to interoperate with such versions, clients MUST be prepared to receive lines beginning with other characters and MUST ignore any they do not understand.

请注意,功能行只能以字母开头。以其他字符开头的行保留给本规范的未来版本。为了与这些版本进行互操作,客户端必须准备好接收以其他字符开头的行,并且必须忽略任何他们不理解的行。

3.3.2. Standard Capabilities
3.3.2. 标准能力

The following capabilities are defined by this specification.

本规范定义了以下功能。

VERSION This capability MUST be advertised by all servers and MUST be the first capability in the capability list; it indicates the version(s) of NNTP that the server supports. There must be at least one argument; each argument is a decimal number and MUST NOT have a leading zero. Version numbers are assigned only in RFCs that update or replace this specification; servers MUST NOT create their own version numbers.

版本此功能必须由所有服务器公布,并且必须是功能列表中的第一个功能;它表示服务器支持的NNTP版本。必须至少有一个论点;每个参数都是一个十进制数,不能有前导零。版本号仅在更新或替换本规范的RFC中分配;服务器不得创建自己的版本号。

The version number of this specification is 2.

本规范的版本号为2。

READER This capability indicates that the server implements the various commands useful for reading clients.

READER此功能表示服务器实现了用于读取客户端的各种命令。

IHAVE This capability indicates that the server implements the IHAVE command.

IHAVE此功能表示服务器实现IHAVE命令。

POST This capability indicates that the server implements the POST command.

POST此功能表示服务器实现POST命令。

NEWNEWS This capability indicates that the server implements the NEWNEWS command.

NEWNEWS此功能表示服务器实现NEWNEWS命令。

HDR This capability indicates that the server implements the header access commands (HDR and LIST HEADERS).

HDR此功能表示服务器实现标头访问命令(HDR和列表标头)。

OVER This capability indicates that the server implements the overview access commands (OVER and LIST OVERVIEW.FMT). If and only if the server supports the message-id form of the OVER command, there must be a single argument MSGID.

此功能表示服务器实现概览访问命令(OVER和LIST overview.FMT)。当且仅当服务器支持OVER命令的消息id形式时,必须有一个参数MSGID。

LIST This capability indicates that the server implements at least one variant of the LIST command. There MUST be one argument for each variant of the LIST command supported by the server, giving the keyword for that variant.

LIST此功能表示服务器至少实现了LIST命令的一个变体。服务器支持的列表命令的每个变量必须有一个参数,并给出该变量的关键字。

IMPLEMENTATION This capability MAY be provided by a server. If so, the arguments SHOULD be used to provide information such as the server software name and version number. The client MUST NOT use this line to determine capabilities of the server. (While servers often provide this information in the initial greeting, clients need to guess whether this is the case; this capability makes it clear what the information is.)

实现此功能可能由服务器提供。如果是,则应使用参数提供服务器软件名称和版本号等信息。客户端不得使用此行来确定服务器的功能。(虽然服务器通常在最初的问候语中提供此信息,但客户端需要猜测情况是否如此;此功能可以清楚地显示信息是什么。)

MODE-READER This capability indicates that the server is mode-switching (Section 3.4.2) and that the MODE READER command needs to be used to enable the READER capability.

模式读取器此功能表示服务器正在进行模式切换(第3.4.2节),需要使用模式读取器命令来启用读取器功能。

3.3.3. Extensions
3.3.3. 扩展

Although NNTP is widely and robustly deployed, some parts of the Internet community might wish to extend the NNTP service. It must be emphasized that any extension to NNTP should not be considered lightly. NNTP's strength comes primarily from its simplicity. Experience with many protocols has shown that:

尽管NNTP被广泛且可靠地部署,但互联网社区的某些部分可能希望扩展NNTP服务。必须强调的是,不应轻视NNTP的任何扩展。NNTP的优势主要来自其简单性。许多协议的经验表明:

Protocols with few options tend towards ubiquity, whilst protocols with many options tend towards obscurity.

选项少的协议趋向于普遍存在,而选项多的协议趋向于模糊。

This means that each and every extension, regardless of its benefits, must be carefully scrutinized with respect to its implementation, deployment, and interoperability costs. In many cases, the cost of extending the NNTP service will likely outweigh the benefit.

这意味着,无论每个扩展的好处如何,都必须仔细检查其实现、部署和互操作性成本。在许多情况下,扩展NNTP服务的成本可能会超过收益。

An extension is a package of associated facilities, often but not always including one or more new commands. Each extension MUST define at least one new capability label (this will often, but need not, be the name of one of these new commands). While any additional capability information can normally be specified using arguments to

扩展是一组相关的工具,通常但不总是包括一个或多个新命令。每个扩展必须定义至少一个新的功能标签(这通常是但不必是这些新命令之一的名称)。而任何附加功能信息通常都可以使用参数来指定

that label, an extension MAY define more than one capability label. However, this SHOULD be limited to exceptional circumstances.

对于该标签,扩展可以定义多个功能标签。但是,这应限于特殊情况。

An extension is either a private extension, or its capabilities are included in the IANA registry of capabilities (see Section 3.3.4) and it is defined in an RFC (in which case it is a "registered extension"). Such RFCs either must be on the standards track or must define an IESG-approved experimental protocol.

扩展是私有扩展,或者其功能包含在IANA功能注册表中(见第3.3.4节),并在RFC中定义(在这种情况下,它是“注册扩展”)。此类RFC要么必须在标准轨道上,要么必须定义IESG批准的实验方案。

The definition of an extension must include the following:

扩展的定义必须包括以下内容:

o a descriptive name for the extension.

o 扩展名的描述性名称。

o the capability label or labels defined by the extension (the capability label of a registered extension MUST NOT begin with "X").

o 扩展定义的一个或多个功能标签(已注册扩展的功能标签不得以“X”开头)。

o The syntax, values, and meanings of any arguments for each capability label defined by the extension.

o 扩展定义的每个功能标签的任何参数的语法、值和含义。

o Any new NNTP commands associated with the extension (the names of commands associated with registered extensions MUST NOT begin with "X").

o 与扩展名关联的任何新NNTP命令(与已注册扩展名关联的命令名称不得以“X”开头)。

o The syntax and possible values of arguments associated with the new NNTP commands.

o 与新NNTP命令关联的参数的语法和可能值。

o The response codes and possible values of arguments for the responses of the new NNTP commands.

o 新NNTP命令响应的响应代码和可能的参数值。

o Any new arguments the extension associates with any other pre-existing NNTP commands.

o 扩展与任何其他预先存在的NNTP命令关联的任何新参数。

o Any increase in the maximum length of commands and initial response lines over the value specified in this document.

o 命令和初始响应行的最大长度超过本文档中指定的值。

o A specific statement about the effect on pipelining that this extension may have (if any).

o 关于此扩展可能对管道的影响的特定声明(如果有)。

o A specific statement about the circumstances when use of this extension can alter the contents of the capabilities list (other than the new capability labels it defines).

o 关于使用此扩展时可能更改功能列表内容(而不是它定义的新功能标签)的情况的特定语句。

o A specific statement about the circumstances under which the extension can cause any pre-existing command to produce a 401, 480, or 483 response.

o 一种特定的语句,说明在何种情况下扩展可以导致任何预先存在的命令生成401、480或483响应。

o A description of how the use of MODE READER on a mode-switching server interacts with the extension.

o 描述在模式切换服务器上使用模式读取器如何与扩展交互。

o A description of how support for the extension affects the behaviour of a server and NNTP client in any other manner not outlined above.

o 描述对扩展的支持如何影响服务器和NNTP客户机的行为,以及上述未概述的任何其他方式。

o Formal syntax as described in Section 9.9.

o 形式语法如第9.9节所述。

A private extension MAY or MAY NOT be included in the capabilities list. If it is, the capability label MUST begin with "X". A server MAY provide additional keywords (for new commands and also for new variants of existing commands) as part of a private extension. To avoid the risk of a clash with a future registered extension, these keywords SHOULD begin with "X".

功能列表中可能包括也可能不包括专用扩展。如果是,功能标签必须以“X”开头。作为专用扩展的一部分,服务器可以提供附加关键字(用于新命令以及现有命令的新变体)。为避免与将来注册的扩展发生冲突,这些关键字应以“X”开头。

If the server advertises a capability defined by a registered extension, it MUST implement the extension so as to fully conform with the specification (for example, it MUST implement all the commands that the extension describes as mandatory). If it does not implement the extension as specified, it MUST NOT list the extension in the capabilities list under its registered name. In that case, it MAY, but SHOULD NOT, provide a private extension (not listed, or listed with a different name) that implements part of the extension or implements the commands of the extension with a different meaning.

如果服务器播发由已注册扩展定义的功能,它必须实现该扩展以完全符合规范(例如,它必须实现扩展描述为必需的所有命令)。如果它没有实现指定的扩展,则不能在其注册名称下的功能列表中列出该扩展。在这种情况下,它可以但不应该提供私有扩展(未列出,或以不同名称列出),该扩展实现了扩展的一部分或以不同的含义实现了扩展的命令。

A server MUST NOT send different response codes to basic NNTP commands documented here or to commands documented in registered extensions in response to the availability or use of a private extension.

服务器不得向此处记录的基本NNTP命令或注册扩展中记录的命令发送不同的响应代码,以响应专用扩展的可用性或使用。

3.3.4. Initial IANA Register
3.3.4. 初始IANA寄存器

IANA will maintain a registry of NNTP capability labels. All capability labels in the registry MUST be keywords and MUST NOT begin with X.

IANA将维护NNTP能力标签的注册。注册表中的所有功能标签必须是关键字,且不得以X开头。

The initial content of the registry consists of these entries:

注册表的初始内容由以下条目组成:

   +-------------------+--------------------------+--------------------+
   | Label             | Meaning                  | Definition         |
   +-------------------+--------------------------+--------------------+
   | AUTHINFO          | Authentication           | [NNTP-AUTH]        |
   |                   |                          |                    |
   | HDR               | Batched header retrieval | Section 3.3.2,     |
   |                   |                          | Section 8.5, and   |
   |                   |                          | Section 8.6        |
   |                   |                          |                    |
   | IHAVE             | IHAVE command available  | Section 3.3.2 and  |
   |                   |                          | Section 6.3.2      |
   |                   |                          |                    |
   | IMPLEMENTATION    | Server                   | Section 3.3.2      |
   |                   | implementation-specific  |                    |
   |                   | information              |                    |
   |                   |                          |                    |
   | LIST              | LIST command variants    | Section 3.3.2 and  |
   |                   |                          | Section 7.6.1      |
   |                   |                          |                    |
   | MODE-READER       | Mode-switching server    | Section 3.4.2      |
   |                   | and MODE READER command  |                    |
   |                   | available                |                    |
   |                   |                          |                    |
   | NEWNEWS           | NEWNEWS command          | Section 3.3.2 and  |
   |                   | available                | Section 7.4        |
   |                   |                          |                    |
   | OVER              | Overview support         | Section 3.3.2,     |
   |                   |                          | Section 8.3, and   |
   |                   |                          | Section 8.4        |
   |                   |                          |                    |
   | POST              | POST command available   | Section 3.3.2 and  |
   |                   |                          | Section 6.3.1      |
   |                   |                          |                    |
   | READER            | Reader commands          | Section 3.3.2      |
   |                   | available                |                    |
   |                   |                          |                    |
   | SASL              | Supported SASL           | [NNTP-AUTH]        |
   |                   | mechanisms               |                    |
   |                   |                          |                    |
   | STARTTLS          | Transport layer security | [NNTP-TLS]         |
   |                   |                          |                    |
   | STREAMING         | Streaming feeds          | [NNTP-STREAM]      |
   |                   |                          |                    |
   | VERSION           | Supported NNTP versions  | Section 3.3.2      |
   +-------------------+--------------------------+--------------------+
        
   +-------------------+--------------------------+--------------------+
   | Label             | Meaning                  | Definition         |
   +-------------------+--------------------------+--------------------+
   | AUTHINFO          | Authentication           | [NNTP-AUTH]        |
   |                   |                          |                    |
   | HDR               | Batched header retrieval | Section 3.3.2,     |
   |                   |                          | Section 8.5, and   |
   |                   |                          | Section 8.6        |
   |                   |                          |                    |
   | IHAVE             | IHAVE command available  | Section 3.3.2 and  |
   |                   |                          | Section 6.3.2      |
   |                   |                          |                    |
   | IMPLEMENTATION    | Server                   | Section 3.3.2      |
   |                   | implementation-specific  |                    |
   |                   | information              |                    |
   |                   |                          |                    |
   | LIST              | LIST command variants    | Section 3.3.2 and  |
   |                   |                          | Section 7.6.1      |
   |                   |                          |                    |
   | MODE-READER       | Mode-switching server    | Section 3.4.2      |
   |                   | and MODE READER command  |                    |
   |                   | available                |                    |
   |                   |                          |                    |
   | NEWNEWS           | NEWNEWS command          | Section 3.3.2 and  |
   |                   | available                | Section 7.4        |
   |                   |                          |                    |
   | OVER              | Overview support         | Section 3.3.2,     |
   |                   |                          | Section 8.3, and   |
   |                   |                          | Section 8.4        |
   |                   |                          |                    |
   | POST              | POST command available   | Section 3.3.2 and  |
   |                   |                          | Section 6.3.1      |
   |                   |                          |                    |
   | READER            | Reader commands          | Section 3.3.2      |
   |                   | available                |                    |
   |                   |                          |                    |
   | SASL              | Supported SASL           | [NNTP-AUTH]        |
   |                   | mechanisms               |                    |
   |                   |                          |                    |
   | STARTTLS          | Transport layer security | [NNTP-TLS]         |
   |                   |                          |                    |
   | STREAMING         | Streaming feeds          | [NNTP-STREAM]      |
   |                   |                          |                    |
   | VERSION           | Supported NNTP versions  | Section 3.3.2      |
   +-------------------+--------------------------+--------------------+
        
3.4. Mandatory and Optional Commands
3.4. 强制命令和可选命令

For a number of reasons, not all the commands in this specification are mandatory. However, it is equally undesirable for every command to be optional, since this means that a client will have no idea what facilities are available. Therefore, as a compromise, some of the commands in this specification are mandatory (they must be supported by all servers) while the remainder are not. The latter are then subdivided into bundles, each indicated by a single capability label.

出于多种原因,本规范中并非所有命令都是强制性的。然而,同样不希望每个命令都是可选的,因为这意味着客户机不知道有什么可用的工具。因此,作为一种折衷方案,本规范中的一些命令是强制性的(所有服务器都必须支持这些命令),而其余命令则不是。然后,后者被细分为捆绑包,每个捆绑包由一个单独的功能标签表示。

o If the label is included in the capability list returned by the server, the server MUST support all commands in that bundle.

o 如果该标签包含在服务器返回的功能列表中,则服务器必须支持该捆绑包中的所有命令。

o If the label is not included, the server MAY support none or some of the commands but SHOULD NOT support all of them. In general, there will be no way for a client to determine which commands are supported without trying them.

o 如果不包括标签,服务器可能不支持任何命令或部分命令,但不应支持所有命令。通常,客户机在不尝试的情况下无法确定支持哪些命令。

The bundles have been chosen to provide useful functionality, and therefore server authors are discouraged from implementing only part of a bundle.

选择捆绑包是为了提供有用的功能,因此不鼓励服务器作者只实现捆绑包的一部分。

The description of each command will either indicate that it is mandatory, or will give, using the term "indicating capability", the capability label indicating whether the bundle including this command is available.

每个命令的描述要么表明它是强制性的,要么使用术语“指示能力”给出能力标签,指示包含此命令的捆绑包是否可用。

Where a server does not implement a command, it MUST always generate a 500 generic response code (or a 501 generic response code in the case of a variant of a command depending on a second keyword where the base command is recognised). Otherwise, the command MUST be fully implemented as specified; a server MUST NOT only partially implement any of the commands in this specification. (Client authors should note that some servers not conforming to this specification will return a 502 generic response code to some commands that are not implemented.)

如果服务器未执行命令,则必须始终生成500通用响应代码(如果是命令变体,则生成501通用响应代码,具体取决于识别基本命令的第二个关键字)。否则,必须按照规定完全执行该命令;服务器不能仅部分实现本规范中的任何命令。(客户端作者应注意,一些不符合此规范的服务器将向一些未实现的命令返回502通用响应代码。)

Note: some commands have cases that require other commands to be used first. If the former command is implemented but the latter is not, the former MUST still generate the relevant specific response code. For example, if ARTICLE (Section 6.2.1) is implemented but GROUP (Section 6.1.1) is not, the correct response to "ARTICLE 1234" remains 412.

注意:某些命令在某些情况下需要先使用其他命令。如果执行了前一个命令,但未执行后一个命令,则前一个命令仍必须生成相关的特定响应代码。例如,如果实施了第条(第6.2.1节),但未实施分组(第6.1.1节),则对“第1234条”的正确响应仍为412。

3.4.1. Reading and Transit Servers
3.4.1. 读取和传输服务器

NNTP is traditionally used in two different ways. The first use is "reading", where the client fetches articles from a large store maintained by the server for immediate or later presentation to a user and sends articles created by that user back to the server (an action called "posting") to be stored and distributed to other stores and users. The second use is for the bulk transfer of articles from one store to another. Since the hosts making this transfer tend to be peers in a network that transmit articles among one another, and not end-user systems, this process is called "peering" or "transit". (Even so, one host is still the client and the other is the server).

NNTP传统上有两种不同的使用方式。第一种用途是“阅读”,客户机从服务器维护的大型商店中获取文章,以便立即或稍后向用户展示,并将该用户创建的文章发送回服务器(称为“过账”的操作),以便存储并分发给其他商店和用户。第二种用途是将物品从一家商店批量转移到另一家商店。由于进行此传输的主机往往是网络中相互传输文章的对等机,而不是最终用户系统,因此此过程称为“对等”或“传输”。(即使如此,一台主机仍然是客户机,另一台是服务器)。

In practice, these two uses are so different that some server implementations are optimised for reading or for transit and, as a result, do not offer the other facility or only offer limited features. Other implementations are more general and offer both. This specification allows for this by bundling the relevant commands accordingly: the IHAVE command is designed for transit, while the commands indicated by the READER capability are designed for reading clients.

在实践中,这两种用途是如此的不同,以至于一些服务器实现针对读取或传输进行了优化,因此,不提供其他功能或仅提供有限的功能。其他实现更通用,并提供这两种功能。本规范通过相应地捆绑相关命令来实现这一点:IHAVE命令是为传输而设计的,而读卡器功能指示的命令是为读取客户端而设计的。

Except as an effect of the MODE READER command (Section 5.3) on a mode-switching server, once a server advertises either or both of the IHAVE or READER capabilities, it MUST continue to advertise them for the entire session.

除模式切换服务器上的模式读取器命令(第5.3节)的影响外,一旦服务器播发IHAVE或READER功能中的一项或两项,它必须在整个会话中继续播发它们。

A server MAY provide different modes of behaviour (transit, reader, or a combination) to different client connections and MAY use external information, such as the IP address of the client, to determine which mode to provide to any given connection.

服务器可以向不同的客户端连接提供不同的行为模式(传输、读卡器或组合),并且可以使用外部信息(例如客户端的IP地址)来确定向任何给定连接提供哪种模式。

The official TCP port for the NNTP service is 119. However, if a host wishes to offer separate servers for transit and reading clients, port 433 SHOULD be used for the transit server and 119 for the reading server.

NNTP服务的官方TCP端口是119。但是,如果主机希望为传输和读取客户端提供单独的服务器,则传输服务器应使用端口433,读取服务器应使用端口119。

3.4.2. Mode Switching
3.4.2. 模式转换

An implementation MAY, but SHOULD NOT, provide both transit and reader facilities on the same server but require the client to select which it wishes to use. Such an arrangement is called a "mode-switching" server.

一个实现可以(但不应该)在同一台服务器上同时提供传输和读卡器设施,但要求客户端选择它希望使用的设备。这种安排被称为“模式切换”服务器。

A mode-switching server has two modes:

模式切换服务器有两种模式:

o Transit mode, which applies after the initial connection.

o 传输模式,在初始连接后应用。

* It MUST advertise the MODE-READER capability.

* 它必须宣传模式读取器功能。

* It MUST NOT advertise the READER capability.

* 它不能宣传阅读器的功能。

However, the server MAY cease to advertise the MODE-READER capability after the client uses any command except CAPABILITIES.

但是,在客户端使用除功能之外的任何命令后,服务器可能会停止播发模式读取器功能。

o Reading mode, after a successful MODE READER command (see Section 5.3).

o 读取模式,在模式读取器命令成功后(见第5.3节)。

* It MUST NOT advertise the MODE-READER capability.

* 它不得宣传模式读取器功能。

* It MUST advertise the READER capability.

* 它必须宣传读者的能力。

* It MAY NOT advertise the IHAVE capability, even if it was advertising it in transit mode.

* 它可能不会宣传IHAVE功能,即使是在运输模式下宣传。

A client SHOULD only issue a MODE READER command to a server if it is advertising the MODE-READER capability. If the server does not support CAPABILITIES (and therefore does not conform to this specification), the client MAY use the following heuristic:

如果客户机正在宣传模式读取器功能,则只应向服务器发出模式读取器命令。如果服务器不支持功能(因此不符合本规范),则客户端可以使用以下启发式方法:

o If the client wishes to use any "reader" commands, it SHOULD use the MODE READER command immediately after the initial connection.

o 如果客户端希望使用任何“读卡器”命令,则应在初始连接后立即使用模式读卡器命令。

o Otherwise, it SHOULD NOT use the MODE READER command.

o 否则,不应使用模式读取器命令。

In each case, it should be prepared for some commands to be unavailable that would have been available if it had made the other choice.

在每种情况下,都应该准备好让某些命令不可用,如果它做出其他选择,这些命令本来是可用的。

3.5. Pipelining
3.5. 流水线

NNTP is designed to operate over a reliable bi-directional connection, such as TCP. Therefore, if a command does not depend on the response to the previous one, it should not matter if it is sent before that response is received. Doing this is called "pipelining". However, certain server implementations throw away all text received from the client following certain commands before sending their response. If this happens, pipelining will be affected because one or more commands will have been ignored or misinterpreted, and the client will be matching the wrong responses to each command. Since there are significant benefits to pipelining, but also circumstances where it is reasonable or common for servers to behave in the above

NNTP旨在通过可靠的双向连接(如TCP)运行。因此,如果命令不依赖于对前一个命令的响应,那么在接收到该响应之前是否发送该命令就无关紧要了。这样做被称为“流水线”。但是,某些服务器实现会在发送响应之前丢弃从客户机接收到的所有文本,这些文本遵循某些命令。如果发生这种情况,管道将受到影响,因为一个或多个命令将被忽略或误解,并且客户端将为每个命令匹配错误的响应。由于流水线有着显著的好处,但在某些情况下,服务器在上述情况下的行为是合理的或常见的

manner, this document puts certain requirements on both clients and servers.

因此,本文档对客户端和服务器都提出了某些要求。

Except where stated otherwise, a client MAY use pipelining. That is, it may send a command before receiving the response for the previous command. The server MUST allow pipelining and MUST NOT throw away any text received after a command. Irrespective of whether pipelining is used, the server MUST process commands in the order they are sent.

除非另有说明,客户可以使用管道。也就是说,它可以在接收前一个命令的响应之前发送命令。服务器必须允许流水线,并且不能丢弃命令后接收到的任何文本。无论是否使用管道,服务器都必须按照命令发送的顺序处理命令。

If the specific description of a command says it "MUST NOT be pipelined", that command MUST end any pipeline of commands. That is, the client MUST NOT send any following command until it receives the CRLF at the end of the response from the command. The server MAY ignore any data received after the command and before the CRLF at the end of the response is sent to the client.

如果某个命令的特定描述中说它“不得管道化”,则该命令必须结束任何命令管道。也就是说,客户端在从命令响应结束时收到CRLF之前,不得发送任何以下命令。服务器可能会忽略在命令之后、响应结束时的CRLF发送到客户端之前接收到的任何数据。

The initial connection must not be part of a pipeline; that is, the client MUST NOT send any command until it receives the CRLF at the end of the greeting.

初始连接不得是管道的一部分;也就是说,在问候结束时收到CRLF之前,客户端不得发送任何命令。

If the client uses blocking system calls to send commands, it MUST ensure that the amount of text sent in pipelining does not cause a deadlock between transmission and reception. The amount of text involved will depend on window sizes in the transmission layer; typically, it is 4k octets for TCP. (Since the server only sends data in response to commands from the client, the converse problem does not occur.)

如果客户端使用阻塞系统调用发送命令,则必须确保在管道中发送的文本量不会导致传输和接收之间的死锁。所涉及的文本量将取决于传输层中的窗口大小;通常,TCP的字节数为4k。(由于服务器仅发送数据以响应来自客户端的命令,因此不会出现相反的问题。)

3.5.1. Examples
3.5.1. 例子

Example of correct use of pipelining:

正确使用管道的示例:

      [C] GROUP misc.test
      [C] STAT
      [C] NEXT
      [S] 211 1234 3000234 3002322 misc.test
      [S] 223 3000234 <45223423@example.com> retrieved
      [S] 223 3000237 <668929@example.org> retrieved
        
      [C] GROUP misc.test
      [C] STAT
      [C] NEXT
      [S] 211 1234 3000234 3002322 misc.test
      [S] 223 3000234 <45223423@example.com> retrieved
      [S] 223 3000237 <668929@example.org> retrieved
        

Example of incorrect use of pipelining (the MODE READER command may not be pipelined):

不正确使用流水线的示例(模式读取器命令可能没有流水线):

      [C] MODE READER
      [C] DATE
      [C] NEXT
      [S] 200 Server ready, posting allowed
      [S] 223 3000237 <668929@example.org> retrieved
        
      [C] MODE READER
      [C] DATE
      [C] NEXT
      [S] 200 Server ready, posting allowed
      [S] 223 3000237 <668929@example.org> retrieved
        

The DATE command has been thrown away by the server, so there is no 111 response to match it.

DATE命令已被服务器丢弃,因此没有与之匹配的响应。

3.6. Articles
3.6. 文章

NNTP is intended to transfer articles between clients and servers. For the purposes of this specification, articles are required to conform to the rules in this section, and clients and servers MUST correctly process any article received from the other that does so. Note that this requirement applies only to the contents of communications over NNTP; it does not prevent the client or server from subsequently rejecting an article for reasons of local policy. Also see Appendix A for further restrictions on the format of articles in some uses of NNTP.

NNTP用于在客户端和服务器之间传输文章。就本规范而言,项目必须符合本节中的规则,客户机和服务器必须正确处理从另一方收到的任何项目。注意,本要求仅适用于NNTP上的通信内容;它不会阻止客户端或服务器基于本地策略的原因拒绝文章。另见附录A,了解NNTP某些用途中条款格式的进一步限制。

An article consists of two parts: the headers and the body. They are separated by a single empty line, or in other words by two consecutive CRLF pairs (if there is more than one empty line, the second and subsequent ones are part of the body). In order to meet the general requirements of NNTP, an article MUST NOT include the octet NUL, MUST NOT contain the octets LF and CR other than as part of a CRLF pair, and MUST end with a CRLF pair. This specification puts no further restrictions on the body; in particular, it MAY be empty.

一篇文章由两部分组成:标题和正文。它们由一个空行分隔,或者换句话说,由两个连续的CRLF对分隔(如果有多个空行,则第二个和后续的空行是主体的一部分)。为了满足NNTP的一般要求,物品不得包含八位元NUL,不得包含八位元LF和CR,除非作为CRLF对的一部分,并且必须以CRLF对结尾。本规范对车身没有进一步的限制;特别是,它可能是空的。

The headers of an article consist of one or more header lines. Each header line consists of a header name, a colon, a space, the header content, and a CRLF, in that order. The name consists of one or more printable US-ASCII characters other than colon and, for the purposes of this specification, is not case sensitive. There MAY be more than one header line with the same name. The content MUST NOT contain CRLF; it MAY be empty. A header may be "folded"; that is, a CRLF pair may be placed before any TAB or space in the line. There MUST still be some other octet between any two CRLF pairs in a header line. (Note that folding means that the header line occupies more than one line when displayed or transmitted; nevertheless, it is still referred to as "a" header line.) The presence or absence of folding does not affect the meaning of the header line; that is, the CRLF pairs introduced by folding are not considered part of the header content. Header lines SHOULD NOT be folded before the space after the colon that follows the header name and SHOULD include at least one octet other than %x09 or %x20 between CRLF pairs. However, if an article that fails to satisfy this requirement has been received from elsewhere, clients and servers MAY transfer it to each other without re-folding it.

文章的标题由一行或多行标题组成。每个标题行按顺序由标题名、冒号、空格、标题内容和CRLF组成。该名称由一个或多个可打印的US-ASCII字符(冒号除外)组成,就本规范而言,不区分大小写。可能有多个标题行具有相同的名称。内容不得包含CRLF;它可能是空的。标题可以“折叠”;也就是说,CRLF对可以放置在行中的任何选项卡或空格之前。在头行中的任意两个CRLF对之间一定还有其他八位字节。(注意,折叠意味着标题行在显示或传输时占据多行;然而,它仍然被称为“a”标题行。)折叠的存在或不存在并不影响标题行的含义;也就是说,通过折叠引入的CRLF对不被视为标题内容的一部分。标题行不应折叠在标题名称后面的冒号后面的空格之前,并且在CRLF对之间至少应包含一个除%x09或%x20以外的八位字节。但是,如果从其他地方收到了不符合此要求的物品,则客户端和服务器可以相互传送该物品,而无需重新折叠。

The content of a header SHOULD be in UTF-8. However, if an implementation receives an article from elsewhere that uses octets in the range 128 to 255 in some other manner, it MAY pass it to a client or server without modification. Therefore, implementations MUST be prepared to receive such headers, and data derived from them (e.g., in the responses from the OVER command, Section 8.3), and MUST NOT assume that they are always UTF-8. Any external processing of those headers, including identifying the encoding used, is outside the scope of this document.

标题的内容应为UTF-8格式。但是,如果一个实现从其他地方接收到一篇文章,该文章以某种其他方式使用128到255范围内的八位字节,那么它可以将其传递给客户机或服务器,而无需修改。因此,实现必须准备好接收这些头以及从中派生的数据(例如,在OVER命令的响应中,第8.3节),并且不能假设它们总是UTF-8。这些头的任何外部处理,包括识别所使用的编码,都不在本文档的范围之内。

Each article MUST have a unique message-id; two articles offered by an NNTP server MUST NOT have the same message-id. For the purposes of this specification, message-ids are opaque strings that MUST meet the following requirements:

每篇文章必须有一个唯一的消息id;NNTP服务器提供的两个项目不得具有相同的message-id。就本规范而言,message id是不透明字符串,必须满足以下要求:

o A message-id MUST begin with "<", end with ">", and MUST NOT contain the latter except at the end.

o 消息id必须以“<”开头,以“>”结尾,并且除结尾外不得包含后者。

o A message-id MUST be between 3 and 250 octets in length.

o 消息id的长度必须介于3到250个八位字节之间。

o A message-id MUST NOT contain octets other than printable US-ASCII characters.

o 消息id不得包含除可打印US-ASCII字符以外的八位字节。

Two message-ids are the same if and only if they consist of the same sequence of octets.

两个消息ID是相同的当且仅当它们由相同的八位字节序列组成时。

This specification does not describe how the message-id of an article is determined. If the server does not have any way to determine a message-id from the article itself, it MUST synthesize one (this specification does not require that the article be changed as a result). See also Appendix A.2.

本规范不描述如何确定文章的消息id。如果服务器无法从文章本身确定消息id,则必须合成一个(此规范不要求因此更改文章)。另见附录A.2。

4. The WILDMAT Format
4. WILDMAT格式

The WILDMAT format described here is based on the version first developed by Rich Salz [SALZ1992], which was in turn derived from the format used in the UNIX "find" command to articulate file names. It was developed to provide a uniform mechanism for matching patterns in the same manner that the UNIX shell matches filenames.

这里描述的WILDMAT格式基于Rich Salz[SALZ1992]首先开发的版本,该版本反过来又源自UNIX“find”命令中用于明确文件名的格式。开发它是为了提供一种统一的模式匹配机制,其方式与UNIX shell匹配文件名的方式相同。

4.1. Wildmat Syntax
4.1. Wildmat语法

A wildmat is described by the following ABNF [RFC4234] syntax, which is an extract of that in Section 9.8.

wildmat由以下ABNF[RFC4234]语法描述,这是第9.8节中的摘录。

     wildmat = wildmat-pattern *("," ["!"] wildmat-pattern)
     wildmat-pattern = 1*wildmat-item
     wildmat-item = wildmat-exact / wildmat-wild
     wildmat-exact = %x22-29 / %x2B / %x2D-3E / %x40-5A / %x5E-7E /
          UTF8-non-ascii ; exclude ! * , ? [ \ ]
     wildmat-wild = "*" / "?"
        
     wildmat = wildmat-pattern *("," ["!"] wildmat-pattern)
     wildmat-pattern = 1*wildmat-item
     wildmat-item = wildmat-exact / wildmat-wild
     wildmat-exact = %x22-29 / %x2B / %x2D-3E / %x40-5A / %x5E-7E /
          UTF8-non-ascii ; exclude ! * , ? [ \ ]
     wildmat-wild = "*" / "?"
        

Note: the characters ",", "\", "[", and "]" are not allowed in wildmats, while * and ? are always wildcards. This should not be a problem, since these characters cannot occur in newsgroup names, which is the only current use of wildmats. Backslash is commonly used to suppress the special meaning of characters, whereas brackets are used to introduce sets. However, these usages are not universal, and interpretation of these characters in the context of UTF-8 strings is potentially complex and differs from existing practice, so they were omitted from this specification. A future extension to this specification may provide semantics for these characters.

注意:wildmats中不允许使用字符“、”、“\”、“[”和“]”,而*和?它们总是通配符。这应该不是问题,因为这些字符不能出现在新闻组名称中,而新闻组名称是当前唯一使用的wildmats。反斜杠通常用于抑制字符的特殊含义,而括号用于引入集合。然而,这些用法并不通用,在UTF-8字符串的上下文中对这些字符的解释可能很复杂,并且与现有实践不同,因此本规范中省略了这些字符。该规范的未来扩展可能会为这些字符提供语义。

4.2. Wildmat Semantics
4.2. Wildmat语义学

A wildmat is tested against a string and either matches or does not match. To do this, each constituent <wildmat-pattern> is matched against the string, and the rightmost pattern that matches is identified. If that <wildmat-pattern> is not preceded with "!", the whole wildmat matches. If it is preceded by "!", or if no <wildmat-pattern> matches, the whole wildmat does not match.

wildmat针对字符串进行测试,并且匹配或不匹配。为此,每个成分<wildmat pattern>都与字符串匹配,并识别匹配的最右边的模式。如果该<wildmat pattern>前面没有“!”,则整个wildmat匹配。如果前面有“!”,或者如果没有匹配的<wildmat pattern>,则整个wildmat不匹配。

For example, consider the wildmat "a*,!*b,*c*":

例如,考虑WelMead“A*,**B,*C*”:

o The string "aaa" matches because the rightmost match is with "a*".

o 字符串“aaa”匹配,因为最右边的匹配与“a*”匹配。

o The string "abb" does not match because the rightmost match is with "*b".

o 字符串“abb”不匹配,因为最右边的匹配项与“*b”匹配。

o The string "ccb" matches because the rightmost match is with "*c*".

o 字符串“ccb”匹配,因为最右边的匹配与“*c*”匹配。

o The string "xxx" does not match because no <wildmat-pattern> matches.

o 字符串“xxx”不匹配,因为没有匹配的<wildmat pattern>。

A <wildmat-pattern> matches a string if the string can be broken into components, each of which matches the corresponding <wildmat-item> in the pattern. The matches must be in the same order, and the whole

如果字符串可以分解为多个组件,则<wildmat pattern>与字符串匹配,每个组件都与模式中相应的<wildmat item>匹配。匹配项的顺序必须相同,并且整个

string must be used in the match. The pattern is "anchored"; that is, the first and last characters in the string must match the first and last item, respectively (unless that item is an asterisk matching zero characters).

必须在匹配中使用字符串。模式是“锚定的”;也就是说,字符串中的第一个和最后一个字符必须分别与第一个和最后一个项目匹配(除非该项目是与零个字符匹配的星号)。

A <wildmat-exact> matches the same character (which may be more than one octet in UTF-8).

<wildmat exact>匹配相同的字符(UTF-8中可能有多个八位组)。

"?" matches exactly one character (which may be more than one octet).

“?”正好匹配一个字符(可能是多个八位字节)。

"*" matches zero or more characters. It can match an empty string, but it cannot match a subsequence of a UTF-8 sequence that is not aligned to the character boundaries.

“*”匹配零个或多个字符。它可以匹配空字符串,但不能匹配未与字符边界对齐的UTF-8序列的子序列。

4.3. Extensions
4.3. 扩展

An NNTP server or extension MAY extend the syntax or semantics of wildmats provided that all wildmats that meet the requirements of Section 4.1 have the meaning ascribed to them by Section 4.2. Future editions of this document may also extend wildmats.

NNTP服务器或扩展可以扩展wildmats的语法或语义,前提是满足第4.1节要求的所有wildmats具有第4.2节赋予它们的含义。本文件的未来版本也可能扩展wildmats。

4.4. Examples
4.4. 例子

In these examples, $ and @ are used to represent the two octets %xC2 and %xA3, respectively; $@ is thus the UTF-8 encoding for the pound sterling symbol, shown as # in the descriptions.

在这些示例中,$和@分别用于表示两个八位字节%xC2和%xA3;$@因此是英镑符号的UTF-8编码,如描述中的#所示。

     Wildmat    Description of strings that match
       abc      The one string "abc"
       abc,def  The two strings "abc" and "def"
       $@       The one character string "#"
       a*       Any string that begins with "a"
       a*b      Any string that begins with "a" and ends with "b"
       a*,*b    Any string that begins with "a" or ends with "b"
       a*,!*b   Any string that begins with "a" and does not end with
                "b"
     a*,!*b,c*  Any string that begins with "a" and does not end with
                "b", and any string that begins with "c" no matter
                what it ends with
     a*,c*,!*b  Any string that begins with "a" or "c" and does not
                end with "b"
       ?a*      Any string with "a" as its second character
       ??a*     Any string with "a" as its third character
       *a?      Any string with "a" as its penultimate character
       *a??     Any string with "a" as its antepenultimate character
        
     Wildmat    Description of strings that match
       abc      The one string "abc"
       abc,def  The two strings "abc" and "def"
       $@       The one character string "#"
       a*       Any string that begins with "a"
       a*b      Any string that begins with "a" and ends with "b"
       a*,*b    Any string that begins with "a" or ends with "b"
       a*,!*b   Any string that begins with "a" and does not end with
                "b"
     a*,!*b,c*  Any string that begins with "a" and does not end with
                "b", and any string that begins with "c" no matter
                what it ends with
     a*,c*,!*b  Any string that begins with "a" or "c" and does not
                end with "b"
       ?a*      Any string with "a" as its second character
       ??a*     Any string with "a" as its third character
       *a?      Any string with "a" as its penultimate character
       *a??     Any string with "a" as its antepenultimate character
        
5. Session Administration Commands
5. 会话管理命令
5.1. Initial Connection
5.1. 初始连接
5.1.1. Usage
5.1.1. 用法

This command MUST NOT be pipelined.

此命令不能通过管道传输。

   Responses [1]
     200    Service available, posting allowed
     201    Service available, posting prohibited
     400    Service temporarily unavailable [2]
     502    Service permanently unavailable [2]
        
   Responses [1]
     200    Service available, posting allowed
     201    Service available, posting prohibited
     400    Service temporarily unavailable [2]
     502    Service permanently unavailable [2]
        

[1] These are the only valid response codes for the initial greeting; the server MUST not return any other generic response code.

[1] 这些是初始问候语的唯一有效回复代码;服务器不得返回任何其他通用响应代码。

[2] Following a 400 or 502 response, the server MUST immediately close the connection.

[2] 在400或502响应之后,服务器必须立即关闭连接。

5.1.2. Description
5.1.2. 描述

There is no command presented by the client upon initial connection to the server. The server MUST present an appropriate response code as a greeting to the client. This response informs the client whether service is available and whether the client is permitted to post.

在初始连接到服务器时,客户端没有显示任何命令。服务器必须提供适当的响应代码作为对客户端的问候语。此响应通知客户端服务是否可用以及是否允许客户端发布。

If the server will accept further commands from the client including POST, the server MUST present a 200 greeting code. If the server will accept further commands from the client, but the client is not authorized to post articles using the POST command, the server MUST present a 201 greeting code.

如果服务器将接受来自客户端的进一步命令(包括POST),则服务器必须提供200个问候语代码。如果服务器将接受来自客户端的进一步命令,但客户端无权使用post命令发布文章,则服务器必须提供201问候语代码。

Otherwise, the server MUST present a 400 or 502 greeting code and then immediately close the connection. 400 SHOULD be used if the issue is only temporary (for example, because of load) and the client can expect to be able to connect successfully at some point in the future without making any changes. 502 MUST be used if the client is not permitted under any circumstances to interact with the server, and MAY be used if the server has insufficient information to determine whether the issue is temporary or permanent.

否则,服务器必须提供400或502问候语代码,然后立即关闭连接。如果问题只是暂时的(例如,由于负载),并且客户端可以期望在将来的某个时间点成功连接,而无需进行任何更改,则应使用400。如果在任何情况下都不允许客户端与服务器交互,则必须使用502,如果服务器没有足够的信息来确定问题是暂时的还是永久的,则可以使用502。

Note: the distinction between the 200 and 201 response codes has turned out in practice to be insufficient; for example, some servers do not allow posting until the client has authenticated, while other clients assume that a 201 response means that posting will never be possible even after authentication. Therefore, clients SHOULD use

注:实践证明,200和201响应代码之间的区别不够充分;例如,一些服务器在客户端进行身份验证之前不允许发布,而其他客户端则认为201响应意味着即使在身份验证之后也不可能发布。因此,客户端应该使用

the CAPABILITIES command (Section 5.2) rather than rely on this response.

能力司令部(第5.2节)不依赖此响应。

5.1.3. Examples
5.1.3. 例子

Example of a normal connection from an authorized client that then terminates the session (see Section 5.4):

来自授权客户端并随后终止会话的正常连接示例(参见第5.4节):

      [Initial connection set-up completed.]
      [S] 200 NNTP Service Ready, posting permitted
      [C] QUIT
      [S] 205 NNTP Service exits normally
      [Server closes connection.]
        
      [Initial connection set-up completed.]
      [S] 200 NNTP Service Ready, posting permitted
      [C] QUIT
      [S] 205 NNTP Service exits normally
      [Server closes connection.]
        

Example of a normal connection from an authorized client that is not permitted to post, which also immediately terminates the session:

来自授权客户端的不允许post的正常连接示例,该连接也会立即终止会话:

      [Initial connection set-up completed.]
      [S] 201 NNTP Service Ready, posting prohibited
      [C] QUIT
      [S] 205 NNTP Service exits normally
      [Server closes connection.]
        
      [Initial connection set-up completed.]
      [S] 201 NNTP Service Ready, posting prohibited
      [C] QUIT
      [S] 205 NNTP Service exits normally
      [Server closes connection.]
        

Example of a normal connection from an unauthorized client:

来自未经授权客户端的正常连接示例:

      [Initial connection set-up completed.]
      [S] 502 NNTP Service permanently unavailable
      [Server closes connection.]
        
      [Initial connection set-up completed.]
      [S] 502 NNTP Service permanently unavailable
      [Server closes connection.]
        

Example of a connection from a client if the server is unable to provide service:

如果服务器无法提供服务,则来自客户端的连接示例:

      [Initial connection set-up completed.]
      [S] 400 NNTP Service temporarily unavailable
      [Server closes connection.]
        
      [Initial connection set-up completed.]
      [S] 400 NNTP Service temporarily unavailable
      [Server closes connection.]
        
5.2. CAPABILITIES
5.2. 能力
5.2.1. Usage
5.2.1. 用法

This command is mandatory.

此命令是必需的。

Syntax CAPABILITIES [keyword]

语法功能[关键字]

Responses 101 Capability list follows (multi-line)

响应101能力列表如下(多行)

Parameters keyword additional feature, see description

参数关键字附加功能,请参见说明

5.2.2. Description
5.2.2. 描述

The CAPABILITIES command allows a client to determine the capabilities of the server at any given time.

CAPABILITIES命令允许客户端在任何给定时间确定服务器的功能。

This command MAY be issued at any time; the server MUST NOT require it to be issued in order to make use of any capability. The response generated by this command MAY change during a session because of other state information (which, in turn, may be changed by the effects of other commands or by external events). An NNTP client is only able to get the current and correct information concerning available capabilities at any point during a session by issuing a CAPABILITIES command at that point of that session and processing the response.

该命令可随时发出;服务器不得为了使用任何功能而要求发布它。此命令生成的响应在会话期间可能会因其他状态信息而更改(反过来,这些信息可能会因其他命令或外部事件的影响而更改)。NNTP客户端只能通过在会话期间的任何时间点发出capabilities命令并处理响应来获取有关可用功能的当前和正确信息。

The capability list is returned as a multi-line data block following the 101 response code. Each capability is described by a separate capability line. The server MUST NOT list the same capability twice in the response, even with different arguments. Except that the VERSION capability MUST be the first line, the order in which the capability lines appears is not significant; the server need not even consistently return the same order.

能力列表作为101响应代码后的多行数据块返回。每个能力由单独的能力行描述。服务器不能在响应中两次列出相同的功能,即使参数不同。除了版本能力必须是第一行外,能力行出现的顺序并不重要;服务器甚至不需要一致地返回相同的订单。

While some capabilities are likely to be always available or never available, others (notably extensions) will appear and disappear depending on server state changes within the session or on external events between sessions. An NNTP client MAY cache the results of this command, but MUST NOT rely on the correctness of any cached results, whether from earlier in this session or from a previous session, MUST cope gracefully with the cached status being out of date, and SHOULD (if caching results) provide a way to force the cached information to be refreshed. Furthermore, a client MUST NOT use cached results in relation to security, privacy, and authentication extensions. See Section 12.6 for further discussion of this topic.

虽然某些功能可能始终可用或永远不可用,但其他功能(尤其是扩展)将根据会话内的服务器状态更改或会话之间的外部事件而出现或消失。NNTP客户端可以缓存此命令的结果,但不得依赖于任何缓存结果的正确性,无论是来自此会话早期还是来自上一个会话,必须优雅地处理缓存状态已过期,并且(如果缓存结果)应提供强制刷新缓存信息的方法。此外,客户端不得使用与安全性、隐私和身份验证扩展相关的缓存结果。有关此主题的进一步讨论,请参见第12.6节。

The keyword argument is not used by this specification. It is provided so that extensions or revisions to this specification can include extra features for this command without requiring the CAPABILITIES command to be used twice (once to determine if the extra features are available, and a second time to make use of them). If the server does not recognise the argument (and it is a keyword), it MUST respond with the 101 response code as if the argument had been omitted. If an argument is provided that the server does recognise, it MAY use the 101 response code or MAY use some other response code

此规范未使用关键字参数。它的提供使得本规范的扩展或修订可以包括该命令的额外功能,而无需使用“能力”命令两次(一次用于确定额外功能是否可用,第二次用于使用它们)。如果服务器无法识别该参数(它是一个关键字),则必须使用101响应代码进行响应,就像忽略了该参数一样。如果提供了服务器无法识别的参数,则可能会使用101响应代码或其他响应代码

(which will be defined in the specification of that feature). If the argument is not a keyword, the 501 generic response code MUST be returned. The server MUST NOT generate any other response code to the CAPABILITIES command.

(将在该特性的规范中定义)。如果参数不是关键字,则必须返回501通用响应代码。服务器不得对CAPABILITIES命令生成任何其他响应代码。

5.2.3. Examples
5.2.3. 例子

Example of a minimal response (a read-only server):

最小响应示例(只读服务器):

      [C] CAPABILITIES
      [S] 101 Capability list:
      [S] VERSION 2
      [S] READER
      [S] LIST ACTIVE NEWSGROUPS
      [S] .
        
      [C] CAPABILITIES
      [S] 101 Capability list:
      [S] VERSION 2
      [S] READER
      [S] LIST ACTIVE NEWSGROUPS
      [S] .
        

Example of a response from a server that has a range of facilities and that also describes itself:

来自具有一系列设施且描述自身的服务器的响应示例:

      [C] CAPABILITIES
      [S] 101 Capability list:
      [S] VERSION 2
      [S] READER
      [S] IHAVE
      [S] POST
      [S] NEWNEWS
      [S] LIST ACTIVE NEWSGROUPS ACTIVE.TIMES OVERVIEW.FMT
      [S] IMPLEMENTATION INN 4.2 2004-12-25
      [S] OVER MSGID
      [S] STREAMING
      [S] XSECRET
      [S] .
        
      [C] CAPABILITIES
      [S] 101 Capability list:
      [S] VERSION 2
      [S] READER
      [S] IHAVE
      [S] POST
      [S] NEWNEWS
      [S] LIST ACTIVE NEWSGROUPS ACTIVE.TIMES OVERVIEW.FMT
      [S] IMPLEMENTATION INN 4.2 2004-12-25
      [S] OVER MSGID
      [S] STREAMING
      [S] XSECRET
      [S] .
        

Example of a server that supports more than one version of NNTP:

支持多个NNTP版本的服务器示例:

      [C] CAPABILITIES
      [S] 101 Capability list:
      [S] VERSION 2 3
      [S] READER
      [S] LIST ACTIVE NEWSGROUPS
      [S] .
        
      [C] CAPABILITIES
      [S] 101 Capability list:
      [S] VERSION 2 3
      [S] READER
      [S] LIST ACTIVE NEWSGROUPS
      [S] .
        

Example of a client attempting to use a feature of the CAPABILITIES command that the server does not support:

客户端试图使用服务器不支持的CAPABILITIES命令功能的示例:

      [C] CAPABILITIES AUTOUPDATE
      [S] 101 Capability list:
      [S] VERSION 2
      [S] READER
      [S] IHAVE
      [S] LIST ACTIVE NEWSGROUPS OVERVIEW.FMT HEADERS
      [S] OVER MSGID
      [S] HDR
      [S] NEWNEWS
      [S] .
        
      [C] CAPABILITIES AUTOUPDATE
      [S] 101 Capability list:
      [S] VERSION 2
      [S] READER
      [S] IHAVE
      [S] LIST ACTIVE NEWSGROUPS OVERVIEW.FMT HEADERS
      [S] OVER MSGID
      [S] HDR
      [S] NEWNEWS
      [S] .
        
5.3. MODE READER
5.3. 模式读取器
5.3.1. Usage
5.3.1. 用法

Indicating capability: MODE-READER

指示能力:模式读取器

This command MUST NOT be pipelined.

此命令不能通过管道传输。

Syntax MODE READER

语法模式读取器

Responses 200 Posting allowed 201 Posting prohibited 502 Reading service permanently unavailable [1]

回复200允许发帖201禁止发帖502阅读服务永久不可用[1]

[1] Following a 502 response the server MUST immediately close the connection.

[1] 在502响应之后,服务器必须立即关闭连接。

5.3.2. Description
5.3.2. 描述

The MODE READER command instructs a mode-switching server to switch modes, as described in Section 3.4.2.

如第2.3节中所述,将命令切换至服务器模式。

If the server is mode-switching, it switches from its transit mode to its reader mode, indicating this by changing the capability list accordingly. It MUST then return a 200 or 201 response with the same meaning as for the initial greeting (as described in Section 5.1.1). Note that the response need not be the same as that presented during the initial greeting. The client MUST NOT issue MODE READER more than once in a session or after any security or privacy commands are issued. When the MODE READER command is issued, the server MAY reset its state to that immediately after the initial connection before switching mode.

如果服务器正在进行模式切换,它将从传输模式切换到读卡器模式,通过相应地更改功能列表来指示这一点。然后,它必须返回一个200或201响应,其含义与初始问候语相同(如第5.1.1节所述)。请注意,响应不必与初次问候时给出的响应相同。在会话中或在发出任何安全或隐私命令后,客户端不得多次发出模式读取器。当发出模式读取器命令时,服务器可以在切换模式之前立即将其状态重置为初始连接后的状态。

If the server is not mode-switching, then the following apply:

如果服务器未进行模式切换,则以下情况适用:

o If it advertises the READER capability, it MUST return a 200 or 201 response with the same meaning as for the initial greeting; in this case, the command MUST NOT affect the server state in any way.

o 如果它宣传阅读器功能,它必须返回一个200或201响应,其含义与最初的问候语相同;在这种情况下,该命令不得以任何方式影响服务器状态。

o If it does not advertise the READER capability, it MUST return a 502 response and then immediately close the connection.

o 如果没有公布读卡器功能,则必须返回502响应,然后立即关闭连接。

5.3.3. Examples
5.3.3. 例子

Example of use of the MODE READER command on a transit-only server (which therefore does not providing reading facilities):

仅传输服务器(因此不提供读取设施)上使用模式读取器命令的示例:

      [C] CAPABILITIES
      [S] 101 Capability list:
      [S] VERSION 2
      [S] IHAVE
      [S] .
      [C] MODE READER
      [S] 502 Transit service only
      [Server closes connection.]
        
      [C] CAPABILITIES
      [S] 101 Capability list:
      [S] VERSION 2
      [S] IHAVE
      [S] .
      [C] MODE READER
      [S] 502 Transit service only
      [Server closes connection.]
        

Example of use of the MODE READER command on a server that provides reading facilities:

在提供读取功能的服务器上使用MODE READER命令的示例:

      [C] CAPABILITIES
      [S] 101 Capability list:
      [S] VERSION 2
      [S] READER
      [S] LIST ACTIVE NEWSGROUPS
      [S] .
      [C] MODE READER
      [S] 200 Reader mode, posting permitted
      [C] IHAVE <i.am.an.article.you.have@example.com>
      [S] 500 Permission denied
      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
        
      [C] CAPABILITIES
      [S] 101 Capability list:
      [S] VERSION 2
      [S] READER
      [S] LIST ACTIVE NEWSGROUPS
      [S] .
      [C] MODE READER
      [S] 200 Reader mode, posting permitted
      [C] IHAVE <i.am.an.article.you.have@example.com>
      [S] 500 Permission denied
      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
        

Note that in both of these situations, the client SHOULD NOT use MODE READER.

请注意,在这两种情况下,客户端不应使用模式读取器。

Example of use of the MODE READER command on a mode-switching server:

在模式切换服务器上使用模式读取器命令的示例:

      [C] CAPABILITIES
      [S] 101 Capability list:
      [S] VERSION 2
      [S] IHAVE
      [S] MODE-READER
      [S] .
      [C] MODE READER
      [S] 200 Reader mode, posting permitted
      [C] CAPABILITIES
      [S] 101 Capability list:
      [S] VERSION 2
      [S] READER
      [S] NEWNEWS
      [S] LIST ACTIVE NEWSGROUPS
      [S] STARTTLS
      [S] .
        
      [C] CAPABILITIES
      [S] 101 Capability list:
      [S] VERSION 2
      [S] IHAVE
      [S] MODE-READER
      [S] .
      [C] MODE READER
      [S] 200 Reader mode, posting permitted
      [C] CAPABILITIES
      [S] 101 Capability list:
      [S] VERSION 2
      [S] READER
      [S] NEWNEWS
      [S] LIST ACTIVE NEWSGROUPS
      [S] STARTTLS
      [S] .
        

In this case, the server offers (but does not require) TLS privacy in its reading mode but not in its transit mode.

在这种情况下,服务器在其读取模式下提供(但不要求)TLS隐私,但在传输模式下不提供。

Example of use of the MODE READER command where the client is not permitted to post:

不允许客户端发布的模式读取器命令的使用示例:

[C] MODE READER [S] 201 NNTP Service Ready, posting prohibited

[C] 模式读取器[S]201 NNTP服务就绪,禁止发布

5.4. QUIT
5.4. 退出
5.4.1. Usage
5.4.1. 用法

This command is mandatory.

此命令是必需的。

Syntax QUIT

语法退出

Responses 205 Connection closing

响应205连接关闭

5.4.2. Description
5.4.2. 描述

The client uses the QUIT command to terminate the session. The server MUST acknowledge the QUIT command and then close the connection to the client. This is the preferred method for a client to indicate that it has finished all of its transactions with the NNTP server.

客户端使用QUIT命令终止会话。服务器必须确认QUIT命令,然后关闭与客户端的连接。这是客户端指示其已完成与NNTP服务器的所有事务的首选方法。

If a client simply disconnects (or if the connection times out or some other fault occurs), the server MUST gracefully cease its attempts to service the client, disconnecting from its end if necessary.

如果客户机只是断开连接(或者如果连接超时或发生其他故障),服务器必须正常停止为客户机提供服务的尝试,必要时从其端断开连接。

The server MUST NOT generate any response code to the QUIT command other than 205 or, if any arguments are provided, 501.

除了205或501(如果提供了任何参数)之外,服务器不得生成任何对QUIT命令的响应代码。

5.4.3. Examples
5.4.3. 例子
      [C] QUIT
      [S] 205 closing connection
      [Server closes connection.]
        
      [C] QUIT
      [S] 205 closing connection
      [Server closes connection.]
        
6. Article Posting and Retrieval
6. 文章发布和检索

News-reading clients have available a variety of mechanisms to retrieve articles via NNTP. The news articles are stored and indexed using three types of keys. The first type of key is the message-id of an article and is globally unique. The second type of key is composed of a newsgroup name and an article number within that newsgroup. On a particular server, there MUST only be one article with a given number within any newsgroup, and an article MUST NOT have two different numbers in the same newsgroup. An article can be cross-posted to multiple newsgroups, so there may be multiple keys that point to the same article on the same server; these MAY have different numbers in each newsgroup. However, this type of key is not required to be globally unique, so the same key MAY refer to different articles on different servers. (Note that the terms "group" and "newsgroup" are equivalent.)

新闻阅读客户端有多种机制可通过NNTP检索文章。新闻文章使用三种类型的键进行存储和索引。第一种类型的密钥是文章的消息id,并且全局唯一。第二种类型的键由新闻组名称和该新闻组内的文章编号组成。在特定服务器上,任何新闻组中必须只有一篇文章具有给定的编号,并且一篇文章在同一新闻组中不得有两个不同的编号。一篇文章可以交叉发布到多个新闻组,因此可能有多个键指向同一服务器上的同一篇文章;每个新闻组中可能有不同的编号。但是,这种类型的密钥不要求全局唯一,因此同一密钥可能引用不同服务器上的不同文章。(请注意,术语“组”和“新闻组”是等效的。)

The final type of key is the arrival timestamp, giving the time that the article arrived at the server. The server MUST ensure that article numbers are issued in order of arrival timestamp; that is, articles arriving later MUST have higher numbers than those that arrive earlier. The server SHOULD allocate the next sequential unused number to each new article.

最后一种类型的密钥是到达时间戳,给出了文章到达服务器的时间。服务器必须确保物品编号按照到达时间戳的顺序发布;也就是说,晚到的文章必须比早到的文章有更高的数量。服务器应该为每个新项目分配下一个连续的未使用编号。

Article numbers MUST lie between 1 and 2,147,483,647, inclusive. The client and server MAY use leading zeroes in specifying article numbers but MUST NOT use more than 16 digits. In some situations, the value zero replaces an article number to show some special situation.

物品编号必须介于1和2147483647之间(含1和2147483647)。客户端和服务器可以在指定商品编号时使用前导零,但不能使用超过16位的数字。在某些情况下,值0将替换物品编号以显示某些特殊情况。

Note that it is likely that the article number limit of 2,147,483,647 will be increased by a future revision or extension to this specification. While servers MUST NOT send article numbers greater than this current limit, client and server developers are advised to

请注意,本规范的未来修订或扩展可能会增加2147483647的物品数量限制。虽然服务器发送的文章数量不得超过此当前限制,但建议客户端和服务器开发人员

use internal structures and datatypes capable of handling larger values in anticipation of such a change.

使用能够处理较大值的内部结构和数据类型,以应对此类更改。

6.1. Group and Article Selection
6.1. 组和文章选择

The following commands are used to set the "currently selected newsgroup" and the "current article number", which are used by various commands. At the start of an NNTP session, both of these values are set to the special value "invalid".

以下命令用于设置“当前选定的新闻组”和“当前文章编号”,这些命令由各种命令使用。在NNTP会话开始时,这两个值都设置为特殊值“无效”。

6.1.1. GROUP
6.1.1. 组
6.1.1.1. Usage
6.1.1.1. 用法

Indicating capability: READER

指示能力:读卡器

Syntax GROUP group

语法组

Responses 211 number low high group Group successfully selected 411 No such newsgroup

响应211个低-高组成功选择411个无此类新闻组

Parameters group Name of newsgroup number Estimated number of articles in the group low Reported low water mark high Reported high water mark

参数组新闻组名称编号组中估计的文章数低报告的低水位线高报告的高水位线

6.1.1.2. Description
6.1.1.2. 描述

The GROUP command selects a newsgroup as the currently selected newsgroup and returns summary information about it.

GROUP命令选择一个新闻组作为当前选定的新闻组,并返回有关它的摘要信息。

The required argument is the name of the newsgroup to be selected (e.g., "news.software.nntp"). A list of valid newsgroups may be obtained by using the LIST ACTIVE command (see Section 7.6.3).

必需的参数是要选择的新闻组的名称(例如,“news.software.nntp”)。可使用list ACTIVE命令获得有效新闻组列表(见第7.6.3节)。

The successful selection response will return the article numbers of the first and last articles in the group at the moment of selection (these numbers are referred to as the "reported low water mark" and the "reported high water mark") and an estimate of the number of articles in the group currently available.

成功的选择响应将返回选择时组中第一篇和最后一篇文章的文章编号(这些编号称为“报告的低水位线”和“报告的高水位线”),以及组中当前可用文章数量的估计值。

If the group is not empty, the estimate MUST be at least the actual number of articles available and MUST be no greater than one more than the difference between the reported low and high water marks. (Some implementations will actually count the number of articles

如果组不是空的,则估计值必须至少是可用物品的实际数量,并且不得大于报告的低水位线和高水位线之间的差值的一倍。(有些实现实际上会计算文章的数量

currently stored. Others will just subtract the low water mark from the high water mark and add one to get an estimate.)

当前存储的。其他人只需从高水位线中减去低水位线,再加上1即可得到估算值。)

If the group is empty, one of the following three situations will occur. Clients MUST accept all three cases; servers MUST NOT represent an empty group in any other way.

如果组为空,将出现以下三种情况之一。客户必须接受所有三种情况;服务器不得以任何其他方式表示空组。

o The high water mark will be one less than the low water mark, and the estimated article count will be zero. Servers SHOULD use this method to show an empty group. This is the only time that the high water mark can be less than the low water mark.

o 高水位线将比低水位线小一个,预计物品数量将为零。服务器应使用此方法显示空组。这是唯一一次高水位线可以小于低水位线。

o All three numbers will be zero.

o 这三个数字都是零。

o The high water mark is greater than or equal to the low water mark. The estimated article count might be zero or non-zero; if it is non-zero, the same requirements apply as for a non-empty group.

o 高水位线大于或等于低水位线。估计物品计数可能为零或非零;如果为非零,则适用于非空组的相同要求。

The set of articles in a group may change after the GROUP command is carried out:

执行group命令后,组中的项目集可能会更改:

o Articles may be removed from the group.

o 可以从组中删除项目。

o Articles may be reinstated in the group with the same article number, but those articles MUST have numbers no less than the reported low water mark (note that this is a reinstatement of the previous article, not a new article reusing the number).

o 物品可以在具有相同物品编号的组中恢复,但这些物品的编号必须不小于报告的低水位线(请注意,这是以前物品的恢复,而不是重复使用该编号的新物品)。

o New articles may be added with article numbers greater than the reported high water mark. (If an article that was the one with the highest number has been removed and the high water mark has been adjusted accordingly, the next new article will not have the number one greater than the reported high water mark.)

o 添加的新物品的物品编号可能大于报告的高水位线。(如果编号最高的物品已被删除,并且相应调整了高水位线,则下一个新物品的编号不会大于报告的高水位线。)

Except when the group is empty and all three numbers are zero, whenever a subsequent GROUP command for the same newsgroup is issued, either by the same client or a different client, the reported low water mark in the response MUST be no less than that in any previous response for that newsgroup in this session, and it SHOULD be no less than that in any previous response for that newsgroup ever sent to any client. Any failure to meet the latter condition SHOULD be transient only. The client may make use of the low water mark to remove all remembered information about articles with lower numbers, as these will never recur. This includes the situation when the high water mark is one less than the low water mark. No similar assumption can be made about the high water mark, as this can

除非组为空且所有三个数字均为零,否则无论是同一客户端还是其他客户端,只要为同一新闻组发出后续组命令,响应中报告的低水位线必须不小于此会话中该新闻组的任何先前响应中的低水位线,而且它应该不低于之前发送给任何客户端的新闻组的任何响应。任何未能满足后一个条件的情况都只能是暂时的。客户可以使用低水位线删除所有关于数字较低物品的记忆信息,因为这些信息将不会再次出现。这包括高水位线比低水位线小一个的情况。对于高水位线,不能做出类似的假设,因为这是可能的

decrease if an article is removed and then increase again if it is reinstated or if new articles arrive.

如果某个项目被删除,则减少;如果该项目被恢复或新项目到达,则再次增加。

When a valid group is selected by means of this command, the currently selected newsgroup MUST be set to that group, and the current article number MUST be set to the first article in the group (this applies even if the group is already the currently selected newsgroup). If an empty newsgroup is selected, the current article number is made invalid. If an invalid group is specified, the currently selected newsgroup and current article number MUST NOT be changed.

通过此命令选择有效组时,必须将当前选定的新闻组设置为该组,并且必须将当前文章编号设置为该组中的第一篇文章(即使该组已经是当前选定的新闻组,这也适用)。如果选择了空新闻组,则当前文章编号无效。如果指定了无效的组,则不得更改当前选定的新闻组和当前文章编号。

The GROUP or LISTGROUP command (see Section 6.1.2) MUST be used by a client, and a successful response received, before any other command is used that depends on the value of the currently selected newsgroup or current article number.

客户端必须先使用GROUP或LISTGOUP命令(参见第6.1.2节),并收到成功的响应,然后才能使用任何其他命令(取决于当前选定的新闻组或当前文章编号的值)。

If the group specified is not available on the server, a 411 response MUST be returned.

如果指定的组在服务器上不可用,则必须返回411响应。

6.1.1.3. Examples
6.1.1.3. 例子

Example for a group known to the server:

服务器已知的组的示例:

[C] GROUP misc.test [S] 211 1234 3000234 3002322 misc.test

[C] 组杂项测试[S]211 1234 3000234 3002322杂项测试

Example for a group unknown to the server:

服务器未知的组的示例:

[C] GROUP example.is.sob.bradner.or.barber [S] 411 example.is.sob.bradner.or.barber is unknown

[C] 组example.is.sob.bradner.or.barber[S]411 example.is.sob.bradner.or.barber未知

Example of an empty group using the preferred response:

使用首选响应的空组示例:

[C] GROUP example.currently.empty.newsgroup [S] 211 0 4000 3999 example.currently.empty.newsgroup

[C] 组example.current.empty.newsgroup[S]211 0 4000 3999 example.current.empty.newsgroup

Example of an empty group using an alternative response:

使用备选响应的空组示例:

[C] GROUP example.currently.empty.newsgroup [S] 211 0 0 0 example.currently.empty.newsgroup

[C] 当前为空的新闻组示例[S.0.0.0]当前为空的新闻组示例

Example of an empty group using a different alternative response:

使用不同备选响应的空组示例:

[C] GROUP example.currently.empty.newsgroup [S] 211 0 4000 4321 example.currently.empty.newsgroup

[C] 组example.current.empty.newsgroup[S]211 0 4000 4321 example.current.empty.newsgroup

Example reselecting the currently selected newsgroup:

重新选择当前选定新闻组的示例:

      [C] GROUP misc.test
      [S] 211 1234 234 567 misc.test
      [C] STAT 444
      [S] 223 444 <123456@example.net> retrieved
      [C] GROUP misc.test
      [S] 211 1234 234 567 misc.test
      [C] STAT
      [S] 223 234 <different@example.net> retrieved
        
      [C] GROUP misc.test
      [S] 211 1234 234 567 misc.test
      [C] STAT 444
      [S] 223 444 <123456@example.net> retrieved
      [C] GROUP misc.test
      [S] 211 1234 234 567 misc.test
      [C] STAT
      [S] 223 234 <different@example.net> retrieved
        
6.1.2. LISTGROUP
6.1.2. 列表组
6.1.2.1. Usage
6.1.2.1. 用法

Indicating capability: READER

指示能力:读卡器

Syntax LISTGROUP [group [range]]

语法列表组[组[范围]]

Responses 211 number low high group Article numbers follow (multi-line) 411 No such newsgroup 412 No newsgroup selected [1]

回复211号低高组文章号跟随(多行)411无此类新闻组412未选择新闻组[1]

Parameters group Name of newsgroup range Range of articles to report number Estimated number of articles in the group low Reported low water mark high Reported high water mark

参数新闻组的组名称要报告的文章范围数量组中估计的文章数量低报告的低水位线高报告的高水位线

[1] The 412 response can only occur if no group has been specified.

[1] 412响应只能在未指定组的情况下发生。

6.1.2.2. Description
6.1.2.2. 描述

The LISTGROUP command selects a newsgroup in the same manner as the GROUP command (see Section 6.1.1) but also provides a list of article numbers in the newsgroup. If no group is specified, the currently selected newsgroup is used.

LISTGROUP命令选择新闻组的方式与GROUP命令相同(参见第6.1.1节),但也提供了新闻组中的文章编号列表。如果未指定组,则使用当前选定的新闻组。

On success, a list of article numbers is returned as a multi-line data block following the 211 response code (the arguments on the initial response line are the same as for the GROUP command). The list contains one number per line and is in numerical order. It lists precisely those articles that exist in the group at the moment of selection (therefore, an empty group produces an empty list). If the optional range argument is specified, only articles within the

成功后,将以多行数据块的形式返回211响应代码后的项目编号列表(初始响应行上的参数与GROUP命令中的参数相同)。该列表每行包含一个数字,并按数字顺序排列。它精确地列出了在选择时存在于组中的那些项目(因此,空组生成空列表)。如果指定了可选范围参数,则仅允许

range are included in the list (therefore, the list MAY be empty even if the group is not).

范围包括在列表中(因此,即使组不在列表中,列表也可能为空)。

The range argument may be any of the following:

范围参数可以是以下任一参数:

o An article number.

o 商品编号。

o An article number followed by a dash to indicate all following.

o 商品编号,后跟破折号,表示以下所有内容。

o An article number followed by a dash followed by another article number.

o 商品编号后接破折号,后接另一商品编号。

In the last case, if the second number is less than the first number, then the range contains no articles. Omitting the range is equivalent to the range 1- being specified.

在最后一种情况下,如果第二个数字小于第一个数字,则该范围不包含项目。省略范围相当于指定的范围1。

If the group specified is not available on the server, a 411 response MUST be returned. If no group is specified and the currently selected newsgroup is invalid, a 412 response MUST be returned.

如果指定的组在服务器上不可用,则必须返回411响应。如果未指定组且当前选择的新闻组无效,则必须返回412响应。

Except that the group argument is optional, that a range argument can be specified, and that a multi-line data block follows the 211 response code, the LISTGROUP command is identical to the GROUP command. In particular, when successful, the command sets the current article number to the first article in the group, if any, even if this is not within the range specified by the second argument.

除了group参数是可选的、可以指定range参数以及211响应代码后面的多行数据块之外,LISTGROUP命令与group命令相同。特别是,如果成功,该命令会将当前项目编号设置为组中的第一个项目(如果有),即使这不在第二个参数指定的范围内。

Note that the range argument is a new feature in this specification and servers that do not support CAPABILITIES (and therefore do not conform to this specification) are unlikely to support it.

请注意,range参数是本规范中的一项新功能,不支持功能(因此不符合本规范)的服务器不太可能支持它。

6.1.2.3. Examples
6.1.2.3. 例子

Example of LISTGROUP being used to select a group:

用于选择组的LISTGROUP示例:

      [C] LISTGROUP misc.test
      [S] 211 2000 3000234 3002322 misc.test list follows
      [S] 3000234
      [S] 3000237
      [S] 3000238
      [S] 3000239
      [S] 3002322
      [S] .
        
      [C] LISTGROUP misc.test
      [S] 211 2000 3000234 3002322 misc.test list follows
      [S] 3000234
      [S] 3000237
      [S] 3000238
      [S] 3000239
      [S] 3002322
      [S] .
        

Example of LISTGROUP on an empty group:

空组上的LISTGROUP示例:

      [C] LISTGROUP example.empty.newsgroup
      [S] 211 0 0 0 example.empty.newsgroup list follows
      [S] .
        
      [C] LISTGROUP example.empty.newsgroup
      [S] 211 0 0 0 example.empty.newsgroup list follows
      [S] .
        

Example of LISTGROUP on a valid, currently selected newsgroup:

当前选定的有效新闻组上的列表组示例:

      [C] GROUP misc.test
      [S] 211 2000 3000234 3002322 misc.test
      [C] LISTGROUP
      [S] 211 2000 3000234 3002322 misc.test list follows
      [S] 3000234
      [S] 3000237
      [S] 3000238
      [S] 3000239
      [S] 3002322
      [S] .
        
      [C] GROUP misc.test
      [S] 211 2000 3000234 3002322 misc.test
      [C] LISTGROUP
      [S] 211 2000 3000234 3002322 misc.test list follows
      [S] 3000234
      [S] 3000237
      [S] 3000238
      [S] 3000239
      [S] 3002322
      [S] .
        

Example of LISTGROUP with a range:

具有范围的LISTGROUP示例:

      [C] LISTGROUP misc.test 3000238-3000248
      [S] 211 2000 3000234 3002322 misc.test list follows
      [S] 3000238
      [S] 3000239
      [S] .
        
      [C] LISTGROUP misc.test 3000238-3000248
      [S] 211 2000 3000234 3002322 misc.test list follows
      [S] 3000238
      [S] 3000239
      [S] .
        

Example of LISTGROUP with an empty range:

具有空范围的LISTGROUP示例:

      [C] LISTGROUP misc.test 12345678-
      [S] 211 2000 3000234 3002322 misc.test list follows
      [S] .
        
      [C] LISTGROUP misc.test 12345678-
      [S] 211 2000 3000234 3002322 misc.test list follows
      [S] .
        

Example of LISTGROUP with an invalid range:

具有无效范围的列表组示例:

      [C] LISTGROUP misc.test 9999-111
      [S] 211 2000 3000234 3002322 misc.test list follows
      [S] .
        
      [C] LISTGROUP misc.test 9999-111
      [S] 211 2000 3000234 3002322 misc.test list follows
      [S] .
        
6.1.3. LAST
6.1.3. 最后的
6.1.3.1. Usage
6.1.3.1. 用法

Indicating capability: READER

指示能力:读卡器

Syntax LAST

语法最后

Responses 223 n message-id Article found 412 No newsgroup selected 420 Current article number is invalid 422 No previous article in this group

响应223 n找到邮件id文章412未选择新闻组420当前文章编号无效422此组中没有以前的文章

Parameters n Article number message-id Article message-id

参数n文章编号消息id文章消息id

6.1.3.2. Description
6.1.3.2. 描述

If the currently selected newsgroup is valid, the current article number MUST be set to the previous article in that newsgroup (that is, the highest existing article number less than the current article number). If successful, a response indicating the new current article number and the message-id of that article MUST be returned. No article text is sent in response to this command.

如果当前选定的新闻组有效,则当前文章编号必须设置为该新闻组中的上一篇文章(即,现有的最高文章编号小于当前文章编号)。如果成功,则必须返回指示新的当前项目编号和该项目的消息id的响应。不发送响应此命令的文章文本。

There MAY be no previous article in the group, although the current article number is not the reported low water mark. There MUST NOT be a previous article when the current article number is the reported low water mark.

组中可能没有以前的文章,尽管当前文章编号不是报告的低水位线。当当前物品编号为报告的低水位线时,不得有以前的物品。

Because articles can be removed and added, the results of multiple LAST and NEXT commands MAY not be consistent over the life of a particular NNTP session.

因为可以删除和添加项目,所以在特定NNTP会话的生命周期内,多个LAST和NEXT命令的结果可能不一致。

If the current article number is already the first article of the newsgroup, a 422 response MUST be returned. If the current article number is invalid, a 420 response MUST be returned. If the currently selected newsgroup is invalid, a 412 response MUST be returned. In all three cases, the currently selected newsgroup and current article number MUST NOT be altered.

如果当前文章编号已经是新闻组的第一篇文章,则必须返回422响应。如果当前项目编号无效,则必须返回420响应。如果当前选择的新闻组无效,则必须返回412响应。在这三种情况下,当前选定的新闻组和当前文章编号都不得更改。

6.1.3.3. Examples
6.1.3.3. 例子

Example of a successful article retrieval using LAST:

使用LAST成功检索文章的示例:

      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] NEXT
      [S] 223 3000237 <668929@example.org> retrieved
      [C] LAST
      [S] 223 3000234 <45223423@example.com> retrieved
        
      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] NEXT
      [S] 223 3000237 <668929@example.org> retrieved
      [C] LAST
      [S] 223 3000234 <45223423@example.com> retrieved
        

Example of an attempt to retrieve an article without having selected a group (via the GROUP command) first:

尝试在未首先选择组(通过group命令)的情况下检索项目的示例:

      [Assumes currently selected newsgroup is invalid.]
      [C] LAST
      [S] 412 no newsgroup selected
        
      [Assumes currently selected newsgroup is invalid.]
      [C] LAST
      [S] 412 no newsgroup selected
        

Example of an attempt to retrieve an article using the LAST command when the current article number is that of the first article in the group:

当当前项目编号为组中第一个项目的编号时,尝试使用最后一个命令检索项目的示例:

      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] LAST
      [S] 422 No previous article to retrieve
        
      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] LAST
      [S] 422 No previous article to retrieve
        

Example of an attempt to retrieve an article using the LAST command when the currently selected newsgroup is empty:

当当前选定的新闻组为空时,尝试使用最后一个命令检索文章的示例:

      [C] GROUP example.empty.newsgroup
      [S] 211 0 0 0 example.empty.newsgroup
      [C] LAST
      [S] 420 No current article selected
        
      [C] GROUP example.empty.newsgroup
      [S] 211 0 0 0 example.empty.newsgroup
      [C] LAST
      [S] 420 No current article selected
        
6.1.4. NEXT
6.1.4. 下一个
6.1.4.1. Usage
6.1.4.1. 用法

Indicating capability: READER

指示能力:读卡器

Syntax NEXT

语法下一步

Responses 223 n message-id Article found 412 No newsgroup selected 420 Current article number is invalid 421 No next article in this group

响应223 n找到邮件id文章412未选择新闻组420当前文章编号无效421此组中无下一篇文章

Parameters n Article number message-id Article message-id

参数n文章编号消息id文章消息id

6.1.4.2. Description
6.1.4.2. 描述

If the currently selected newsgroup is valid, the current article number MUST be set to the next article in that newsgroup (that is, the lowest existing article number greater than the current article number). If successful, a response indicating the new current article number and the message-id of that article MUST be returned. No article text is sent in response to this command.

如果当前选定的新闻组有效,则必须将当前文章编号设置为该新闻组中的下一篇文章(即,大于当前文章编号的最低现有文章编号)。如果成功,则必须返回指示新的当前项目编号和该项目的消息id的响应。不发送响应此命令的文章文本。

If the current article number is already the last article of the newsgroup, a 421 response MUST be returned. In all other aspects (apart, of course, from the lack of 422 response), this command is identical to the LAST command (Section 6.1.3).

如果当前文章编号已经是新闻组的最后一篇文章,则必须返回421响应。在所有其他方面(当然,除了缺少422响应外),该命令与最后一个命令相同(第6.1.3节)。

6.1.4.3. Examples
6.1.4.3. 例子

Example of a successful article retrieval using NEXT:

使用NEXT成功检索文章的示例:

      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] NEXT
      [S] 223 3000237 <668929@example.org> retrieved
        
      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] NEXT
      [S] 223 3000237 <668929@example.org> retrieved
        

Example of an attempt to retrieve an article without having selected a group (via the GROUP command) first:

尝试在未首先选择组(通过group命令)的情况下检索项目的示例:

      [Assumes currently selected newsgroup is invalid.]
      [C] NEXT
      [S] 412 no newsgroup selected
        
      [Assumes currently selected newsgroup is invalid.]
      [C] NEXT
      [S] 412 no newsgroup selected
        

Example of an attempt to retrieve an article using the NEXT command when the current article number is that of the last article in the group:

当当前项目编号为组中最后一个项目的编号时,尝试使用NEXT命令检索项目的示例:

      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] STAT 3002322
      [S] 223 3002322 <411@example.net> retrieved
      [C] NEXT
      [S] 421 No next article to retrieve
        
      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] STAT 3002322
      [S] 223 3002322 <411@example.net> retrieved
      [C] NEXT
      [S] 421 No next article to retrieve
        

Example of an attempt to retrieve an article using the NEXT command when the currently selected newsgroup is empty:

当当前选定的新闻组为空时,尝试使用NEXT命令检索文章的示例:

      [C] GROUP example.empty.newsgroup
      [S] 211 0 0 0 example.empty.newsgroup
      [C] NEXT
      [S] 420 No current article selected
        
      [C] GROUP example.empty.newsgroup
      [S] 211 0 0 0 example.empty.newsgroup
      [C] NEXT
      [S] 420 No current article selected
        
6.2. Retrieval of Articles and Article Sections
6.2. 文章和文章章节的检索

The ARTICLE, BODY, HEAD, and STAT commands are very similar. They differ only in the parts of the article that are presented to the client and in the successful response code. The ARTICLE command is described here in full, while the other three commands are described in terms of the differences. As specified in Section 3.6, an article consists of two parts: the article headers and the article body.

ARTICLE、BODY、HEAD和STAT命令非常相似。它们只在文章中呈现给客户的部分和成功响应代码中有所不同。本文对ARTICLE命令进行了完整描述,而对其他三个命令的区别进行了描述。如第3.6节所述,文章由两部分组成:文章标题和文章正文。

When responding to one of these commands, the server MUST present the entire article or appropriate part and MUST NOT attempt to alter or translate it in any way.

当响应其中一个命令时,服务器必须呈现整篇文章或适当的部分,并且不得试图以任何方式修改或翻译它。

6.2.1. ARTICLE
6.2.1. 文章
6.2.1.1. Usage
6.2.1.1. 用法

Indicating capability: READER

指示能力:读卡器

Syntax ARTICLE message-id ARTICLE number ARTICLE

语法文章消息id文章编号文章

Responses

响应

First form (message-id specified) 220 0|n message-id Article follows (multi-line) 430 No article with that message-id

第一种形式(指定消息id)220 0 | n消息id文章跟随(多行)430没有具有该消息id的文章

Second form (article number specified) 220 n message-id Article follows (multi-line) 412 No newsgroup selected 423 No article with that number

第二种形式(指定文章编号)220 n消息id文章如下(多行)412未选择新闻组423未选择具有该编号的文章

Third form (current article number used) 220 n message-id Article follows (multi-line) 412 No newsgroup selected 420 Current article number is invalid

第三种形式(使用当前文章编号)220 n消息id文章如下(多行)412未选择新闻组420当前文章编号无效

Parameters number Requested article number n Returned article number message-id Article message-id

参数编号请求的项目编号n返回的项目编号消息id项目消息id

6.2.1.2. Description
6.2.1.2. 描述

The ARTICLE command selects an article according to the arguments and presents the entire article (that is, the headers, an empty line, and the body, in that order) to the client. The command has three forms.

ARTICLE命令根据参数选择一篇文章,并将整个文章(即,标题、空行和正文,按此顺序)呈现给客户端。该命令有三种形式。

In the first form, a message-id is specified, and the server presents the article with that message-id. In this case, the server MUST NOT alter the currently selected newsgroup or current article number. This is both to facilitate the presentation of articles that may be referenced within another article being read, and because of the semantic difficulties of determining the proper sequence and membership of an article that may have been cross-posted to more than one newsgroup.

在第一种形式中,指定了一个消息id,服务器使用该消息id呈现文章。在这种情况下,服务器不得更改当前选定的新闻组或当前文章编号。这既有助于展示可在阅读的另一篇文章中引用的文章,也有助于确定交叉发布到多个新闻组的文章的正确顺序和成员资格的语义困难。

In the response, the article number MUST be replaced with zero, unless there is a currently selected newsgroup and the article is present in that group, in which case the server MAY use the article's number in that group. (The server is not required to determine whether the article is in the currently selected newsgroup or, if so, what article number it has; the client MUST always be prepared for zero to be specified.) The server MUST NOT provide an article number unless use of that number in a second ARTICLE command immediately following this one would return the same article. Even if the server chooses to return article numbers in these circumstances, it need not do so consistently; it MAY return zero to any such command (also see the STAT examples, Section 6.2.4.3).

在响应中,文章编号必须替换为零,除非存在当前选定的新闻组并且该文章存在于该组中,在这种情况下,服务器可以使用该组中的文章编号。(服务器无需确定文章是否在当前选定的新闻组中,或者如果在当前选定的新闻组中,则确定文章编号;客户端必须始终准备好指定零。)服务器不能提供项目编号,除非在紧接该编号之后的第二个项目命令中使用该编号将返回相同的项目。即使服务器在这些情况下选择返回物品编号,它也不必始终如一地返回物品编号;它可以将任何此类命令返回零(另请参见第6.2.4.3节的STAT示例)。

In the second form, an article number is specified. If there is an article with that number in the currently selected newsgroup, the server MUST set the current article number to that number.

在第二种形式中,指定了物品编号。如果当前选定的新闻组中存在具有该编号的文章,服务器必须将当前文章编号设置为该编号。

In the third form, the article indicated by the current article number in the currently selected newsgroup is used.

在第三种形式中,使用由当前选定新闻组中的当前文章编号指示的文章。

Note that a previously valid article number MAY become invalid if the article has been removed. A previously invalid article number MAY become valid if the article has been reinstated, but this article number MUST be no less than the reported low water mark for that group.

请注意,如果物品已被移除,以前有效的物品编号可能会变得无效。如果物品已恢复,则先前无效的物品编号可能会变为有效,但该物品编号不得小于该组别报告的低水位线。

The server MUST NOT change the currently selected newsgroup as a result of this command. The server MUST NOT change the current article number except when an article number argument was provided and the article exists; in particular, it MUST NOT change it following an unsuccessful response.

服务器不能因为此命令而更改当前选定的新闻组。服务器不得更改当前项目编号,除非提供了项目编号参数且项目存在;特别是,在响应不成功后,不得更改它。

Since the message-id is unique for each article, it may be used by a client to skip duplicate displays of articles that have been posted more than once, or to more than one newsgroup.

由于消息id对于每篇文章都是唯一的,因此客户端可以使用它跳过已发布多次的文章的重复显示,或者跳过已发布到多个新闻组的重复显示。

The article is returned as a multi-line data block following the 220 response code.

文章作为220响应代码后的多行数据块返回。

If the argument is a message-id and no such article exists, a 430 response MUST be returned. If the argument is a number or is omitted and the currently selected newsgroup is invalid, a 412 response MUST be returned. If the argument is a number and that article does not exist in the currently selected newsgroup, a 423 response MUST be returned. If the argument is omitted and the current article number is invalid, a 420 response MUST be returned.

如果参数是消息id,并且不存在此类项目,则必须返回430响应。如果参数是数字或被省略,并且当前选择的新闻组无效,则必须返回412响应。如果参数是一个数字,而当前选定的新闻组中不存在该文章,则必须返回423响应。如果省略参数且当前项目编号无效,则必须返回420响应。

6.2.1.3. Examples
6.2.1.3. 例子

Example of a successful retrieval of an article (explicitly not using an article number):

成功检索文章的示例(明确不使用文章编号):

      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] ARTICLE
      [S] 220 3000234 <45223423@example.com>
      [S] Path: pathost!demo!whitehouse!not-for-mail
      [S] From: "Demo User" <nobody@example.net>
      [S] Newsgroups: misc.test
      [S] Subject: I am just a test article
      [S] Date: 6 Oct 1998 04:38:40 -0500
      [S] Organization: An Example Net, Uncertain, Texas
      [S] Message-ID: <45223423@example.com>
      [S]
      [S] This is just a test article.
      [S] .
        
      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] ARTICLE
      [S] 220 3000234 <45223423@example.com>
      [S] Path: pathost!demo!whitehouse!not-for-mail
      [S] From: "Demo User" <nobody@example.net>
      [S] Newsgroups: misc.test
      [S] Subject: I am just a test article
      [S] Date: 6 Oct 1998 04:38:40 -0500
      [S] Organization: An Example Net, Uncertain, Texas
      [S] Message-ID: <45223423@example.com>
      [S]
      [S] This is just a test article.
      [S] .
        

Example of a successful retrieval of an article by message-id:

通过邮件id成功检索文章的示例:

      [C] ARTICLE <45223423@example.com>
      [S] 220 0 <45223423@example.com>
      [S] Path: pathost!demo!whitehouse!not-for-mail
      [S] From: "Demo User" <nobody@example.net>
      [S] Newsgroups: misc.test
      [S] Subject: I am just a test article
      [S] Date: 6 Oct 1998 04:38:40 -0500
      [S] Organization: An Example Net, Uncertain, Texas
      [S] Message-ID: <45223423@example.com>
      [S]
      [S] This is just a test article.
      [S] .
        
      [C] ARTICLE <45223423@example.com>
      [S] 220 0 <45223423@example.com>
      [S] Path: pathost!demo!whitehouse!not-for-mail
      [S] From: "Demo User" <nobody@example.net>
      [S] Newsgroups: misc.test
      [S] Subject: I am just a test article
      [S] Date: 6 Oct 1998 04:38:40 -0500
      [S] Organization: An Example Net, Uncertain, Texas
      [S] Message-ID: <45223423@example.com>
      [S]
      [S] This is just a test article.
      [S] .
        

Example of an unsuccessful retrieval of an article by message-id:

按邮件id检索文章失败的示例:

[C] ARTICLE <i.am.not.there@example.com> [S] 430 No Such Article Found

[C] 文章<我不是。there@example.com>[S]430未发现此类物品

Example of an unsuccessful retrieval of an article by number:

按编号检索文章失败的示例:

      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 news.groups
      [C] ARTICLE 300256
      [S] 423 No article with that number
        
      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 news.groups
      [C] ARTICLE 300256
      [S] 423 No article with that number
        

Example of an unsuccessful retrieval of an article by number because no newsgroup was selected first:

由于未首先选择新闻组,按编号检索文章失败的示例:

      [Assumes currently selected newsgroup is invalid.]
      [C] ARTICLE 300256
      [S] 412 No newsgroup selected
        
      [Assumes currently selected newsgroup is invalid.]
      [C] ARTICLE 300256
      [S] 412 No newsgroup selected
        

Example of an attempt to retrieve an article when the currently selected newsgroup is empty:

当前选定的新闻组为空时尝试检索文章的示例:

      [C] GROUP example.empty.newsgroup
      [S] 211 0 0 0 example.empty.newsgroup
      [C] ARTICLE
      [S] 420 No current article selected
        
      [C] GROUP example.empty.newsgroup
      [S] 211 0 0 0 example.empty.newsgroup
      [C] ARTICLE
      [S] 420 No current article selected
        
6.2.2. HEAD
6.2.2. 头
6.2.2.1. Usage
6.2.2.1. 用法

This command is mandatory.

此命令是必需的。

Syntax HEAD message-id HEAD number HEAD

语法头消息id头数字头

Responses

响应

First form (message-id specified) 221 0|n message-id Headers follow (multi-line) 430 No article with that message-id

第一种形式(指定的消息id)2210 | n消息id头跟随(多行)430没有带有该消息id的文章

Second form (article number specified) 221 n message-id Headers follow (multi-line) 412 No newsgroup selected 423 No article with that number

第二个表单(指定了文章编号)221 n消息id标题跟随(多行)412未选择新闻组423未选择具有该编号的文章

Third form (current article number used) 221 n message-id Headers follow (multi-line) 412 No newsgroup selected 420 Current article number is invalid

第三种形式(使用当前文章编号)221 n消息id标题跟随(多行)412未选择新闻组420当前文章编号无效

Parameters number Requested article number n Returned article number message-id Article message-id

参数编号请求的项目编号n返回的项目编号消息id项目消息id

6.2.2.2. Description
6.2.2.2. 描述

The HEAD command behaves identically to the ARTICLE command except that, if the article exists, the response code is 221 instead of 220 and only the headers are presented (the empty line separating the headers and body MUST NOT be included).

HEAD命令的行为与ARTICLE命令相同,不同之处在于,如果存在ARTICLE,则响应代码为221而不是220,并且只显示标题(分隔标题和正文的空行不得包括在内)。

6.2.2.3. Examples
6.2.2.3. 例子

Example of a successful retrieval of the headers of an article (explicitly not using an article number):

成功检索文章标题的示例(明确不使用文章编号):

      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] HEAD
      [S] 221 3000234 <45223423@example.com>
      [S] Path: pathost!demo!whitehouse!not-for-mail
      [S] From: "Demo User" <nobody@example.net>
      [S] Newsgroups: misc.test
      [S] Subject: I am just a test article
      [S] Date: 6 Oct 1998 04:38:40 -0500
      [S] Organization: An Example Net, Uncertain, Texas
      [S] Message-ID: <45223423@example.com>
      [S] .
        
      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] HEAD
      [S] 221 3000234 <45223423@example.com>
      [S] Path: pathost!demo!whitehouse!not-for-mail
      [S] From: "Demo User" <nobody@example.net>
      [S] Newsgroups: misc.test
      [S] Subject: I am just a test article
      [S] Date: 6 Oct 1998 04:38:40 -0500
      [S] Organization: An Example Net, Uncertain, Texas
      [S] Message-ID: <45223423@example.com>
      [S] .
        

Example of a successful retrieval of the headers of an article by message-id:

通过邮件id成功检索文章标题的示例:

      [C] HEAD <45223423@example.com>
      [S] 221 0 <45223423@example.com>
      [S] Path: pathost!demo!whitehouse!not-for-mail
      [S] From: "Demo User" <nobody@example.net>
      [S] Newsgroups: misc.test
      [S] Subject: I am just a test article
      [S] Date: 6 Oct 1998 04:38:40 -0500
      [S] Organization: An Example Net, Uncertain, Texas
      [S] Message-ID: <45223423@example.com>
      [S] .
        
      [C] HEAD <45223423@example.com>
      [S] 221 0 <45223423@example.com>
      [S] Path: pathost!demo!whitehouse!not-for-mail
      [S] From: "Demo User" <nobody@example.net>
      [S] Newsgroups: misc.test
      [S] Subject: I am just a test article
      [S] Date: 6 Oct 1998 04:38:40 -0500
      [S] Organization: An Example Net, Uncertain, Texas
      [S] Message-ID: <45223423@example.com>
      [S] .
        

Example of an unsuccessful retrieval of the headers of an article by message-id:

按邮件id检索文章标题失败的示例:

[C] HEAD <i.am.not.there@example.com> [S] 430 No Such Article Found

[C] 头<我不是。there@example.com>[S]430未发现此类物品

Example of an unsuccessful retrieval of the headers of an article by number:

按编号检索文章标题失败的示例:

      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] HEAD 300256
      [S] 423 No article with that number
        
      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] HEAD 300256
      [S] 423 No article with that number
        

Example of an unsuccessful retrieval of the headers of an article by number because no newsgroup was selected first:

由于未首先选择新闻组,按编号检索文章标题失败的示例:

      [Assumes currently selected newsgroup is invalid.]
      [C] HEAD 300256
      [S] 412 No newsgroup selected
        
      [Assumes currently selected newsgroup is invalid.]
      [C] HEAD 300256
      [S] 412 No newsgroup selected
        

Example of an attempt to retrieve the headers of an article when the currently selected newsgroup is empty:

当当前选定的新闻组为空时,尝试检索文章标题的示例:

      [C] GROUP example.empty.newsgroup
      [S] 211 0 0 0 example.empty.newsgroup
      [C] HEAD
      [S] 420 No current article selected
        
      [C] GROUP example.empty.newsgroup
      [S] 211 0 0 0 example.empty.newsgroup
      [C] HEAD
      [S] 420 No current article selected
        
6.2.3. BODY
6.2.3. 身体
6.2.3.1. Usage
6.2.3.1. 用法

Indicating capability: READER

指示能力:读卡器

Syntax BODY message-id BODY number BODY

语法正文消息id正文编号正文

Responses

响应

First form (message-id specified) 222 0|n message-id Body follows (multi-line) 430 No article with that message-id

第一种形式(指定的消息id)2220 | n消息id正文跟随(多行)430没有带有该消息id的文章

Second form (article number specified) 222 n message-id Body follows (multi-line) 412 No newsgroup selected 423 No article with that number

第二个表单(指定了文章编号)222 n消息id正文跟随(多行)412未选择新闻组423未选择具有该编号的文章

Third form (current article number used) 222 n message-id Body follows (multi-line) 412 No newsgroup selected 420 Current article number is invalid

第三种形式(使用当前文章编号)222 n消息id正文如下(多行)412未选择新闻组420当前文章编号无效

Parameters number Requested article number n Returned article number message-id Article message-id

参数编号请求的项目编号n返回的项目编号消息id项目消息id

6.2.3.2. Description
6.2.3.2. 描述

The BODY command behaves identically to the ARTICLE command except that, if the article exists, the response code is 222 instead of 220 and only the body is presented (the empty line separating the headers and body MUST NOT be included).

BODY命令的行为与ARTICLE命令的行为相同,不同之处在于,如果项目存在,则响应代码为222而不是220,并且仅显示BODY(不得包含分隔标题和正文的空行)。

6.2.3.3. Examples
6.2.3.3. 例子

Example of a successful retrieval of the body of an article (explicitly not using an article number):

成功检索文章正文的示例(明确不使用文章编号):

      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] BODY
      [S] 222 3000234 <45223423@example.com>
      [S] This is just a test article.
      [S] .
        
      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] BODY
      [S] 222 3000234 <45223423@example.com>
      [S] This is just a test article.
      [S] .
        

Example of a successful retrieval of the body of an article by message-id:

通过邮件id成功检索文章正文的示例:

      [C] BODY <45223423@example.com>
      [S] 222 0 <45223423@example.com>
      [S] This is just a test article.
      [S] .
        
      [C] BODY <45223423@example.com>
      [S] 222 0 <45223423@example.com>
      [S] This is just a test article.
      [S] .
        

Example of an unsuccessful retrieval of the body of an article by message-id:

按邮件id检索文章正文失败的示例:

[C] BODY <i.am.not.there@example.com> [S] 430 No Such Article Found

[C] 身体<我不是。there@example.com>[S]430未发现此类物品

Example of an unsuccessful retrieval of the body of an article by number:

按编号检索文章正文失败的示例:

      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] BODY 300256
      [S] 423 No article with that number
        
      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] BODY 300256
      [S] 423 No article with that number
        

Example of an unsuccessful retrieval of the body of an article by number because no newsgroup was selected first:

由于未首先选择新闻组,按编号检索文章正文失败的示例:

      [Assumes currently selected newsgroup is invalid.]
      [C] BODY 300256
      [S] 412 No newsgroup selected
        
      [Assumes currently selected newsgroup is invalid.]
      [C] BODY 300256
      [S] 412 No newsgroup selected
        

Example of an attempt to retrieve the body of an article when the currently selected newsgroup is empty:

当前选定的新闻组为空时尝试检索文章正文的示例:

      [C] GROUP example.empty.newsgroup
      [S] 211 0 0 0 example.empty.newsgroup
      [C] BODY
      [S] 420 No current article selected
        
      [C] GROUP example.empty.newsgroup
      [S] 211 0 0 0 example.empty.newsgroup
      [C] BODY
      [S] 420 No current article selected
        
6.2.4. STAT
6.2.4. 斯达
6.2.4.1. Usage
6.2.4.1. 用法

This command is mandatory.

此命令是必需的。

Syntax STAT message-id STAT number STAT

语法统计信息id统计数字统计

Responses

响应

First form (message-id specified) 223 0|n message-id Article exists 430 No article with that message-id

第一种形式(指定消息id)223 0 | n消息id文章存在430没有具有该消息id的文章

Second form (article number specified) 223 n message-id Article exists 412 No newsgroup selected 423 No article with that number

第二个表单(指定文章编号)223 n邮件id文章存在412未选择新闻组423未选择具有该编号的文章

Third form (current article number used) 223 n message-id Article exists 412 No newsgroup selected 420 Current article number is invalid

第三种形式(使用当前文章编号)223 n消息id文章存在412未选择新闻组420当前文章编号无效

Parameters number Requested article number n Returned article number message-id Article message-id

参数编号请求的项目编号n返回的项目编号消息id项目消息id

6.2.4.2. Description
6.2.4.2. 描述

The STAT command behaves identically to the ARTICLE command except that, if the article exists, it is NOT presented to the client and the response code is 223 instead of 220. Note that the response is NOT multi-line.

STAT命令的行为与ARTICLE命令相同,不同的是,如果ARTICLE存在,它不会显示给客户端,并且响应代码是223而不是220。请注意,响应不是多行的。

This command allows the client to determine whether an article exists and, in the second and third forms, what its message-id is, without having to process an arbitrary amount of text.

此命令允许客户端确定项目是否存在,以及第二和第三种形式的消息id是什么,而无需处理任意数量的文本。

6.2.4.3. Examples
6.2.4.3. 例子

Example of STAT on an existing article (explicitly not using an article number):

现有物品上的STAT示例(明确不使用物品编号):

      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] STAT
      [S] 223 3000234 <45223423@example.com>
        
      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] STAT
      [S] 223 3000234 <45223423@example.com>
        

Example of STAT on an existing article by message-id:

按消息id列出的现有文章上的STAT示例:

      [C] STAT <45223423@example.com>
      [S] 223 0 <45223423@example.com>
        
      [C] STAT <45223423@example.com>
      [S] 223 0 <45223423@example.com>
        

Example of STAT on an article not on the server by message-id:

非服务器上文章的STAT示例(按消息id):

[C] STAT <i.am.not.there@example.com> [S] 430 No Such Article Found

[C] 统计<我不是。there@example.com>[S]430未发现此类物品

Example of STAT on an article not in the server by number:

不在服务器中的物品上的STAT示例(按编号):

      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] STAT 300256
      [S] 423 No article with that number
        
      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] STAT 300256
      [S] 423 No article with that number
        

Example of STAT on an article by number when no newsgroup was selected first:

未首先选择新闻组时,文章按编号统计的示例:

      [Assumes currently selected newsgroup is invalid.]
      [C] STAT 300256
      [S] 412 No newsgroup selected
        
      [Assumes currently selected newsgroup is invalid.]
      [C] STAT 300256
      [S] 412 No newsgroup selected
        

Example of STAT on an article when the currently selected newsgroup is empty:

当前选定的新闻组为空时文章的统计示例:

      [C] GROUP example.empty.newsgroup
      [S] 211 0 0 0 example.empty.newsgroup
      [C] STAT
      [S] 420 No current article selected
        
      [C] GROUP example.empty.newsgroup
      [S] 211 0 0 0 example.empty.newsgroup
      [C] STAT
      [S] 420 No current article selected
        

Example of STAT by message-id on a server that sometimes reports the actual article number:

服务器上有时报告实际商品编号的消息id统计示例:

      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] STAT
      [S] 223 3000234 <45223423@example.com>
      [C] STAT <45223423@example.com>
      [S] 223 0 <45223423@example.com>
      [C] STAT <45223423@example.com>
      [S] 223 3000234 <45223423@example.com>
      [C] GROUP example.empty.newsgroup
      [S] 211 0 0 0 example.empty.newsgroup
      [C] STAT <45223423@example.com>
      [S] 223 0 <45223423@example.com>
      [C] GROUP alt.crossposts
      [S] 211 9999 111111 222222 alt.crossposts
      [C] STAT <45223423@example.com>
      [S] 223 123456 <45223423@example.com>
      [C] STAT
      [S] 223 111111 <23894720@example.com>
        
      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] STAT
      [S] 223 3000234 <45223423@example.com>
      [C] STAT <45223423@example.com>
      [S] 223 0 <45223423@example.com>
      [C] STAT <45223423@example.com>
      [S] 223 3000234 <45223423@example.com>
      [C] GROUP example.empty.newsgroup
      [S] 211 0 0 0 example.empty.newsgroup
      [C] STAT <45223423@example.com>
      [S] 223 0 <45223423@example.com>
      [C] GROUP alt.crossposts
      [S] 211 9999 111111 222222 alt.crossposts
      [C] STAT <45223423@example.com>
      [S] 223 123456 <45223423@example.com>
      [C] STAT
      [S] 223 111111 <23894720@example.com>
        

The first STAT command establishes the identity of an article in the group. The second and third show that the server may, but need not, give the article number when the message-id is specified. The fourth STAT command shows that zero must be specified if the article isn't in the currently selected newsgroup. The fifth shows that the number, if provided, must be that relating to the currently selected newsgroup. The last one shows that the current article number is still not changed by the use of STAT with a message-id even if it returns an article number.

第一个STAT命令建立组中项目的标识。第二个和第三个示例显示,当指定消息id时,服务器可以(但不需要)提供文章编号。第四个STAT命令显示,如果文章不在当前选定的新闻组中,则必须指定零。第五个数字显示,如果提供,则该数字必须与当前选定的新闻组相关。最后一个示例显示,使用带有消息id的STAT仍然不会更改当前项目编号,即使它返回项目编号也是如此。

6.3. Article Posting
6.3. 文章投递

Article posting is done in one of two ways: individual article posting from news-reading clients using POST, and article transfer from other news servers using IHAVE.

文章发布通过两种方式之一完成:使用POST从新闻阅读客户端发布单个文章,使用IHAVE从其他新闻服务器传输文章。

6.3.1. POST
6.3.1. 邮递
6.3.1.1. Usage
6.3.1.1. 用法

Indicating capability: POST

指示能力:员额

This command MUST NOT be pipelined.

此命令不能通过管道传输。

Syntax POST

语法贴子

Responses

响应

Initial responses 340 Send article to be posted 440 Posting not permitted

初始回复340发送待发布的文章440不允许发布

Subsequent responses 240 Article received OK 441 Posting failed

后续回复240文章收到OK 441发布失败

6.3.1.2. Description
6.3.1.2. 描述

If posting is allowed, a 340 response MUST be returned to indicate that the article to be posted should be sent. If posting is prohibited for some installation-dependent reason, a 440 response MUST be returned.

如果允许发布,则必须返回340响应,以指示应发送要发布的文章。如果由于某些安装相关原因而禁止发布,则必须返回440响应。

If posting is permitted, the article MUST be in the format specified in Section 3.6 and MUST be sent by the client to the server as a multi-line data block (see Section 3.1.1). Thus a single dot (".") on a line indicates the end of the text, and lines starting with a dot in the original text have that dot doubled during transmission.

如果允许发布,则文章必须采用第3.6节规定的格式,并且必须由客户端作为多行数据块发送到服务器(见第3.1.1节)。因此,一行上的单点(“.”)表示文本的结尾,而在原始文本中以点开头的行在传输过程中会使该点加倍。

Following the presentation of the termination sequence by the client, the server MUST return a response indicating success or failure of the article transfer. Note that response codes 340 and 440 are used in direct response to the POST command while 240 and 441 are returned after the article is sent.

在客户端显示终止序列之后,服务器必须返回一个响应,指示文章传输的成功或失败。请注意,响应代码340和440用于直接响应POST命令,而240和441在发送物品后返回。

A response of 240 SHOULD indicate that, barring unforeseen server errors, the posted article will be made available on the server and/or transferred to other servers, as appropriate, possibly following further processing. In other words, articles not wanted by the server SHOULD be rejected with a 441 response, rather than being accepted and then discarded silently. However, the client SHOULD NOT assume that the article has been successfully transferred unless it receives an affirmative response from the server and SHOULD NOT assume that it is being made available to other clients without explicitly checking (for example, using the STAT command).

240的响应应表明,除非出现不可预见的服务器错误,发布的文章将在服务器上可用和/或传输到其他服务器(视情况而定),可能在进一步处理之后。换句话说,服务器不需要的文章应该以441响应被拒绝,而不是被接受然后默默地丢弃。但是,客户机不应假设文章已成功传输,除非它收到来自服务器的肯定响应,并且不应假设未经显式检查(例如,使用STAT命令)它已提供给其他客户机。

If the session is interrupted before the response is received, it is possible that an affirmative response was sent but has been lost. Therefore, in any subsequent session, the client SHOULD either check whether the article was successfully posted before resending or ensure that the server will allocate the same message-id to the new attempt (see Appendix A.2). The latter approach is preferred since the article might not have been made available for reading yet (for example, it may have to go through a moderation process).

如果会话在收到响应之前中断,则可能发送了肯定响应,但已丢失。因此,在任何后续会话中,客户端应在重新发送之前检查文章是否已成功发布,或确保服务器将为新尝试分配相同的消息id(见附录A.2)。后一种方法是首选的,因为文章可能还没有提供给读者阅读(例如,它可能需要经过一个审核过程)。

6.3.1.3. Examples
6.3.1.3. 例子

Example of a successful posting:

成功发布的示例:

      [C] POST
      [S] 340 Input article; end with <CR-LF>.<CR-LF>
      [C] From: "Demo User" <nobody@example.net>
      [C] Newsgroups: misc.test
      [C] Subject: I am just a test article
      [C] Organization: An Example Net
      [C]
      [C] This is just a test article.
      [C] .
      [S] 240 Article received OK
        
      [C] POST
      [S] 340 Input article; end with <CR-LF>.<CR-LF>
      [C] From: "Demo User" <nobody@example.net>
      [C] Newsgroups: misc.test
      [C] Subject: I am just a test article
      [C] Organization: An Example Net
      [C]
      [C] This is just a test article.
      [C] .
      [S] 240 Article received OK
        

Example of an unsuccessful posting:

未成功发布的示例:

      [C] POST
      [S] 340 Input article; end with <CR-LF>.<CR-LF>
      [C] From: "Demo User" <nobody@example.net>
      [C] Newsgroups: misc.test
      [C] Subject: I am just a test article
      [C] Organization: An Example Net
      [C]
      [C] This is just a test article.
      [C] .
      [S] 441 Posting failed
        
      [C] POST
      [S] 340 Input article; end with <CR-LF>.<CR-LF>
      [C] From: "Demo User" <nobody@example.net>
      [C] Newsgroups: misc.test
      [C] Subject: I am just a test article
      [C] Organization: An Example Net
      [C]
      [C] This is just a test article.
      [C] .
      [S] 441 Posting failed
        

Example of an attempt to post when posting is not allowed:

不允许过帐时尝试过帐的示例:

      [Initial connection set-up completed.]
      [S] 201 NNTP Service Ready, posting prohibited
      [C] POST
      [S] 440 Posting not permitted
        
      [Initial connection set-up completed.]
      [S] 201 NNTP Service Ready, posting prohibited
      [C] POST
      [S] 440 Posting not permitted
        
6.3.2. IHAVE
6.3.2. 我有
6.3.2.1. Usage
6.3.2.1. 用法

Indicating capability: IHAVE

指示能力:IHAVE

This command MUST NOT be pipelined.

此命令不能通过管道传输。

Syntax IHAVE message-id

语法IHAVE消息id

Responses

响应

Initial responses 335 Send article to be transferred 435 Article not wanted 436 Transfer not possible; try again later

初始响应335发送要传输的物品435物品不需要436传输不可能;请稍后再试

Subsequent responses 235 Article transferred OK 436 Transfer failed; try again later 437 Transfer rejected; do not retry

后续响应235物品转移OK 436转移失败;稍后重试437传输被拒绝;不要重试

Parameters message-id Article message-id

参数消息id文章消息id

6.3.2.2. Description
6.3.2.2. 描述

The IHAVE command informs the server that the client has an article with the specified message-id. If the server desires a copy of that article, a 335 response MUST be returned, instructing the client to send the entire article. If the server does not want the article (if, for example, the server already has a copy of it), a 435 response MUST be returned, indicating that the article is not wanted. Finally, if the article isn't wanted immediately but the client should retry later if possible (if, for example, another client is in the process of sending the same article to the server), a 436 response MUST be returned.

IHAVE命令通知服务器客户端有一个具有指定message-id的文章。如果服务器需要该文章的副本,则必须返回335响应,指示客户端发送整个文章。如果服务器不需要该文章(例如,如果服务器已经有该文章的副本),则必须返回435响应,指示不需要该文章。最后,如果不立即需要该文章,但如果可能,客户端应稍后重试(例如,如果另一个客户端正在向服务器发送相同的文章),则必须返回436响应。

If transmission of the article is requested, the client MUST send the entire article, including headers and body, to the server as a multi-line data block (see Section 3.1.1). Thus, a single dot (".") on a line indicates the end of the text, and lines starting with a dot in the original text have that dot doubled during transmission. The server MUST return a 235 response, indicating that the article was successfully transferred; a 436 response, indicating that the transfer failed but should be tried again later; or a 437 response, indicating that the article was rejected.

如果请求传输文章,客户端必须将整个文章(包括标题和正文)作为多行数据块发送到服务器(见第3.1.1节)。因此,一行上的一个单点(“.”)表示文本的结尾,而以原始文本中的一个点开头的行在传输过程中使该点加倍。服务器必须返回235响应,指示物品已成功传输;436响应,指示传输失败,但应稍后重试;或437回复,表明该文章被拒绝。

This function differs from the POST command in that it is intended for use in transferring already-posted articles between hosts. It SHOULD NOT be used when the client is a personal news-reading program, since use of this command indicates that the article has already been posted at another site and is simply being forwarded from another host. However, despite this, the server MAY elect not to post or forward the article if, after further examination of the article, it deems it inappropriate to do so. Reasons for such subsequent rejection of an article may include problems such as inappropriate newsgroups or distributions, disc space limitations, article lengths, garbled headers, and the like. These are typically restrictions enforced by the server host's news software and not necessarily by the NNTP server itself.

此函数与POST命令的不同之处在于,它用于在主机之间传输已发布的文章。当客户端是个人新闻阅读程序时,不应使用此命令,因为使用此命令表示文章已在另一个站点上发布,并且只是从另一个主机转发。然而,尽管如此,如果在对文章进行进一步检查后,服务器认为不适合发布或转发文章,服务器可能会选择不发布或转发文章。此类后续拒绝文章的原因可能包括诸如不适当的新闻组或发行版、光盘空间限制、文章长度、乱码标题等问题。这些限制通常由服务器主机的新闻软件强制执行,而不一定由NNTP服务器本身强制执行。

The client SHOULD NOT assume that the article has been successfully transferred unless it receives an affirmative response from the server. A lack of response (such as a dropped network connection or a network timeout) SHOULD be treated the same as a 436 response.

客户机不应假定文章已成功传输,除非它收到服务器的肯定响应。缺少响应(如网络连接断开或网络超时)应与436响应一样处理。

Because some news server software may not immediately be able to determine whether an article is suitable for posting or forwarding, an NNTP server MAY acknowledge the successful transfer of the article (with a 235 response) but later silently discard it.

由于某些新闻服务器软件可能无法立即确定文章是否适合发布或转发,NNTP服务器可能会确认文章的成功传输(带有235响应),但稍后会自动放弃。

6.3.2.3. Examples
6.3.2.3. 例子

Example of successfully sending an article to another site:

成功将文章发送到其他站点的示例:

      [C] IHAVE <i.am.an.article.you.will.want@example.com>
      [S] 335 Send it; end with <CR-LF>.<CR-LF>
      [C] Path: pathost!demo!somewhere!not-for-mail
      [C] From: "Demo User" <nobody@example.com>
      [C] Newsgroups: misc.test
      [C] Subject: I am just a test article
      [C] Date: 6 Oct 1998 04:38:40 -0500
      [C] Organization: An Example Com, San Jose, CA
      [C] Message-ID: <i.am.an.article.you.will.want@example.com>
      [C]
      [C] This is just a test article.
      [C] .
      [S] 235 Article transferred OK
        
      [C] IHAVE <i.am.an.article.you.will.want@example.com>
      [S] 335 Send it; end with <CR-LF>.<CR-LF>
      [C] Path: pathost!demo!somewhere!not-for-mail
      [C] From: "Demo User" <nobody@example.com>
      [C] Newsgroups: misc.test
      [C] Subject: I am just a test article
      [C] Date: 6 Oct 1998 04:38:40 -0500
      [C] Organization: An Example Com, San Jose, CA
      [C] Message-ID: <i.am.an.article.you.will.want@example.com>
      [C]
      [C] This is just a test article.
      [C] .
      [S] 235 Article transferred OK
        

Example of sending an article to another site that rejects it. Note that the message-id in the IHAVE command is not the same as the one in the article headers; while this is bad practice and SHOULD NOT be done, it is not forbidden.

将文章发送到另一个拒绝它的站点的示例。请注意,IHAVE命令中的消息id与文章标题中的消息id不同;虽然这是一种不好的做法,不应该这样做,但这并不是禁止的。

      [C] IHAVE <i.am.an.article.you.will.want@example.com>
      [S] 335 Send it; end with <CR-LF>.<CR-LF>
      [C] Path: pathost!demo!somewhere!not-for-mail
      [C] From: "Demo User" <nobody@example.com>
      [C] Newsgroups: misc.test
      [C] Subject: I am just a test article
      [C] Date: 6 Oct 1998 04:38:40 -0500
      [C] Organization: An Example Com, San Jose, CA
      [C] Message-ID: <i.am.an.article.you.have@example.com>
      [C]
      [C] This is just a test article.
      [C] .
      [S] 437 Article rejected; don't send again
        
      [C] IHAVE <i.am.an.article.you.will.want@example.com>
      [S] 335 Send it; end with <CR-LF>.<CR-LF>
      [C] Path: pathost!demo!somewhere!not-for-mail
      [C] From: "Demo User" <nobody@example.com>
      [C] Newsgroups: misc.test
      [C] Subject: I am just a test article
      [C] Date: 6 Oct 1998 04:38:40 -0500
      [C] Organization: An Example Com, San Jose, CA
      [C] Message-ID: <i.am.an.article.you.have@example.com>
      [C]
      [C] This is just a test article.
      [C] .
      [S] 437 Article rejected; don't send again
        

Example of sending an article to another site where the transfer fails:

将文章发送到传输失败的其他站点的示例:

      [C] IHAVE <i.am.an.article.you.will.want@example.com>
      [S] 335 Send it; end with <CR-LF>.<CR-LF>
      [C] Path: pathost!demo!somewhere!not-for-mail
      [C] From: "Demo User" <nobody@example.com>
      [C] Newsgroups: misc.test
      [C] Subject: I am just a test article
      [C] Date: 6 Oct 1998 04:38:40 -0500
      [C] Organization: An Example Com, San Jose, CA
      [C] Message-ID: <i.am.an.article.you.will.want@example.com>
      [C]
      [C] This is just a test article.
      [C] .
      [S] 436 Transfer failed
        
      [C] IHAVE <i.am.an.article.you.will.want@example.com>
      [S] 335 Send it; end with <CR-LF>.<CR-LF>
      [C] Path: pathost!demo!somewhere!not-for-mail
      [C] From: "Demo User" <nobody@example.com>
      [C] Newsgroups: misc.test
      [C] Subject: I am just a test article
      [C] Date: 6 Oct 1998 04:38:40 -0500
      [C] Organization: An Example Com, San Jose, CA
      [C] Message-ID: <i.am.an.article.you.will.want@example.com>
      [C]
      [C] This is just a test article.
      [C] .
      [S] 436 Transfer failed
        

Example of sending an article to a site that already has it:

将文章发送到已有文章的站点的示例:

[C] IHAVE <i.am.an.article.you.have@example.com> [S] 435 Duplicate

[C] 我给你写了一篇文章。have@example.com>[S]435重复

Example of sending an article to a site that requests that the article be tried again later:

向请求稍后重试文章的站点发送文章的示例:

[C] IHAVE <i.am.an.article.you.defer@example.com> [S] 436 Retry later

[C] 我给你写了一篇文章。defer@example.com>[S]436请稍后重试

7. Information Commands
7. 信息命令

This section lists other commands that may be used at any time between the beginning of a session and its termination. Using these commands does not alter any state information, but the response generated from their use may provide useful information to clients.

本节列出了在会话开始和终止之间的任何时间可以使用的其他命令。使用这些命令不会改变任何状态信息,但使用这些命令生成的响应可能会为客户端提供有用的信息。

7.1. DATE
7.1. 日期
7.1.1. Usage
7.1.1. 用法

Indicating capability: READER

指示能力:读卡器

Syntax DATE

语法日期

Responses 111 yyyymmddhhmmss Server date and time

响应111 YYYYMMDDHMMSS服务器日期和时间

Parameters yyyymmddhhmmss Current UTC date and time on server

参数yyyymmddhhmmss服务器上的当前UTC日期和时间

7.1.2. Description
7.1.2. 描述

This command exists to help clients find out the current Coordinated Universal Time [TF.686-1] from the server's perspective. This command SHOULD NOT be used as a substitute for NTP [RFC1305] but to provide information that might be useful when using the NEWNEWS command (see Section 7.4).

此命令用于帮助客户机从服务器的角度找出当前的协调世界时[TF.686-1]。此命令不应替代NTP[RFC1305],而应提供在使用NEWNEWS命令时可能有用的信息(参见第7.4节)。

The DATE command MUST return a timestamp from the same clock as is used for determining article arrival and group creation times (see Section 6). This clock SHOULD be monotonic, and adjustments SHOULD be made by running it fast or slow compared to "real" time rather than by making sudden jumps. A system providing NNTP service SHOULD keep the system clock as accurate as possible, either with NTP or by some other method.

DATE命令必须从用于确定物品到达和组创建时间的同一时钟返回时间戳(参见第6节)。这个时钟应该是单调的,调整应该通过与“实时”时间相比快速或慢速运行来进行,而不是通过突然跳跃。提供NNTP服务的系统应使用NTP或其他方法尽可能保持系统时钟的准确性。

The server MUST return a 111 response specifying the date and time on the server in the form yyyymmddhhmmss. This date and time is in Coordinated Universal Time.

服务器必须返回111响应,以yyyymmddhhmmss的形式指定服务器上的日期和时间。这个日期和时间是协调的世界时。

7.1.3. Examples
7.1.3. 例子

[C] DATE [S] 111 19990623135624

[C] 日期:111 19990623135624

7.2. HELP
7.2. 帮助
7.2.1. Usage
7.2.1. 用法

This command is mandatory.

此命令是必需的。

Syntax HELP

语法帮助

Responses 100 Help text follows (multi-line)

以下是回复100帮助文本(多行)

7.2.2. Description
7.2.2. 描述

This command provides a short summary of the commands that are understood by this implementation of the server. The help text will be presented as a multi-line data block following the 100 response code.

此命令提供此服务器实现可以理解的命令的简短摘要。下面的文本帮助行代码将显示为“多帮助块100”。

This text is not guaranteed to be in any particular format (but must be UTF-8) and MUST NOT be used by clients as a replacement for the CAPABILITIES command described in Section 5.2.

本文本不保证采用任何特定格式(但必须为UTF-8),客户不得将其用作第5.2节所述能力命令的替代品。

7.2.3. Examples
7.2.3. 例子
      [C] HELP
      [S] 100 Help text follows
      [S] This is some help text.  There is no specific
      [S] formatting requirement for this test, though
      [S] it is customary for it to list the valid commands
      [S] and give a brief definition of what they do.
      [S] .
        
      [C] HELP
      [S] 100 Help text follows
      [S] This is some help text.  There is no specific
      [S] formatting requirement for this test, though
      [S] it is customary for it to list the valid commands
      [S] and give a brief definition of what they do.
      [S] .
        
7.3. NEWGROUPS
7.3. 新团体
7.3.1. Usage
7.3.1. 用法

Indicating capability: READER

指示能力:读卡器

Syntax NEWGROUPS date time [GMT]

语法新组日期时间[GMT]

Responses 231 List of new newsgroups follows (multi-line)

回复231新新闻组列表如下(多行)

Parameters date Date in yymmdd or yyyymmdd format time Time in hhmmss format

参数yymmdd格式的日期或yyyymmdd格式的时间hhmmss格式的时间

7.3.2. Description
7.3.2. 描述

This command returns a list of newsgroups created on the server since the specified date and time. The results are in the same format as the LIST ACTIVE command (see Section 7.6.3). However, they MAY include groups not available on the server (and so not returned by LIST ACTIVE) and MAY omit groups for which the creation date is not available.

此命令返回自指定日期和时间以来在服务器上创建的新闻组列表。结果与LIST ACTIVE命令的格式相同(见第7.6.3节)。但是,它们可能包括服务器上不可用的组(因此不会由“活动列表”返回),也可能忽略创建日期不可用的组。

The date is specified as 6 or 8 digits in the format [xx]yymmdd, where xx is the first two digits of the year (19-99), yy is the last two digits of the year (00-99), mm is the month (01-12), and dd is the day of the month (01-31). Clients SHOULD specify all four digits of the year. If the first two digits of the year are not specified (this is supported only for backward compatibility), the year is to be taken from the current century if yy is smaller than or equal to the current year, and the previous century otherwise.

在[xx]yymmdd格式中,日期指定为6或8位数字,其中xx是一年(19-99)的前两位数字,yy是一年(00-99)的最后两位数字,mm是一个月(01-12),dd是一个月的第几天(01-31)。客户应指定年份的所有四位数字。如果未指定年份的前两位数字(仅支持向后兼容),则如果yy小于或等于当前年份,则年份将取自当前世纪,否则取自上一世纪。

The time is specified as 6 digits in the format hhmmss, where hh is the hours in the 24-hour clock (00-23), mm is the minutes (00-59), and ss is the seconds (00-60, to allow for leap seconds). The token "GMT" specifies that the date and time are given in Coordinated Universal Time [TF.686-1]; if it is omitted, then the date and time are specified in the server's local timezone. Note that there is no way of using the protocol specified in this document to establish the server's local timezone.

时间以hhmmss格式指定为6位数字,其中hh是24小时时钟中的小时(00-23),mm是分钟(00-59),ss是秒(00-60,允许闰秒)。标记“GMT”指定日期和时间以协调世界时[TF.686-1]给出;如果省略,则在服务器的本地时区中指定日期和时间。请注意,无法使用本文档中指定的协议来建立服务器的本地时区。

Note that an empty list is a possible valid response and indicates that there are no new newsgroups since that date-time.

请注意,空列表可能是一个有效的响应,表示自该日期起没有新的新闻组。

Clients SHOULD make all queries using Coordinated Universal Time (i.e., by including the "GMT" argument) when possible.

在可能的情况下,客户应使用协调世界时(即通过包含“GMT”参数)进行所有查询。

7.3.3. Examples
7.3.3. 例子

Example where there are new groups:

存在新组的示例:

      [C] NEWGROUPS 19990624 000000 GMT
      [S] 231 list of new newsgroups follows
      [S] alt.rfc-writers.recovery 4 1 y
      [S] tx.natives.recovery 89 56 y
      [S] .
        
      [C] NEWGROUPS 19990624 000000 GMT
      [S] 231 list of new newsgroups follows
      [S] alt.rfc-writers.recovery 4 1 y
      [S] tx.natives.recovery 89 56 y
      [S] .
        

Example where there are no new groups:

没有新组的示例:

      [C] NEWGROUPS 19990624 000000 GMT
      [S] 231 list of new newsgroups follows
      [S] .
        
      [C] NEWGROUPS 19990624 000000 GMT
      [S] 231 list of new newsgroups follows
      [S] .
        
7.4. NEWNEWS
7.4. 新消息
7.4.1. Usage
7.4.1. 用法

Indicating capability: NEWNEWS

指示能力:最新消息

Syntax NEWNEWS wildmat date time [GMT]

语法NEWNEWS wildmat日期时间[GMT]

Responses 230 List of new articles follows (multi-line)

回复230新文章列表如下(多行)

Parameters wildmat Newsgroups of interest date Date in yymmdd or yyyymmdd format time Time in hhmmss format

参数wildmat新闻组兴趣日期日期yymmdd或yyyymmdd格式时间时间hhmmss格式

7.4.2. Description
7.4.2. 描述

This command returns a list of message-ids of articles posted or received on the server, in the newsgroups whose names match the wildmat, since the specified date and time. One message-id is sent on each line; the order of the response has no specific significance and may vary from response to response in the same session. A message-id MAY appear more than once; if it does, it has the same meaning as if it appeared only once.

此命令返回自指定日期和时间以来在服务器上发布或接收的、名称与wildmat匹配的新闻组中的文章的消息ID列表。每行发送一个消息id;答复的顺序没有具体意义,在同一届会议上,答复的顺序可能因答复的不同而不同。消息id可能出现多次;如果它出现了,它的含义就好像它只出现过一次一样。

Date and time are in the same format as the NEWGROUPS command (see Section 7.3).

日期和时间与NEWGROUPS命令的格式相同(参见第7.3节)。

Note that an empty list is a possible valid response and indicates that there is currently no new news in the relevant groups.

请注意,空列表可能是有效的响应,表示相关组中当前没有新消息。

Clients SHOULD make all queries in Coordinated Universal Time (i.e., by using the "GMT" argument) when possible.

如果可能,客户端应在协调的世界时(即使用“GMT”参数)中进行所有查询。

7.4.3. Examples
7.4.3. 例子

Example where there are new articles:

有新文章的示例:

      [C] NEWNEWS news.*,sci.* 19990624 000000 GMT
      [S] 230 list of new articles by message-id follows
      [S] <i.am.a.new.article@example.com>
      [S] <i.am.another.new.article@example.com>
      [S] .
        
      [C] NEWNEWS news.*,sci.* 19990624 000000 GMT
      [S] 230 list of new articles by message-id follows
      [S] <i.am.a.new.article@example.com>
      [S] <i.am.another.new.article@example.com>
      [S] .
        

Example where there are no new articles:

没有新文章的示例:

      [C] NEWNEWS alt.* 19990624 000000 GMT
      [S] 230 list of new articles by message-id follows
      [S] .
        
      [C] NEWNEWS alt.* 19990624 000000 GMT
      [S] 230 list of new articles by message-id follows
      [S] .
        
7.5. Time
7.5. 时间

As described in Section 6, each article has an arrival timestamp. Each newsgroup also has a creation timestamp. These timestamps are used by the NEWNEWS and NEWGROUP commands to construct their responses.

如第6节所述,每件物品都有一个到达时间戳。每个新闻组还具有创建时间戳。NEWNEWS和NEWGROUP命令使用这些时间戳来构造它们的响应。

Clients can ensure that they do not have gaps in lists of articles or groups by using the DATE command in the following manner:

客户端可以通过以下方式使用DATE命令,确保在项目或组列表中没有间隙:

First session: Issue DATE command and record result. Issue NEWNEWS command using a previously chosen timestamp.

第一个会话:发出日期命令并记录结果。使用以前选择的newtimestamp命令发出新闻。

Subsequent sessions: Issue DATE command and hold result in temporary storage. Issue NEWNEWS command using timestamp saved from previous session. Overwrite saved timestamp with that currently in temporary storage.

后续会话:发出日期命令并将结果保留在临时存储中。使用上一个会话中保存的时间戳发出NEWNEWS命令。用当前临时存储中的时间戳覆盖保存的时间戳。

In order to allow for minor errors, clients MAY want to adjust the timestamp back by two or three minutes before using it in NEWNEWS.

为了允许出现小错误,客户端可能希望在NEWNEWS中使用时间戳之前将时间戳调整回两三分钟。

7.5.1. Examples
7.5.1. 例子

First session:

第一届会议:

      [C] DATE
      [S] 111 20010203112233
      [C] NEWNEWS local.chat 20001231 235959 GMT
      [S] 230 list follows
      [S] <article.1@local.service>
      [S] <article.2@local.service>
      [S] <article.3@local.service>
      [S] .
        
      [C] DATE
      [S] 111 20010203112233
      [C] NEWNEWS local.chat 20001231 235959 GMT
      [S] 230 list follows
      [S] <article.1@local.service>
      [S] <article.2@local.service>
      [S] <article.3@local.service>
      [S] .
        

Second session (the client has subtracted 3 minutes from the timestamp returned previously):

第二个会话(客户端已从先前返回的时间戳中减去3分钟):

      [C] DATE
      [S] 111 20010204003344
      [C] NEWNEWS local.chat 20010203 111933 GMT
      [S] 230 list follows
      [S] <article.3@local.service>
      [S] <article.4@local.service>
      [S] <article.5@local.service>
      [S] .
        
      [C] DATE
      [S] 111 20010204003344
      [C] NEWNEWS local.chat 20010203 111933 GMT
      [S] 230 list follows
      [S] <article.3@local.service>
      [S] <article.4@local.service>
      [S] <article.5@local.service>
      [S] .
        

Note how <article.3@local.service> arrived in the 3 minute gap and so is listed in both responses.

注意这篇文章是怎么写的。3@local.service>在3分钟间隔内到达,因此在两个回答中都列出。

7.6. The LIST Commands
7.6. 列表命令

The LIST family of commands all return information that is multi-line and that can, in general, be expected not to change during the session. Often the information is related to newsgroups, in which case the response has one line per newsgroup and a wildmat MAY be provided to restrict the groups for which information is returned.

命令列表系列返回的所有信息都是多行的,通常在会话期间不会更改。通常,信息与新闻组相关,在这种情况下,每个新闻组都有一行响应,可以提供一个wildmat来限制返回信息的组。

The set of available keywords (including those provided by extensions) is given in the capability list with capability label LIST.

可用关键字集(包括扩展提供的关键字)在带有功能标签列表的功能列表中给出。

7.6.1. LIST
7.6.1. 列表
7.6.1.1. Usage
7.6.1.1. 用法

Indicating capability: LIST

指示能力:列表

Syntax LIST [keyword [wildmat|argument]]

语法列表[关键字[wildmat |参数]]

Responses 215 Information follows (multi-line)

回复215信息如下(多行)

Parameters keyword Information requested [1] argument Specific to keyword wildmat Groups of interest

参数请求的关键字信息[1]特定于关键字wildmat兴趣组的参数

[1] If no keyword is provided, it defaults to ACTIVE.

[1] 如果未提供关键字,则默认为ACTIVE。

7.6.1.2. Description
7.6.1.2. 描述

The LIST command allows the server to provide blocks of information to the client. This information may be global or may be related to newsgroups; in the latter case, the information may be returned either for all groups or only for those matching a wildmat. Each block of information is represented by a different keyword. The command returns the specific information identified by the keyword.

LIST命令允许服务器向客户端提供信息块。这些信息可能是全球性的,也可能与新闻组有关;在后一种情况下,可以为所有组返回信息,也可以仅为与wildmat匹配的组返回信息。每个信息块由不同的关键字表示。该命令返回由关键字标识的特定信息。

If the information is available, it is returned as a multi-line data block following the 215 response code. The format of the information depends on the keyword. The information MAY be affected by the additional argument, but the format MUST NOT be.

如果信息可用,它将作为215响应代码后的多行数据块返回。信息的格式取决于关键字。信息可能会受到附加参数的影响,但格式不得更改。

If the information is based on newsgroups and the optional wildmat argument is specified, the response is limited to only the groups (if any) whose names match the wildmat and for which the information is available.

如果信息基于新闻组,并且指定了可选的wildmat参数,则响应仅限于名称与wildmat匹配且信息可用的组(如果有)。

Note that an empty list is a possible valid response; for a newsgroup-based keyword, it indicates that there are no groups meeting the above criteria.

请注意,空列表是可能的有效响应;对于基于新闻组的关键字,它表示没有满足上述条件的组。

If the keyword is not recognised, or if an argument is specified and the keyword does not expect one, a 501 response code MUST BE returned. If the keyword is recognised but the server does not maintain the information, a 503 response code MUST BE returned.

如果无法识别关键字,或者指定了参数,但关键字不需要参数,则必须返回501响应代码。如果识别出关键字,但服务器未维护该信息,则必须返回503响应代码。

The LIST command MUST NOT change the visible state of the server in any way; that is, the behaviour of subsequent commands MUST NOT be affected by whether the LIST command was issued. For example, it MUST NOT make groups available that otherwise would not have been.

LIST命令不得以任何方式更改服务器的可见状态;也就是说,后续命令的行为不得受是否发出LIST命令的影响。例如,它不能提供否则无法使用的组。

7.6.1.3. Examples
7.6.1.3. 例子

Example of LIST with the ACTIVE keyword:

具有活动关键字的列表示例:

      [C] LIST ACTIVE
      [S] 215 list of newsgroups follows
      [S] misc.test 3002322 3000234 y
      [S] comp.risks 442001 441099 m
      [S] alt.rfc-writers.recovery 4 1 y
      [S] tx.natives.recovery 89 56 y
      [S] tx.natives.recovery.d 11 9 n
      [S] .
        
      [C] LIST ACTIVE
      [S] 215 list of newsgroups follows
      [S] misc.test 3002322 3000234 y
      [S] comp.risks 442001 441099 m
      [S] alt.rfc-writers.recovery 4 1 y
      [S] tx.natives.recovery 89 56 y
      [S] tx.natives.recovery.d 11 9 n
      [S] .
        

Example of LIST with no keyword:

没有关键字的列表示例:

      [C] LIST
      [S] 215 list of newsgroups follows
      [S] misc.test 3002322 3000234 y
      [S] comp.risks 442001 441099 m
      [S] alt.rfc-writers.recovery 4 1 y
      [S] tx.natives.recovery 89 56 y
      [S] tx.natives.recovery.d 11 9 n
      [S] .
        
      [C] LIST
      [S] 215 list of newsgroups follows
      [S] misc.test 3002322 3000234 y
      [S] comp.risks 442001 441099 m
      [S] alt.rfc-writers.recovery 4 1 y
      [S] tx.natives.recovery 89 56 y
      [S] tx.natives.recovery.d 11 9 n
      [S] .
        

The output is identical to that of the previous example.

输出与上一示例的输出相同。

Example of LIST on a newsgroup-based keyword with and without wildmat:

带和不带wildmat的基于新闻组的关键字列表示例:

      [C] LIST ACTIVE.TIMES
      [S] 215 information follows
      [S] misc.test 930445408 <creatme@isc.org>
      [S] alt.rfc-writers.recovery 930562309 <m@example.com>
      [S] tx.natives.recovery 930678923 <sob@academ.com>
      [S] .
      [C] LIST ACTIVE.TIMES tx.*
      [S] 215 information follows
      [S] tx.natives.recovery 930678923 <sob@academ.com>
      [S] .
        
      [C] LIST ACTIVE.TIMES
      [S] 215 information follows
      [S] misc.test 930445408 <creatme@isc.org>
      [S] alt.rfc-writers.recovery 930562309 <m@example.com>
      [S] tx.natives.recovery 930678923 <sob@academ.com>
      [S] .
      [C] LIST ACTIVE.TIMES tx.*
      [S] 215 information follows
      [S] tx.natives.recovery 930678923 <sob@academ.com>
      [S] .
        

Example of LIST returning an error where the keyword is recognized but the software does not maintain this information:

列表返回错误的示例,其中关键字已识别,但软件未维护此信息:

      [C] CAPABILITIES
      [S] 101 Capability list:
      [S] VERSION 2
      [S] READER
      [S] LIST ACTIVE NEWSGROUPS ACTIVE.TIMES XTRA.DATA
      [S] .
      [C] LIST XTRA.DATA
      [S] 503 Data item not stored
        
      [C] CAPABILITIES
      [S] 101 Capability list:
      [S] VERSION 2
      [S] READER
      [S] LIST ACTIVE NEWSGROUPS ACTIVE.TIMES XTRA.DATA
      [S] .
      [C] LIST XTRA.DATA
      [S] 503 Data item not stored
        

Example of LIST where the keyword is not recognised:

无法识别关键字的列表示例:

      [C] CAPABILITIES
      [S] 101 Capability list:
      [S] VERSION 2
      [S] READER
      [S] LIST ACTIVE NEWSGROUPS ACTIVE.TIMES XTRA.DATA
      [S] .
      [C] LIST DISTRIB.PATS
      [S] 501 Syntax Error
        
      [C] CAPABILITIES
      [S] 101 Capability list:
      [S] VERSION 2
      [S] READER
      [S] LIST ACTIVE NEWSGROUPS ACTIVE.TIMES XTRA.DATA
      [S] .
      [C] LIST DISTRIB.PATS
      [S] 501 Syntax Error
        
7.6.2. Standard LIST Keywords
7.6.2. 标准列表关键字

This specification defines the following LIST keywords:

本规范定义了以下列表关键字:

   +--------------+---------------+------------------------------------+
   | Keyword      | Definition    | Status                             |
   +--------------+---------------+------------------------------------+
   | ACTIVE       | Section 7.6.3 | Mandatory if the READER capability |
   |              |               | is advertised                      |
   |              |               |                                    |
   | ACTIVE.TIMES | Section 7.6.4 | Optional                           |
   |              |               |                                    |
   | DISTRIB.PATS | Section 7.6.5 | Optional                           |
   |              |               |                                    |
   | HEADERS      | Section 8.6   | Mandatory if the HDR capability is |
   |              |               | advertised                         |
   |              |               |                                    |
   | NEWSGROUPS   | Section 7.6.6 | Mandatory if the READER capability |
   |              |               | is advertised                      |
   |              |               |                                    |
   | OVERVIEW.FMT | Section 8.4   | Mandatory if the OVER capability   |
   |              |               | is advertised                      |
   +--------------+---------------+------------------------------------+
        
   +--------------+---------------+------------------------------------+
   | Keyword      | Definition    | Status                             |
   +--------------+---------------+------------------------------------+
   | ACTIVE       | Section 7.6.3 | Mandatory if the READER capability |
   |              |               | is advertised                      |
   |              |               |                                    |
   | ACTIVE.TIMES | Section 7.6.4 | Optional                           |
   |              |               |                                    |
   | DISTRIB.PATS | Section 7.6.5 | Optional                           |
   |              |               |                                    |
   | HEADERS      | Section 8.6   | Mandatory if the HDR capability is |
   |              |               | advertised                         |
   |              |               |                                    |
   | NEWSGROUPS   | Section 7.6.6 | Mandatory if the READER capability |
   |              |               | is advertised                      |
   |              |               |                                    |
   | OVERVIEW.FMT | Section 8.4   | Mandatory if the OVER capability   |
   |              |               | is advertised                      |
   +--------------+---------------+------------------------------------+
        

Where one of these LIST keywords is supported by a server, it MUST have the meaning given in the relevant sub-section.

如果服务器支持其中一个列表关键字,则该关键字必须具有相关小节中给出的含义。

7.6.3. LIST ACTIVE
7.6.3. 活动列表

This keyword MUST be supported by servers advertising the READER capability.

发布读卡器功能的服务器必须支持此关键字。

LIST ACTIVE returns a list of valid newsgroups and associated information. If no wildmat is specified, the server MUST include every group that the client is permitted to select with the GROUP command (Section 6.1.1). Each line of this list consists of four fields separated from each other by one or more spaces:

LIST ACTIVE返回有效新闻组和关联信息的列表。如果未指定wildmat,服务器必须包括允许客户端使用group命令选择的每个组(第6.1.1节)。此列表的每一行由四个字段组成,每个字段之间用一个或多个空格隔开:

o The name of the newsgroup. o The reported high water mark for the group. o The reported low water mark for the group. o The current status of the group on this server.

o 新闻组的名称。o该组报告的高水位线。o该组报告的低水位线。o此服务器上组的当前状态。

The reported high and low water marks are as described in the GROUP command (see Section 6.1.1), but note that they are in the opposite order to the 211 response to that command.

报告的高水位线和低水位线如GROUP命令所述(见第6.1.1节),但请注意,它们的顺序与211对该命令的响应相反。

The status field is typically one of the following:

状态字段通常是以下字段之一:

"y" Posting is permitted.

允许“y”过帐。

"n" Posting is not permitted.

不允许使用“n”过帐。

"m" Postings will be forwarded to the newsgroup moderator.

“m”帖子将转发给新闻组主持人。

The server SHOULD use these values when these meanings are required and MUST NOT use them with any other meaning. Other values for the status may exist; the definition of these other values and the circumstances under which they are returned may be specified in an extension or may be private to the server. A client SHOULD treat an unrecognized status as giving no information.

当需要这些含义时,服务器应使用这些值,并且不得将其与任何其他含义一起使用。可能存在状态的其他值;这些其他值的定义以及返回它们的环境可以在扩展中指定,也可以是服务器专用的。客户端应将未识别的状态视为未提供任何信息。

The status of a newsgroup only indicates how posts to that newsgroup are normally processed and is not necessarily customised to the specific client. For example, if the current client is forbidden from posting, then this will apply equally to groups with status "y". Conversely, a client with special privileges (not defined by this specification) might be able to post to a group with status "n".

新闻组的状态仅表示向该新闻组发送的邮件通常是如何处理的,而不一定是针对特定客户机定制的。例如,如果当前客户端被禁止发布,则这将同样适用于状态为“y”的组。相反,具有特殊权限(本规范未定义)的客户机可能能够向状态为“n”的组发布。

For example:

例如:

      [C] LIST ACTIVE
      [S] 215 list of newsgroups follows
      [S] misc.test 3002322 3000234 y
      [S] comp.risks 442001 441099 m
      [S] alt.rfc-writers.recovery 4 1 y
      [S] tx.natives.recovery 89 56 y
      [S] tx.natives.recovery.d 11 9 n
      [S] .
        
      [C] LIST ACTIVE
      [S] 215 list of newsgroups follows
      [S] misc.test 3002322 3000234 y
      [S] comp.risks 442001 441099 m
      [S] alt.rfc-writers.recovery 4 1 y
      [S] tx.natives.recovery 89 56 y
      [S] tx.natives.recovery.d 11 9 n
      [S] .
        

or, on an implementation that includes leading zeroes:

或者,对于包含前导零的实现:

      [C] LIST ACTIVE
      [S] 215 list of newsgroups follows
      [S] misc.test 0003002322 0003000234 y
      [S] comp.risks 0000442001 0000441099 m
      [S] alt.rfc-writers.recovery 0000000004 0000000001 y
      [S] tx.natives.recovery 0000000089 0000000056 y
      [S] tx.natives.recovery.d 0000000011 0000000009 n
      [S] .
        
      [C] LIST ACTIVE
      [S] 215 list of newsgroups follows
      [S] misc.test 0003002322 0003000234 y
      [S] comp.risks 0000442001 0000441099 m
      [S] alt.rfc-writers.recovery 0000000004 0000000001 y
      [S] tx.natives.recovery 0000000089 0000000056 y
      [S] tx.natives.recovery.d 0000000011 0000000009 n
      [S] .
        

The information is newsgroup based, and a wildmat MAY be specified, in which case the response is limited to only the groups (if any) whose names match the wildmat. For example:

该信息基于新闻组,并且可以指定wildmat,在这种情况下,响应仅限于名称与wildmat匹配的组(如果有)。例如:

      [C] LIST ACTIVE *.recovery
      [S] 215 list of newsgroups follows
      [S] alt.rfc-writers.recovery 4 1 y
      [S] tx.natives.recovery 89 56 y
      [S] .
        
      [C] LIST ACTIVE *.recovery
      [S] 215 list of newsgroups follows
      [S] alt.rfc-writers.recovery 4 1 y
      [S] tx.natives.recovery 89 56 y
      [S] .
        
7.6.4. LIST ACTIVE.TIMES
7.6.4. 列出活动时间

This keyword is optional.

此关键字是可选的。

The active.times list is maintained by some NNTP servers to contain information about who created a particular newsgroup and when. Each line of this list consists of three fields separated from each other by one or more spaces. The first field is the name of the newsgroup. The second is the time when this group was created on this news server, measured in seconds since the start of January 1, 1970. The third is plain text intended to describe the entity that created the newsgroup; it is often a mailbox as defined in RFC 2822 [RFC2822]. For example:

active.times列表由一些NNTP服务器维护,以包含有关谁创建了特定新闻组以及何时创建的信息。此列表的每一行由三个字段组成,三个字段之间用一个或多个空格隔开。第一个字段是新闻组的名称。第二个是此新闻服务器上创建此组的时间,从1970年1月1日开始以秒为单位。第三种是纯文本,旨在描述创建新闻组的实体;它通常是RFC 2822[RFC2822]中定义的邮箱。例如:

      [C] LIST ACTIVE.TIMES
      [S] 215 information follows
      [S] misc.test 930445408 <creatme@isc.org>
      [S] alt.rfc-writers.recovery 930562309 <m@example.com>
      [S] tx.natives.recovery 930678923 <sob@academ.com>
      [S] .
        
      [C] LIST ACTIVE.TIMES
      [S] 215 information follows
      [S] misc.test 930445408 <creatme@isc.org>
      [S] alt.rfc-writers.recovery 930562309 <m@example.com>
      [S] tx.natives.recovery 930678923 <sob@academ.com>
      [S] .
        

The list MAY omit newsgroups for which the information is unavailable and MAY include groups not available on the server; in particular, it MAY omit all groups created before the date and time of the oldest entry. The client MUST NOT assume that the list is complete or that it matches the list returned by the LIST ACTIVE command (Section 7.6.3). The NEWGROUPS command (Section 7.3) may provide a better way to access this information, and the results of the two commands SHOULD be consistent except that, if the latter is invoked with a date and time earlier than the oldest entry in active.times list, its result may include extra groups.

该列表可能省略信息不可用的新闻组,并可能包括服务器上不可用的组;特别是,它可能会忽略在最早条目的日期和时间之前创建的所有组。客户不得假设列表已完成或与list ACTIVE命令返回的列表匹配(第7.6.3节)。NEWGROUPS命令(第7.3节)可以提供更好的方式来访问此信息,并且两个命令的结果应该是一致的,除非调用后者的日期和时间早于active.times列表中最早的条目,其结果可能包括额外的组。

The information is newsgroup based, and a wildmat MAY be specified, in which case the response is limited to only the groups (if any) whose names match the wildmat.

该信息基于新闻组,并且可以指定wildmat,在这种情况下,响应仅限于名称与wildmat匹配的组(如果有)。

7.6.5. LIST DISTRIB.PATS
7.6.5. 列出发行版

This keyword is optional.

此关键字是可选的。

The distrib.pats list is maintained by some NNTP servers to assist clients to choose a value for the content of the Distribution header of a news article being posted. Each line of this list consists of three fields separated from each other by a colon (":"). The first field is a weight, the second field is a wildmat (which may be a simple newsgroup name), and the third field is a value for the Distribution header content. For example:

distrib.pats列表由一些NNTP服务器维护,以帮助客户端为正在发布的新闻文章的分发标题的内容选择一个值。此列表的每一行由三个字段组成,三个字段之间用冒号(“:”)分隔。第一个字段是权重,第二个字段是wildmat(可能是一个简单的新闻组名称),第三个字段是分发标题内容的值。例如:

      [C] LIST DISTRIB.PATS
      [S] 215 information follows
      [S] 10:local.*:local
      [S] 5:*:world
      [S] 20:local.here.*:thissite
      [S] .
        
      [C] LIST DISTRIB.PATS
      [S] 215 information follows
      [S] 10:local.*:local
      [S] 5:*:world
      [S] 20:local.here.*:thissite
      [S] .
        

The client MAY use this information to construct an appropriate Distribution header given the name of a newsgroup. To do so, it should determine the lines whose second field matches the newsgroup name, select from among them the line with the highest weight (with 0 being the lowest), and use the value of the third field to construct the Distribution header.

客户机可以使用此信息构造一个适当的分发头,该分发头具有新闻组的名称。为此,它应该确定第二个字段与新闻组名称匹配的行,从中选择权重最高(0为最低)的行,并使用第三个字段的值构造分发标头。

The information is not newsgroup based, and an argument MUST NOT be specified.

该信息不是基于新闻组的,并且不能指定参数。

7.6.6. LIST NEWSGROUPS
7.6.6. 列出新闻组

This keyword MUST be supported by servers advertising the READER capability.

发布读卡器功能的服务器必须支持此关键字。

The newsgroups list is maintained by NNTP servers to contain the name of each newsgroup that is available on the server and a short description about the purpose of the group. Each line of this list consists of two fields separated from each other by one or more space or TAB characters (the usual practice is a single TAB). The first field is the name of the newsgroup, and the second is a short description of the group. For example:

新闻组列表由NNTP服务器维护,以包含服务器上可用的每个新闻组的名称以及有关该组用途的简短说明。此列表的每一行由两个字段组成,两个字段之间用一个或多个空格或制表符分隔(通常的做法是单个制表符)。第一个字段是新闻组的名称,第二个字段是组的简短描述。例如:

      [C] LIST NEWSGROUPS
      [S] 215 information follows
      [S] misc.test General Usenet testing
      [S] alt.rfc-writers.recovery RFC Writers Recovery
      [S] tx.natives.recovery Texas Natives Recovery
      [S] .
        
      [C] LIST NEWSGROUPS
      [S] 215 information follows
      [S] misc.test General Usenet testing
      [S] alt.rfc-writers.recovery RFC Writers Recovery
      [S] tx.natives.recovery Texas Natives Recovery
      [S] .
        

The list MAY omit newsgroups for which the information is unavailable and MAY include groups not available on the server. The client MUST NOT assume that the list is complete or that it matches the list returned by LIST ACTIVE.

该列表可能会忽略信息不可用的新闻组,并可能包括服务器上不可用的组。客户机不得假设列表已完成,或与list ACTIVE返回的列表匹配。

The description SHOULD be in UTF-8. However, servers often obtain the information from external sources. These sources may have used different encodings (ones that use octets in the range 128 to 255 in some other manner) and, in that case, the server MAY pass it on unchanged. Therefore, clients MUST be prepared to receive such descriptions.

说明应使用UTF-8。但是,服务器通常从外部来源获取信息。这些源可能使用了不同的编码(以其他方式使用128到255范围内的八位字节的编码),在这种情况下,服务器可以原封不动地传递它。因此,客户必须做好接收此类描述的准备。

The information is newsgroup based, and a wildmat MAY be specified, in which case the response is limited to only the groups (if any) whose names match the wildmat.

该信息基于新闻组,并且可以指定wildmat,在这种情况下,响应仅限于名称与wildmat匹配的组(如果有)。

8. Article Field Access Commands
8. 项目字段访问命令

This section lists commands that may be used to access specific article fields; that is, headers of articles and metadata about articles. These commands typically fetch data from an "overview database", which is a database of headers extracted from incoming articles plus metadata determined as the article arrives. Only certain fields are included in the database.

本节列出了可用于访问特定文章字段的命令;也就是说,文章的标题和关于文章的元数据。这些命令通常从“概览数据库”中获取数据,该数据库包含从传入文章中提取的标题以及文章到达时确定的元数据。数据库中只包含某些字段。

This section is based on the Overview/NOV database [ROBE1995] developed by Geoff Collyer.

本节基于Geoff Collyer开发的Overview/NOV数据库[ROBE1995]。

8.1. Article Metadata
8.1. 文章元数据

Article "metadata" is data about articles that does not occur within the article itself. Each metadata item has a name that MUST begin with a colon (and that MUST NOT contain a colon elsewhere within it). As with header names, metadata item names are not case sensitive.

文章“元数据”是关于文章本身不存在的文章的数据。每个元数据项都有一个名称,该名称必须以冒号开头(并且不得在其中的其他位置包含冒号)。与头名称一样,元数据项名称不区分大小写。

When generating a metadata item, the server MUST compute it for itself and MUST NOT trust any related value provided in the article. (In particular, a Lines or Bytes header in the article MUST NOT be assumed to specify the correct number of lines or bytes in the article.) If the server has access to several non-identical copies of an article, the value returned MUST be correct for any copy of that article retrieved during the same session.

在生成元数据项时,服务器必须自己计算它,并且不能信任文章中提供的任何相关值。(特别是,文章中的行或字节头不能被假定为指定了文章中正确的行数或字节数。)如果服务器可以访问文章的多个不完全相同的副本,则对于在同一会话期间检索到的该文章的任何副本,返回的值必须是正确的。

This specification defines two metadata items: ":bytes" and ":lines". Other metadata items may be defined by extensions. The names of metadata items defined by registered extensions MUST NOT begin with ":x-". To avoid the risk of a clash with a future registered extension, the names of metadata items defined by private extensions SHOULD begin with ":x-".

本规范定义了两个元数据项:“:字节”和“:行”。其他元数据项可以通过扩展来定义。由已注册扩展定义的元数据项的名称不得以“:x-”开头。为了避免与将来注册的扩展冲突的风险,私有扩展定义的元数据项的名称应以“:x-”开头。

8.1.1. The :bytes Metadata Item
8.1.1. 字节元数据项

The :bytes metadata item for an article is a decimal integer. It SHOULD equal the number of octets in the entire article: headers, body, and separating empty line (counting a CRLF pair as two octets, and excluding both the "." CRLF terminating the response and any "." added for "dot-stuffing" purposes).

项目的:字节元数据项是十进制整数。它应该等于整篇文章中的八位字节数:标题、正文和分隔空行(将CRLF对计算为两个八位字节,不包括为“点填充”目的添加的“.CRLF终止响应”和“.any”。)。

Note to client implementers: some existing servers return a value different from that above. The commonest reasons for this are as follows:

客户机实现者注意:一些现有服务器返回与上面不同的值。最常见的原因如下:

o Counting a CRLF pair as one octet.

o 将CRLF对计算为一个八位组。

o Including the "." character used for dot-stuffing in the number.

o 包括数字中用于点填充的“.”字符。

o Including the terminating "." CRLF in the number.

o 在数字中包括终止的“.”CRLF。

o Using one copy of an article for counting the octets but then returning another one that differs in some (permitted) manner.

o 使用文章的一个副本计算八位字节,然后返回另一个以某种(允许的)方式不同的八位字节。

Implementations should be prepared for such variation and MUST NOT rely on the value being accurate.

实施应针对此类变化做好准备,且不得依赖于准确的值。

8.1.2. The :lines Metadata Item
8.1.2. 行元数据项

The :lines metadata item for an article is a decimal integer. It MUST equal the number of lines in the article body (excluding the empty line separating headers and body). Equivalently, it is two less than the number of CRLF pairs that the BODY command would return for that article (the extra two are those following the response code and the termination octet).

项目的:行元数据项是十进制整数。它必须等于文章正文中的行数(不包括分隔标题和正文的空行)。等效地,它比BODY命令将为该文章返回的CRLF对的数量少两个(额外的两个是响应代码和终止八位组后面的两个)。

8.2. Database Consistency
8.2. 数据库一致性

The information stored in the overview database may change over time. If the database records the content or absence of a given field (that is, a header or metadata item) for all articles, it is said to be "consistent" for that field. If it records the content of a header for some articles but not for others that nevertheless included that header, or if it records a metadata item for some articles but not for others to which that item applies, it is said to be "inconsistent" for that field.

存储在概览数据库中的信息可能会随着时间的推移而变化。如果数据库记录了所有文章的给定字段(即标题或元数据项)的内容或缺失,则该字段称为“一致”。如果它记录了某些文章的标题内容,但不记录包含该标题的其他文章的标题内容,或者如果它记录了某些文章的元数据项目,但不记录该项目适用的其他文章的元数据项目,则该字段称为“不一致”。

The LIST OVERVIEW.FMT command SHOULD list all the fields for which the database is consistent at that moment. It MAY omit such fields (for example, if it is not known whether the database is consistent or inconsistent). It MUST NOT include fields for which the database is inconsistent or that are not stored in the database. Therefore, if a header appears in the LIST OVERVIEW.FMT output but not in the OVER output for a given article, that header does not appear in the article (similarly for metadata items).

LIST OVERVIEW.FMT命令应列出数据库当时一致的所有字段。它可能会忽略这些字段(例如,如果不知道数据库是一致的还是不一致的)。它不能包括数据库不一致或未存储在数据库中的字段。因此,如果某个标题出现在LIST OVERVIEW.FMT输出中,但未出现在给定文章的OVER output中,则该标题不会出现在文章中(类似于元数据项)。

These rules assume that the fields being stored in the database remain constant for long periods of time, and therefore the database will be consistent. When the set of fields to be stored is changed, it will be inconsistent until either the database is rebuilt or the only articles remaining are those received since the change. Therefore, the output from LIST OVERVIEW.FMT needs to be altered twice. Firstly, before any fields stop being stored they MUST be removed from the output; then, when the database is once more known to be consistent, the new fields SHOULD be added to the output.

这些规则假定数据库中存储的字段在很长一段时间内保持不变,因此数据库将保持一致。当要存储的字段集发生更改时,它将不一致,直到重新生成数据库或只剩下更改后收到的项目。因此,LIST OVERVIEW.FMT的输出需要更改两次。首先,在停止存储任何字段之前,必须将其从输出中删除;然后,当再次知道数据库是一致的时,应将新字段添加到输出中。

If the HDR command uses the overview database rather than taking information directly from the articles, the same issues of consistency and inconsistency apply, and the LIST HEADERS command SHOULD take the same approach as the LIST OVERVIEW.FMT command in resolving them.

如果HDR命令使用overview数据库而不是直接从文章中获取信息,则一致性和不一致性问题同样适用,并且LIST HEADERS命令在解决这些问题时应采用与LIST overview.FMT命令相同的方法。

8.3. OVER
8.3. 结束
8.3.1. Usage
8.3.1. 用法

Indicating capability: OVER

指示能力:超过

Syntax OVER message-id OVER range OVER

语法超过消息id超过范围超过

Responses

响应

First form (message-id specified) 224 Overview information follows (multi-line) 430 No article with that message-id

第一个表单(指定消息id)224概述信息(多行)430没有带有该消息id的文章

Second form (range specified) 224 Overview information follows (multi-line) 412 No newsgroup selected 423 No articles in that range

第二个表单(指定范围)224概述信息如下(多行)412未选择新闻组423未选择该范围内的文章

Third form (current article number used) 224 Overview information follows (multi-line) 412 No newsgroup selected 420 Current article number is invalid

第三种形式(使用当前文章编号)224概述信息如下(多行)412未选择新闻组420当前文章编号无效

Parameters range Number(s) of articles message-id Message-id of article

参数范围文章编号消息id文章的消息id

8.3.2. Description
8.3.2. 描述

The OVER command returns the contents of all the fields in the database for an article specified by message-id, or from a specified article or range of articles in the currently selected newsgroup.

OVER命令返回数据库中由消息id指定的文章的所有字段的内容,或从当前选定新闻组中的指定文章或一系列文章返回的内容。

The message-id argument indicates a specific article. The range argument may be any of the following:

message id参数表示特定的项目。范围参数可以是以下任一参数:

o An article number.

o 商品编号。

o An article number followed by a dash to indicate all following.

o 商品编号,后跟破折号,表示以下所有内容。

o An article number followed by a dash followed by another article number.

o 商品编号后接破折号,后接另一商品编号。

If neither is specified, the current article number is used.

如果两者均未指定,则使用当前商品编号。

Support for the first (message-id) form is optional. If it is supported, the OVER capability line MUST include the argument "MSGID". Otherwise, the capability line MUST NOT include this argument, and the OVER command MUST return the generic response code 503 when this form is used.

对第一个(消息id)表单的支持是可选的。如果支持,则OVER capability行必须包含参数“MSGID”。否则,功能行不能包含此参数,并且当使用此表单时,OVER命令必须返回通用响应代码503。

If the information is available, it is returned as a multi-line data block following the 224 response code and contains one line per article, sorted in numerical order of article number. (Note that unless the argument is a range including a dash, there will be exactly one line in the data block.) Each line consists of a number of fields separated by a TAB. A field may be empty (in which case there will be two adjacent TABs), and a sequence of trailing TABs may be omitted.

如果信息可用,它将作为224响应代码后的多行数据块返回,并包含每件物品一行,按物品编号的数字顺序排序。(请注意,除非参数是包含破折号的范围,否则数据块中只有一行。)每一行由多个字段组成,字段之间用制表符分隔。一个字段可能为空(在这种情况下,将有两个相邻的选项卡),并且可以省略一系列后续选项卡。

The first 8 fields MUST be the following, in order:

前8个字段的顺序必须如下所示:

"0" or article number (see below) Subject header content From header content Date header content Message-ID header content References header content :bytes metadata item :lines metadata item

“0”或文章编号(见下文)标题内容中的主题标题内容日期标题内容消息ID标题内容引用标题内容:字节元数据项:行元数据项

If the article is specified by message-id (the first form of the command), the article number MUST be replaced with zero, except that if there is a currently selected newsgroup and the article is present in that group, the server MAY use the article's number in that group. (See the ARTICLE command (Section 6.2.1) and STAT examples (Section 6.2.4.3) for more details.) In the other two forms of the command, the article number MUST be returned.

如果文章是由消息id(命令的第一种形式)指定的,则文章编号必须替换为零,除非存在当前选定的新闻组且该组中存在该文章,否则服务器可以使用该组中的文章编号。(有关更多详细信息,请参见ARTICLE命令(第6.2.1节)和STAT示例(第6.2.4.3节)。在其他两种形式的命令中,必须返回物品编号。

Any subsequent fields are the contents of the other headers and metadata held in the database.

任何后续字段都是数据库中保存的其他头和元数据的内容。

For the five mandatory headers, the content of each field MUST be based on the content of the header (that is, with the header name and following colon and space removed). If the article does not contain that header, or if the content is empty, the field MUST be empty. For the two mandatory metadata items, the content of the field MUST be just the value, with no other text.

对于五个必填标题,每个字段的内容必须基于标题的内容(即,删除标题名称和后面的冒号和空格)。如果文章不包含该标题,或者内容为空,则字段必须为空。对于两个必需的元数据项,字段的内容必须仅为值,而不包含其他文本。

For all subsequent fields that contain headers, the content MUST be the entire header line other than the trailing CRLF. For all subsequent fields that contain metadata, the field consists of the metadata name, a single space, and then the value.

对于包含标题的所有后续字段,内容必须是除尾部CRLF之外的整个标题行。对于包含元数据的所有后续字段,该字段由元数据名称、单个空格和值组成。

For all fields, the value is processed by first removing all CRLF pairs (that is, undoing any folding and removing the terminating CRLF) and then replacing each TAB with a single space. If there is no such header in the article, no such metadata item, or no header or item stored in the database for that article, the corresponding field MUST be empty.

对于所有字段,首先移除所有CRLF对(即,撤消任何折叠并移除终止的CRLF),然后用单个空格替换每个制表符来处理该值。如果文章中没有此类标题、没有此类元数据项,或者数据库中没有存储该文章的标题或项,则相应字段必须为空。

Note that, after unfolding, the characters NUL, LF, and CR cannot occur in the header of an article offered by a conformant server. Nevertheless, servers SHOULD check for these characters and replace each one by a single space (so that, for example, CR LF LF TAB will become two spaces, since the CR and first LF will be removed by the unfolding process). This will encourage robustness in the face of non-conforming data; it is also possible that future versions of this specification could permit these characters to appear in articles.

注意,在展开之后,字符NUL、LF和CR不能出现在一致性服务器提供的文章的标题中。然而,服务器应该检查这些字符,并用单个空格替换每个字符(例如,CR LF TAB将变成两个空格,因为CR和第一个LF将通过展开过程移除)。这将鼓励在面对不一致数据时的稳健性;本规范的未来版本也可能允许这些字符出现在文章中。

The server SHOULD NOT produce output for articles that no longer exist.

服务器不应为不再存在的项目生成输出。

If the argument is a message-id and no such article exists, a 430 response MUST be returned. If the argument is a range or is omitted and the currently selected newsgroup is invalid, a 412 response MUST be returned. If the argument is a range and no articles in that number range exist in the currently selected newsgroup, including the case where the second number is less than the first one, a 423 response MUST be returned. If the argument is omitted and the current article number is invalid, a 420 response MUST be returned.

如果参数是消息id,并且不存在此类项目,则必须返回430响应。如果参数是一个范围或被省略,并且当前选择的新闻组无效,则必须返回412响应。如果参数是一个范围,并且当前选定的新闻组中不存在该数字范围内的文章,包括第二个数字小于第一个数字的情况,则必须返回423响应。如果省略参数且当前项目编号无效,则必须返回420响应。

8.3.3. Examples
8.3.3. 例子

In the first four examples, TAB has been replaced by vertical bar and some lines have been folded for readability.

在前四个示例中,制表符已被竖条替换,一些行已折叠以便于阅读。

Example of a successful retrieval of overview information for an article (explicitly not using an article number):

成功检索文章概述信息的示例(明确不使用文章编号):

      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] OVER
      [S] 224 Overview information follows
      [S] 3000234|I am just a test article|"Demo User"
          <nobody@example.com>|6 Oct 1998 04:38:40 -0500|
          <45223423@example.com>|<45454@example.net>|1234|
          17|Xref: news.example.com misc.test:3000363
      [S] .
        
      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] OVER
      [S] 224 Overview information follows
      [S] 3000234|I am just a test article|"Demo User"
          <nobody@example.com>|6 Oct 1998 04:38:40 -0500|
          <45223423@example.com>|<45454@example.net>|1234|
          17|Xref: news.example.com misc.test:3000363
      [S] .
        

Example of a successful retrieval of overview information for an article by message-id:

通过邮件id成功检索文章概述信息的示例:

      [C] CAPABILITIES
      [S] 101 Capability list:
      [S] VERSION 2
      [S] READER
      [S] OVER MSGID
      [S] LIST ACTIVE NEWSGROUPS OVERVIEW.FMT
      [S] .
      [C] OVER <45223423@example.com>
      [S] 224 Overview information follows
      [S] 0|I am just a test article|"Demo User"
          <nobody@example.com>|6 Oct 1998 04:38:40 -0500|
          <45223423@example.com>|<45454@example.net>|1234|
          17|Xref: news.example.com misc.test:3000363
      [S] .
        
      [C] CAPABILITIES
      [S] 101 Capability list:
      [S] VERSION 2
      [S] READER
      [S] OVER MSGID
      [S] LIST ACTIVE NEWSGROUPS OVERVIEW.FMT
      [S] .
      [C] OVER <45223423@example.com>
      [S] 224 Overview information follows
      [S] 0|I am just a test article|"Demo User"
          <nobody@example.com>|6 Oct 1998 04:38:40 -0500|
          <45223423@example.com>|<45454@example.net>|1234|
          17|Xref: news.example.com misc.test:3000363
      [S] .
        

Note that the article number has been replaced by "0".

请注意,物品编号已替换为“0”。

Example of the same commands on a system that does not implement retrieval by message-id:

未实现按消息id检索的系统上的相同命令示例:

      [C] CAPABILITIES
      [S] 101 Capability list:
      [S] VERSION 2
      [S] READER
      [S] OVER
      [S] LIST ACTIVE NEWSGROUPS OVERVIEW.FMT
      [S] .
      [C] OVER <45223423@example.com>
      [S] 503 Overview by message-id unsupported
        
      [C] CAPABILITIES
      [S] 101 Capability list:
      [S] VERSION 2
      [S] READER
      [S] OVER
      [S] LIST ACTIVE NEWSGROUPS OVERVIEW.FMT
      [S] .
      [C] OVER <45223423@example.com>
      [S] 503 Overview by message-id unsupported
        

Example of a successful retrieval of overview information for a range of articles:

成功检索一系列文章的概述信息的示例:

      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] OVER 3000234-3000240
      [S] 224 Overview information follows
      [S] 3000234|I am just a test article|"Demo User"
          <nobody@example.com>|6 Oct 1998 04:38:40 -0500|
          <45223423@example.com>|<45454@example.net>|1234|
          17|Xref: news.example.com misc.test:3000363
      [S] 3000235|Another test article|nobody@nowhere.to
          (Demo User)|6 Oct 1998 04:38:45 -0500|<45223425@to.to>||
          4818|37||Distribution: fi
      [S] 3000238|Re: I am just a test article|somebody@elsewhere.to|
          7 Oct 1998 11:38:40 +1200|<kfwer3v@elsewhere.to>|
          <45223423@to.to>|9234|51
      [S] .
        
      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] OVER 3000234-3000240
      [S] 224 Overview information follows
      [S] 3000234|I am just a test article|"Demo User"
          <nobody@example.com>|6 Oct 1998 04:38:40 -0500|
          <45223423@example.com>|<45454@example.net>|1234|
          17|Xref: news.example.com misc.test:3000363
      [S] 3000235|Another test article|nobody@nowhere.to
          (Demo User)|6 Oct 1998 04:38:45 -0500|<45223425@to.to>||
          4818|37||Distribution: fi
      [S] 3000238|Re: I am just a test article|somebody@elsewhere.to|
          7 Oct 1998 11:38:40 +1200|<kfwer3v@elsewhere.to>|
          <45223423@to.to>|9234|51
      [S] .
        

Note the missing "References" and Xref headers in the second line, the missing trailing fields in the first and last lines, and that there are only results for those articles that still exist.

请注意,第二行中缺少“References”和Xref标题,第一行和最后一行中缺少尾部字段,并且只有那些仍然存在的项目的结果。

Example of an unsuccessful retrieval of overview information on an article by number:

按编号检索文章概述信息失败的示例:

      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] OVER 300256
      [S] 423 No such article in this group
        
      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] OVER 300256
      [S] 423 No such article in this group
        

Example of an invalid range:

无效范围的示例:

      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] OVER 3000444-3000222
      [S] 423 Empty range
        
      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] OVER 3000444-3000222
      [S] 423 Empty range
        

Example of an unsuccessful retrieval of overview information by number because no newsgroup was selected first:

由于未首先选择新闻组,按编号检索概述信息失败的示例:

      [Assumes currently selected newsgroup is invalid.]
      [C] OVER
      [S] 412 No newsgroup selected
        
      [Assumes currently selected newsgroup is invalid.]
      [C] OVER
      [S] 412 No newsgroup selected
        

Example of an attempt to retrieve information when the currently selected newsgroup is empty:

当前选定的新闻组为空时尝试检索信息的示例:

      [C] GROUP example.empty.newsgroup
      [S] 211 0 0 0 example.empty.newsgroup
      [C] OVER
      [S] 420 No current article selected
        
      [C] GROUP example.empty.newsgroup
      [S] 211 0 0 0 example.empty.newsgroup
      [C] OVER
      [S] 420 No current article selected
        
8.4. LIST OVERVIEW.FMT
8.4. 列表概述.FMT
8.4.1. Usage
8.4.1. 用法

Indicating capability: OVER

指示能力:超过

Syntax LIST OVERVIEW.FMT

语法列表概述.FMT

Responses 215 Information follows (multi-line)

回复215信息如下(多行)

8.4.2. Description
8.4.2. 描述

See Section 7.6.1 for general requirements of the LIST command.

LIST命令的一般要求见第7.6.1节。

The LIST OVERVIEW.FMT command returns a description of the fields in the database for which it is consistent (as described above). The information is returned as a multi-line data block following the 215 response code. The information contains one line per field in the order in which they are returned by the OVER command; the first 7 lines MUST (except for the case of letters) be exactly as follows:

LIST OVERVIEW.FMT命令返回数据库中与其一致的字段的描述(如上所述)。该信息作为215响应代码后的多行数据块返回。该信息按OVER命令返回的顺序为每个字段包含一行;前7行(字母除外)必须完全如下所示:

Subject: From: Date: Message-ID: References: :bytes :lines

主题:发件人:日期:消息ID:引用::字节:行

For compatibility with existing implementations, the last two lines MAY instead be:

为了与现有实现兼容,最后两行可能是:

Bytes: Lines:

字节:行:

even though they refer to metadata, not headers.

即使它们引用的是元数据,而不是标题。

All subsequent lines MUST consist of either a header name followed by ":full", or the name of a piece of metadata.

所有后续行必须由标题名后跟“:full”或元数据的名称组成。

There are no leading or trailing spaces in the output.

输出中没有前导空格或尾随空格。

Note that the 7 fixed lines describe the 2nd to 8th fields of the OVER output. The "full" suffix (which may use either uppercase, lowercase, or a mix) is a reminder that the corresponding fields include the header name.

请注意,7条固定行描述了过输出的第2至第8个字段。“full”后缀(可以使用大写、小写或混合)提醒相应字段包括标题名。

This command MAY generate different results if it is used more than once in a session.

如果在会话中多次使用此命令,则可能会生成不同的结果。

If the OVER command is not implemented, the meaning of the output from this command is not specified, but it must still meet the above syntactic requirements.

如果未实现OVER命令,则不会指定此命令输出的含义,但它仍必须满足上述语法要求。

8.4.3. Examples
8.4.3. 例子

Example of LIST OVERVIEW.FMT output corresponding to the example OVER output above, in the preferred format:

LIST OVERVIEW.FMT输出示例与上述输出示例相对应,采用首选格式:

      [C] LIST OVERVIEW.FMT
      [S] 215 Order of fields in overview database.
      [S] Subject:
      [S] From:
      [S] Date:
      [S] Message-ID:
      [S] References:
      [S] :bytes
      [S] :lines
      [S] Xref:full
      [S] Distribution:full
      [S] .
        
      [C] LIST OVERVIEW.FMT
      [S] 215 Order of fields in overview database.
      [S] Subject:
      [S] From:
      [S] Date:
      [S] Message-ID:
      [S] References:
      [S] :bytes
      [S] :lines
      [S] Xref:full
      [S] Distribution:full
      [S] .
        

Example of LIST OVERVIEW.FMT output corresponding to the example OVER output above, in the alternative format:

LIST OVERVIEW.FMT输出示例与上述输出示例相对应,采用替代格式:

      [C] LIST OVERVIEW.FMT
      [S] 215 Order of fields in overview database.
      [S] Subject:
      [S] From:
      [S] Date:
      [S] Message-ID:
      [S] References:
      [S] Bytes:
      [S] Lines:
      [S] Xref:FULL
      [S] Distribution:FULL
      [S] .
        
      [C] LIST OVERVIEW.FMT
      [S] 215 Order of fields in overview database.
      [S] Subject:
      [S] From:
      [S] Date:
      [S] Message-ID:
      [S] References:
      [S] Bytes:
      [S] Lines:
      [S] Xref:FULL
      [S] Distribution:FULL
      [S] .
        
8.5. HDR
8.5. HDR
8.5.1. Usage
8.5.1. 用法

Indicating capability: HDR

指示能力:HDR

Syntax HDR field message-id HDR field range HDR field

语法HDR字段消息id HDR字段范围HDR字段

Responses

响应

First form (message-id specified) 225 Headers follow (multi-line) 430 No article with that message-id

第一个表单(指定消息id)225个标题(多行)430没有带有该消息id的文章

Second form (range specified) 225 Headers follow (multi-line) 412 No newsgroup selected 423 No articles in that range

第二种形式(指定范围)225个标题(多行)412未选择新闻组423未选择该范围内的文章

Third form (current article number used) 225 Headers follow (multi-line) 412 No newsgroup selected 420 Current article number is invalid

第三种形式(使用当前文章编号)225个标题(多行)412未选择新闻组420当前文章编号无效

Parameters field Name of field range Number(s) of articles message-id Message-id of article

参数字段名称字段范围项目编号消息id消息id项目

8.5.2. Description
8.5.2. 描述

The HDR command provides access to specific fields from an article specified by message-id, or from a specified article or range of articles in the currently selected newsgroup. It MAY take the information directly from the articles or from the overview database. In the case of headers, an implementation MAY restrict the use of this command to a specific list of headers or MAY allow it to be used with any header; it may behave differently when it is used with a message-id argument and when it is used with a range or no argument.

HDR命令提供对消息id指定文章或当前选定新闻组中指定文章或文章范围中特定字段的访问。它可以直接从文章或概述数据库获取信息。在头的情况下,实现可能会将此命令的使用限制为特定的头列表,或者允许它与任何头一起使用;当它与message id参数一起使用时,以及与range或no参数一起使用时,其行为可能会有所不同。

The required field argument is the name of a header with the colon omitted (e.g., "subject") or the name of a metadata item including the leading colon (e.g., ":bytes"), and is case insensitive.

必填字段参数是省略冒号的标题名(例如,“subject”)或包含前导冒号的元数据项名(例如“:bytes”),不区分大小写。

The message-id argument indicates a specific article. The range argument may be any of the following:

message id参数表示特定的项目。范围参数可以是以下任一参数:

o An article number.

o 商品编号。

o An article number followed by a dash to indicate all following.

o 商品编号,后跟破折号,表示以下所有内容。

o An article number followed by a dash followed by another article number.

o 商品编号后接破折号,后接另一商品编号。

If neither is specified, the current article number is used.

如果两者均未指定,则使用当前商品编号。

If the information is available, it is returned as a multi-line data block following the 225 response code and contains one line for each article in the range that exists. (Note that unless the argument is a range including a dash, there will be exactly one line in the data block.) The line consists of the article number, a space, and then the contents of the field. In the case of a header, the header name, the colon, and the first space after the colon are all omitted.

如果信息可用,它将作为225响应代码后的多行数据块返回,并为存在范围内的每个项目包含一行。(请注意,除非参数是包含破折号的范围,否则数据块中只有一行。)该行由项目编号、空格和字段内容组成。对于标头,标头名称、冒号和冒号后的第一个空格都将被省略。

If the article is specified by message-id (the first form of the command), the article number MUST be replaced with zero, except that if there is a currently selected newsgroup and the article is present in that group, the server MAY use the article's number in that group. (See the ARTICLE command (Section 6.2.1) and STAT examples (Section 6.2.4.3) for more details.) In the other two forms of the command, the article number MUST be returned.

如果文章是由消息id(命令的第一种形式)指定的,则文章编号必须替换为零,除非存在当前选定的新闻组且该组中存在该文章,否则服务器可以使用该组中的文章编号。(有关更多详细信息,请参见ARTICLE命令(第6.2.1节)和STAT示例(第6.2.4.3节)。在其他两种形式的命令中,必须返回物品编号。

Header contents are modified as follows: all CRLF pairs are removed, and then each TAB is replaced with a single space. (Note that this is the same transformation as is performed by the OVER command (Section 8.3.2), and the same comment concerning NUL, CR, and LF applies.)

标题内容修改如下:删除所有CRLF对,然后用单个空格替换每个选项卡。(请注意,这与OVER命令(第8.3.2节)执行的转换相同,有关NUL、CR和LF的相同注释适用。)

Note the distinction between headers and metadata appearing to have the same meaning. Headers are always taken unchanged from the article; metadata are always calculated. For example, a request for "Lines" returns the contents of the "Lines" header of the specified articles, if any, no matter whether they accurately state the number of lines, while a request for ":lines" returns the line count metadata, which is always the actual number of lines irrespective of what any header may state.

请注意,标题和元数据之间的区别似乎具有相同的含义。标题总是从文章中取出来,保持不变;元数据总是经过计算的。例如,对“行”的请求返回指定项目的“行”标题的内容(如果有),无论它们是否准确地说明行数,而对“:Lines”的请求返回行数元数据,该元数据始终是实际行数,而不管任何标题可能说明什么。

If the requested header is not present in the article, or if it is present but empty, a line for that article is included in the output, but the header content portion of the line is empty (the space after the article number MAY be retained or omitted). If the header occurs in a given article more than once, only the content of the first occurrence is returned by HDR. If any article number in the provided range does not exist in the group, no line for that article number is included in the output.

如果请求的标题不存在于文章中,或者如果它存在但为空,则输出中将包含该文章的一行,但该行的标题内容部分为空(可以保留或省略文章编号后的空格)。如果标题在给定文章中多次出现,HDR只返回第一次出现的内容。如果组中不存在所提供范围内的任何商品编号,则输出中不包括该商品编号的行。

If the second argument is a message-id and no such article exists, a 430 response MUST be returned. If the second argument is a range or is omitted and the currently selected newsgroup is invalid, a 412 response MUST be returned. If the second argument is a range and no articles in that number range exist in the currently selected newsgroup, including the case where the second number is less than the first one, a 423 response MUST be returned. If the second argument is omitted and the current article number is invalid, a 420 response MUST be returned.

如果第二个参数是消息id,并且不存在这样的项目,则必须返回430响应。如果第二个参数是一个范围或被省略,并且当前选择的新闻组无效,则必须返回412响应。如果第二个参数是一个范围,并且当前选定的新闻组中不存在该数字范围内的文章,包括第二个数字小于第一个数字的情况,则必须返回423响应。如果省略了第二个参数且当前项目编号无效,则必须返回420响应。

A server MAY only allow HDR commands for a limited set of fields; it may behave differently in this respect for the first (message-id) form from how it would for the other forms. If so, it MUST respond with the generic 503 response to attempts to request other fields, rather than return erroneous results, such as a successful empty response.

服务器可能只允许有限字段集的HDR命令;在这方面,第一个(消息id)表单的行为可能与其他表单不同。如果是这样,它必须使用通用503响应来响应请求其他字段的尝试,而不是返回错误的结果,例如成功的空响应。

If HDR uses the overview database and it is inconsistent for the requested field, the server MAY return what results it can, or it MAY respond with the generic 503 response. In the latter case, the field MUST NOT appear in the output from LIST HEADERS.

如果HDR使用概览数据库,并且它与请求的字段不一致,则服务器可能会返回它可以返回的结果,或者它可能会使用通用503响应进行响应。在后一种情况下,该字段不得出现在列表标题的输出中。

8.5.3. Examples
8.5.3. 例子

Example of a successful retrieval of subject lines from a range of articles (3000235 has no Subject header, and 3000236 is missing):

从一系列文章中成功检索主题行的示例(3000235没有主题标题,3000236缺失):

      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] HDR Subject 3000234-3000238
      [S] 225 Headers follow
      [S] 3000234 I am just a test article
      [S] 3000235
      [S] 3000237 Re: I am just a test article
      [S] 3000238 Ditto
      [S] .
        
      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] HDR Subject 3000234-3000238
      [S] 225 Headers follow
      [S] 3000234 I am just a test article
      [S] 3000235
      [S] 3000237 Re: I am just a test article
      [S] 3000238 Ditto
      [S] .
        

Example of a successful retrieval of line counts from a range of articles:

从一系列文章中成功检索行数的示例:

      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] HDR :lines 3000234-3000238
      [S] 225 Headers follow
      [S] 3000234 42
      [S] 3000235 5
      [S] 3000237 11
      [S] 3000238 2378
      [S] .
        
      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] HDR :lines 3000234-3000238
      [S] 225 Headers follow
      [S] 3000234 42
      [S] 3000235 5
      [S] 3000237 11
      [S] 3000238 2378
      [S] .
        

Example of a successful retrieval of the subject line from an article by message-id:

按消息id从文章中成功检索主题行的示例:

      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] HDR subject <i.am.a.test.article@example.com>
      [S] 225 Header information follows
      [S] 0 I am just a test article
      [S] .
        
      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] HDR subject <i.am.a.test.article@example.com>
      [S] 225 Header information follows
      [S] 0 I am just a test article
      [S] .
        

Example of a successful retrieval of the subject line from the current article:

从当前文章中成功检索主题行的示例:

      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] HDR subject
      [S] 225 Header information follows
      [S] 3000234 I am just a test article
      [S] .
        
      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] HDR subject
      [S] 225 Header information follows
      [S] 3000234 I am just a test article
      [S] .
        

Example of an unsuccessful retrieval of a header from an article by message-id:

按邮件id从文章中检索标题失败的示例:

[C] HDR subject <i.am.not.there@example.com> [S] 430 No Such Article Found

[C] HDR受试者<i.am.not。there@example.com>[S]430未发现此类物品

Example of an unsuccessful retrieval of headers from articles by number because no newsgroup was selected first:

由于未首先选择新闻组,按编号从文章中检索标题失败的示例:

      [Assumes currently selected newsgroup is invalid.]
      [C] HDR subject 300256-
      [S] 412 No newsgroup selected
        
      [Assumes currently selected newsgroup is invalid.]
      [C] HDR subject 300256-
      [S] 412 No newsgroup selected
        

Example of an unsuccessful retrieval of headers because the currently selected newsgroup is empty:

由于当前选定的新闻组为空而检索标题失败的示例:

      [C] GROUP example.empty.newsgroup
      [S] 211 0 0 0 example.empty.newsgroup
      [C] HDR subject 1-
      [S] 423 No articles in that range
        
      [C] GROUP example.empty.newsgroup
      [S] 211 0 0 0 example.empty.newsgroup
      [C] HDR subject 1-
      [S] 423 No articles in that range
        

Example of an unsuccessful retrieval of headers because the server does not allow HDR commands for that header:

由于服务器不允许对标头使用HDR命令而检索标头失败的示例:

      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] HDR Content-Type 3000234-3000238
      [S] 503 HDR not permitted on Content-Type
        
      [C] GROUP misc.test
      [S] 211 1234 3000234 3002322 misc.test
      [C] HDR Content-Type 3000234-3000238
      [S] 503 HDR not permitted on Content-Type
        
8.6. LIST HEADERS
8.6. 列表标题
8.6.1. Usage
8.6.1. 用法

Indicating capability: HDR

指示能力:HDR

Syntax LIST HEADERS [MSGID|RANGE]

语法列表标题[MSGID | RANGE]

Responses 215 Field list follows (multi-line)

响应215字段列表如下(多行)

Parameters MSGID Requests list for access by message-id RANGE Requests list for access by range

参数按消息id访问的MSGID请求列表按范围访问的范围请求列表

8.6.2. Description
8.6.2. 描述

See Section 7.6.1 for general requirements of the LIST command.

LIST命令的一般要求见第7.6.1节。

The LIST HEADERS command returns a list of fields that may be retrieved using the HDR command.

LIST HEADERS命令返回可以使用HDR命令检索的字段列表。

The information is returned as a multi-line data block following the 215 response code and contains one line for each field name (excluding the trailing colon for headers and including the leading colon for metadata items). If the implementation allows any header to be retrieved, it MUST NOT include any header names in the list but MUST include the special entry ":" (a single colon on its own). It MUST still explicitly list any metadata items that are available. The order of items in the list is not significant; the server need not even consistently return the same order. The list MAY be empty (though in this circumstance there is little point in providing the HDR command).

信息以多行数据块的形式返回,在215响应代码之后,每个字段名包含一行(不包括标题的尾随冒号和元数据项的前导冒号)。如果实现允许检索任何标题,则它不得在列表中包含任何标题名称,但必须包含特殊条目“:”(单独一个冒号)。必须明确列出所有可用的元数据项。列表中项目的顺序不重要;服务器甚至不需要一致地返回相同的订单。列表可能为空(尽管在这种情况下,提供HDR命令没有什么意义)。

An implementation that also supports the OVER command SHOULD at least permit all the headers and metadata items listed in the output from the LIST OVERVIEW.FMT command.

还支持OVER命令的实现应至少允许LIST OVERVIEW.FMT命令输出中列出的所有头和元数据项。

If the server treats the first form of the HDR command (message-id specified) differently from the other two forms (range specified or current article number used) in respect of which headers or metadata items are available, then the following apply:

如果服务器对HDR命令的第一种形式(指定的消息id)与其他两种形式(指定的范围或使用的当前项目号)的处理方式有所不同,则以下情况适用:

o If the MSGID argument is specified, the results MUST be those available for the first form of the HDR command.

o 如果指定了MSGID参数,则结果必须是第一种形式的HDR命令可用的结果。

o If the RANGE argument is specified, the results MUST be those available for the second and third forms of the HDR command.

o 如果指定了RANGE参数,则结果必须是第二种和第三种形式的HDR命令可用的结果。

o If no argument is specified, the results MUST be those available in all forms of the HDR command (that is, it MUST only list those items listed in both the previous cases).

o 如果未指定参数,则结果必须是所有形式的HDR命令中可用的结果(也就是说,它必须只列出前面两种情况中列出的项目)。

If the server does not treat the various forms differently, then it MUST ignore any argument and always produce the same results (though not necessarily always in the same order).

如果服务器没有以不同的方式处理各种表单,那么它必须忽略任何参数并始终生成相同的结果(尽管不一定总是以相同的顺序)。

If the HDR command is not implemented, the meaning of the output from this command is not specified, but it must still meet the above syntactic requirements.

如果未实现HDR命令,则不会指定此命令输出的含义,但它仍必须满足上述语法要求。

8.6.3. Examples
8.6.3. 例子

Example of an implementation providing access to only a few headers:

仅提供对几个标头的访问的实现示例:

      [C] LIST HEADERS
      [S] 215 headers supported:
      [S] Subject
      [S] Message-ID
      [S] Xref
      [S] .
        
      [C] LIST HEADERS
      [S] 215 headers supported:
      [S] Subject
      [S] Message-ID
      [S] Xref
      [S] .
        

Example of an implementation providing access to the same fields as the first example in Section 8.4.3:

提供访问第8.4.3节中第一个示例相同字段的实现示例:

      [C] CAPABILITIES
      [S] 101 Capability list:
      [S] VERSION 2
      [S] READER
      [S] OVER
      [S] HDR
      [S] LIST ACTIVE NEWSGROUPS HEADERS OVERVIEW.FMT
      [S] .
      [C] LIST HEADERS
      [S] 215 headers and metadata items supported:
      [S] Date
      [S] Distribution
      [S] From
      [S] Message-ID
      [S] References
      [S] Subject
      [S] Xref
      [S] :bytes
      [S] :lines
      [S] .
        
      [C] CAPABILITIES
      [S] 101 Capability list:
      [S] VERSION 2
      [S] READER
      [S] OVER
      [S] HDR
      [S] LIST ACTIVE NEWSGROUPS HEADERS OVERVIEW.FMT
      [S] .
      [C] LIST HEADERS
      [S] 215 headers and metadata items supported:
      [S] Date
      [S] Distribution
      [S] From
      [S] Message-ID
      [S] References
      [S] Subject
      [S] Xref
      [S] :bytes
      [S] :lines
      [S] .
        

Example of an implementation providing access to all headers:

提供对所有标头的访问的实现示例:

      [C] LIST HEADERS
      [S] 215 metadata items supported:
      [S] :
      [S] :lines
      [S] :bytes
      [S] :x-article-number
      [S] .
        
      [C] LIST HEADERS
      [S] 215 metadata items supported:
      [S] :
      [S] :lines
      [S] :bytes
      [S] :x-article-number
      [S] .
        

Example of an implementation distinguishing the first form of the HDR command from the other two forms:

区分HDR命令的第一种形式与其他两种形式的实现示例:

      [C] LIST HEADERS RANGE
      [S] 215 metadata items supported:
      [S] :
      [S] :lines
      [S] :bytes
      [S] .
      [C] LIST HEADERS MSGID
      [S] 215 headers and metadata items supported:
      [S] Date
      [S] Distribution
      [S] From
      [S] Message-ID
      [S] References
      [S] Subject
      [S] :lines
      [S] :bytes
      [S] :x-article-number
      [S] .
      [C] LIST HEADERS
      [S] 215 headers and metadata items supported:
      [S] Date
      [S] Distribution
      [S] From
      [S] Message-ID
      [S] References
      [S] Subject
      [S] :lines
      [S] :bytes
      [S] .
        
      [C] LIST HEADERS RANGE
      [S] 215 metadata items supported:
      [S] :
      [S] :lines
      [S] :bytes
      [S] .
      [C] LIST HEADERS MSGID
      [S] 215 headers and metadata items supported:
      [S] Date
      [S] Distribution
      [S] From
      [S] Message-ID
      [S] References
      [S] Subject
      [S] :lines
      [S] :bytes
      [S] :x-article-number
      [S] .
      [C] LIST HEADERS
      [S] 215 headers and metadata items supported:
      [S] Date
      [S] Distribution
      [S] From
      [S] Message-ID
      [S] References
      [S] Subject
      [S] :lines
      [S] :bytes
      [S] .
        

Note that :x-article-number does not appear in the last set of output.

请注意:x-article-number不会出现在最后一组输出中。

9. Augmented BNF Syntax for NNTP
9. NNTP的扩充BNF语法
9.1. Introduction
9.1. 介绍

Each of the following sections describes the syntax of a major element of NNTP. This syntax extends and refines the descriptions elsewhere in this specification and should be given precedence when resolving apparent conflicts. Note that ABNF [RFC4234] strings are case insensitive. Non-terminals used in several places are defined in a separate section at the end.

以下各节介绍NNTP主要元素的语法。此语法扩展并细化了本规范其他地方的描述,在解决明显冲突时应优先考虑。请注意,ABNF[RFC4234]字符串不区分大小写。多处使用的非端子在末端的单独部分中定义。

Between them, the non-terminals <command-line>, <command-datastream>, <command-continuation>, and <response> specify the text that flows between client and server. A consistent naming scheme is used in this document for the non-terminals relating to each command, and SHOULD be used by the specification of registered extensions.

在它们之间,非终端<command-line>、<command-datastream>、<command continuation>和<response>指定在客户端和服务器之间流动的文本。本文档中对与每个命令相关的非终端使用了一致的命名方案,注册扩展规范应使用该命名方案。

For each command, the sequence is as follows:

对于每个命令,顺序如下所示:

o The client sends an instance of <command-line>; the syntax for the EXAMPLE command is <example-command>.

o 客户端发送<命令行>的实例;示例命令的语法为<EXAMPLE command>。

o If the client is one that immediately streams data, it sends an instance of <command-datastream>; the syntax for the EXAMPLE command is <example-datastream>.

o 如果客户端是立即流式传输数据的客户端,它将发送<command datastream>的实例;示例命令的语法为<EXAMPLE datastream>。

o The server sends an instance of <response>.

o 服务器发送<response>的实例。

* The initial response line is independent of the command that generated it; if the 000 response has arguments, the syntax of the initial line is <response-000-content>.

* 初始响应行独立于生成它的命令;如果000响应有参数,则初始行的语法为<response-000-content>。

* If the response is multi-line, the initial line is followed by a <multi-line-data-block>. The syntax for the contents of this block after "dot-stuffing" has been removed is (for the 000 response to the EXAMPLE command) <example-000-ml-content> and is an instance of <multi-line-response-content>.

* 如果响应为多行,则初始行后面跟着一个<multi-line data block>。删除“点填充”后,此块内容的语法为(对于示例命令的000响应)<EXAMPLE-000-ml-content>,是<multi-line response content>的一个实例。

o While the latest response is one that indicates more data is required (in general, a 3xx response):

o 虽然最新的响应表明需要更多数据(通常为3xx响应):

* the client sends an instance of <command-continuation>; the syntax for the EXAMPLE continuation following a 333 response is <example-333-continuation>;

* 客户端发送一个<command continuation>的实例;333响应后的示例延续的语法为<EXAMPLE-333-continuation>;

* the server sends another instance of <response>, as above.

* 服务器发送另一个<response>实例,如上所述。

(There are no commands in this specification that immediately stream data, but this non-terminal is defined for the convenience of extensions.)

(本规范中没有立即流式传输数据的命令,但定义此非终端是为了方便扩展。)

9.2. Commands
9.2. 命令

This syntax defines the non-terminal <command-line>, which represents what is sent from the client to the server (see section 3.1 for limits on lengths).

此语法定义了非终端<command-line>,它表示从客户端发送到服务器的内容(有关长度限制,请参见第3.1节)。

command-line = command EOL command = X-command X-command = keyword *(WS token)

命令行=命令下线命令=X命令X命令=关键字*(WS令牌)

command =/ article-command / body-command / capabilities-command / date-command / group-command / hdr-command / head-command / help-command / ihave-command / last-command / list-command / listgroup-command / mode-reader-command / newgroups-command / newnews-command / next-command / over-command / post-command / quit-command / stat-command

command=/article command/body command/capabilities command/date command/group command/hdr command/head command/help command/ihave command/last command/list command/listgroup command/mode reader command/newgroups command/newnews command/next command/over command/post command/quit command/stat command

     article-command = "ARTICLE" [WS article-ref]
     body-command = "BODY" [WS article-ref]
     capabilities-command = "CAPABILITIES" [WS keyword]
     date-command = "DATE"
     group-command = "GROUP" [WS newsgroup-name]
     hdr-command = "HDR" WS header-meta-name [WS range-ref]
     head-command = "HEAD" [WS article-ref]
     help-command = "HELP"
     ihave-command = "IHAVE" WS message-id
     last-command = "LAST"
     list-command = "LIST" [WS list-arguments]
     listgroup-command = "LISTGROUP" [WS newsgroup-name [WS range]]
     mode-reader-command = "MODE" WS "READER"
     newgroups-command = "NEWGROUPS" WS date-time
     newnews-command = "NEWNEWS" WS wildmat WS date-time
     next-command = "NEXT"
     over-command = "OVER" [WS range-ref]
        
     article-command = "ARTICLE" [WS article-ref]
     body-command = "BODY" [WS article-ref]
     capabilities-command = "CAPABILITIES" [WS keyword]
     date-command = "DATE"
     group-command = "GROUP" [WS newsgroup-name]
     hdr-command = "HDR" WS header-meta-name [WS range-ref]
     head-command = "HEAD" [WS article-ref]
     help-command = "HELP"
     ihave-command = "IHAVE" WS message-id
     last-command = "LAST"
     list-command = "LIST" [WS list-arguments]
     listgroup-command = "LISTGROUP" [WS newsgroup-name [WS range]]
     mode-reader-command = "MODE" WS "READER"
     newgroups-command = "NEWGROUPS" WS date-time
     newnews-command = "NEWNEWS" WS wildmat WS date-time
     next-command = "NEXT"
     over-command = "OVER" [WS range-ref]
        

post-command = "POST" quit-command = "QUIT" stat-command = "STAT" [WS article-ref]

post-command=“post”quit-command=“quit”stat-command=“stat”[WS-article-ref]

     article-ref = article-number / message-id
     date = date2y / date4y
     date4y = 4DIGIT 2DIGIT 2DIGIT
     date2y = 2DIGIT 2DIGIT 2DIGIT
     date-time = date WS time [WS "GMT"]
     header-meta-name = header-name / metadata-name
     list-arguments = keyword [WS token]
     metadata-name = ":" 1*A-NOTCOLON
     range = article-number ["-" [article-number]]
     range-ref = range / message-id
     time = 2DIGIT 2DIGIT 2DIGIT
        
     article-ref = article-number / message-id
     date = date2y / date4y
     date4y = 4DIGIT 2DIGIT 2DIGIT
     date2y = 2DIGIT 2DIGIT 2DIGIT
     date-time = date WS time [WS "GMT"]
     header-meta-name = header-name / metadata-name
     list-arguments = keyword [WS token]
     metadata-name = ":" 1*A-NOTCOLON
     range = article-number ["-" [article-number]]
     range-ref = range / message-id
     time = 2DIGIT 2DIGIT 2DIGIT
        
9.3. Command Continuation
9.3. 命令延续

This syntax defines the further material sent by the client in the case of multi-stage commands and those that stream data.

该语法定义了在多阶段命令和流式传输数据的命令的情况下,客户端发送的进一步材料。

command-datastream = UNDEFINED ; not used, provided as a hook for extensions command-continuation = ihave-335-continuation / post-340-continuation

命令数据流=未定义;未使用,作为扩展命令continuation=ihave-335-continuation/post-340-continuation的钩子提供

ihave-335-continuation = encoded-article post-340-continuation = encoded-article

ihave-335-continuation=编码文章post-340-continuation=编码文章

     encoded-article = multi-line-data-block
       ; after undoing the "dot-stuffing", this MUST match <article>
        
     encoded-article = multi-line-data-block
       ; after undoing the "dot-stuffing", this MUST match <article>
        
9.4. Responses
9.4. 响应
9.4.1. Generic Responses
9.4.1. 一般反应

This syntax defines the non-terminal <response>, which represents the generic form of responses; that is, what is sent from the server to the client in response to a <command> or a <command-continuation>.

该语法定义了非终端<response>,它表示响应的一般形式;也就是说,响应<command>或<command continuation>从服务器发送到客户端的内容。

response = simple-response / multi-line-response simple-response = initial-response-line multi-line-response = initial-response-line multi-line-data-block

响应=简单响应/多行响应简单响应=初始响应行多行响应=初始响应行多行数据块

initial-response-line = initial-response-content [SP trailing-comment] CRLF initial-response-content = X-initial-response-content X-initial-response-content = 3DIGIT *(SP response-argument)

初始响应行=初始响应内容[SP尾随注释]CRLF初始响应内容=X-initial-response-content X-initial-response-content=3DIGIT*(SP响应参数)

     response-argument = 1*A-CHAR
     trailing-comment = *U-CHAR
        
     response-argument = 1*A-CHAR
     trailing-comment = *U-CHAR
        
9.4.2. Initial Response Line Contents
9.4.2. 初始响应行内容

This syntax defines the specific initial response lines for the various commands in this specification (see section 3.1 for limits on lengths). Only those response codes with arguments are listed.

该语法定义了本规范中各种命令的特定初始响应线(长度限制见第3.1节)。仅列出带有参数的响应代码。

initial-response-content =/ response-111-content / response-211-content / response-220-content / response-221-content / response-222-content / response-223-content / response-401-content

初始响应内容=/response-111-content/response-211-content/response-220-content/response-221-content/response-222-content/response-223-content/response-401-content

response-111-content = "111" SP date4y time response-211-content = "211" 3(SP article-number) SP newsgroup-name response-220-content = "220" SP article-number SP message-id response-221-content = "221" SP article-number SP message-id response-222-content = "222" SP article-number SP message-id response-223-content = "223" SP article-number SP message-id response-401-content = "401" SP capability-label

response-111-content=“111”SP date4y time response-211-content=“211”3(SP文章编号)SP新闻组名称response-220-content=“220”SP文章编号SP消息id response-221-content=“221”SP文章编号SP消息id response-222-content=“222”SP文章编号SP消息id response-223-content=“223”SP物品编号SP消息id响应-401-content=“401”SP功能标签

9.4.3. Multi-line Response Contents
9.4.3. 多行响应内容

This syntax defines the content of the various multi-line responses; more precisely, it defines the part of the response in the multi-line data block after any "dot-stuffing" has been undone. The numeric portion of each non-terminal name indicates the response code that is followed by this data.

该语法定义了各种多行响应的内容;更准确地说,它定义了在撤销任何“点填充”后,多行数据块中的响应部分。每个非终端名称的数字部分表示该数据后面的响应代码。

multi-line-response-content = article-220-ml-content / body-222-ml-content / capabilities-101-ml-content / hdr-225-ml-content / head-221-ml-content / help-100-ml-content / list-215-ml-content / listgroup-211-ml-content / newgroups-231-ml-content / newnews-230-ml-content / over-224-ml-content

多行响应内容=article-220-ml-content/body-222-ml-content/capabilities-101-ml-content/hdr-225-ml-content/head-221-ml-content/help-100-ml-content/list-215-ml-content/listgroup-211-ml-content/newgroups-231-ml-content/newnewnewnewnewnews-230-ml-content/over-224-ml-content

article-220-ml-content = article body-222-ml-content = body capabilities-101-ml-content = version-line CRLF

article-220-ml-content=文章正文-222-ml-content=正文能力-101-ml-content=版本行CRLF

           *(capability-line CRLF)
     hdr-225-ml-content = *(article-number SP hdr-content CRLF)
     head-221-ml-content = 1*header
     help-100-ml-content = *(*U-CHAR CRLF)
     list-215-ml-content = list-content
     listgroup-211-ml-content = *(article-number CRLF)
     newgroups-231-ml-content = active-groups-list
     newnews-230-ml-content = *(message-id CRLF)
     over-224-ml-content = *(article-number over-content CRLF)
        
           *(capability-line CRLF)
     hdr-225-ml-content = *(article-number SP hdr-content CRLF)
     head-221-ml-content = 1*header
     help-100-ml-content = *(*U-CHAR CRLF)
     list-215-ml-content = list-content
     listgroup-211-ml-content = *(article-number CRLF)
     newgroups-231-ml-content = active-groups-list
     newnews-230-ml-content = *(message-id CRLF)
     over-224-ml-content = *(article-number over-content CRLF)
        
     active-groups-list = *(newsgroup-name SPA article-number
           SPA article-number SPA newsgroup-status CRLF)
     hdr-content = *S-NONTAB
     hdr-n-content = [(header-name ":" / metadata-name) SP hdr-content]
     list-content = body
     newsgroup-status = %x79 / %x6E / %x6D / private-status
     over-content = 1*6(TAB hdr-content) /
           7(TAB hdr-content) *(TAB hdr-n-content)
     private-status = token ; except the values in newsgroup-status
        
     active-groups-list = *(newsgroup-name SPA article-number
           SPA article-number SPA newsgroup-status CRLF)
     hdr-content = *S-NONTAB
     hdr-n-content = [(header-name ":" / metadata-name) SP hdr-content]
     list-content = body
     newsgroup-status = %x79 / %x6E / %x6D / private-status
     over-content = 1*6(TAB hdr-content) /
           7(TAB hdr-content) *(TAB hdr-n-content)
     private-status = token ; except the values in newsgroup-status
        
9.5. Capability Lines
9.5. 能力线

This syntax defines the generic form of a capability line in the capabilities list (see Section 3.3.1).

该语法定义了能力列表中能力行的一般形式(见第3.3.1节)。

capability-line = capability-entry capability-entry = X-capability-entry X-capability-entry = capability-label *(WS capability-argument) capability-label = keyword capability-argument = token

能力行=能力条目能力条目=X-capability-entry X-capability-entry=能力标签*(WS-capability参数)能力标签=关键字能力参数=令牌

This syntax defines the specific capability entries for the capabilities in this specification.

此语法定义了本规范中功能的特定功能条目。

capability-entry =/ hdr-capability / ihave-capability / implementation-capability / list-capability / mode-reader-capability / newnews-capability / over-capability / post-capability / reader-capability

能力条目=/hdr能力/I拥有能力/实施能力/列表能力/模式读取器能力/新闻能力/过度能力/后期能力/读取器能力

hdr-capability = "HDR" ihave-capability = "IHAVE" implementation-capability = "IMPLEMENTATION" *(WS token)

hdr capability=“hdr”ihave capability=“ihave”implementation capability=“implementation”*(WS-token)

list-capability = "LIST" 1*(WS keyword) mode-reader-capability = "MODE-READER" newnews-capability = "NEWNEWS" over-capability = "OVER" [WS "MSGID"] post-capability = "POST" reader-capability = "READER"

list capability=“list”1*(WS关键字)mode reader capability=“mode-reader”newnews capability=“newnews”over capability=“over”[WS“MSGID”]post capability=“post”reader capability=“reader”

     version-line = "VERSION" 1*(WS version-number)
     version-number = nzDIGIT *5DIGIT
        
     version-line = "VERSION" 1*(WS version-number)
     version-number = nzDIGIT *5DIGIT
        
9.6. LIST Variants
9.6. 列出变体

This section defines more specifically the keywords for the LIST command and the syntax of the corresponding response contents.

本节更具体地定义LIST命令的关键字以及相应响应内容的语法。

     ; active
     list-arguments =/ "ACTIVE" [WS wildmat]
     list-content =/ list-active-content
     list-active-content = active-groups-list
        
     ; active
     list-arguments =/ "ACTIVE" [WS wildmat]
     list-content =/ list-active-content
     list-active-content = active-groups-list
        
     ; active.times
     list-arguments =/ "ACTIVE.TIMES" [WS wildmat]
     list-content =/ list-active-times-content
     list-active-times-content =
           *(newsgroup-name SPA 1*DIGIT SPA newsgroup-creator CRLF)
     newsgroup-creator = U-TEXT
        
     ; active.times
     list-arguments =/ "ACTIVE.TIMES" [WS wildmat]
     list-content =/ list-active-times-content
     list-active-times-content =
           *(newsgroup-name SPA 1*DIGIT SPA newsgroup-creator CRLF)
     newsgroup-creator = U-TEXT
        
     ; distrib.pats
     list-arguments =/ "DISTRIB.PATS"
     list-content =/ list-distrib-pats-content
     list-distrib-pats-content =
           *(1*DIGIT ":" wildmat ":" distribution CRLF)
     distribution = token
        
     ; distrib.pats
     list-arguments =/ "DISTRIB.PATS"
     list-content =/ list-distrib-pats-content
     list-distrib-pats-content =
           *(1*DIGIT ":" wildmat ":" distribution CRLF)
     distribution = token
        
     ; headers
     list-arguments =/ "HEADERS" [WS ("MSGID" / "RANGE")]
     list-content =/ list-headers-content
     list-headers-content = *(header-meta-name CRLF) /
           *((metadata-name / ":") CRLF)
        
     ; headers
     list-arguments =/ "HEADERS" [WS ("MSGID" / "RANGE")]
     list-content =/ list-headers-content
     list-headers-content = *(header-meta-name CRLF) /
           *((metadata-name / ":") CRLF)
        
     ; newsgroups
     list-arguments =/ "NEWSGROUPS" [WS wildmat]
     list-content =/ list-newsgroups-content
     list-newsgroups-content =
        
     ; newsgroups
     list-arguments =/ "NEWSGROUPS" [WS wildmat]
     list-content =/ list-newsgroups-content
     list-newsgroups-content =
        

*(newsgroup-name WS newsgroup-description CRLF) newsgroup-description = S-TEXT

*(新闻组名称WS新闻组描述CRLF)新闻组描述=S-TEXT

     ; overview.fmt
     list-arguments =/ "OVERVIEW.FMT"
     list-content =/ list-overview-fmt-content
     list-overview-fmt-content = "Subject:" CRLF
           "From:" CRLF
           "Date:" CRLF
           "Message-ID:" CRLF
           "References:" CRLF
           ( ":bytes" CRLF ":lines" / "Bytes:" CRLF "Lines:") CRLF
           *((header-name ":full" / metadata-name) CRLF)
        
     ; overview.fmt
     list-arguments =/ "OVERVIEW.FMT"
     list-content =/ list-overview-fmt-content
     list-overview-fmt-content = "Subject:" CRLF
           "From:" CRLF
           "Date:" CRLF
           "Message-ID:" CRLF
           "References:" CRLF
           ( ":bytes" CRLF ":lines" / "Bytes:" CRLF "Lines:") CRLF
           *((header-name ":full" / metadata-name) CRLF)
        
9.7. Articles
9.7. 文章

This syntax defines the non-terminal <article>, which represents the format of an article as described in Section 3.6.

该语法定义了非终端<article>,表示第3.6节所述的文章格式。

     article = 1*header CRLF body
     header = header-name ":" [CRLF] SP header-content CRLF
     header-content = *(S-CHAR / [CRLF] WS)
     body = *(*B-CHAR CRLF)
        
     article = 1*header CRLF body
     header = header-name ":" [CRLF] SP header-content CRLF
     header-content = *(S-CHAR / [CRLF] WS)
     body = *(*B-CHAR CRLF)
        
9.8. General Non-terminals
9.8. 一般非终端

These non-terminals are used at various places in the syntax and are collected here for convenience. A few of these non-terminals are not used in this specification but are provided for the consistency and convenience of extension authors.

这些非终端在语法中的不同位置使用,为了方便起见,在这里收集它们。本规范中未使用其中一些非终端,但提供这些非终端是为了扩展作者的一致性和方便性。

     multi-line-data-block = content-lines termination
     content-lines = *([content-text] CRLF)
     content-text = (".." / B-NONDOT) *B-CHAR
     termination = "." CRLF
        
     multi-line-data-block = content-lines termination
     content-lines = *([content-text] CRLF)
     content-text = (".." / B-NONDOT) *B-CHAR
     termination = "." CRLF
        
     article-number = 1*16DIGIT
     header-name = 1*A-NOTCOLON
     keyword = ALPHA 2*(ALPHA / DIGIT / "." / "-")
     message-id = "<" 1*248A-NOTGT ">"
     newsgroup-name = 1*wildmat-exact
     token = 1*P-CHAR
        
     article-number = 1*16DIGIT
     header-name = 1*A-NOTCOLON
     keyword = ALPHA 2*(ALPHA / DIGIT / "." / "-")
     message-id = "<" 1*248A-NOTGT ">"
     newsgroup-name = 1*wildmat-exact
     token = 1*P-CHAR
        
     wildmat = wildmat-pattern *("," ["!"] wildmat-pattern)
     wildmat-pattern = 1*wildmat-item
     wildmat-item = wildmat-exact / wildmat-wild
     wildmat-exact = %x22-29 / %x2B / %x2D-3E / %x40-5A / %x5E-7E /
        
     wildmat = wildmat-pattern *("," ["!"] wildmat-pattern)
     wildmat-pattern = 1*wildmat-item
     wildmat-item = wildmat-exact / wildmat-wild
     wildmat-exact = %x22-29 / %x2B / %x2D-3E / %x40-5A / %x5E-7E /
        
          UTF8-non-ascii  ; exclude ! * , ? [ \ ]
     wildmat-wild = "*" / "?"
        
          UTF8-non-ascii  ; exclude ! * , ? [ \ ]
     wildmat-wild = "*" / "?"
        
     base64 = *(4base64-char) [base64-terminal]
     base64-char = UPPER / LOWER / DIGIT / "+" / "/"
     base64-terminal = 2base64-char "==" / 3base64-char "="
        
     base64 = *(4base64-char) [base64-terminal]
     base64-char = UPPER / LOWER / DIGIT / "+" / "/"
     base64-terminal = 2base64-char "==" / 3base64-char "="
        
     ; Assorted special character sets
     ;   A- means based on US-ASCII, excluding controls and SP
     ;   P- means based on UTF-8, excluding controls and SP
     ;   U- means based on UTF-8, excluding NUL CR and LF
     ;   B- means based on bytes, excluding NUL CR and LF
     A-CHAR     = %x21-7E
     A-NOTCOLON = %x21-39 / %x3B-7E  ; exclude ":"
     A-NOTGT    = %x21-3D / %x3F-7E  ; exclude ">"
     P-CHAR     = A-CHAR / UTF8-non-ascii
     U-CHAR     = CTRL / TAB / SP / A-CHAR / UTF8-non-ascii
     U-NONTAB   = CTRL /       SP / A-CHAR / UTF8-non-ascii
     U-TEXT     = P-CHAR *U-CHAR
     B-CHAR     = CTRL / TAB / SP / %x21-FF
     B-NONDOT   = CTRL / TAB / SP / %x21-2D / %x2F-FF  ; exclude "."
        
     ; Assorted special character sets
     ;   A- means based on US-ASCII, excluding controls and SP
     ;   P- means based on UTF-8, excluding controls and SP
     ;   U- means based on UTF-8, excluding NUL CR and LF
     ;   B- means based on bytes, excluding NUL CR and LF
     A-CHAR     = %x21-7E
     A-NOTCOLON = %x21-39 / %x3B-7E  ; exclude ":"
     A-NOTGT    = %x21-3D / %x3F-7E  ; exclude ">"
     P-CHAR     = A-CHAR / UTF8-non-ascii
     U-CHAR     = CTRL / TAB / SP / A-CHAR / UTF8-non-ascii
     U-NONTAB   = CTRL /       SP / A-CHAR / UTF8-non-ascii
     U-TEXT     = P-CHAR *U-CHAR
     B-CHAR     = CTRL / TAB / SP / %x21-FF
     B-NONDOT   = CTRL / TAB / SP / %x21-2D / %x2F-FF  ; exclude "."
        
     ALPHA = UPPER / LOWER   ; use only when case-insensitive
     CR = %x0D
     CRLF = CR LF
     CTRL = %x01-08 / %x0B-0C / %x0E-1F
     DIGIT = %x30-39
     nzDIGIT = %x31-39
     EOL = *(SP / TAB) CRLF
     LF = %x0A
     LOWER = %x61-7A
     SP = %x20
     SPA = 1*SP
     TAB = %x09
     UPPER = %x41-5A
     UTF8-non-ascii = UTF8-2 / UTF8-3 / UTF8-4
     UTF8-2    = %xC2-DF UTF8-tail
     UTF8-3    = %xE0 %xA0-BF UTF8-tail / %xE1-EC 2UTF8-tail /
                 %xED %x80-9F UTF8-tail / %xEE-EF 2UTF8-tail
     UTF8-4    = %xF0 %x90-BF 2UTF8-tail / %xF1-F3 3UTF8-tail /
                 %xF4 %x80-8F 2UTF8-tail
     UTF8-tail = %x80-BF
     WS = 1*(SP / TAB)
        
     ALPHA = UPPER / LOWER   ; use only when case-insensitive
     CR = %x0D
     CRLF = CR LF
     CTRL = %x01-08 / %x0B-0C / %x0E-1F
     DIGIT = %x30-39
     nzDIGIT = %x31-39
     EOL = *(SP / TAB) CRLF
     LF = %x0A
     LOWER = %x61-7A
     SP = %x20
     SPA = 1*SP
     TAB = %x09
     UPPER = %x41-5A
     UTF8-non-ascii = UTF8-2 / UTF8-3 / UTF8-4
     UTF8-2    = %xC2-DF UTF8-tail
     UTF8-3    = %xE0 %xA0-BF UTF8-tail / %xE1-EC 2UTF8-tail /
                 %xED %x80-9F UTF8-tail / %xEE-EF 2UTF8-tail
     UTF8-4    = %xF0 %x90-BF 2UTF8-tail / %xF1-F3 3UTF8-tail /
                 %xF4 %x80-8F 2UTF8-tail
     UTF8-tail = %x80-BF
     WS = 1*(SP / TAB)
        

The following non-terminals require special consideration. They represent situations where material SHOULD be restricted to UTF-8, but implementations MUST be able to cope with other character encodings. Therefore, there are two sets of definitions for them.

以下非端子需要特别考虑。它们表示材料应限制为UTF-8的情况,但实现必须能够处理其他字符编码。因此,它们有两套定义。

Implementations MUST accept any content that meets this syntax:

实现必须接受符合以下语法的任何内容:

     S-CHAR   = %x21-FF
     S-NONTAB = CTRL / SP / S-CHAR
     S-TEXT   = (CTRL / S-CHAR) *B-CHAR
        
     S-CHAR   = %x21-FF
     S-NONTAB = CTRL / SP / S-CHAR
     S-TEXT   = (CTRL / S-CHAR) *B-CHAR
        

and MAY pass such content on unaltered.

并且可以将这些内容原封不动地传递给用户。

When generating new content or re-encoding existing content, implementations SHOULD conform to this syntax:

生成新内容或重新编码现有内容时,实现应符合以下语法:

S-CHAR = P-CHAR S-NONTAB = U-NONTAB S-TEXT = U-TEXT

S-CHAR=P-CHAR S-NONTAB=U-NONTAB S-TEXT=U-TEXT

9.9. Extensions and Validation
9.9. 扩展和验证

The specification of a registered extension MUST include formal syntax that defines additional forms for the following non-terminals:

注册扩展的规范必须包括为以下非终端定义其他形式的正式语法:

command for each new command other than a variant of the LIST command - the syntax of each command MUST be compatible with the definition of <X-command>;

每个命令的语法必须与另一个命令的语法列表兼容;

command-datastream for each new command that immediately streams data;

每个新命令的命令数据流,立即流数据;

command-continuation for each new command that sends further material after the initial command line - the syntax of each continuation MUST be exactly what is sent to the server, including any escape mechanisms such as "dot-stuffing";

在初始命令行之后发送更多材料的每个新命令的命令继续-每个继续的语法必须与发送到服务器的语法完全相同,包括任何转义机制,如“点填充”;

initial-response-content for each new response code that has arguments - the syntax of each response MUST be compatible with the definition of <X-initial-response-content>;

具有参数的每个新响应代码的初始响应内容-每个响应的语法必须与<X-initial-response-content>的定义兼容;

multi-line-response-content for each new response code that has a multi-line response - the syntax MUST show the response after the lines containing the response code and the terminating octet have been removed and any "dot-stuffing" undone;

具有多行响应的每个新响应代码的多行响应内容-语法必须在包含响应代码和终止八位字节的行被删除以及任何“点填充”撤消后显示响应;

capability-entry for each new capability label - the syntax of each entry MUST be compatible with the definition of <X-capability-entry>;

每个新功能标签的功能条目-每个条目的语法必须与<X-capability-entry>的定义兼容;

list-arguments for each new variant of the LIST command - the syntax of each entry MUST be compatible with the definition of <X-command>;

list命令的每个新变体的列表参数-每个条目的语法必须与<X-command>的定义兼容;

list-content for each new variant of the LIST command - the syntax MUST show the response after the lines containing the 215 response code and the terminating octet have been removed and any "dot-stuffing" undone.

列出list命令的每个新变体的内容-包含215响应代码和终止八位字节的行被删除并且任何“点填充”被撤消后,语法必须显示响应。

The =/ notation of ABNF [RFC4234] and the naming conventions described in Section 9.1 SHOULD be used for this.

ABNF[RFC4234]的=/符号和第9.1节中描述的命名约定应用于此。

When the syntax in this specification, or syntax based on it, is validated, it should be noted that:

当验证本规范中的语法或基于本规范的语法时,应注意:

o the non-terminals <command-line>, <command-datastream>, <command-continuation>, <response>, and <multi-line-response-content> describe basic concepts of the protocol and are not referred to by any other rule;

o 非终端<command-line>、<command-datastream>、<command-continuation>、<response>和<multi-line-response-content>描述了协议的基本概念,不被任何其他规则引用;

o the non-terminal <base64> is provided for the convenience of extension authors and is not referred to by any rule in this specification;

o 非终端<base64>是为了方便扩展作者而提供的,本规范中没有任何规则提及;

o for the reasons given above, the non-terminals <S-CHAR>, <S-NONTAB>, and <S-TEXT> each have two definitions; and

o 基于上述原因,非终端<S-CHAR>、<S-NONTAB>和<S-TEXT>各有两个定义;和

o the non-terminal <UNDEFINED> is deliberately not defined.

o 故意不定义非端子<未定义>。

10. Internationalisation Considerations
10. 国际化考虑
10.1. Introduction and Historical Situation
10.1. 导言和历史情况

RFC 977 [RFC977] was written at a time when internationalisation was not seen as a significant issue. As such, it was written on the assumption that all communication would be in ASCII and use only a 7-bit transport layer, although in practice just about all known implementations are 8-bit clean.

RFC977[RFC977]是在国际化不被视为重大问题的时候编写的。因此,它是基于这样的假设编写的,即所有通信都将使用ASCII,并且只使用7位传输层,尽管实际上几乎所有已知的实现都是8位干净的。

Since then, Usenet and NNTP have spread throughout the world. In the absence of standards for handling the issues of language and character sets, countries, newsgroup hierarchies, and individuals have found a variety of solutions that work for them but that are not necessarily appropriate elsewhere. For example, some have adopted a default 8-bit character set appropriate to their needs (such as ISO/IEC 8859-1 in Western Europe or KOI-8 in Russia), others have used ASCII (either US-ASCII or national variants) in headers but

从那时起,Usenet和NNTP已经在全世界传播。在缺乏处理语言和字符集问题的标准的情况下,国家、新闻组层级和个人已经找到了各种各样的解决方案,这些解决方案对他们有效,但不一定适用于其他地方。例如,一些人采用了适合其需要的默认8位字符集(如西欧的ISO/IEC 8859-1或俄罗斯的KOI-8),其他人在标题中使用ASCII(US-ASCII或国家变体),但

local 16-bit character sets in article bodies, and still others have gone for a combination of MIME [RFC2045] and UTF-8. With the increased use of MIME in email, it is becoming more common to find NNTP articles containing MIME headers that identify the character set of the body, but this is far from universal.

文章正文中的本地16位字符集,以及其他一些字符集已经采用了MIME[RFC2045]和UTF-8的组合。随着电子邮件中MIME使用的增加,越来越多的人发现NNTP文章中包含识别正文字符集的MIME标题,但这还远远不是通用的。

The resulting confusion does not help interoperability.

由此产生的混乱无助于互操作性。

One point that has been generally accepted is that articles can contain octets with the top bit set, and NNTP is only expected to operate on 8-bit clean transport paths.

人们普遍接受的一点是,文章可以包含具有顶级位集的八位字节,而NNTP只希望在8位干净传输路径上运行。

10.2. This Specification
10.2. 本规范

Part of the role of this present specification is to eliminate this confusion and promote interoperability as far as possible. At the same time, it is necessary to accept the existence of the present situation and not break existing implementations and arrangements gratuitously, even if they are less than optimal. Therefore, the current practice described above has been taken into consideration in producing this specification.

本规范的部分作用是消除这种混淆,并尽可能促进互操作性。同时,必须接受现状的存在,不要无缘无故地破坏现有的实施和安排,即使它们不是最优的。因此,在编制本规范时,已考虑上述现行做法。

This specification extends NNTP from US-ASCII [ANSI1986] to UTF-8 [RFC3629]. Except in the two areas discussed below, UTF-8 (which is a superset of US-ASCII) is mandatory, and implementations MUST NOT use any other encoding.

本规范将NNTP从US-ASCII[ANSI1986]扩展到UTF-8[RFC3629]。除了下面讨论的两个领域外,UTF-8(US-ASCII的超集)是强制性的,实现不得使用任何其他编码。

Firstly, the use of MIME for article headers and bodies is strongly recommended. However, given widely divergent existing practices, an attempt to require a particular encoding and tagging standard would be premature at this time. Accordingly, this specification allows the use of arbitrary 8-bit data in articles subject to the following requirements and recommendations.

首先,强烈建议对文章标题和正文使用MIME。然而,考虑到目前存在的做法大相径庭,现在尝试要求采用特定的编码和标记标准还为时过早。因此,本规范允许在符合以下要求和建议的物品中使用任意8位数据。

o The names of headers (e.g., "From" or "Subject") MUST be in US-ASCII.

o 标题的名称(例如,“From”或“Subject”)必须使用US-ASCII。

o Header values SHOULD use US-ASCII or an encoding based on it, such as RFC 2047 [RFC2047], until such time as another approach has been standardised. At present, 8-bit encodings (including UTF-8) SHOULD NOT be used because they are likely to cause interoperability problems.

o 标头值应使用US-ASCII或基于US-ASCII的编码,如RFC 2047[RFC2047],直到另一种方法标准化。目前,不应使用8位编码(包括UTF-8),因为它们可能导致互操作性问题。

o The character set of article bodies SHOULD be indicated in the article headers, and this SHOULD be done in accordance with MIME.

o 文章正文的字符集应该在文章标题中指出,这应该按照MIME来完成。

o Where an article is obtained from an external source, an implementation MAY pass it on and derive data from it (such as the

o 如果一个项目是从外部来源获得的,那么实现可以传递它并从中派生数据(例如

response to the HDR command), even though the article or the data does not meet the above requirements. Implementations MUST transfer such articles and data correctly and unchanged; they MUST NOT attempt to convert or re-encode the article or derived data. (Nevertheless, a client or server MAY elect not to post or forward the article if, after further examination of the article, it deems it inappropriate to do so.)

响应HDR命令),即使物品或数据不符合上述要求。实施必须正确且不变地传输此类条款和数据;他们不得试图转换或重新编码文章或衍生数据。(尽管如此,如果客户机或服务器在对文章进行进一步检查后认为不适宜发布或转发文章,则可以选择不发布或转发。)

This requirement affects the ARTICLE (Section 6.2.1), BODY (Section 6.2.3), HDR (Section 8.5), HEAD (Section 6.2.2), IHAVE (Section 6.3.2), OVER (Section 8.3), and POST (Section 6.3.1) commands.

本要求影响条款(第6.2.1节)、正文(第6.2.3节)、HDR(第8.5节)、HEAD(第6.2.2节)、IHAVE(第6.3.2节)、OVER(第8.3节)和POST(第6.3.1节)命令。

Secondly, the following requirements are placed on the newsgroups list returned by the LIST NEWSGROUPS command (Section 7.6.6):

其次,在list newsgroups命令返回的新闻组列表上有以下要求(第7.6.6节):

o Although this specification allows UTF-8 for newsgroup names, they SHOULD be restricted to US-ASCII until a successor to RFC 1036 [RFC1036] standardises another approach. 8-bit encodings SHOULD NOT be used because they are likely to cause interoperability problems.

o 尽管本规范允许新闻组名称使用UTF-8,但在RFC 1036[RFC1036]的后续版本将另一种方法标准化之前,新闻组名称应限制为US-ASCII。不应使用8位编码,因为它们可能导致互操作性问题。

o The newsgroup description SHOULD be in US-ASCII or UTF-8 unless and until a successor to RFC 1036 standardises other encoding arrangements. 8-bit encodings other than UTF-8 SHOULD NOT be used because they are likely to cause interoperability problems.

o 新闻组描述应使用US-ASCII或UTF-8,除非RFC 1036的后续版本标准化了其他编码安排。不应使用UTF-8以外的8位编码,因为它们可能导致互操作性问题。

o Implementations that obtain this data from an external source MUST handle it correctly even if it does not meet the above requirements. Implementations (in particular, clients) MUST handle such data correctly.

o 从外部源获取此数据的实现必须正确处理它,即使它不满足上述要求。实现(特别是客户端)必须正确处理此类数据。

10.3. Outstanding Issues
10.3. 未决问题

While the primary use of NNTP is for transmitting articles that conform to RFC 1036 (Netnews articles), it is also used for other formats (see Appendix A). It is therefore most appropriate that internationalisation issues related to article formats be addressed in the relevant specifications. For Netnews articles, this is any successor to RFC 1036. For email messages, it is RFC 2822 [RFC2822].

虽然NNTP的主要用途是传输符合RFC 1036(网络新闻文章)的文章,但它也用于其他格式(见附录A)。因此,在相关规范中解决与文章格式相关的国际化问题是最合适的。对于Netnews文章,这是RFC1036的任何后续版本。对于电子邮件,它是RFC 2822[RFC2822]。

Of course, any article transmitted via NNTP needs to conform to this specification as well.

当然,通过NNTP传输的任何文章也需要符合本规范。

Restricting newsgroup names to UTF-8 is not a complete solution. In particular, when new newsgroup names are created or a user is asked to enter a newsgroup name, some scheme of canonicalisation will need to take place. This specification does not attempt to define that

将新闻组名称限制为UTF-8并不是一个完整的解决方案。特别是,当创建新的新闻组名称或要求用户输入新闻组名称时,需要进行一些规范化方案。本规范不试图定义该定义

canonicalization; further work is needed in this area, in conjunction with the article format specifications. Until such specifications are published, implementations SHOULD match newsgroup names octet by octet. It is anticipated that any approved scheme will be applied "at the edges", and therefore octet-by-octet comparison will continue to apply to most, if not all, uses of newsgroup names in NNTP.

规范化;这方面还需要进一步的工作,以及文章格式规范。在这些规范发布之前,实现应该一个八位字节一个八位字节地匹配新闻组名称。预计任何经批准的方案都将“在边缘”应用,因此,八位字节对八位字节的比较将继续适用于NNTP中新闻组名称的大多数(如果不是全部)使用。

In the meantime, any implementation experimenting with UTF-8 newsgroup names is strongly cautioned that a future specification may require that those names be canonicalized when used with NNTP in a way that is not compatible with their experiments.

同时,任何尝试使用UTF-8新闻组名称的实现都要受到强烈警告,未来的规范可能会要求这些名称在与NNTP一起使用时以与其实验不兼容的方式进行规范化。

Since the primary use of NNTP is with Netnews, and since newsgroup descriptions are normally distributed through specially formatted articles, it is recommended that the internationalisation issues related to them be addressed in any successor to RFC 1036.

由于NNTP主要用于Netnews,且新闻组描述通常通过特殊格式的文章分发,因此建议在RFC 1036的任何后续版本中解决与之相关的国际化问题。

11. IANA Considerations
11. IANA考虑

This specification requires IANA to keep a registry of capability labels. The initial contents of this registry are specified in Section 3.3.4. As described in Section 3.3.3, labels beginning with X are reserved for private use, while all other names are expected to be associated with a specification in an RFC on the standards track or defining an IESG-approved experimental protocol.

此规范要求IANA保留功能标签的注册表。第3.3.4节规定了本登记册的初始内容。如第3.3.3节所述,以X开头的标签保留供私人使用,而所有其他名称预计与标准轨道上RFC中的规范或定义IESG批准的实验协议相关。

Different entries in the registry MUST use different capability labels.

注册表中的不同条目必须使用不同的功能标签。

Different entries in the registry MUST NOT use the same command name. For this purpose, variants distinguished by a second or subsequent keyword (e.g., "LIST HEADERS" and "LIST OVERVIEW.FMT") count as different commands. If there is a need for two extensions to use the same command, a single harmonised specification MUST be registered.

注册表中的不同项不得使用相同的命令名。为此,通过第二个或后续关键字(例如,“列表标题”和“LIST OVERVIEW.FMT”)区分的变体被视为不同的命令。如果需要两个扩展使用同一命令,则必须注册一个统一规范。

12. Security Considerations
12. 安全考虑

This section is meant to inform application developers, information providers, and users of the security limitations in NNTP as described by this document. The discussion does not include definitive solutions to the problems revealed, though it does make some suggestions for reducing security risks.

本节旨在告知应用程序开发人员、信息提供商和用户本文档所述NNTP中的安全限制。虽然讨论中提出了一些降低安全风险的建议,但并没有包括对所揭示问题的最终解决方案。

12.1. Personal and Proprietary Information
12.1. 个人和专有信息

NNTP, because it was created to distribute network news articles, will forward whatever information is stored in those articles. Specification of that information is outside this scope of this document, but it is likely that some personal and/or proprietary information is available in some of those articles. It is very important that designers and implementers provide informative warnings to users so that personal and/or proprietary information in material that is added automatically to articles (e.g., in headers) is not disclosed inadvertently. Additionally, effective and easily understood mechanisms to manage the distribution of news articles SHOULD be provided to NNTP Server administrators, so that they are able to report with confidence the likely spread of any particular set of news articles.

NNTP是为了分发网络新闻文章而创建的,它将转发这些文章中存储的任何信息。该信息的说明不在本文件的范围内,但其中一些条款中可能包含一些个人和/或专有信息。设计者和实施者向用户提供信息性警告非常重要,这样自动添加到文章(例如标题)中的材料中的个人和/或专有信息就不会被无意中披露。此外,应向NNTP服务器管理员提供管理新闻文章分发的有效且易于理解的机制,以便他们能够自信地报告任何特定新闻文章集的可能传播。

12.2. Abuse of Server Log Information
12.2. 滥用服务器日志信息

A server is in the position to save session data about a user's requests that might identify their reading patterns or subjects of interest. This information is clearly confidential in nature, and its handling can be constrained by law in certain countries. People using this protocol to provide data are responsible for ensuring that such material is not distributed without the permission of any individuals that are identifiable by the published results.

服务器可以保存有关用户请求的会话数据,这些请求可以识别用户的阅读模式或感兴趣的主题。这些信息在性质上显然是保密的,其处理可能受到某些国家法律的限制。使用本协议提供数据的人员有责任确保未经发布结果可识别的任何个人许可,不得分发此类材料。

12.3. Weak Authentication and Access Control
12.3. 弱身份验证和访问控制

There is no user-based or token-based authentication in the basic NNTP specification. Access is normally controlled by server configuration files. Those files specify access by using domain names or IP addresses. However, this specification does permit the creation of extensions to NNTP for such purposes; one such extension is [NNTP-AUTH]. While including such mechanisms is optional, doing so is strongly encouraged.

基本NNTP规范中没有基于用户或令牌的身份验证。访问通常由服务器配置文件控制。这些文件通过使用域名或IP地址指定访问权限。但是,本规范允许为此目的创建NNTP扩展;一个这样的扩展是[NNTP-AUTH]。虽然纳入此类机制是可选的,但强烈鼓励这样做。

Other mechanisms are also available. For example, a proxy server could be put in place that requires authentication before connecting via the proxy to the NNTP server.

其他机制也可用。例如,在通过代理连接到NNTP服务器之前,可以设置需要身份验证的代理服务器。

12.4. DNS Spoofing
12.4. DNS欺骗

Many existing NNTP implementations authorize incoming connections by checking the IP address of that connection against the IP addresses obtained via DNS lookups of lists of domain names given in local configuration files. Servers that use this type of authentication and clients that find a server by doing a DNS lookup of the server name rely very heavily on the Domain Name Service, and are thus

许多现有的NNTP实现通过将该连接的IP地址与通过DNS查找本地配置文件中给定的域名列表而获得的IP地址进行核对来授权传入连接。使用这种身份验证的服务器和通过DNS查找服务器名称来查找服务器的客户机严重依赖域名服务,因此

generally prone to security attacks based on the deliberate misassociation of IP addresses and DNS names. Clients and servers need to be cautious in assuming the continuing validity of an IP number/DNS name association.

通常容易受到基于IP地址和DNS名称故意错误关联的安全攻击。客户端和服务器在假设IP号码/DNS名称关联的持续有效性时需要谨慎。

In particular, NNTP clients and servers SHOULD rely on their name resolver for confirmation of an IP number/DNS name association, rather than cache the result of previous host name lookups. Many platforms already can cache host name lookups locally when appropriate, and they SHOULD be configured to do so. It is proper for these lookups to be cached, however, only when the TTL (Time To Live) information reported by the name server makes it likely that the cached information will remain useful.

特别是,NNTP客户端和服务器应该依赖其名称解析程序来确认IP号码/DNS名称关联,而不是缓存以前主机名查找的结果。许多平台已经可以在适当的时候在本地缓存主机名查找,并且应该将它们配置为这样做。但是,只有当名称服务器报告的TTL(生存时间)信息使得缓存的信息可能仍然有用时,才适合缓存这些查找。

If NNTP clients or servers cache the results of host name lookups in order to achieve a performance improvement, they MUST observe the TTL information reported by DNS. If NNTP clients or servers do not observe this rule, they could be spoofed when a previously accessed server's IP address changes. As network renumbering is expected to become increasingly common, the possibility of this form of attack will increase. Observing this requirement thus reduces this potential security vulnerability.

如果NNTP客户端或服务器缓存主机名查找的结果以实现性能改进,则它们必须遵守DNS报告的TTL信息。如果NNTP客户端或服务器不遵守此规则,则当以前访问的服务器的IP地址更改时,可能会欺骗它们。随着网络重新编号预计将变得越来越普遍,这种形式的攻击的可能性将增加。因此,遵守此要求可以减少此潜在的安全漏洞。

This requirement also improves the load-balancing behaviour of clients for replicated servers using the same DNS name and reduces the likelihood of a user's experiencing failure in accessing sites that use that strategy.

此要求还改进了使用相同DNS名称的复制服务器的客户端的负载平衡行为,并降低了用户在访问使用该策略的站点时遇到故障的可能性。

12.5. UTF-8 Issues
12.5. UTF-8问题

UTF-8 [RFC3629] permits only certain sequences of octets and designates others as either malformed or "illegal". The Unicode standard identifies a number of security issues related to illegal sequences and forbids their generation by conforming implementations.

UTF-8[RFC3629]只允许某些八位元序列,并将其他八位元序列指定为格式错误或“非法”。Unicode标准确定了许多与非法序列相关的安全问题,并禁止通过一致性实现生成这些序列。

Implementations of this specification MUST NOT generate malformed or illegal sequences and SHOULD detect them and take some appropriate action. This could include the following:

本规范的实现不得生成格式错误或非法的序列,应检测它们并采取适当的措施。这可能包括以下内容:

o Generating a 501 response code.

o 生成501响应代码。

o Replacing such sequences by the sequence %xEF.BF.BD, which encodes the "replacement character" U+FFFD.

o 用替换字符“xEBF+f.f”替换“xEBF.f”序列。

o Closing the connection.

o 正在关闭连接。

o Replacing such sequences by a "guessed" valid sequence (based on properties of the UTF-8 encoding).

o 用“猜测”的有效序列替换这些序列(基于UTF-8编码的属性)。

In the last case, the implementation MUST ensure that any replacement cannot be used to bypass validity or security checks. For example, the illegal sequence %xC0.A0 is an over-long encoding for space (%x20). If it is replaced by the correct encoding in a command line, this needs to happen before the command line is parsed into individual arguments. If the replacement came after parsing, it would be possible to generate an argument with an embedded space, which is forbidden. Use of the "replacement character" does not have this problem, since it is permitted wherever non-US-ASCII characters are. Implementations SHOULD use one of the first two solutions where the general structure of the NNTP stream remains intact and SHOULD close the connection if it is no longer possible to parse it sensibly.

在最后一种情况下,实现必须确保任何替换都不能用于绕过有效性或安全性检查。例如,非法序列%xC0.A0是空间(%x20)的超长编码。如果在命令行中被正确的编码替换,则需要在将命令行解析为单个参数之前执行此操作。如果替换是在解析之后进行的,则可以生成带有嵌入空格的参数,这是禁止的。“替换字符”的使用并没有这个问题,因为在非美国ASCII字符的任何地方都允许使用。在NNTP流的一般结构保持不变的情况下,实现应该使用前两个解决方案中的一个,如果不再能够合理地解析它,则应该关闭连接。

12.6. Caching of Capability Lists
12.6. 缓存功能列表

The CAPABILITIES command provides a capability list, which is information about the current capabilities of the server. Whenever there is a relevant change to the server state, the results of this command are required to change accordingly.

CAPABILITIES命令提供了一个功能列表,该列表是关于服务器当前功能的信息。每当服务器状态发生相关更改时,都需要相应地更改此命令的结果。

In most situations, the capabilities list in a given server state will not change from session to session; for example, a given extension will be installed permanently on a server. Some clients may therefore wish to remember which extensions a server supports to avoid the delay of an additional command and response, particularly if they open multiple connections in the same session.

在大多数情况下,给定服务器状态下的功能列表不会因会话而改变;例如,给定的扩展将永久安装在服务器上。因此,一些客户端可能希望记住服务器支持哪些扩展,以避免额外命令和响应的延迟,特别是当它们在同一会话中打开多个连接时。

However, information about extensions related to security and privacy MUST NOT be cached, since this could allow a variety of attacks.

但是,与安全和隐私相关的扩展信息不能缓存,因为这可能会允许各种攻击。

For example, consider a server that permits the use of cleartext passwords on links that are encrypted but not otherwise:

例如,考虑允许在加密但不是其他链接的链接上使用明文密码的服务器:

      [Initial connection set-up completed.]
      [S] 200 NNTP Service Ready, posting permitted
      [C] CAPABILITIES
      [S] 101 Capability list:
      [S] VERSION 2
      [S] READER
      [S] NEWNEWS
      [S] POST
      [S] XENCRYPT
      [S] LIST ACTIVE NEWSGROUPS
      [S] .
      [C] XENCRYPT
      [Client and server negotiate encryption on the link]
      [S] 283 Encrypted link established
        
      [Initial connection set-up completed.]
      [S] 200 NNTP Service Ready, posting permitted
      [C] CAPABILITIES
      [S] 101 Capability list:
      [S] VERSION 2
      [S] READER
      [S] NEWNEWS
      [S] POST
      [S] XENCRYPT
      [S] LIST ACTIVE NEWSGROUPS
      [S] .
      [C] XENCRYPT
      [Client and server negotiate encryption on the link]
      [S] 283 Encrypted link established
        
      [C] CAPABILITIES
      [S] 101 Capability list:
      [S] VERSION 2
      [S] READER
      [S] NEWNEWS
      [S] POST
      [S] XSECRET
      [S] LIST ACTIVE NEWSGROUPS
      [S] .
      [C] XSECRET fred flintstone
      [S] 290 Password for fred accepted
        
      [C] CAPABILITIES
      [S] 101 Capability list:
      [S] VERSION 2
      [S] READER
      [S] NEWNEWS
      [S] POST
      [S] XSECRET
      [S] LIST ACTIVE NEWSGROUPS
      [S] .
      [C] XSECRET fred flintstone
      [S] 290 Password for fred accepted
        

If the client caches the last capabilities list, then on the next session it will attempt to use XSECRET on an unencrypted link:

如果客户端缓存最后一个功能列表,则在下一个会话中,它将尝试在未加密的链接上使用XSECRET:

      [Initial connection set-up completed.]
      [S] 200 NNTP Service Ready, posting permitted
      [C] XSECRET fred flintstone
      [S] 483 Only permitted on secure links
        
      [Initial connection set-up completed.]
      [S] 200 NNTP Service Ready, posting permitted
      [C] XSECRET fred flintstone
      [S] 483 Only permitted on secure links
        

This exposes the password to any eavesdropper. While the primary cause of this is passing a secret without first checking the security of the link, caching of capability lists can increase the risk.

这会将密码暴露给任何窃听者。虽然主要原因是在未首先检查链接安全性的情况下传递秘密,但缓存功能列表可能会增加风险。

Any security extension should include requirements to check the security state of the link in a manner appropriate to that extension.

任何安全扩展都应包括以适合该扩展的方式检查链路安全状态的要求。

Caching should normally only be considered for anonymous clients that do not use any security or privacy extensions and for which the time required for an additional command and response is a noticeable issue.

缓存通常只应考虑用于不使用任何安全或隐私扩展的匿名客户端,对于这些客户端,额外命令和响应所需的时间是一个值得注意的问题。

13. Acknowledgements
13. 致谢

This document is the result of much effort by the present and past members of the NNTP Working Group, chaired by Russ Allbery and Ned Freed. It could not have been produced without them.

本文件是由Russ Allbery和Ned Freed担任主席的NNTP工作组现任和前任成员努力的结果。没有他们就不可能生产。

The author acknowledges the original authors of NNTP as documented in RFC 977 [RFC977]: Brian Kantor and Phil Lapsey.

作者承认RFC 977[RFC977]中记录的NNTP的原始作者:Brian Kantor和Phil Farsey。

The author gratefully acknowledges the following:

作者感谢以下几点:

o The work of the NNTP committee chaired by Eliot Lear. The organization of this document was influenced by the last available version from this working group. A special thanks to Eliot for generously providing the original machine-readable sources for that document.

o 由艾略特·李尔主持的NNTP委员会的工作。本文件的组织结构受本工作组最新版本的影响。特别感谢Eliot慷慨地为该文档提供了原始的机器可读源代码。

o The work of the DRUMS working group, specifically RFC 1869 [RFC1869], that drove the original thinking that led to the CAPABILITIES command and the extensions mechanism detailed in this document.

o 鼓工作组的工作,特别是RFC 1869[RFC1869],推动了最初的想法,导致了本文件中详述的能力指令和扩展机制。

o The authors of RFC 2616 [RFC2616] for providing specific and relevant examples of security issues that should be considered for HTTP. Since many of the same considerations exist for NNTP, those examples that are relevant have been included here with some minor rewrites.

o RFC 2616[RFC2616]的作者提供了HTTP应考虑的安全问题的具体和相关示例。由于NNTP存在许多相同的考虑因素,因此在这里包含了一些相关的示例,并进行了一些小的重写。

o The comments and additional information provided by the following individuals in preparing one or more of the progenitors of this document:

o 以下人员在准备本文件的一个或多个前身时提供的评论和附加信息:

         Russ Allbery <rra@stanford.edu>
         Wayne Davison <davison@armory.com>
         Chris Lewis <clewis@bnr.ca>
         Tom Limoncelli <tal@mars.superlink.net>
         Eric Schnoebelen <eric@egsner.cirr.com>
         Rich Salz <rsalz@osf.org>
        
         Russ Allbery <rra@stanford.edu>
         Wayne Davison <davison@armory.com>
         Chris Lewis <clewis@bnr.ca>
         Tom Limoncelli <tal@mars.superlink.net>
         Eric Schnoebelen <eric@egsner.cirr.com>
         Rich Salz <rsalz@osf.org>
        

This work was motivated by the work of various news reader authors and news server authors, including those listed below:

这项工作的动机是各种新闻阅读器作者和新闻服务器作者的工作,包括下列作者:

Rick Adams Original author of the NNTP extensions to the RN news reader and last maintainer of Bnews.

Rick Adams是RN新闻阅读器NNTP扩展的原始作者,也是BNNews的最后一个维护者。

Stan Barber Original author of the NNTP extensions to the news readers that are part of Bnews.

斯坦·巴伯(Stan Barber)是Bnews新闻读者NNTP扩展的原始作者。

Geoff Collyer Original author of the OVERVIEW database proposal and one of the original authors of CNEWS.

Geoff Collyer是概览数据库提案的原始作者,也是CNEWS的原始作者之一。

Dan Curry Original author of the xvnews news reader.

丹·库里是《xvnews新闻阅读器》的原作者。

Wayne Davison Author of the first threading extensions to the RN news reader (commonly called TRN).

Wayne Davison是RN新闻阅读器(通常称为TRN)的第一个线程扩展的作者。

Geoff Huston Original author of ANU NEWS.

杰夫·休斯顿是ANU新闻的原作者。

Phil Lapsey Original author of the UNIX reference implementation for NNTP.

PhilFarsey是NNTP的UNIX参考实现的原始作者。

Iain Lea Original maintainer of the TIN news reader.

Iain Lea是TIN新闻阅读器的原始维护者。

Chris Lewis First known implementer of the AUTHINFO GENERIC extension.

ChrisLewis是AUTHINFO通用扩展的第一个已知实现者。

Rich Salz Original author of INN.

Rich Salz是《客栈》的原作者。

Henry Spencer One of the original authors of CNEWS.

亨利·斯宾塞是CNEWS的原始作者之一。

Kim Storm Original author of the NN news reader.

金·斯托姆是《NN新闻读取器》的原作者。

Other people who contributed to this document include:

对本文件作出贡献的其他人员包括:

Matthias Andree Greg Andruk Daniel Barclay Maurizio Codogno Mark Crispin Andrew Gierth Juergen Helbing Scott Hollenbeck Urs Janssen Charles Lindsey Ade Lovett David Magda Ken Murchison Francois Petillon Peter Robinson Rob Siemborski Howard Swinehart Ruud van Tol Jeffrey Vinocur Erik Warmelink

马蒂亚斯·安德烈·格雷格·安德鲁克·丹尼尔·巴克莱·莫里齐奥·科多格诺·马克·克里斯宾·安德鲁·吉尔思·尤尔根·赫尔宾·斯科特·霍伦贝克·杨森·查尔斯·林赛·阿德·洛维特·大卫·马格达·肯·默奇森·弗朗索瓦·佩蒂伦·彼得·罗宾逊·罗伯·辛博斯基·霍华德·斯温哈特·路德·范托尔·杰弗里·维诺科·埃里克

The author thanks them all and apologises to anyone omitted.

作者感谢他们,并向任何遗漏的人道歉。

Finally, the present author gratefully acknowledges the vast amount of work put into previous versions by the previous author:

最后,本作者衷心感谢前作者在以前版本中投入的大量工作:

      Stan Barber <sob@academ.com>
        
      Stan Barber <sob@academ.com>
        
14. References
14. 工具书类
14.1. Normative References
14.1. 规范性引用文件

[ANSI1986] American National Standards Institute, "Coded Character Set - 7-bit American Standard Code for Information Interchange", ANSI X3.4, 1986.

[ANSI1986]美国国家标准协会,“编码字符集-信息交换用7位美国标准代码”,ANSI X3.41986。

[RFC977] Kantor, B. and P. Lapsley, "Network News Transfer Protocol", RFC 977, February 1986.

[RFC977]Kantor,B.和P.Lapsley,“网络新闻传输协议”,RFC977,1986年2月。

[RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies", RFC 2045, November 1996.

[RFC2045]Freed,N.和N.Borenstein,“多用途Internet邮件扩展(MIME)第一部分:Internet邮件正文格式”,RFC 20451996年11月。

[RFC2047] Moore, K., "MIME (Multipurpose Internet Mail Extensions) Part Three: Message Header Extensions for Non-ASCII Text", RFC 2047, November 1996.

[RFC2047]Moore,K.,“MIME(多用途互联网邮件扩展)第三部分:非ASCII文本的消息头扩展”,RFC 2047,1996年11月。

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.

[RFC2119]Bradner,S.,“RFC中用于表示需求水平的关键词”,BCP 14,RFC 2119,1997年3月。

[RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 10646", STD 63, RFC 3629, November 2003.

[RFC3629]Yergeau,F.,“UTF-8,ISO 10646的转换格式”,STD 63,RFC 3629,2003年11月。

[RFC4234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", RFC 4234, October 2005.

[RFC4234]Crocker,D.,Ed.和P.Overell,“语法规范的扩充BNF:ABNF”,RFC 4234,2005年10月。

[RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data Encodings", RFC 4648, October 2006.

[RFC4648]Josefsson,S.,“Base16、Base32和Base64数据编码”,RFC4648,2006年10月。

[TF.686-1] International Telecommunications Union - Radio, "Glossary, ITU-R Recommendation TF.686-1", ITU-R Recommendation TF.686-1, October 1997.

[TF.686-1]国际电信联盟-无线电,“术语表,ITU-R建议TF.686-1”,ITU-R建议TF.686-1,1997年10月。

14.2. Informative References
14.2. 资料性引用

[NNTP-AUTH] Vinocur, J., Murchison, K., and C. Newman, "Network News Transfer Protocol (NNTP) Extension for Authentication", RFC 4643, October 2006.

[NNTP-AUTH]Vinocur,J.,Murchison,K.,和C.Newman,“网络新闻传输协议(NNTP)认证扩展”,RFC 46432006年10月。

[NNTP-STREAM] Vinocur, J. and K. Murchison, "Network News Transfer Protocol (NNTP) Extension for Streaming Feeds", RFC 4644, October 2006.

[NNTP-STREAM]Vinocur,J.和K.Murchison,“流媒体源的网络新闻传输协议(NNTP)扩展”,RFC4642006年10月。

[NNTP-TLS] Murchison, K., Vinocur, J., and C. Newman, "Using Transport Layer Security (TLS) with Network News Transfer Protocol (NNTP)", RFC 4642, October 2006.

[NNTP-TLS]Murchison,K.,Vinocur,J.,和C.Newman,“将传输层安全(TLS)与网络新闻传输协议(NNTP)结合使用”,RFC 4642,2006年10月。

[RFC1036] Horton, M. and R. Adams, "Standard for interchange of USENET messages", RFC 1036, December 1987.

[RFC1036]霍顿,M.和R.亚当斯,“USENET消息交换标准”,RFC1036,1987年12月。

[RFC1305] Mills, D., "Network Time Protocol (Version 3) Specification, Implementation and Analysis", RFC 1305, March 1992.

[RFC1305]Mills,D.,“网络时间协议(第3版)规范、实施和分析”,RFC1305,1992年3月。

[RFC1869] Klensin, J., Freed, N., Rose, M., Stefferud, E., and D. Crocker, "SMTP Service Extensions", STD 10, RFC 1869, November 1995.

[RFC1869]Klensin,J.,Freed,N.,Rose,M.,Stefferud,E.,和D.Crocker,“SMTP服务扩展”,STD 10,RFC 18691995年11月。

[RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.

[RFC2616]菲尔丁,R.,盖蒂斯,J.,莫卧儿,J.,弗莱斯蒂克,H.,马斯特,L.,利奇,P.,和T.伯纳斯李,“超文本传输协议——HTTP/1.1”,RFC 2616,1999年6月。

[RFC2629] Rose, M., "Writing I-Ds and RFCs using XML", RFC 2629, June 1999.

[RFC2629]Rose,M.,“使用XML编写I-D和RFC”,RFC 26292999年6月。

[RFC2822] Resnick, P., "Internet Message Format", RFC 2822, April 2001.

[RFC2822]Resnick,P.,“互联网信息格式”,RFC 2822,2001年4月。

[RFC2980] Barber, S., "Common NNTP Extensions", RFC 2980, October 2000.

[RFC2980]Barber,S.,“通用NNTP扩展”,RFC 29802000年10月。

[ROBE1995] Robertson, R., "FAQ: Overview database / NOV General Information", January 1995.

[Robertson,R.,“常见问题解答:概览数据库/11月一般信息”,1995年1月。

There is no definitive copy of this document known to the author. It was previously posted as the Usenet article <news:nov-faq-1-930909720@agate.Berkeley.EDU>

作者不知道本文件的最终副本。这篇文章之前曾作为Usenet文章发表<news:nov-faq-1-930909720@agate.Berkeley.EDU>

[SALZ1992] Salz, R., "Manual Page for wildmat(3) from the INN 1.4 distribution, Revision 1.10", April 1992.

[SALZ1992]Salz,R.,“来自INN 1.4发行版的wildmat(3)手册页,修订版1.10”,1992年4月。

There is no definitive copy of this document known to the author.

作者不知道本文件的最终副本。

Appendix A. Interaction with Other Specifications
附录A.与其他规范的相互作用

NNTP is most often used for transferring articles that conform to RFC 1036 [RFC1036] (such articles are called "Netnews articles" here). It is also sometimes used for transferring email messages that conform to RFC 2822 [RFC2822] (such articles are called "email articles" here). In this situation, articles must conform both to this specification and to that other one; this appendix describes some relevant issues.

NNTP最常用于传输符合RFC 1036[RFC1036]的文章(此类文章在这里称为“网络新闻文章”)。它有时也用于传输符合RFC 2822[RFC2822]的电子邮件(此类文章在此处称为“电子邮件文章”)。在这种情况下,物品必须同时符合本规范和另一规范;本附录描述了一些相关问题。

A.1. Header Folding
A.1. 收割台折叠

NNTP allows a header line to be folded (by inserting a CRLF pair) before any space or TAB character.

NNTP允许在任何空格或制表符之前折叠标题行(通过插入CRLF对)。

Both email and Netnews articles are required to have at least one octet other than space or TAB on each header line. Thus, folding can only happen at one point in each sequence of consecutive spaces or TABs. Netnews articles are further required to have the header name, colon, and following space all on the first line; folding may only happen beyond that space. Finally, some non-conforming software will remove trailing spaces and TABs from a line. Therefore, it might be inadvisable to fold a header after a space or TAB.

电子邮件和Netnews文章都必须至少有一个八位字节,而不是每个标题行上的空格或制表符。因此,折叠只能发生在每个连续空格或制表符序列中的一个点上。Netnews文章还要求标题名、冒号和后续空格都在第一行;折叠可能只发生在该空间之外。最后,一些不一致的软件将删除行中的尾随空格和制表符。因此,在空格或标签后折叠标题可能是不可取的。

For maximum safety, header lines SHOULD conform to the following syntax rather than to that in Section 9.7.

为了最大程度的安全,标题行应符合以下语法,而不是第9.7节中的语法。

     header = header-name ":" SP [header-content] CRLF
     header-content = [WS] token *( [CRLF] WS token )
        
     header = header-name ":" SP [header-content] CRLF
     header-content = [WS] token *( [CRLF] WS token )
        
A.2. Message-IDs
A.2. 消息ID

Every article handled by an NNTP server MUST have a unique message-id. For the purposes of this specification, a message-id is an arbitrary opaque string that merely needs to meet certain syntactic requirements and is just a way to refer to the article.

NNTP服务器处理的每一篇文章都必须有一个唯一的message-id。就本规范而言,message id是一个任意的不透明字符串,它只需要满足某些语法要求,并且只是引用文章的一种方式。

Because there is a significant risk that old articles will be reinjected into the global Usenet system, RFC 1036 [RFC1036] requires that message-ids are globally unique for all time.

由于存在将旧文章重新注入全局Usenet系统的重大风险,RFC 1036[RFC1036]要求消息ID在任何时候都是全局唯一的。

This specification states that message-ids are the same if and only if they consist of the same sequence of octets. Other specifications may define two different sequences as being equal because they are putting an interpretation on particular characters. RFC 2822 [RFC2822] has a concept of "quoted" and "escaped" characters. It therefore considers the three message-ids:

本规范规定,当且仅当消息ID由相同的八位字节序列组成时,它们是相同的。其他规范可能将两个不同的序列定义为相等,因为它们对特定字符进行解释。RFC 2822[RFC2822]具有“引用”和“转义”字符的概念。因此,它考虑三个消息ID:

      <ab.cd@example.com>
      <"ab.cd"@example.com>
      <"ab.\cd"@example.com>
        
      <ab.cd@example.com>
      <"ab.cd"@example.com>
      <"ab.\cd"@example.com>
        

as being identical. Therefore, an NNTP implementation handing email articles must ensure that only one of these three appears in the protocol and that the other two are converted to it as and when necessary, such as when a client checks the results of a NEWNEWS command against an internal database of message-ids. Note that RFC 1036 [RFC1036] never treats two different strings as being identical. Its successor (as of the time of writing) restricts the syntax of message-ids so that, whenever RFC 2822 would treat two strings as equivalent, only one of them is valid (in the above example, only the first string is valid).

一模一样。因此,处理电子邮件文章的NNTP实现必须确保协议中仅出现这三个选项中的一个,并在必要时将其他两个转换为该选项,例如当客户端根据消息ID的内部数据库检查NEWNEWS命令的结果时。请注意,RFC1036[RFC1036]从不将两个不同的字符串视为相同。它的后继者(在编写本文时)限制消息ID的语法,以便无论何时RFC 2822将两个字符串视为等效字符串,其中只有一个是有效的(在上面的示例中,只有第一个字符串是有效的)。

This specification does not describe how the message-id of an article is determined; it may be deduced from the contents of the article or derived from some external source. If the server is also conforming to another specification that contains a definition of message-id compatible with this one, the server SHOULD use those message-ids. A common approach, and one that SHOULD be used for email and Netnews articles, is to extract the message-id from the contents of a header with name "Message-ID". This may not be as simple as copying the entire header contents; it may be necessary to strip off comments and undo quoting, or to reduce "equivalent" message-ids to a canonical form.

本规范不描述如何确定文章的消息id;它可能是从文章的内容推断出来的,也可能是从一些外部来源衍生出来的。如果服务器也符合另一个规范,其中包含与此规范兼容的消息id定义,则服务器应使用这些消息id。一种常见的方法,也应该用于电子邮件和Netnews文章,是从名为“message id”的标题内容中提取消息id。这可能不像复制整个标题内容那么简单;可能需要删除注释并撤消引用,或者将“等效”消息ID缩减为规范形式。

If an article is obtained through the IHAVE command, there will be a message-id provided with the command. The server MAY either use it or determine one from the article contents. However, whichever it does, it SHOULD ensure that, if the IHAVE command is repeated with the same argument and article, it will be recognized as a duplicate.

如果通过IHAVE命令获得文章,则该命令将提供消息id。服务器可以使用它,也可以根据文章内容确定一个。但是,无论它做了什么,它都应该确保,如果使用相同的参数和项目重复IHAVE命令,它将被识别为重复。

If an article does not contain a message-id that the server can identify, it MUST synthesize one. This could, for example, be a simple sequence number or be based on the date and time when the article arrived. When email or Netnews articles are handled, a Message-ID header SHOULD be added to ensure global consistency and uniqueness.

如果文章不包含服务器可以识别的消息id,则必须合成一个。例如,这可以是一个简单的序列号,也可以基于文章到达的日期和时间。处理电子邮件或Netnews文章时,应添加消息ID标头以确保全局一致性和唯一性。

Note that, because the message-id might not have been derived from the Message-ID header in the article, the following example is legitimate (though unusual):

请注意,由于邮件id可能不是从本文中的邮件id标头派生的,因此以下示例是合法的(尽管不常见):

      [C] HEAD <45223423@example.com>
      [S] 221 0 <45223423@example.com>
      [S] Path: pathost!demo!whitehouse!not-for-mail
      [S] Message-ID: <1234@example.net>
      [S] From: "Demo User" <nobody@example.net>
      [S] Newsgroups: misc.test
      [S] Subject: I am just a test article
      [S] Date: 6 Oct 1998 04:38:40 -0500
      [S] Organization: An Example Net, Uncertain, Texas
      [S] .
        
      [C] HEAD <45223423@example.com>
      [S] 221 0 <45223423@example.com>
      [S] Path: pathost!demo!whitehouse!not-for-mail
      [S] Message-ID: <1234@example.net>
      [S] From: "Demo User" <nobody@example.net>
      [S] Newsgroups: misc.test
      [S] Subject: I am just a test article
      [S] Date: 6 Oct 1998 04:38:40 -0500
      [S] Organization: An Example Net, Uncertain, Texas
      [S] .
        
A.3. Article Posting
A.3. 文章投递

As far as NNTP is concerned, the POST and IHAVE commands provide the same basic facilities in a slightly different way. However, they have rather different intentions.

就NNTP而言,POST和IHAVE司令部以略微不同的方式提供相同的基本设施。然而,他们有着截然不同的意图。

The IHAVE command is intended for transmitting conforming articles between a system of NNTP servers, with all articles perhaps also conforming to another specification (e.g., all articles are Netnews articles). It is expected that the client will already have done any necessary validation (or that it has in turn obtained the article from a third party that has done so); therefore, the contents SHOULD be left unchanged.

IHAVE命令用于在NNTP服务器系统之间传输一致性文章,所有文章可能也符合另一个规范(例如,所有文章都是Netnews文章)。预计客户已经进行了任何必要的验证(或者客户已经从第三方获得了物品);因此,内容应保持不变。

In contrast, the POST command is intended for use when an end-user is injecting a newly created article into a such a system. The article being transferred might not be a conforming email or Netnews article, and the server is expected to validate it and, if necessary, to convert it to the right form for onward distribution. This is often done by a separate piece of software on the server installation; if so, the NNTP server SHOULD pass the incoming article to that software unaltered, making no attempt to filter characters, to fold or limit lines, or to process the incoming text otherwise.

相比之下,POST命令旨在当最终用户将新创建的项目注入这样的系统时使用。正在传输的文章可能不是符合要求的电子邮件或Netnews文章,服务器需要对其进行验证,并在必要时将其转换为正确的形式以便继续分发。这通常是通过在服务器上安装一个单独的软件来完成的;如果是这样,NNTP服务器应将传入的文章原封不动地传递给该软件,不尝试过滤字符、折叠或限制行,或以其他方式处理传入的文本。

The POST command can fail in various ways, and clients should be prepared to re-send an article. When doing so, however, it is often important to ensure (as far as possible) that the same message-id is allocated to both attempts so that the server, or other servers, can recognize the two articles as duplicates. In the case of email or Netnews articles, therefore, the posted article SHOULD contain a header with the name "Message-ID", and the contents of this header SHOULD be identical on each attempt. The server SHOULD ensure that two POSTed articles with the same contents for this header are recognized as identical and that the same message-id is allocated, whether or not those contents are suitable for use as the message-id.

POST命令可能以各种方式失败,客户端应该准备重新发送文章。但是,在执行此操作时,通常必须确保(尽可能)为两次尝试分配相同的消息id,以便服务器或其他服务器能够将这两个项目识别为重复项。因此,对于电子邮件或Netnews文章,发布的文章应包含一个标题,标题名为“Message ID”,并且每次尝试时标题的内容应相同。服务器应确保具有此标题相同内容的两篇已发布文章被识别为相同,并分配相同的邮件id,无论这些内容是否适合用作邮件id。

Appendix B. Summary of Commands
附录B.命令摘要

This section contains a list of every command defined in this document, ordered by command name and by indicating capability.

本节包含本文档中定义的每个命令的列表,按命令名和指示功能排序。

Ordered by command name:

按命令名排序:

       +-------------------+-----------------------+---------------+
       | Command           | Indicating capability | Definition    |
       +-------------------+-----------------------+---------------+
       | ARTICLE           | READER                | Section 6.2.1 |
       | BODY              | READER                | Section 6.2.3 |
       | CAPABILITIES      | mandatory             | Section 5.2   |
       | DATE              | READER                | Section 7.1   |
       | GROUP             | READER                | Section 6.1.1 |
       | HDR               | HDR                   | Section 8.5   |
       | HEAD              | mandatory             | Section 6.2.2 |
       | HELP              | mandatory             | Section 7.2   |
       | IHAVE             | IHAVE                 | Section 6.3.2 |
       | LAST              | READER                | Section 6.1.3 |
       | LIST              | LIST                  | Section 7.6.1 |
       | LIST ACTIVE.TIMES | LIST                  | Section 7.6.4 |
       | LIST ACTIVE       | LIST                  | Section 7.6.3 |
       | LIST DISTRIB.PATS | LIST                  | Section 7.6.5 |
       | LIST HEADERS      | HDR                   | Section 8.6   |
       | LIST NEWSGROUPS   | LIST                  | Section 7.6.6 |
       | LIST OVERVIEW.FMT | OVER                  | Section 8.4   |
       | LISTGROUP         | READER                | Section 6.1.2 |
       | MODE READER       | MODE-READER           | Section 5.3   |
       | NEWGROUPS         | READER                | Section 7.3   |
       | NEWNEWS           | NEWNEWS               | Section 7.4   |
       | NEXT              | READER                | Section 6.1.4 |
       | OVER              | OVER                  | Section 8.3   |
       | POST              | POST                  | Section 6.3.1 |
       | QUIT              | mandatory             | Section 5.4   |
       | STAT              | mandatory             | Section 6.2.4 |
       +-------------------+-----------------------+---------------+
        
       +-------------------+-----------------------+---------------+
       | Command           | Indicating capability | Definition    |
       +-------------------+-----------------------+---------------+
       | ARTICLE           | READER                | Section 6.2.1 |
       | BODY              | READER                | Section 6.2.3 |
       | CAPABILITIES      | mandatory             | Section 5.2   |
       | DATE              | READER                | Section 7.1   |
       | GROUP             | READER                | Section 6.1.1 |
       | HDR               | HDR                   | Section 8.5   |
       | HEAD              | mandatory             | Section 6.2.2 |
       | HELP              | mandatory             | Section 7.2   |
       | IHAVE             | IHAVE                 | Section 6.3.2 |
       | LAST              | READER                | Section 6.1.3 |
       | LIST              | LIST                  | Section 7.6.1 |
       | LIST ACTIVE.TIMES | LIST                  | Section 7.6.4 |
       | LIST ACTIVE       | LIST                  | Section 7.6.3 |
       | LIST DISTRIB.PATS | LIST                  | Section 7.6.5 |
       | LIST HEADERS      | HDR                   | Section 8.6   |
       | LIST NEWSGROUPS   | LIST                  | Section 7.6.6 |
       | LIST OVERVIEW.FMT | OVER                  | Section 8.4   |
       | LISTGROUP         | READER                | Section 6.1.2 |
       | MODE READER       | MODE-READER           | Section 5.3   |
       | NEWGROUPS         | READER                | Section 7.3   |
       | NEWNEWS           | NEWNEWS               | Section 7.4   |
       | NEXT              | READER                | Section 6.1.4 |
       | OVER              | OVER                  | Section 8.3   |
       | POST              | POST                  | Section 6.3.1 |
       | QUIT              | mandatory             | Section 5.4   |
       | STAT              | mandatory             | Section 6.2.4 |
       +-------------------+-----------------------+---------------+
        

Ordered by indicating capability:

按指示能力排序:

       +-------------------+-----------------------+---------------+
       | Command           | Indicating capability | Definition    |
       +-------------------+-----------------------+---------------+
       | CAPABILITIES      | mandatory             | Section 5.2   |
       | HEAD              | mandatory             | Section 6.2.2 |
       | HELP              | mandatory             | Section 7.2   |
       | QUIT              | mandatory             | Section 5.4   |
       | STAT              | mandatory             | Section 6.2.4 |
       | HDR               | HDR                   | Section 8.5   |
       | LIST HEADERS      | HDR                   | Section 8.6   |
       | IHAVE             | IHAVE                 | Section 6.3.2 |
       | LIST              | LIST                  | Section 7.6.1 |
       | LIST ACTIVE       | LIST                  | Section 7.6.3 |
       | LIST ACTIVE.TIMES | LIST                  | Section 7.6.4 |
       | LIST DISTRIB.PATS | LIST                  | Section 7.6.5 |
       | LIST NEWSGROUPS   | LIST                  | Section 7.6.6 |
       | MODE READER       | MODE-READER           | Section 5.3   |
       | NEWNEWS           | NEWNEWS               | Section 7.4   |
       | OVER              | OVER                  | Section 8.3   |
       | LIST OVERVIEW.FMT | OVER                  | Section 8.4   |
       | POST              | POST                  | Section 6.3.1 |
       | ARTICLE           | READER                | Section 6.2.1 |
       | BODY              | READER                | Section 6.2.3 |
       | DATE              | READER                | Section 7.1   |
       | GROUP             | READER                | Section 6.1.1 |
       | LAST              | READER                | Section 6.1.3 |
       | LISTGROUP         | READER                | Section 6.1.2 |
       | NEWGROUPS         | READER                | Section 7.3   |
       | NEXT              | READER                | Section 6.1.4 |
       +-------------------+-----------------------+---------------+
        
       +-------------------+-----------------------+---------------+
       | Command           | Indicating capability | Definition    |
       +-------------------+-----------------------+---------------+
       | CAPABILITIES      | mandatory             | Section 5.2   |
       | HEAD              | mandatory             | Section 6.2.2 |
       | HELP              | mandatory             | Section 7.2   |
       | QUIT              | mandatory             | Section 5.4   |
       | STAT              | mandatory             | Section 6.2.4 |
       | HDR               | HDR                   | Section 8.5   |
       | LIST HEADERS      | HDR                   | Section 8.6   |
       | IHAVE             | IHAVE                 | Section 6.3.2 |
       | LIST              | LIST                  | Section 7.6.1 |
       | LIST ACTIVE       | LIST                  | Section 7.6.3 |
       | LIST ACTIVE.TIMES | LIST                  | Section 7.6.4 |
       | LIST DISTRIB.PATS | LIST                  | Section 7.6.5 |
       | LIST NEWSGROUPS   | LIST                  | Section 7.6.6 |
       | MODE READER       | MODE-READER           | Section 5.3   |
       | NEWNEWS           | NEWNEWS               | Section 7.4   |
       | OVER              | OVER                  | Section 8.3   |
       | LIST OVERVIEW.FMT | OVER                  | Section 8.4   |
       | POST              | POST                  | Section 6.3.1 |
       | ARTICLE           | READER                | Section 6.2.1 |
       | BODY              | READER                | Section 6.2.3 |
       | DATE              | READER                | Section 7.1   |
       | GROUP             | READER                | Section 6.1.1 |
       | LAST              | READER                | Section 6.1.3 |
       | LISTGROUP         | READER                | Section 6.1.2 |
       | NEWGROUPS         | READER                | Section 7.3   |
       | NEXT              | READER                | Section 6.1.4 |
       +-------------------+-----------------------+---------------+
        
Appendix C. Summary of Response Codes
附录C.响应代码摘要

This section contains a list of every response code defined in this document and indicates whether it is multi-line, which commands can generate it, what arguments it has, and what its meaning is.

本节包含本文档中定义的每个响应代码的列表,并指出它是否为多行代码、哪些命令可以生成它、它有哪些参数以及它的含义。

Response code 100 (multi-line) Generated by: HELP Meaning: help text follows.

响应代码100(多行)由以下内容生成:帮助含义:帮助文本。

Response code 101 (multi-line) Generated by: CAPABILITIES Meaning: capabilities list follows.

响应代码101(多行)由:CAPABILITIES生成,含义如下:CAPABILITIES列表。

Response code 111 Generated by: DATE 1 argument: yyyymmddhhmmss Meaning: server date and time.

响应代码111由:DATE 1参数:yyyymmddhhmmss生成,意思是:服务器日期和时间。

Response code 200 Generated by: initial connection, MODE READER Meaning: service available, posting allowed.

允许连接,初始响应:200由服务生成。

Response code 201 Generated by: initial connection, MODE READER Meaning: service available, posting prohibited.

响应代码201由以下内容生成:初始连接,模式读取器含义:服务可用,禁止发布。

Response code 205 Generated by: QUIT Meaning: connection closing (the server immediately closes the connection).

响应代码205由:QUIT生成,意思是:连接关闭(服务器立即关闭连接)。

Response code 211 The 211 response code has two completely different forms, depending on which command generated it:

响应代码211 211响应代码有两种完全不同的形式,具体取决于生成它的命令:

(not multi-line) Generated by: GROUP 4 arguments: number low high group Meaning: group selected.

(非多行)生成者:组4参数:数量低-高-组含义:选择组。

(multi-line) Generated by: LISTGROUP 4 arguments: number low high group Meaning: article numbers follow.

(多行)生成者:LISTGROUP 4参数:number low high group含义:文章编号跟随。

Response code 215 (multi-line) Generated by: LIST Meaning: information follows.

响应代码215(多行)由以下内容生成:列表含义:信息如下。

Response code 220 (multi-line) Generated by: ARTICLE 2 arguments: n message-id Meaning: article follows.

响应代码220(多行)由以下内容生成:ARTICLE 2参数:n消息id含义:ARTICLE如下。

Response code 221 (multi-line) Generated by: HEAD 2 arguments: n message-id Meaning: article headers follow.

响应代码221(多行)由以下内容生成:HEAD 2参数:n消息id含义:后面是文章标题。

Response code 222 (multi-line) Generated by: BODY 2 arguments: n message-id Meaning: article body follows.

由多条主体代码生成的(多条主体代码:222)。

Response code 223 Generated by: LAST, NEXT, STAT 2 arguments: n message-id Meaning: article exists and selected.

响应代码223由:LAST、NEXT、STAT 2参数生成:n消息id含义:文章存在并已选定。

Response code 224 (multi-line) Generated by: OVER Meaning: overview information follows.

响应代码224(多行)由以下内容生成:过度含义:概述信息。

Response code 225 (multi-line) Generated by: HDR Meaning: headers follow.

响应代码225(多行)由:HDR生成,意思是:后面跟着标题。

Response code 230 (multi-line) Generated by: NEWNEWS Meaning: list of new articles follows.

响应代码230(多行)由以下人员生成:NEWNEWS含义:新文章列表。

Response code 231 (multi-line) Generated by: NEWGROUPS Meaning: list of new newsgroups follows.

响应代码231(多行)由:NEWGROUPS生成,意思是:新新闻组列表如下。

Response code 235 Generated by: IHAVE (second stage) Meaning: article transferred OK.

响应代码235由:IHAVE(第二阶段)生成,意思是:物品转移正常。

Response code 240 Generated by: POST (second stage) Meaning: article received OK.

回复代码240生成人:POST(第二阶段)意思是:物品已收到OK。

Response code 335 Generated by: IHAVE (first stage) Meaning: send article to be transferred.

响应代码335由:IHAVE(第一阶段)生成,意思是:发送要传输的文章。

Response code 340 Generated by: POST (first stage) Meaning: send article to be posted.

响应代码340由:POST(第一阶段)生成,意思是:发送要发布的文章。

Response code 400 Generic response and generated by initial connection Meaning: service not available or no longer available (the server immediately closes the connection).

响应代码400由初始连接生成的通用响应,意思是:服务不可用或不再可用(服务器立即关闭连接)。

Response code 401 Generic response 1 argument: capability-label Meaning: the server is in the wrong mode; the indicated capability should be used to change the mode.

响应代码401通用响应1参数:能力标签含义:服务器处于错误模式;应使用指示的能力来改变模式。

Response code 403 Generic response Meaning: internal fault or problem preventing action being taken.

响应代码403一般响应含义:内部故障或问题阻止采取措施。

Response code 411 Generated by: GROUP, LISTGROUP Meaning: no such newsgroup.

响应代码411由:GROUP生成,LISTGROUP意思是:没有这样的新闻组。

Response code 412 Generated by: ARTICLE, BODY, GROUP, HDR, HEAD, LAST, LISTGROUP, NEXT, OVER, STAT Meaning: no newsgroup selected.

响应代码412由以下内容生成:文章、正文、组、HDR、标题、最后一个、列表组、下一个、结束、统计意味着:未选择新闻组。

Response code 420 Generated by: ARTICLE, BODY, HDR, HEAD, LAST, NEXT, OVER, STAT Meaning: current article number is invalid.

由以下内容生成的响应代码420:文章、正文、HDR、标题、最后一个、下一个、结束、统计意味着:当前文章编号无效。

Response code 421 Generated by: NEXT Meaning: no next article in this group.

响应代码421生成人:NEXT含义:此组中无下一篇文章。

Response code 422 Generated by: LAST Meaning: no previous article in this group.

响应代码422生成人:LAST Means:此组中没有以前的文章。

Response code 423 Generated by: ARTICLE, BODY, HDR, HEAD, OVER, STAT Meaning: no article with that number or in that range.

响应代码423由:ARTICLE、BODY、HDR、HEAD、OVER、STAT生成,意思是:没有包含该数字或该范围内的文章。

Response code 430 Generated by: ARTICLE, BODY, HDR, HEAD, OVER, STAT Meaning: no article with that message-id.

响应代码430由以下内容生成:ARTICLE、BODY、HDR、HEAD、OVER、STAT意味着:没有包含该消息id的文章。

Response code 435 Generated by: IHAVE (first stage) Meaning: article not wanted.

响应代码435由:IHAVE(第一阶段)生成,意思是:不需要物品。

Response code 436 Generated by: IHAVE (either stage) Meaning: transfer not possible (first stage) or failed (second stage); try again later.

响应代码436由以下内容生成:IHAVE(任一阶段)意思是:传输不可能(第一阶段)或失败(第二阶段);请稍后再试。

Response code 437 Generated by: IHAVE (second stage) Meaning: transfer rejected; do not retry.

响应代码437生成:IHAVE(第二阶段)意思是:传输被拒绝;不要重试。

Response code 440 Generated by: POST (first stage) Meaning: posting not permitted.

响应代码440由:POST(第一阶段)生成,意思是:不允许发布。

Response code 441 Generated by: POST (second stage) Meaning: posting failed.

响应代码441由:POST(第二阶段)生成,意思是:POST失败。

Response code 480 Generic response Meaning: command unavailable until the client has authenticated itself.

响应代码480通用响应含义:在客户端对自身进行身份验证之前,命令不可用。

Response code 483 Generic response Meaning: command unavailable until suitable privacy has been arranged.

响应代码483通用响应含义:在安排适当的隐私之前,命令不可用。

Response code 500 Generic response Meaning: unknown command.

响应代码500通用响应含义:未知命令。

Response code 501 Generic response Meaning: syntax error in command.

响应代码501通用响应含义:命令中出现语法错误。

Response code 502 Generic response and generated by initial connection

响应代码502通用响应,由初始连接生成

Meaning for the initial connection and the MODE READER command: service permanently unavailable (the server immediately closes the connection).

对于初始连接和模式读取器命令的含义:服务永久不可用(服务器立即关闭连接)。

Meaning for all other commands: command not permitted (and there is no way for the client to change this).

所有其他命令的含义:不允许使用命令(客户端无法更改此命令)。

Response code 503 Generic response Meaning: feature not supported.

响应代码503通用响应含义:不支持功能。

Response code 504 Generic response Meaning: error in base64-encoding [RFC4648] of an argument.

响应代码504通用响应含义:参数的base64编码[RFC4648]中存在错误。

Appendix D. Changes from RFC 977
附录D.RFC 977的变更

In general every attempt has been made to ensure that the protocol specification in this document is compatible with the version specified in RFC 977 [RFC977] and the various facilities adopted from RFC 2980 [RFC2980]. However, there have been a number of changes, some compatible and some not.

通常,已尽一切努力确保本文件中的协议规范与RFC 977[RFC977]中规定的版本以及RFC 2980[RFC2980]中采用的各种设施兼容。然而,有一些变化,有些兼容,有些不兼容。

This appendix lists these changes. It is not guaranteed to be exhaustive or correct and MUST NOT be relied on.

本附录列出了这些变化。不保证其详尽无遗或正确无误,且不得依赖。

o A formal syntax specification (Section 9) has been added.

o 增加了正式语法规范(第9节)。

o The default character set is changed from US-ASCII [ANSI1986] to UTF-8 [RFC3629] (note that US-ASCII is a subset of UTF-8). This matter is discussed further in Section 10.

o 默认字符集从US-ASCII[ANSI1986]更改为UTF-8[RFC3629](请注意,US-ASCII是UTF-8的子集)。第10节将进一步讨论这一问题。

o All articles are required to have a message-id, eliminating the "<0>" placeholder used in RFC 977 in some responses.

o 所有文章都需要有消息id,从而消除了RFC 977中在某些响应中使用的“<0>”占位符。

o The newsgroup name matching capabilities already documented in RFC 977 ("wildmats", Section 4) are clarified and extended. The new facilities (e.g., the use of commas and exclamation marks) are allowed wherever wildmats appear in the protocol.

o RFC 977(“wildmats”,第4节)中已经记录的新闻组名称匹配功能得到了澄清和扩展。新设施(例如,使用逗号和感叹号)允许在协议中出现wildmats的任何地方使用。

o Support for pipelining of commands (Section 3.5) is made mandatory.

o 命令管道化支持(第3.5节)是强制性的。

o The principles behind response codes (Section 3.2) have been tidied up. In particular:

o 响应代码背后的原则(第3.2节)已经整理好。特别地:

* the x8x response code family, formerly used for private extensions, is now reserved for authentication and privacy extensions;

* x8x响应代码系列以前用于私有扩展,现在保留用于身份验证和隐私扩展;

* the x9x response code family, formerly intended for debugging facilities, are now reserved for private extensions;

* x9x响应代码系列以前用于调试设备,现在保留用于私有扩展;

* the 502 and 503 generic response codes (Section 3.2.1) have been redefined;

* 502和503通用响应代码(第3.2.1节)已重新定义;

* new 401, 403, 480, 483, and 504 generic response codes have been added.

* 添加了新的401、403、480、483和504通用响应代码。

o The rules for article numbering (Section 6) have been clarified (also see Section 6.1.1.2).

o 已澄清物品编号规则(第6节)(另见第6.1.1.2节)。

o The SLAVE command (which was ill-defined) is removed from the protocol.

o 从协议中删除从属命令(定义错误)。

o Four-digit years are permitted in the NEWNEWS (Section 7.4) and NEWGROUPS (Section 7.3) commands (two-digit years are still permitted). The optional distribution parameter to these commands has been removed.

o NEWNEWS(第7.4节)和NEWGROUPS(第7.3节)命令中允许使用四位数年(仍然允许使用两位数年)。已删除这些命令的可选分布参数。

o The LIST command (Section 7.6.1) is greatly extended; the original is available as LIST ACTIVE, while new variants include ACTIVE.TIMES, DISTRIB.PATS, and NEWSGROUPS. A new "m" status flag is added to the LIST ACTIVE response.

o LIST命令(第7.6.1节)被大大扩展;原始版本以列表活动的形式提供,而新的变体包括ACTIVE.TIMES、DISTRIB.PATS和新闻组。新的“m”状态标志添加到列表活动响应中。

o A new CAPABILITIES command (Section 5.2) allows clients to determine what facilities are supported by a server.

o 新的“能力”命令(第5.2节)允许客户端确定服务器支持哪些设施。

o The DATE command (Section 7.1) is adopted from RFC 2980 effectively unchanged.

o 日期命令(第7.1节)从RFC 2980中采用,实际上没有改变。

o The LISTGROUP command (Section 6.1.2) is adopted from RFC 2980. An optional range argument has been added, and the 211 initial response line now has the same format as the 211 response from the GROUP command.

o LISTGROUP命令(第6.1.2节)采用RFC 2980。添加了一个可选的范围参数,211初始响应行现在的格式与来自GROUP命令的211响应相同。

o The MODE READER command (Section 5.3) is adopted from RFC 2980 and its meaning and effects clarified.

o 模式读取器命令(第5.3节)采用RFC 2980,并阐明其含义和效果。

o The XHDR command in RFC 2980 has been formalised as the new HDR (Section 8.5) and LIST HEADERS (Section 8.6) commands.

o RFC2980中的XHDR命令已正式化为新的HDR(第8.5节)和列表头(第8.6节)命令。

o The XOVER command in RFC 2980 has been formalised as the new OVER (Section 8.3) and LIST OVERVIEW.FMT (Section 8.4) commands. The former can be applied to a message-id as well as to a range.

o RFC 2980中的XOVER命令已正式化为新的OVER(第8.3节)和LIST OVERVIEW.FMT(第8.4节)命令。前者可以应用于消息id,也可以应用于范围。

o The concept of article metadata (Section 8.1) has been formalised, allowing the Bytes and Lines pseudo-headers to be deprecated.

o 文章元数据的概念(第8.1节)已经正式化,允许不推荐使用字节和行伪头。

Client authors should note in particular that lack of support for the CAPABILITIES command is a good indication that the server does not support this specification.

客户机作者应特别注意,缺乏对CAPABILITIES命令的支持很好地表明服务器不支持此规范。

Author's Address

作者地址

Clive D.W. Feather THUS plc 322 Regents Park Road London N3 2QQ United Kingdom

Clive D.W.Feather Thous plc英国伦敦丽晶公园路322号N3 2QQ

   Phone: +44 20 8495 6138
   Fax:   +44 870 051 9937
   EMail: clive@demon.net
   URI:   http://www.davros.org/
        
   Phone: +44 20 8495 6138
   Fax:   +44 870 051 9937
   EMail: clive@demon.net
   URI:   http://www.davros.org/
        

Full Copyright Statement

完整版权声明

Copyright (C) The Internet Society (2006).

版权所有(C)互联网协会(2006年)。

This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights.

本文件受BCP 78中包含的权利、许可和限制的约束,除其中规定外,作者保留其所有权利。

This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

本文件及其包含的信息是按“原样”提供的,贡献者、他/她所代表或赞助的组织(如有)、互联网协会和互联网工程任务组不承担任何明示或暗示的担保,包括但不限于任何保证,即使用本文中的信息不会侵犯任何权利,或对适销性或特定用途适用性的任何默示保证。

Intellectual Property

知识产权

The IETF takes no position regarding the validity or scope of any Intellectual Property Rights or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; nor does it represent that it has made any independent effort to identify any such rights. Information on the procedures with respect to rights in RFC documents can be found in BCP 78 and BCP 79.

IETF对可能声称与本文件所述技术的实施或使用有关的任何知识产权或其他权利的有效性或范围,或此类权利下的任何许可可能或可能不可用的程度,不采取任何立场;它也不表示它已作出任何独立努力来确定任何此类权利。有关RFC文件中权利的程序信息,请参见BCP 78和BCP 79。

Copies of IPR disclosures made to the IETF Secretariat and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this specification can be obtained from the IETF on-line IPR repository at http://www.ietf.org/ipr.

向IETF秘书处披露的知识产权副本和任何许可证保证,或本规范实施者或用户试图获得使用此类专有权利的一般许可证或许可的结果,可从IETF在线知识产权存储库获取,网址为http://www.ietf.org/ipr.

The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology that may be required to implement this standard. Please address the information to the IETF at ietf-ipr@ietf.org.

IETF邀请任何相关方提请其注意任何版权、专利或专利申请,或其他可能涵盖实施本标准所需技术的专有权利。请将信息发送至IETF的IETF-ipr@ietf.org.

Acknowledgement

确认

Funding for the RFC Editor function is provided by the IETF Administrative Support Activity (IASA).

RFC编辑器功能的资金由IETF行政支持活动(IASA)提供。