]> git.ipfire.org Git - thirdparty/dovecot/core.git/commit
imapc: Don't process untagged replies in mailbox that isn't fully selected yet
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 9 Feb 2023 14:12:35 +0000 (16:12 +0200)
committerMarkus Valentin <markus.valentin@open-xchange.com>
Mon, 13 Feb 2023 11:39:34 +0000 (12:39 +0100)
commita11c232854aaf8e658c347ea9d9008ccd231845c
treede6cab4e27e1508159529ad57e93a4cb3e72a8ec
parentcf7d19e729578a2d8820bebae8bfb62b3b913b30
imapc: Don't process untagged replies in mailbox that isn't fully selected yet

For example if the communication was:

C: a SELECT box1
...
C: b SELECT box2
S: * 1 EXPUNGE
S: * 1 EXISTS
S: * OK [UIDVALIDITY 1675948459] UIDs valid
S: ...
S: b OK

The expunge was intended for box1, not box2. This caused:
Warning: imapc(...): Mailbox '...' state corrupted: EXPUNGE received for empty mailbox - reconnecting

Fixed this by ignoring untagged EXPUNGE, FETCH, SEARCH and ESEARCH replies
when the UIDVALIDITY reply hasn't been yet received for a mailbox.
src/lib-storage/index/imapc/imapc-mailbox.c
src/lib-storage/index/imapc/imapc-storage.h