🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #81158

Re: Implementation question

#81158
From: Julien ÉLIE
Date: Sun, 31 May 2009 12:15
172 lines
6142 bytes
Hi Mateusz,

> I'm currently writing my own NNTP server, and I got my way to authentication
> now, which gave me an implementation problem I'm not sure how to deal
> with...

Interesting questions.
I have an idea about how it should be done but well, better test it!


> Say, that my server is holding two groups: auth.test.test and
> noauth.test.test. The first one requires authentication to read articles,
> the second not.
>
> Now, I am posting (crossposting) an article to both of these groups, without
> being authenticated. The article's ID is <test@test123>.
> What shall be the response of the server?

441.

I assume you mean that you are authorized to *post* to noauth.test.test
and not auth.test.test. (?)

noauth.test.test == trigofacile.test
auth.test.test == trigofacile.test2


access "users" {
    read: "*,!trigofacile.test2"
    post: "trigofacile.test"
}


% telnet news.trigofacile.com 119
Trying 91.121.26.68...
Connected to news.trigofacile.com.
Escape character is '^]'.
200 news.trigofacile.com InterNetNews NNRP server INN 2.5.0 (20090521 prerelease) ready (posting ok)
CAPABILITIES
101 Capability list:
VERSION 2
IMPLEMENTATION INN 2.5.0 (20090521 prerelease)
AUTHINFO USER SASL
HDR
IHAVE
LIST ACTIVE ACTIVE.TIMES DISTRIB.PATS HEADERS NEWSGROUPS OVERVIEW.FMT
NEWNEWS
OVER
POST
READER
SASL GSSAPI OTP PLAIN NTLM LOGIN DIGEST-MD5 CRAM-MD5
STARTTLS
..
LIST ACTIVE trigo*
215 Newsgroups in form "group high low flags"
trigofacile.test 0000000218 0000000006 y
trigofacile.support 0000000013 0000000001 y
trigofacile.test.vide 0000000001 0000000002 y
trigofacile.alias 0000000000 0000000001 y
..
POST
340 Ok, recommended message-ID <gvtqlm$u9i$1@news.trigofacile.com>
From: =?ISO-8859-15?Q?Julien_=C9LIE?= <iulius@nom-de-mon-site.com.invalid>
Newsgroups: trigofacile.test,trigofacile.test2
Subject: test
Message-ID: <gvtqlm$u9i$1@news.trigofacile.com>

test
..
441 You are not allowed to post to trigofacile.test2



** Note that LIST ACTIVE does not return trigofacile.test2 (no reading permission).


Just to be sure, I also tried with IHAVE:

IHAVE <gvtqlm$u9i$1@news.trigofacile.com>
335 Send it; end with <CR-LF>.<CR-LF>
From: =?ISO-8859-15?Q?Julien_=C9LIE?= <iulius@nom-de-mon-site.com.invalid>
Newsgroups: trigofacile.test,trigofacile.test2
Subject: test
Message-ID: <gvtqlm$u9i$1@news.trigofacile.com>
Date: Sun, 31 May 2009 13:58:18 +0200
Path: test

test
..
437 You are not allowed to post to trigofacile.test2


That's pretty good!


> Should it accept the message for
> the group without required authentication, and silently drop it for the
> other one?

No!  On no account should you do that.  You have to reject the post.
You should not modify the Newsgroups: header.  And you should not just
post it to one of the two groups.
The user has to check himself what's wrong (maybe he forgot to authenticate
and he will, so you should not silently drop his articles -- the user
has to know what happens to his article).



> Anyway, let's say that the article got his way to both groups. Later, I
> would like to read this article.
> I am connecting to the server (without any authentication) and I send the
> command "ARTICLE <test@test123>". What should be the server's answer?

As you could have seen it in noauth.test.test, you can display it.
ARTICLE will show it.

STAT <test@test123>
223 0 <test@test123> status

In case you had not access to noauth.test.test, it would have been different:

STAT <test@test123>
480 Read access denied for this article


I hope it is clear.


Oh, another thing for your implementation.  For this second test, I had:

% telnet news.trigofacile.com 119
Trying 91.121.26.68...
Connected to news.trigofacile.com.
Escape character is '^]'.
200 news.trigofacile.com InterNetNews NNRP server INN 2.5.0 (20090521 prerelease) ready (no posting)
CAPABILITIES
101 Capability list:
VERSION 2
IMPLEMENTATION INN 2.5.0 (20090521 prerelease)
AUTHINFO USER SASL
HDR
LIST ACTIVE ACTIVE.TIMES DISTRIB.PATS HEADERS NEWSGROUPS OVERVIEW.FMT
NEWNEWS
OVER
READER
SASL GSSAPI OTP PLAIN NTLM LOGIN DIGEST-MD5 CRAM-MD5
STARTTLS
..


Note that the initial greeting is 200 with the comment "no posting" whereas
it was 200 with the comment "posting ok" the first time.
So the initial greeting is *not* as simple as:

IF WriteAccess = 1 THEN
    PRINT "200 " + Banner + CRLF; ' Write access ok
  ELSE
    PRINT "201 " + Banner + CRLF; ' Write access not ok
END IF

We have put in INN the 200 answer for
(the user can post)
  OR
[(the user can authenticate) AND (one authentication block for him will
allow postings)].

-- 
Julien ÉLIE

« Le meilleur moyen de faire tourner la tête à une femme,
  c'est de lui dire qu'elle a un joli profil. » (Sacha Guitry)
Technical Details
Message-ID: <gvtsdb$a4$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: <b12af6-523.ln1@mail.viste-family.net>

Show Full Headers
Complete Article Headers
Message-ID: <gvtsdb$a4$1@news.trigofacile.com>
Subject: Re: Implementation question
Date: Sun, 31 May 2009 14:15:31 +0200
From: Julien ÉLIE <iulius@nom-de-mon-site.com.invalid>
References: <b12af6-523.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: 172
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 1243772139 324 83.114.135.218 (31 May 2009
X-Complaints-To: abuse@trigofacile.com
NNTP-Posting-Date: Sun, 31 May 2009 12:15:39 +0000 (UTC)
In-Reply-To: <b12af6-523.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