🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #81118

Re: Have I to issue a GROUP command before POSTing?

#81118
From: Julien ÉLIE
Date: Fri, 29 May 2009 22:23
121 lines
4856 bytes
Hi Mateusz,

> It still lacks some commands, and doesn't handle some cases properly, but
> it's on a very good way so far :)

In case it helps...  Quickly glancing at your code:

            CASE "HEAD"   ' nnn or <msgid>
              PRINT "501 Sorry, not implemented yet..." + CRLF; ' WRITE ME!

Be careful it is not 501 to send (syntax error on a recognized command,
for instance "HEAD 1a2" or "HEAD msg-id-without-brackets" or
"HEAD <msg-id-with-300-octets>").  Here, it would be 500.
The same goes for other commands.
"CAPABILITIES A" returns 501 whereas "CAPABILITIES TEST" returns 101.
...

            CASE "XOVER", "OVER"
              Xover(LastCommand(2))

Be careful XOVER and OVER are not the same commands.

OVER <test>
503 Overview by message-ID unsupported
XOVER <test>
501 Syntax error in range

GROUP fr.test
211 7501 1760 10030 fr.test
OVER 1
423 No articles in 1
XOVER 1
224 No articles in 1
..


  PRINT "101 Capability list:" + CRLF;
  PRINT "VERSION 2" + CRLF;
  PRINT "READER" + CRLF;
  PRINT "LIST ACTIVE NEWSGROUPS OVERVIEW.FMT" + CRLF;
  PRINT "OVER" + CRLF;
  PRINT "." + CRLF;

No "POST"?  (when WriteAccess = 1)
And "AUTHINFO USER", in case you wish to advertise it?


  PRINT "502 Authentication rejected."

Not a valid answer.  It must be 481 (see RFC 4643).  Or 482 in case
it is out of sequence (which is dealt afterwards in your code).


> the gateway is sending a POST command without issuing a GROUP command
> before.
> So there comes my question: is it legal? I read RFC 977 and 3977 several
> times, but I could not find any clear information about that...

Yes it is perfectly legal.


> The RFC
> doesn't tell that a "no group selected" answer is possible to a "POST"
> command, so it makes me think that the GROUP is not required...

GROUP is not required and 412 is not a valid answer to POST!

By the way, there is "dot-stuffing" to handle (maybe you already takes
care of that but better warn you):

   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.


> On the other hand, it seems weird to me, because: If my server holds two
> groups, one called X, which is read-only, and the second called Y, which is
> read-write, how could I possibly know what I have to answer to a client
> which tries to POST without specifying the group first?

340 :)
He sends his article and you see afterwards.


> Of course, I could answer "Ok, give me your stuff", receive the message,
> check the Newsgroups header, and then answer with an error if he tried to
> post to the read-only group, but such behavior seems tricky to me...

It is what you should do.
Incidentally, I have a question which will show you why GROUP is not required:
** how do you handle crossposts? :) **


> Do you know what is the *right* way to handle that?

340.


> If it helps, here is the dump of the NNTP dialog:
>
> S: 200 Welcome to the BasicNews Server!
> C: MODE READER
> S: 200 Reader mode, posting permitted.
> C: POST
> S: 412 No newsgroup selected.

You shouldn't have answered 412.


> C: From: Mateusz <mateusz@test.test>
> S: 500 I don't know such command. Sorry.

He shouldn't have gone on sending the article...  412 (4xx) was
not a 3xx answer!

-- 
Julien ÉLIE

« Rien, ce n'est pas rien ! La preuve, c'est que l'on peut le soustraire.
  Exemple : rien moins rien = moins que rien ! » (Raymond Devos) 
Technical Details
Message-ID: <gvpn99$37q$1@news.trigofacile.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!de-l.enfer-du-nord.net!gegeweb.org!news.trigofacile.com!not-for-mail
References: <3l06f6-ji1.ln1@mail.viste-family.net>

Show Full Headers
Complete Article Headers
Message-ID: <gvpn99$37q$1@news.trigofacile.com>
Subject: Re: Have I to issue a GROUP command before POSTing?
Date: Sat, 30 May 2009 00:23:31 +0200
From: Julien ÉLIE <iulius@nom-de-mon-site.com.invalid>
References: <3l06f6-ji1.ln1@mail.viste-family.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.ams.giganews.com!nntp.giganews.com!de-l.enfer-du-nord.net!gegeweb.org!news.trigofacile.com!not-for-mail
Newsgroups: news.software.nntp
Organization: TrigoFACILE -- http://www.trigofacile.com/
Lines: 121
NNTP-Posting-Host: aaubervilliers-151-1-45-218.w83-114.abo.wanadoo.fr
Mime-Version: 1.0
Content-Type: text/plain; format=flowed; charset="iso-8859-1";
 reply-type=original
Content-Transfer-Encoding: 8bit
X-Trace: news.trigofacile.com 1243635817 3322 83.114.135.218 (29 May 2009
X-Complaints-To: abuse@trigofacile.com
NNTP-Posting-Date: Fri, 29 May 2009 22:23:37 +0000 (UTC)
In-Reply-To: <3l06f6-ji1.ln1@mail.viste-family.net>
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Windows Mail 6.0.6001.18000
X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6001.18049