It's a non-issue in real world, but according to http://tools.ietf.org/html/rfc2683#page-13 , one shall deal with changed UIDVALIDITY while a mailbox is selected. A completely acceptable fix would be to raise an error and disconnect.
Git commit 41e25fc28527aa528336039fa27fa89ef3d7e32c by Jan Kundrát. Committed on 04/10/2013 at 19:53. Pushed by jkt into branch 'master'. IMAP: detect UIDVALIDITY changes when they happen while a mailbox is already selected No real-world IMAP server shall do this, ever, and expect the clients to work well. That said, clients absolutely have to handle this reasonably. Given that no server is known to do this (apart from an old version which does this at most once for a user for reasons related to delayed mailbox allocation), it seems acceptable to simply disconnect in this case. Yes, it might be possible to reconnect to the mailbox. However, verifying that all pending requests are killed reasonably is too much work for a condition that no Trojita user will ever see, hopefully. REVIEW: 113109 M +22 -0 src/Imap/Tasks/KeepMailboxOpenTask.cpp M +21 -0 tests/Imap/test_Imap_SelectedMailboxUpdates.cpp M +2 -0 tests/Imap/test_Imap_SelectedMailboxUpdates.h http://commits.kde.org/trojita/41e25fc28527aa528336039fa27fa89ef3d7e32c