Syntax of NNTP commands

Russ Allbery rra at stanford.edu
Sat Aug 23 17:27:33 UTC 2008


Julien ÉLIE <julien at trigofacile.com> writes:

> Are whitespaces allowed at the beginning and the end of NNTP commands?
> That is to say, are these commands valid:
>
>    " QUIT"
>    "QUIT "
>    "LIST MOTD "
>
> It appears that nnrpd accepts them.
> However, innd does not accept spaces at the beginning.
>
> According to RFC 3977, I think that both leading and trailing spaces
> are not allowed:
>
>    command-line = command EOL
>    command = X-command
>    X-command = keyword *(WS token)
>
>    command =/ quit-command /
>    [...]
>
>    quit-command = "QUIT"

I agree with your reading.

> Should it be enforced in both nnrpd and innd?

I don't know.  My first instinct is to tend towards being generous in what
one accepts on the nnrpd side.  It's sort of annoying to have stray spaces
cause the command to be unrecognized when testing things by hand when the
meaning is unambiguous.  The standard doesn't say we can't accept it.

> By the way, innd only matches the beginning of the command:
>
> % telnet localhost 119
> 200 news.trigofacile.com InterNetNews server INN 2.5.0 (20080629 prerelease) ready
> QUITNOTOK
> 205 .
> Connection closed by foreign host.
>
> :)

Yeah, the innd command parser is very poor and needs significant
improvement.  See also the first problem in doc/compliance-nntp.

> Another thing:  "HELP test" should answer "501 Usage error" (nothing
> should be put after "HELP").  Should it be fixed?

Probably, although it's not a very high priority.

-- 
Russ Allbery (rra at stanford.edu)             <http://www.eyrie.org/~eagle/>

    Please send questions to the list rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.


More information about the inn-workers mailing list