• src/sbbs3/mailsrvr.cpp

    From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Tue Aug 18 22:04:59 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/126ed841933b774477b5c1b1
    Modified Files:
    src/sbbs3/mailsrvr.cpp
    Log Message:
    mailsrvr: name the rejected address in the sender-auth 550 replies

    The 550 reply for an unauthorized MAIL FROM or From: address named only the address to use instead, never the address that was rejected. The submitter
    is left to guess which of the settings in their mail client the server is objecting to, and only the server log records it -- which the submitter
    cannot read.

    Seen on Vertrauen: "550 Sender address not authorized for this account, try <PHARCYDE@vert.synchro.net>" was read as a statement about the server
    hostname the client had connected to, and answered with a question about
    which hostname to use, when the setting at fault was the sender address.

    Grow from_errmsg to 512 bytes: the header 'FROM' message now formats two addresses of up to 127 characters each, which 256 bytes could truncate.

    Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
    --- SBBSecho 3.37-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Wed Sep 30 19:08:47 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/c6c715a40a2556421292cdc8
    Modified Files:
    src/sbbs3/mailsrvr.cpp
    Log Message:
    Mail Server: don't log POP3 passwords or SMTP AUTH credentials

    Fixes #1267

    With the receive/response debug options on, the mail server logged the
    POP3 PASS line, the SMTP AUTH LOGIN username and password responses, the
    AUTH PLAIN response (all base64, trivially decoded), and the AUTH PLAIN
    initial response on the command line was logged at LOG_DEBUG regardless of options. The "!Bad AUTH ..." notices logged the raw argument at NOTICE
    level. Anyone who could read the log could recover every password used to authenticate to the server.

    Redact those lines unless the sysop has set the "Echo Passwords Locally"
    system option (SM_ECHO_PW), the way the password-failure messages already
    honor it: a received command line is logged through loggable_line(), which replaces a POP3 password or an AUTH initial response with a placeholder,
    and a line that is nothing but credentials (an AUTH response) is logged as "<credentials>".

    Verified on a scratch mail server with the debug options on: POP3 USER/PASS, AUTH PLAIN (initial response and challenge forms), AUTH LOGIN and a
    malformed AUTH LOGIN argument all authenticate or fail as before, and the
    log holds no trace of the password in clear or base64; with SM_ECHO_PW set
    the lines are logged in full, as before.

    Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
    --- SBBSecho 3.38-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Tue Oct 13 23:29:30 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/d4f33e47976414b619032701
    Modified Files:
    src/sbbs3/mailsrvr.cpp
    Log Message:
    mailsrvr: stop sending the message after a body line fails to send

    When a send failed partway through the message body, sockmimetext()
    broke out of the body loop but still went on to MIME-encode any
    attachments and send the "." end-of-data terminator over the dead
    connection. With DKIM signing enabled, that terminator finalized the
    verify pass's body hash over the truncated body, so every dropped
    connection mid-DATA was also logged as the error "DKIM body hash changed between sign and send - message delivery aborted", though nothing had
    changed and the delivery had already failed.

    Return as soon as a body line fails to send, as is already done when the
    header terminator fails.

    Fixes #1279

    Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
    --- SBBSecho 3.38-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Tue Oct 13 23:29:30 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/1728d248fb27d5d1cf0737e9
    Modified Files:
    src/sbbs3/mailsrvr.cpp
    Log Message:
    mailsrvr: POP3 LIST/UIDL skips unreadable messages instead of stopping

    In the POP3 LIST and UIDL (all messages) loop, a failure to read a
    message's index entry, lock its header, or read its header ended the
    listing early. Every message after the bad one was then missing from
    the client's view of the mailbox. Skip just the bad message instead:
    the error is still logged, and the other messages keep their POP3
    numbers, so RETR and DELE still work on them. A failed socket write
    still ends the loop.

    Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
    --- SBBSecho 3.38-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Windows 11)@1:103/705 to Git commit to main/sbbs/master on Mon Oct 26 00:05:59 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/dd868cf96f01d669158e480b
    Modified Files:
    src/sbbs3/mailsrvr.cpp
    Log Message:
    Mail server: keep the mailproc script's callback struct alive with its context

    Fixes a crash in sbbs.dll (remove_js_socket_event) when an SMTP client
    thread ends.

    b43e1c8256 (2009-01-14) made js_mailproc() reuse one JS runtime, context
    and global object per SMTP client thread, created on the first mailproc
    and destroyed only when the thread ends, but left its js_callback_t as a
    local of js_mailproc(). The "js" object and the client.socket Socket
    object created in that persistent global recorded a pointer to the local,
    which was gone as soon as the first js_mailproc() call returned.

    Nothing followed that stale pointer after the call until 85e04a4262 (2026-09-30) made every Socket object remember its script's callback
    struct at creation and consult it when closed. From then on, destroying
    the context at thread end finalized client.socket, do_js_close() walked
    the event list of a js_callback_t that was a dead stack frame, and the
    mail server crashed with an access violation.

    Move the js_callback_t to smtp_client_thread(), beside the runtime,
    context and global, and pass it to js_mailproc(). It is still zeroed and
    given the logger on each invocation, as before.

    Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
    --- SBBSecho 3.38-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)