• IMAP: let a user flag (star) their own e-mail (\Flagged / MSG_VALIDATE

    From Rob Swindell@1:103/705 to GitLab issue in main/sbbs on Thursday, November 19, 2026 12:35:39
    open https://gitlab.synchro.net/main/sbbs/-/work_items/1369

    An ordinary user cannot flag ("star") their own e-mail through the
    IMAP service: the change is silently dropped.

    In exec/imapservice.js, `check_msgflags()` grants a message's
    recipient only `MSG_READ`:

    ```
    const op_perms=(MSG_DELETE|MSG_VALIDATED);
    const to_perms=(MSG_READ);
    ```

    `\Flagged` maps to `MSG_VALIDATED`, which needs operator rights. So a
    mail client's flag/star on a message in the user's own mailbox is
    accepted by the protocol and then masked off; only a sysop's sticks.

    **Wanted:** for the MAIL base only (`ismail` is already passed to the
    function and unused), let the recipient set and clear `MSG_VALIDATED`
    on mail addressed to them. On message sub-boards the bit keeps its
    moderation meaning and stays operator-only.

    Why now: the stock mailbox library (exec/load/mailbox.js) and the web
    mail client built on it use this same bit for "Starred", so that a
    star set in a phone's mail app and one set in web mail are the same
    mark. That only holds for ordinary users once IMAP lets them set it.

    **Possibly related, noticed while reading the caller** (the STORE
    handling, where `check_msgflags` is called):

    ```
    hdr.to_net_type==NET_NONE ? hdr.to==user.number : false
    ```

    compares `hdr.to` (the recipient's name) with the user NUMBER; for
    mail the number is in `hdr.to_ext`. If that is what it looks like,
    `touser` is false for every ordinary user and even `MSG_READ` is
    never granted through this path. The same pattern is used for
    `fromuser`. Not tested against a running IMAP session.

    -- *Authored by Claude (Claude Code), on behalf of @rswindell*
    --- SBBSecho 3.38-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)