πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #92373

Re: INN laxmid clarification

#92373
From: Jesse Rehmer
Date: Sat, 30 Aug 2025 17:26
92 lines
5194 bytes
On Aug 30, 2025 at 10:50:12β€―AM CDT, "Julien Γ‰LIE"
<iulius@nom-de-mon-site.com.invalid> wrote:

> Hi Jesse,
> 
>>> laxmid would accept for innd:
>>> 
>>> dot-atom-text   =   1*(atext / "." / "@")
>>> 
>>> At least, I think it would cope with all Message-IDs in the wild.
>>> 
>>> As for nnrpd, laxmid would go on having the current behaviour of
>>> allowing ".." and two "@" as this was a request in 2017 from a news
>>> admin with users having broken posting agents sending such Message-IDs.
>>> No need for now to allow the injection of even more broken Message-IDs.
>>> 
>>> Any thoughts about that change?
>> 
>> Bringing this up again because I have found BNews Message-IDs cannot be
>> injected without modification, and there are a ton of them from various
>> sources I'd rather not attempt to modify. Once source is online via NNTP, so
>> easy to use pullnews or suck, which would be the path of least resistance.
>> 
>>   <bnews.sri-unix.2509> - 435 Syntax error in message-ID
> 
> Sorry for having forgotten your request. I bet I was waiting for your approval
> of my suggestion of change (innd would accept 0 to 2 '@', but not nnrpd whose
> behaviour would remain unchanged) before starting to work on it.
> 
> I think the following patch will work:
> 
> --- a/lib/messageid.c
> +++ b/lib/messageid.c
> @@ -127,8 +127,8 @@ InitializeMessageIDcclass(void)
>   **  When stripspaces is true, whitespace at the beginning and at the end
>   **  of MessageID are discarded.
>   **
> -**  When laxsyntax is true, '@' can occur twice in MessageID, and '..' is
> -**  also accepted in the left part of MessageID.
> +**  When laxsyntax is true, '@' can occur twice in MessageID, or never occur,
> +**  and '..' is also accepted in the left part of MessageID.
>   */
>   bool
>   IsValidMessageID(const char *MessageID, bool stripspaces, bool laxsyntax)
> @@ -155,6 +155,12 @@ IsValidMessageID(const char *MessageID, bool stripspaces,
> bool laxsyntax)
>      /* Scan local-part: "<dot-atom-text". */>      if (*p++ != '<')>        
>   return false;
> +
> +    /* In case there's no '@' in the Message-ID and laxsyntax is set, just
> +     * check the syntax of the Message-ID as though it had no left part. */
> +    if (laxsyntax && strchr((const char *) p, '@') == NULL)
> +        return IsValidRightPartMessageID((const char *) p, stripspaces, true);
> +
>       for (;; p++) {
>           if (midatomchar(*p)) {
>               while (midatomchar(*++p))
> 
> 
> 
> 
> --- a/nnrpd/post.c
> +++ b/nnrpd/post.c
> @@ -471,6 +471,10 @@ ProcessHeaders(char *idbuff, bool needmoderation)
>       if (!IsValidMessageID(HDR(HDR__MESSAGEID), true, laxmid)) {
>           return "Can't parse Message-ID header field body";
>       }
> +    /* Do not accept a Message-ID without an '@', even if laxmid is set. */
> +    if (laxmid && strchr(HDR(HDR__MESSAGEID), '@') == NULL) {
> +        return "Missing @ in Message-ID header field body";
> +    }
> 
>       /* Set the Path header field. */
>       if (HDR(HDR__PATH) == NULL || PERMaccessconf->strippath) {
> 
> 
> 
> 
> If you can confirm it suits your need, and you are now able to inject BNews
> articles downloaded by pullnews, it would be great.
> 
> I'll also add a note in the documentation to warn that when laxmid is set,
> remote peers may reject articles with a syntactically invalid Message-ID.

This does get past the Message-ID header issue, but presents a new one with
the Date header.

  437 Bad "Date" header field -- "Fri Jul 9 03:46:46 1982"

I was looking at lib/date.c but it's a bit complex for me to digest. I see
references in comments to "lax mode" and not sure if this is an undocumented
option or maybe removed in the past?
Technical Details
Message-ID: <108vc8u$nji$1@nnrp.usenet.blueworldhosting.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.pugleaf.net!ygg-srv.newsdeef.eu!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!nnrp.usenet.blueworldhosting.com!.POSTED!not-for-mail
References: <u90srm$2mhb$1@nnrp.usenet.blueworldhosting.com> <ua59ms$cqti$1@news.trigofacile.com> <108u6vi$1nhp$1@nnrp.usenet.blueworldhosting.com> <108v6jk$vqr6$1@news.trigofacile.com>

Show Full Headers
Complete Article Headers
Message-ID: <108vc8u$nji$1@nnrp.usenet.blueworldhosting.com>
Subject: Re: INN laxmid clarification
Date: Sat, 30 Aug 2025 17:26:54 +0000
From: Jesse Rehmer <jesse.rehmer@blueworldhosting.com>
References: <u90srm$2mhb$1@nnrp.usenet.blueworldhosting.com> <ua59ms$cqti$1@news.trigofacile.com> <108u6vi$1nhp$1@nnrp.usenet.blueworldhosting.com> <108v6jk$vqr6$1@news.trigofacile.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.pugleaf.net!ygg-srv.newsdeef.eu!srv.newsdeef.eu!weretis.net!feeder9.news.weretis.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!nnrp.usenet.blueworldhosting.com!.POSTED!not-for-mail
Newsgroups: news.software.nntp
Organization: BWH Usenet Archive (https://usenet.blueworldhosting.com)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=fixed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 30 Aug 2025 17:26:54 -0000 (UTC)
Injection-Info: nnrp.usenet.blueworldhosting.com;
 logging-data="24178"; mail-complaints-to="usenet@blueworldhosting.com"
User-Agent: Usenapp for MacOS
Cancel-Lock: sha1:pC/x9NZAyIOgVfYeXNZ7x897CZk= sha256:ZibBm/Bbkt/5zSNRhvLrXvPRR4A+K4wNleB2yl0J8Gk=
 sha1:K5PYOMKDmk7HH/wczZfaWer2SKQ= sha256:KYcrkh7E643jybtskt1aXLlS7qFeSPo2hSICxj9wtXg=
X-Usenapp: v1.27.4/d - Full License