πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #53

Re: [NeReO] 1.5

#53
From: De ongekruisigde ds.
Date: Sat, 17 Oct 2026 21:29
110 lines
5804 bytes
On 2026-10-12, MCSM <despammed@mcsm.anonaddy.me> wrote:
> https://sourceforge.net/projects/nereo/files/1.5/
>
> This is the start of the β€œstable” version...
>
> But for now, I'm putting the project on hold for a while.
>
> I'm only accepting feedback on potential bug fixes in this thread
> MTIA

OUTBOUND References header on deep threads

THE SYMPTOM

Replying to a deep thread fails at post time with something like
"too many references / header too big / server refuses the article."
The example that triggered this was a post in nl.politiek whose
References field carried 27 message-ids (see the reference id below).
The reply never went out; the user worked around it via Thunderbird.

WHY IT HAPPENS (in this code)

1. When you open a reply, the draft is built at
   ui/screens/ComposeScreen.kt:217:

       referencesHeader = (p.references + " " + p.messageId).trim()

   i.e. the parent's whole References list plus the parent's own
   Message-ID. That draft value is stored at ComposeScreen.kt:335
   (references = referencesHeader.orEmpty()) and handed to the sender
   at ComposeScreen.kt:439.

2. The draft value is emitted as-is at data/Repository.kt:2807:

       referencesHeader?.takeIf { it.isNotBlank() }?.let {
           add("References: ${unaRiga(it)}")
       }

   unaRiga only swaps CR/LF and trims the ends. It does NOT cap the
   number of message-ids and does NOT fold the field. So the full
   parent chain is sent verbatim.

3. Because the parent's References already ends with the parent's own
   Message-ID, appending p.messageId again produces a duplicate
   trailing id. In the example the parent carried 27 ids ending in
   <11a5h73$2t7tn$1@dont-email.me>; the reply became 28 ids, the last
   two identical, ~1.4 KB on one line. The server rejects it.

WHAT THE RFCS SAY

RFC 5537, section 3.4.4 (Construction of the References Header Field):

  "The content of the new article's References header field MUST be
   formed from the content of the parent's References header field if
   present, followed by the content of the Message-ID header field of
   the parent. ... If the resulting References header field would, after
   unfolding, exceed 998 characters in length (including its field name
   but not the final CRLF), it MUST be trimmed (and otherwise MAY be
   trimmed). Trimming means removing any number of message identifiers
   from its content, except that the first message identifier and the
   last two MUST NOT be removed."

RFC 5536, section 2.2:

  "Compliant software MUST NOT generate (but MAY accept) header field
   lines of more than 998 octets. This is the only limit on the length
   of a header field line prescribed by this standard."

So: keep the first id (root) and at least the last two (direct parent
and its parent), drop everything in between, and never let the field
exceed 998 octets unfolded. Keeping a few more than the last two is
allowed (it is a superset of the requirement) and helps threading
survive central pruning (RFC 5536 section 3.4).

THE FIX (proposed)

Apply a bounded, deduped trim on the outbound References, at the single
choke point Repository.kt:2807 (covers reply, supersede, crosspost and
draft-resume, so the draft and the post cannot drift):

  1. Build the candidate as parent.References + parent.Message-ID.
  2. De-duplicate consecutive / repeated ids so the trailing parent id
     is not sent twice.
  3. If the unfolded length exceeds 998 octets, trim to first + last N
     (N = 2 is the RFC minimum; 4-8 is a safe, allowed superset).

Reuse Threader.idNelleReferences (thread/Threader.kt:91, MAX_REFERENCES)
or an equivalent first+last-N cut so the cap is defined in one place.
Consider also bounding filter/FollowupPropagator.kt:56 (parseReferences),
which currently passes the raw, uncapped id list along the same line.

This keeps the reply threaded on the root and the direct parent, well
under any server's header limit, and matches what RFC 5537 3.4.4 and
Thunderbird actually do.

REFERENCE MESSAGE (the post that failed to reply to)

  Newsgroups: nl.politiek
  References: <... 27 message-ids ...>
  Last / own Message-ID of that post:

      <11a5h73$2t7tn$1@dont-email.me>

Replying to it produced a 28-id References with a duplicated final id
and was refused by the server.


-- 
I am a disgrace to all possible and impossible universes and all
that is not a universe. -- Gemini AI
Technical Details
Message-ID: <11b0pcb$k507$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <mn.64c87eaa2b399585.0@mcsm.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: "De ongekruisigde ds." <ongekruisigde-ds@invalid.invalid>
Newsgroups: news.software.readers
Subject: Re: [NeReO] 1.5
Date: Sat, 17 Oct 2026 21:29:47 -0000 (UTC)
Organization: Ongekruisigden
Lines: 110
Message-ID: <11b0pcb$k507$1@dont-email.me>
References: <mn.64c87eaa2b399585.0@mcsm.org>
Reply-To: ongekruisigde-ds@invalid.invalid
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sat, 17 Oct 2026 21:29:48 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="660487"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/N2iBONQ22uizl7wl9Q815Y9gBiNoU6OXFe8ReSNLFtg=="; posting-host="557bb94a4e0bb3abde371062fb6ee701"
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:bbmyxWzdd06IMRQTy4IsZWvoT/4= sha256:CHQVUkFDdLIskf8AZbI3RtA8ikojWUvqxINwneDwVcI=
	sha1:9b8cP7g39XMlrxSixYi1t/AkNKo= sha256:xNttYP5bI4mkfmYdKdjbQj9Xw7T8Efg+b4xTVWXw2UY=
Content-Language: nl
X-Operating-System: NixOS