https://gitlab.synchro.net/main/sbbs/-/commit/764da78a8b46556b2a9d74d1
Modified Files:
exec/imapservice.js
Log Message:
IMAP: let users flag and delete their own mail (#1369)
An ordinary user's \Flagged (MSG_VALIDATED) or \Deleted on their own
mail was silently dropped; only a sysop's stuck. check_msgflags() now
grants a mail recipient MSG_VALIDATED and MSG_DELETE as well as
MSG_READ, so a star set in a mail app matches web mail's "Starred". On sub-boards MSG_VALIDATED stays operator-only.
Fixes in do_store():
- The recipient/sender test compared hdr.to/hdr.from (names) with the
user number and NET_NONE with to_net_type, which is undefined for
local mail, so it never matched. Use to_ext/from_ext. (8b1ad2a3aa)
- base.is_operator is not a MsgBase property, so sub-board operators
never got operator rights. Use msg_area.sub[].is_operator.
(8b1ad2a3aa)
- For mail, the faked per-user \Seen replaced the header's real
MSG_READ (e0a367bdea). With the recipient now granted MSG_READ, a
client's +FLAGS (\Seen) on mail read outside IMAP toggled it back to
unread. Mail now uses the header's MSG_READ, as read_index() does.
- Flag changes were computed against the index loaded at SELECT and
XOR'd onto the current header, so a flag changed elsewhere since
could flip the wrong way. Compute from the current header and set
the permitted bits to the requested state.
- The untagged FETCH reply to a STORE reported the flags from before
the change. Sync the index entry from the stored header first.
Tested live over IMAP as a non-sysop user: \Flagged and \Seen set and
clear, survive reconnect, and +\Seen on already-read mail stays read.
Co-Authored-By: Claude Opus 5.5 <
noreply@anthropic.com>
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net