• src/sbbs3/mail.cpp

    From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Thu Jan 9 17:56:28 2025
    https://gitlab.synchro.net/main/sbbs/-/commit/fdac4238e18bc9102ba2583e
    Modified Files:
    src/sbbs3/mail.cpp
    Log Message:
    delallmail() optimization and fix

    Optimization:
    No need to read and re-write headers that already have the DELETE attribute.

    Fix:
    Forced permanent removal of deleted messages (e.g. when creating a new user that's reusing an existing user number), didn't work unless SCFG->Message Options->Purge Delete E-mail was set to "Immediately" (not the default).

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Sat Jan 17 13:49:33 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/c84844023703f488aea9107d
    Modified Files:
    src/sbbs3/mail.cpp
    Log Message:
    The proper check is "did *we* lock the base" not "did *anyone* lock the base"

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Sat Nov 14 11:52:09 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/d91796ec3a2d991b537ff5ac
    Modified Files:
    src/sbbs3/mail.cpp
    Log Message:
    delmail: replace the mail index and status under the header lock

    delmail() relied on the mail.lock file alone and never locked the mail
    base header. The lock file only stops a base from being opened; a
    process that already has it open (a mail server session or its send
    thread) can still add or update a message while the purge reads,
    compacts and rewrites the index. Such a write could be undone by the
    rewrite or, for a newly added message, be truncated off the index, and
    the purge wrote back the status record it read at the start, rolling
    back the last message number.

    The index and status are now read and rewritten under the header lock,
    which every writer takes. The headers and data of the removed messages
    are freed afterward, once nothing indexes them, so the lock is held
    only briefly. If the allocation files can't then be opened, the
    removed messages' blocks are left allocated rather than the purge
    being abandoned.

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

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