Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imapd: don't auto-expunge if replicaonly #5164

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

brong
Copy link
Member

@brong brong commented Dec 10, 2024

This came up where a test script was logging into a replica and SELECTing the INBOX. If there was a DELETED message that wasn't expunged, then it would try to write quote while expunging on the replica, and fail an assert.

This simplifies the code by putting it in a function.

@brong brong requested a review from wolfsage December 10, 2024 02:04
@@ -5004,10 +5009,13 @@ static void cmd_close(char *tag, char *cmd)
}

/* local mailbox */
if ((cmd[0] == 'C' || config_getswitch(IMAPOPT_AUTOEXPUNGE)) && index_hasrights(imapd_index, ACL_EXPUNGE)) {
if (cmd[0] == 'C') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like a mistake - now we'll call index_expunge(imapd_index, NULL, 1) on close without checking if they have EXPUNGE rights, when before we'd check

If I open two ctel sessions, and do x SELECT INBOX and then x STORE 1 +Flags \Deleted in one, and then in the other I do x EXAMINE INBOX and x CLOSE, imapd crashes with:

2024-12-10T10:02:19.351166-05:00 box-fastmail-01 (err) slotf1n01/imapadmin[3149412]:  Internal error: assertion failed (aborting): imap/mailbox.c: 4516: mailbox_index_islocked(mailbox, 1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants