]> 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)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 10 Feb 2023 07:05:50 +0000 (07:05 +0000)
commitdb13586f2eab0c48515fd94c0408b7740ffc19fa
treec8a4b59238106ca8d4821e1a9c6d7195b13ceb2d
parentbbb72c112a588cdee7c597dc49a4e55b74a19ad9
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