Article View: news.software.nntp
Article #92372Re: INN laxmid clarification
From: Julien ÉLIE
Date: Sat, 30 Aug 2025 15:50
Date: Sat, 30 Aug 2025 15:50
82 lines
4639 bytes
4639 bytes
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.
--
Julien ÉLIE
« – C'est une bonne situation ça, scribe ?
– Oh, c'est une situation assise. » (Astérix)
Technical Details
Message-ID:
<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-srl.newsdeef.eu!srl.newsdeef.eu!weretis.net!feeder8.news.weretis.net!news.trigofacile.com!.POSTED.2001:861:3f81:7990:cb9:b40f:f4da:eae8!not-for-mailReferences:
<u90srm$2mhb$1@nnrp.usenet.blueworldhosting.com> <ua59ms$cqti$1@news.trigofacile.com> <108u6vi$1nhp$1@nnrp.usenet.blueworldhosting.com>Show Full Headers
Complete Article Headers
Message-ID: <108v6jk$vqr6$1@news.trigofacile.com> Subject: Re: INN laxmid clarification Date: Sat, 30 Aug 2025 17:50:12 +0200 From: Julien ÉLIE <iulius@nom-de-mon-site.com.invalid> References: <u90srm$2mhb$1@nnrp.usenet.blueworldhosting.com> <ua59ms$cqti$1@news.trigofacile.com> <108u6vi$1nhp$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-srl.newsdeef.eu!srl.newsdeef.eu!weretis.net!feeder8.news.weretis.net!news.trigofacile.com!.POSTED.2001:861:3f81:7990:cb9:b40f:f4da:eae8!not-for-mail Newsgroups: news.software.nntp Organization: Groupes francophones par TrigoFACILE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sat, 30 Aug 2025 15:50:12 -0000 (UTC) Injection-Info: news.trigofacile.com; posting-account="julien"; posting-host="2001:861:3f81:7990:cb9:b40f:f4da:eae8"; logging-data="1043302"; mail-complaints-to="abuse@trigofacile.com" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:DutWGH2lHNuPQTmGuZ1LhCBn3qs= sha256:Qsj5Qz+qnI7bJBr0Ogoxu01/AOx2zNi9V0M473vtArw= In-Reply-To: <108u6vi$1nhp$1@nnrp.usenet.blueworldhosting.com>