• SAUCE record in posted/imported message bodies displays as garbage

    From Rob Swindell@VERT to GitLab issue in main/sbbs on Fri Oct 16 16:01:57 2026
    open https://gitlab.synchro.net/main/sbbs/-/work_items/1285

    ## Problem

    A SAUCE record appended to an ANSI art file ends up in the body of a message posted from that file, and the built-in message reader displays it as garbage at the end of the message.

    Example: DOVE-Net Ads (`DOVE-ADS`) "[ANSI] FuNToPiA BBS" from Mindsurfer, 2026-10-16, imported via QWK from FUNTOPIA (3.22a-Win32). The end of the body:

    ```
    ...ESC[0m CRLF CRLF
    -- 20261016_113201
    1A "SAUCE00" + spaces (blank Title/Author/Group) + "20260609" + 2A 61
    CRLF ^An CRLF
    --- CRLF * Synchronet * FuNToPiA BBS - telnet://funtopia...
    ```

    The reader shows a CP437 right-arrow glyph (the Ctrl-Z), `SAUCE00`, a run of spaces, the SAUCE date and `*a`, then the tagline.

    ### Why

    1. Nothing removes the SAUCE trailer (Ctrl-Z EOF + optional `COMNT` block +
    128-byte `SAUCE00` record) when a file becomes a message body.
    2. The record gets truncated at its first NUL byte. SAUCE FileSize is a
    little-endian 32-bit value (here `2A 61 00 00` = 24,874), and message
    bodies are C strings: `smb_addmsg()` takes the body length with `strlen()`
    (`smbadd.c`), and `postmsg.cpp`, `postmsg.js`/`save_msg()` and smbutil
    import all end up there. So DataType, FileType, TInfo, TFlags etc. are lost,
    while the printable leading fields survive.
    3. The message reader does not stop at Ctrl-Z. Display *files* do:
    `prntfile.cpp` detects SAUCE with `sauce_fread_charinfo()` and sets
    `P_CPM_EOF`, which `putmsg()` honors. Message bodies never take that path,
    and setting `P_CPM_EOF` for them would cut off the tagline/origin that
    follows the Ctrl-Z.

    How the originating message was posted (`/UPLOAD` into the internal editor, ZMODEM upload in fseditor.js, `postmsg.js`, `smbutil i`, ...) can't be determined from our copy: every path truncates at the NUL the same way, and FUNTOPIA's REP packets have never included HEADERS.DAT, so its `editor`, `columns`, Message-ID, time zone etc. never arrived. (chksetup.js now warns about that hub misconfiguration.)

    ## Why not just truncate at the first Ctrl-Z?

    Because Synchronet itself produces legitimate 0x1A bytes in message text.
    CP437 0x1A is the glyph for U+2192 RIGHTWARDS ARROW (`xpdev/unicode.c`), and `unicode_to_cp437()` reverse-maps it, so `utf8_to_cp437_inplace()` turns every right arrow into 0x1A. Verified: `utf8_decode()` of a UTF-8 "a, arrow, b" string yields `"a\u001ab"`. That conversion is applied to message text in:

    - `msgtoqwk.cpp`: UTF-8 messages exported to non-UTF-8 QWK hubs/users
    - `sbbsecho.c`: FidoNet export to non-UTF-8 links
    - `writemsg.cpp`: quoting/editing a UTF-8 message in a CP437 editor
    - `mailsrvr.cpp`

    Right arrows are common in modern text (Markdown, LLM-written posts), so a receiving system that truncated at Ctrl-Z would lose everything after the
    first arrow, including the tagline/origin. (UTF-8 itself is safe either way: 0x1A is never part of a multi-byte sequence.)

    ## Proposed solution

    Strip SAUCE specifically: a Ctrl-Z followed by `COMNT` or `SAUCE00`, through the end of the record. Leave other 0x1A bytes alone. One shared helper
    (e.g. `strip_sauce()`), handling both the intact and the truncated form, used at three points:

    1. **Where an uploaded/edited file is read in, before anything is appended.**
    writemsg after the editor or `/UPLOAD`, `postmsg.js`/`MsgBase.save_msg()`,
    smbutil import. The record is still intact here (the NUL truncation only
    happens later at `smb_addmsg()`). This must happen *before* writemsg
    appends the user's signature and tag file, or they'd be lost too. Here the
    SAUCE can also be put to use rather than discarded: `sauce_fread_charinfo()`
    already exists, and its width could populate the message's `SMB_COLUMNS`
    header field (e.g. for 132-column art).
    2. **QWK and FidoNet import** (`qwktomsg`, SBBSecho). Messages from systems
    without the fix arrive with the already-truncated form: Ctrl-Z + `SAUCE00`
    + whatever preceded the first NUL, followed by the exporter's newline and
    tagline. Stripping here must stop at the 128-byte record length or the
    line end, whichever comes first, so the tagline survives. (A FileSize
    byte of 0x0D/0x0A would end the line early; a small risk.)
    3. **The message reader**, as a display-time fallback, to clean up messages
    already stored in message bases, including the example above.

    -- *Authored by Claude (Claude Code), on behalf of @rswindell*
    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From Accession@VERT/PHARCYDE to Rob Swindell on Fri Oct 16 21:05:40 2026
    Hey Rob!

    On Fri, Oct 16 2026 16:01:56 -0700, you wrote:

    1. Nothing removes the SAUCE trailer (Ctrl-Z EOF + optional `COMNT` block + 128-byte `SAUCE00` record) when a file becomes a message body.

    I'm sure you're well aware, but SAUCE was created for ANSI /viewers/ specifically (at the time) ACiDView. Other viewers of course adopted the same. Nobody should be posting BBS ads to a BBS with SAUCE, but I imagine these days they probably don't know any better. ;(

    I blame Pablodraw (and then probably future drawing programs that followed suit). At some point the guy decided to add SAUCE to saved ANSI by default, whereas you used to have to include it manually yourself (since it was, and ultimately still is for a specific purpose).

    Eh well..

    Either way, this would be a nice feature for Synchronet (stripping it)!

    Regards,
    Accession

    ... He who laughs last, thinks slowest.
    --- AmberEdit/linux 0.9.3
    * Origin: thePharcyde_ telnet://bbs.pharcyde.org (Wisconsin) (723:1/1)
    þ Synchronet þ _thePharcyde telnet://bbs.pharcyde.org (Wisconsin)
  • From phigan@VERT/TACOPRON to Rob Swindell on Sat Oct 17 08:51:56 2026
    Re: SAUCE record in posted/imported message bodies displays as garbage
    By: Rob Swindell to GitLab issue in main/sbbs on Fri Oct 16 2026 04:01 pm

    A SAUCE record appended to an ANSI art file ends up in the body of a messag posted from that file, and the built-in message reader displays it as garba at the end of the message.

    I say the fix should be the poster saving without SAUCE info. Having SBBS
    strip it out risks future issues. Just an opinion, though.

    Man I hate that sauce junk.

    ---
    þ Synchronet þ TIRED of waiting 2 hours for a taco? GO TO TACOPRONTO.bbs.io
  • From Digital Man@VERT to phigan on Sat Oct 17 13:53:34 2026
    Re: SAUCE record in posted/imported message bodies displays as garbage
    By: phigan to Rob Swindell on Sat Oct 17 2026 08:51 am

    Re: SAUCE record in posted/imported message bodies displays as garbage
    By: Rob Swindell to GitLab issue in main/sbbs on Fri Oct 16 2026 04:01 pm

    A SAUCE record appended to an ANSI art file ends up in the body of a messag posted from that file, and the built-in message reader displays it as garba at the end of the message.

    I say the fix should be the poster saving without SAUCE info. Having SBBS strip it out risks future issues. Just an opinion, though.

    Man I hate that sauce junk.

    I actually like the SAUCE idea and its capabilities and we use it for Synchronet avatars and other cool/invisible features in Synchronet where knowing or importing meta data about ANSI/block art files is useful.
    --
    digital man (rob)

    Rush quote #28:
    The future pre-decided, detached and subdivided in the mass production zone Norco, CA WX: 86.9øF, 21.0% humidity, 2 mph WSW wind, 0.00 inches rain/24hrs ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net
  • From phigan@VERT/TACOPRON to Digital Man on Sat Oct 17 15:10:26 2026
    Re: SAUCE record in posted/imported message bodies displays as garbage
    By: Digital Man to phigan on Sat Oct 17 2026 01:53 pm

    I actually like the SAUCE idea and its capabilities and we use it for Synchronet avatars and other cool/invisible features in Synchronet where knowing or importing meta data about ANSI/block art files is useful.

    I could see that, but it has no place in artwork you're displaying to the public. Why the heck is it on by default and does it feel almost forced? You have to jump through hoops to get rid of it. If you're incrementaly saving with command keys, most programs add it back in.

    ---
    þ Synchronet þ TIRED of waiting 2 hours for a taco? GO TO TACOPRONTO.bbs.io
  • From kk4qbn@VERT/KK4QBN to Digital Man on Sat Oct 17 18:17:03 2026
    Re: SAUCE record in posted/imported message bodies displays as garbage
    By: Digital Man to phigan on Sat Oct 17 2026 13:53:34


    I actually like the SAUCE idea and its capabilities and we use it for Synchronet avatars and other cool/invisible features in Synchronet where knowing or importing meta data about ANSI/block art files is useful.

    Yes, and it comes it very handy when pulling up multiple files like, example the randomXX.msg files i have located in the text/menu directory I have descriptions of all the files written in the sauce field and when listing them in SyncDraw, I'm able to see what each file contains without having to open each individual one of my 45 or so random files..

    So yes.. Very convenient..




    Tim (kk4qbn)

    ---
    þ Synchronet þ kk4qbn bbs: Northwest GA, telnet/www kk4qbn.synchro.net
  • From Digital Man@VERT to phigan on Sat Oct 17 19:14:51 2026
    Re: SAUCE record in posted/imported message bodies displays as garbage
    By: phigan to Digital Man on Sat Oct 17 2026 03:10 pm

    Re: SAUCE record in posted/imported message bodies displays as garbage
    By: Digital Man to phigan on Sat Oct 17 2026 01:53 pm

    I actually like the SAUCE idea and its capabilities and we use it for Synchronet avatars and other cool/invisible features in Synchronet where knowing or importing meta data about ANSI/block art files is useful.

    I could see that, but it has no place in artwork you're displaying to the public.

    Why not? I think the web-sites and other places that index the art files can (and do) use the meta data to help with searches and organization. Synchcronet, for example, uses the SAUCE record from the DIZ of uploaded files to populate details about the author/group of the archive being uploaded.

    Why the heck is it on by default and does it feel almost forced?

    Well it's *supposed* to be invisible (e.g. if you "type" the file from a command prompt) - but that's really a non-universal CPM/DOSism (the Ctrl-Z character is treated as an EOF marker that terminates the file).

    You
    have to jump through hoops to get rid of it. If you're incrementaly saving with command keys, most programs add it back in.

    I agree that editors should make the addition of SAUCE optional, but it *is* a useful feature and I don't have an issue with it defaulting on.
    --
    digital man (rob)

    Steven Wright quote #3:
    Half the people you know are below average.
    Norco, CA WX: 77.4øF, 27.0% humidity, 0 mph ESE wind, 0.00 inches rain/24hrs ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net