• ctrl/modopts/webmail.ini exec/tests/webmail/api.js config.js download.

    From Rob Swindell (on Debian Linux)@VERT to Git commit to main/sbbs/master on Thursday, November 19, 2026 15:05:47
    https://gitlab.synchro.net/main/sbbs/-/commit/c37c7b02f5fef6bc835974f1
    Added Files:
    ctrl/modopts/webmail.ini exec/tests/webmail/api.js config.js download.js kit.js locale.js session.js shell.js skipif userdata.js webv4.js webmail/lib/api.js config.js download.js locale.js webmail/lib/locale/en_us.ini webmail/lib/session.js shell.js userdata.js webv4.js webmail/mods/README.txt webmail/root/api.ssjs part.ssjs webctrl.ini
    Log Message:
    Web mail client: server side (settings, sessions, strings, API)

    The server half of a web mail client that lives in a new top-level
    webmail/ directory and uses the stock mailbox library for all mail
    logic.

    - ctrl/modopts/webmail.ini: every setting, commented out with its
    default. While the file exists a [webmail] section in modopts.ini is
    not read. webmail/lib/config.js loads the settings, warns about an
    unusable value and uses the default; a bad value can never turn the
    HTTPS requirement off. The product name defaults to "{system}
    Webmail"; {system} is the BBS name and {host} the requested host.
    - webmail/lib/session.js: sign-in sessions, many per user, kept in the
    user's data directory. The cookie's key comes from the system random
    generator and only its SHA-256 is stored. A session without "keep me
    signed in" ends after 2 idle hours or 24 hours; the browser's own
    background requests do not count as activity. Changing the password
    ends every session of that user.
    - webmail/lib/locale.js and locale/en_us.ini: strings in sectioned ini
    files, chosen from the user's language, then the browser's, then the
    sysop's default; an overlay in webmail/mods/locale changes single
    strings.
    - webmail/lib/api.js with root/api.ssjs: one endpoint taking a batch of
    JSON calls. This set signs in and out and reads mail: folders, lists,
    search, a message, and "has anything changed". Every call needs a
    custom request header, HTTPS unless the sysop allows otherwise, and a
    valid session whose user still exists and still has access. Request
    text is checked and normalized as UTF-8. Errors reach the browser as
    a code and a localized fixed text. A message comes with its sender's
    avatar, chosen as the terminal chooses it.
    - webmail/lib/download.js with root/part.ssjs: sends one attachment.
    Only PNG, JPEG, GIF and WebP are ever shown inline; everything else
    is a download, sandboxed and not sniffed.
    - webmail/lib/webv4.js: with webv4_login on, a user signed in to webv4
    on the same host name is signed in here without the form.
    - webmail/lib/shell.js: what the shell page needs (boot data, security
    headers, versioned asset paths).

    Sign-in checks that the account may use web mail before calling the web server's login(), so a refused guest leaves no logon behind.

    Tests are in exec/tests/webmail and use scratch bases and directories.
    The .ssjs pages are covered by their libraries' tests and were
    exercised through a scratch web server on a loopback port. Run on
    Linux only.

    Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

    ---
    þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net