🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #91033

200 or 201, when auth enabled?

#91033
From: Adam W.
Date: Mon, 30 Oct 2023 01:46
53 lines
2978 bytes
Hi!

My server currently greets users with:

200 news.chmurka.net InterNetNews NNRP server INN 2.7.0 ready (no posting)

So it's 200, but posting is not allowed. It's because authorization is 
needed before user is able to post.

It seems that Mozilla Thunderbird has several problems with this (it's to 
be confirmed, I think I'll create another port where it greets users with 
201 and experiment; I don't want to break it for other readers). Result is 
that Thunderbird tries to post, gets 480, and doesn't retry with auth, but 
claims that the post has been posted. At least that's what users report, 
combined with what I can see in logs (I didn't test it myself yet).

But is it correct? Should server in this case respond with 200, or with 
201?

I found this in the RFC 3977:

https://datatracker.ietf.org/doc/html/rfc3977#section-5.1.2

But it's still not clear to me -- I just understand that it's a grey area 
(200 is "posting allowed", 201 is "posting not allowed", and there's no 
code for "posting will be allowed after auth") and readers should use 
CAPABILITIES instead.

Looking at nnrpd.c it's clear that this behavior (200 when posting will be 
allowed after auth) is expected:

#v+
Reply("%d %s InterNetNews NNRP server %s ready (%s)\r\n",
      (PERMcanpost || (PERMcanauthenticate && PERMcanpostgreeting))
          ? NNTP_OK_BANNER_POST
          : NNTP_OK_BANNER_NOPOST,
      PERMaccessconf->pathhost, INN_VERSION_STRING,
      (!PERMneedauth && PERMcanpost) ? "posting ok" : "no posting");
#v-

And (perm.c):

#v+
/* We assume that an access or dynamic script will allow
 * the user to post when authenticated, so that a 200 greeting
 * code can be sent. */
if (auth_realms[i]->access_script != NULL
    || auth_realms[i]->dynamic_script != NULL)
    PERMcanpostgreeting = true;
#v-

Did you (other newsadmins) receive similar complaints from Thunderbird 
users?
Technical Details
Message-ID: <uhn1t5$h7f$2$arnold@news.chmurka.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <uhn1t5$h7f$2$arnold@news.chmurka.net>
Subject: 200 or 201, when auth enabled?
Date: Mon, 30 Oct 2023 01:46:13 +0000
From: gof-cut-this-news@cut-this-chmurka.net.invalid (Adam W.)
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!not-for-mail
Newsgroups: news.software.nntp
Organization: news.chmurka.net
Nntp-Posting-Host: s.v.chmurka.net
Injection-Date: Mon, 30 Oct 2023 01:46:13 -0000 (UTC)
Injection-Info: news.chmurka.net; posting-account="arnold"; posting-host="s.v.chmurka.net:172.24.44.20"; logging-data="17647"; mail-complaints-to="abuse-news.(at).chmurka.net"
User-Agent: tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.32-v7+ (armv7l))
Cancel-Lock: sha1:AAn6MB02SyfrDntOw05dY3FdkXo= sha1:8OPQ22fZWvbLKM44ZNRWvcnxk+s= sha256:+qb49WyLpCOzHiUQWssNDdN6javaxaU1Bo8sMvYnzBc= sha1:UzjwHd6x3ASLfl5kxwBTrhYP8AU= sha256:wi0CgAePA4gHc6gmQYtc3ShFoxlJiCF9uJnAZ0cHC0o=