]> git.ipfire.org Git - thirdparty/dovecot/core.git/commit
lib-storage: Don't allow removing \Recent flags with mail_update_flags()
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 18 Jul 2017 09:39:44 +0000 (12:39 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 18 Jul 2017 09:39:44 +0000 (12:39 +0300)
commite1c762cb4c9cce5e7677ad1906ead2a951403ddf
tree4cc592e584dc7b4176360bbe95d1ea0132572166
parente12a822e72e86d1b28196790323220dcb1c42430
lib-storage: Don't allow removing \Recent flags with mail_update_flags()

Reverts an ancient commit 7deb24e7453249d09741641bff0f269f68165033. I don't
know why it was added in the first place. Normally \Recent flags are
removed during sync with MAIL_INDEX_SYNC_FLAG_DROP_RECENT. This should be
enough, especially since it's not even possible to remove a single \Recent
flag - only update the first_recent_uid.

The code was also wrong: It was dropping \Recent flags even when
modify_type/flags combination didn't ask for it. Even if this was fixed,
there would still be race conditions with multiple processes since this
update is done without locking.

Fixes:
Error: Recent flags state corrupted for mailbox
src/lib-storage/index/index-mail.c