• exec/tests/msgbase/notify

    From Rob Swindell (on Debian L@VERT to Git commit to main/sbbs/m on Fri Nov 20 15:25:00 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/48f7666bb036aa8c19e00419
    Added Files:
    exec/tests/msgbase/notify/rcpt_list.js rcpt_list_child.inc scratch.inc skipif
    Modified Files:
    src/sbbs3/js_msgbase.cpp postmsg.cpp sbbs.h
    Log Message:
    Notify recipients of mail saved to a recipient list

    MsgBase.save_msg() and save_msg_from_file() given a recipient list stored
    the message with savemsg(), which saw a header with no recipient and so
    skipped its post-save work, then added one header per recipient with smb_addmsghdr(), which does none of it either. So mail saved to a list,
    even a list of one, left no "sent you E-mail" short message for a local recipient and never touched the FidoNet netmail semaphore for a FidoNet recipient (nor a sub-board's semaphores, for a sub saved to a list).

    The semaphore and short-message lines of savemsg() are now a function of
    their own, announce_saved_msg(), unchanged: the same conditions, texts
    and user lookup. savemsg() calls it where it ran those lines, and the
    recipient loop in js_msgbase.cpp calls it after each header it adds, so
    each recipient of a list is handled as a single recipient is. A list
    with several FidoNet recipients touches the semaphore once per
    recipient. The mail server's own recipient loop, which notifies in its
    own way, is unchanged.

    As before, a mail base opened by path is not the configured mail base:
    no short message is left for its recipients.

    New test exec/tests/msgbase/notify/rcpt_list.js saves to the "mail" base
    of a scratch configuration and data directory (below the test jsexec's system.temp_dir, removed afterwards) in a child jsexec, which refuses to
    run unless its data directory is inside the scratch tree. It is skipped
    where /proc is unavailable (the child jsexec is located through it).
    Without the fix the list cases fail: no short message for the recipient
    or the sender, and the semaphore untouched; the single-recipient cases
    pass either way.

    Built and tested with GCC only.

    Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
  • From Rob Swindell (on Debian L@VERT to Git commit to main/sbbs/m on Sat Nov 21 11:03:00 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/4c62ce808f9f03a1a797a82b
    Added Files:
    exec/tests/msgbase/notify/fwd_keep.js fwd_keep_child.inc
    Modified Files:
    docs/v322_new.md exec/load/sbbsdefs.js exec/tests/webmail/api_settings.js src/sbbs3/bulkmail.cpp getmail.c getmail.h mailsrvr.cpp postmsg.cpp sbbsdefs.h sbbsecho.c src/sbbs3/scfg/scfgmsg.c src/sbbs3/un_qwk.cpp un_rep.cpp
    Log Message:
    Forward e-mail to netmail and keep a local copy

    "Allow Forwarding to NetMail" (SCFG Message Options) now offers Yes, No
    and Both. Both keeps today's forwarding (SM_FWDTONET, the user's
    forward setting, a usable address) and also delivers a copy to the
    user's mailbox. The new message option MM_FWDKEEP is bit 0 of the
    message options word: bits 16 and up default to on (a stock msgs.ini
    holds settings=0xffff0000), so a new off-by-default option takes a low
    bit. With it clear, nothing changes.

    One body, two headers, where the forward and the local copy come from
    the same saved message: the SMTP delivery (mailsrvr.cpp), bulk mail (bulkmail.cpp), system notices (notify() in postmsg.cpp) and inbound
    FidoNet netmail (sbbsecho.c). The local copy is a second header,
    indexed to the user, sharing the forwarded message's data; its
    reference is added before the header, so a header never outlives its
    data. New add_fwd_mail_copy() (getmail.c) builds it for the last three.
    The forwarded header is unchanged and still deleted once sent.

    SMTP: the local copy rides in the forwarded recipient's section of the recipient list (a LocalCopy key), so a forwarding recipient still takes
    one slot toward the recipient limit, and the sender's daily count and
    the mail archive go up once. The user gets the normal new-mail notice
    once, not also the "forwarded" notice; SBBSecho does the same.

    Body stored twice: QWK network mail (un_qwk.cpp) and REP packets
    (un_rep.cpp) forward through qwktonetmail(), then import the same
    packet body again as local mail. A REP message that was forwarded is
    counted against its sender and announced once, not again for the local
    copy; when the forward was not made (the sender may not send netmail,
    or the address is bad) the message is kept locally only and that is
    logged. Terminal e-mail (email.cpp) stays
    forward-only when the sender chooses to forward: a local copy there
    would need a second editor session or a change to netmail(), so the
    SCFG help and release note say so.

    Tested: notify() through system.notify(), with the option clear and
    set, by a new jsexec test (exec/tests/msgbase/notify/fwd_keep.js) that
    checks the headers, index records, mailbox count, notice and, with
    chksmb, the data reference counts; a build without the reference
    increment fails it. The whole msgbase test directory passes. SCFG: all
    three values set and saved on a scratch ctrl copy. Only read and
    compiled: mailsrvr.cpp, bulkmail.cpp, sbbsecho.c, un_qwk.cpp,
    un_rep.cpp. Built with GCC only.

    Fixes #593
    Fixes #140

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