From ee0f1caa4e286b92626517b5aca0bd628209c1f3 Mon Sep 17 00:00:00 2001 From: Ken Johnson Date: Sun, 19 Apr 2026 16:16:28 -0700 Subject: [PATCH] mb.kludge: recognise FTS-0004 AREA: envelope in ParseKludgeLine AREA: is the echomail transport envelope -- FTS-0004 puts it at the head of the packet-message body, before any ^A kludges. It has the same no-^A-prefix shape as the FTS-4 trailing control lines (SEEN-BY: / PATH:) the parser already handled. Without this, SplitKludgeBlob would leave AREA: sitting in the "body" output and msgbase writers would store the echomail envelope-tag as the first 12+ characters of the on-disk body. HPT and every other tosser strip AREA: before write since the area tag is implicit in the destination container (JAM directory, Squish basename, SDM directory). Fix: add AREA: to isTrailControl, add 'area' to the dispatch case. The attribute bag now carries area under the 'area' key (same slot 0.5.0 already populates from `MessageBaseOpen`'s area-tag argument on reads), consumers that need the tag read it there. Broke test_uue_hpt_compare when NR's `post -u` path built a body blob starting with "AREA:" and handed it to WriteMessage via SplitKludgeBlob; the envelope leaked through into the JAM body, inflating decoded UUE by the envelope length per section. With the parse fix every consumer now gets a clean body + a populated 'area' attribute. --- src/mb.kludge.pas | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/mb.kludge.pas b/src/mb.kludge.pas index 83d12ac..ab19d00 100644 --- a/src/mb.kludge.pas +++ b/src/mb.kludge.pas @@ -111,7 +111,15 @@ begin if Line = '' then exit; isKludge := Line[1] = #1; upperLine := UpperCase(Line); - isTrailControl := (Pos('SEEN-BY:', upperLine) = 1) or + { FTS-0004: AREA:, SEEN-BY: and PATH: appear without ^A prefix - + AREA: is the echomail transport envelope, the other two are + FTS-4 trailing control lines. All three belong in the attribute + bag so msgbase writers can store the area-tag in the slot that + makes sense for the format (JAM has no area field -- it's + implicit in the directory path -- so the attr is consumed and + dropped from body; Squish / SDM ditto). } + isTrailControl := (Pos('AREA:', upperLine) = 1) or + (Pos('SEEN-BY:', upperLine) = 1) or (Pos('PATH:', upperLine) = 1); if not (isKludge or isTrailControl) then exit; @@ -158,6 +166,7 @@ begin 'seen-by': AppendAttr(A, 'seen-by', value); 'path': AppendAttr(A, 'path', value); 'via': AppendAttr(A, 'via', value); + 'area': A.SetValue('area', value); else AppendAttr(A, 'kludge.' + lower, value); end;