1

I am using TIdNNTP and encountered a situation with news.astraweb.com server where it announces in LIST EXTENSIONS that it supports new command HDR and OVER (formal versions of XHDR and XOVER) - see https://www.rfc-editor.org/rfc/rfc3977#section-8.3 and https://www.rfc-editor.org/rfc/rfc2980#section-2.8

The problem is that the server replies with command code 500 (invalid command) when issued OVER command (instead of XOVER). Although this is clearly non-RFC-compliant behavior I'd like to see if there is a possibility to force TIdNNTP to use XOVER instead of OVER, in other words to work in a sort of "legacy" mode. The same thing works perfectly with compliant server like news.aioe.org

Log example from news.astraweb.com (problematic server)

->CAPABILITIES
<-500 What?
->LIST EXTENSIONS
<-202 Extensions supported:
<-HDR
<-OVER
<-.
->GROUP group.name
<-211 100031 1 100031 group.name
->OVER 100031-100031
<-500 What?

Proper log from news.aioe.org (works as expected)

-> CAPABILITIES
<- 101 Capability list:
<- VERSION 2
<- IMPLEMENTATION INN 2.5.2
<- AUTHINFO
<-  SASL
<- HDR
<- LIST ACTIVE ACTIVE.TIMES DISTRIB.PATS HEADERS NEWSGROUPS OVERVIEW.FMT
<- OVER
<- POST
<- READER
<- SASL NTLM DIGEST-MD5 CRAM-MD5
<- STARTTLS
<- .
-> STARTTLS
<- 382 Begin TLS negotiation now
-> MODE READER
<- 200 news.aioe.org InterNetNews NNRP server INN 2.5.2 ready (posting ok)
-> CAPABILITIES
<- 101 Capability list:
<- VERSION 2
<- IMPLEMENTATION INN 2.5.2
<- AUTHINFO
<-  USER
<-  SASL
<- 
<- HDR
<- LIST ACTIVE ACTIVE.TIMES DISTRIB.PATS HEADERS NEWSGROUPS OVERVIEW.FMT
<- OVER
<- POST
<- READER
<- SASL NTLM DIGEST-MD5 CRAM-MD5 PLAIN LOGIN
<- .
-> GROUP group.name
<- 211 4540 67027 71566 group.name
-> OVER 67027-71566
<- 224 Overview information for 67027-71566 follows
....

Right now, TIdNNTP automatically selects OVER when server announces it supports OVER and using IdNNTP.XOVER call will issue OVER command. Can this be overridden somehow? Is it worth bothering by doing this sort of legacy support?

4

1 回答 1

1

TIdNNTP is hard-coded to use OVER if the server claims to support OVER, and likewise for HDR. There is no option to change that. You would have to call SendCmd() directly, then you can process the response however you want.

Personally, I would contact astraweb.com and let them know that their NNTP server is broken. They went to the trouble of implementing the newer CAPABILITIES command, but they violated a core requirement of it:

The server MUST ensure that the capability list accurately reflects the capabilities (including extensions) currently available.

I am not inclined to change Indy's behavior just because one server is non-conforming. If there are other servers that exhibit the same faulty behavior, then adding a fallback option would make more sense.

于 2013-10-07T06:54:12.973 回答