Files
inbuxa-server/crates/imap
jcoffey-dev 82f00b7088 IMAP: stop serving a shared mailbox once the share is revoked
The right to read a shared mailbox was checked only at SELECT. A user
who had another account's mailbox selected kept reading its messages,
flags and counts through FETCH, SEARCH, SORT, THREAD, NOOP and IDLE
for as long as the connection stayed open, after the owner stopped
sharing it.

Commands on a selected mailbox in another account now check the right
to read it first, and get NO [NOPERM] once it's gone; CLOSE and
UNSELECT still work. NOOP and IDLE no longer report changes in a
mailbox that can't be read. Mailboxes in the user's own account are
not checked.

Test: after the owner ran DELETEACL, UID FETCH 1:* (PREVIEW) on the
still-selected mailbox returned the message on main and now gets NO
[NOPERM]; UID SEARCH ALL too.
2026-10-28 17:18:12 -07:00
..