[Dovecot] dsync-2.2.2 incorrectly synchronizes subscription status of deleted mailbox
Hi,
It seems that dsync-2.2.2 doesn't correctly synchronize subscription status of a deleted mailbox. The situation is as follows.
There are two servers: A and B, and a test user test_mdbox. Mailboxes (mdbox) of this user on both servers are synchronized. Specifically on both of them there is a Trash/x mailbox. Replication plugin is disabled.
I delete Thrash/x mailbox on A with Thunderbird. The relevant IMAP commands issued are:
71 87.068176 10.4.0.13 10.1.107.144 IMAP Request: 9 delete "Trash/x" 72 87.072238 10.1.107.144 10.4.0.13 IMAP Response: 9 OK Delete completed. 73 87.073736 10.4.0.13 10.1.107.144 IMAP Request: 10 unsubscribe "Trash/x" 74 87.085263 10.1.107.144 10.4.0.13 IMAP Response: 10 OK Unsubscribe completed.
Inspecting output of 'doveadm mailbox list' and contents of subscriptions file shows that everything is as expected, ie. mailbox was deleted and unsubscribed. Moreover in dovecot.mailbox.log on A the following records appear:
#480: delete-mailbox 3f3eb117a51c9a51d8280000f671379f (2013-05-20 14:54:40) #504: delete-dir f91e44cab57821aa456b525c7a2f1d7e (2013-05-20 14:54:40) #528: unsubscribe f91e44cab57821aa456b525c7a2f1d7e (2013-05-20 14:54:40)
Subsequently I run 'doveadm sync -u test_mdbox -d'. It causes an entry for Thrash/x to reappear in subscriptions file on both servers and the following records are appended to dovecot.mailbox.log on B:
#2112: delete-mailbox 3f3eb117a51c9a51d8280000f671379f (2013-05-20 14:55:49) #2136: delete-dir f91e44cab57821aa456b525c7a2f1d7e (2013-05-20 14:55:49)
On A this record is added:
#552: subscribe f91e44cab57821aa456b525c7a2f1d7e (2013-05-20 14:55:49)
So, in described situation, dsync subscribes a mailbox on a server it was deleted on instead of unsubscribing it on the other one.
-- Karol Jurak
On Mon, 2013-05-20 at 15:29 +0200, Karol Jurak wrote:
It seems that dsync-2.2.2 doesn't correctly synchronize subscription status of a deleted mailbox.
Thanks, fixed: http://hg.dovecot.org/dovecot-2.2/rev/9878986a028d
(The fixed dsync protocol is still compatible with the old dsync, but the deleted mailbox subscription states aren't synced the same until both run new ones.)
**
On Monday 20 of May 2013 17:33:44 Timo Sirainen wrote:
On Mon, 2013-05-20 at 15:29 +0200, Karol Jurak wrote:
It seems that dsync-2.2.2 doesn't correctly synchronize subscription
status of a deleted mailbox.
Thanks, fixed: http://hg.dovecot.org/dovecot-2.2/rev/9878986a028d
I performed the test and subscription state of a deleted mailbox is still incorrectly synchronized: the mailbox is being subscribed on the first server (the one it was originally deleted on) instead of being unsubscribed on the other. One thing changed however: a subsequent attempt to unsubscribe this mailbox on the first server is now correctly synchronized. Previously every attempt to unsubscribe a nonexistent mailbox was being reverted by dsync.
--
Karol Jurak
On Tue, 2013-05-21 at 15:58 +0200, Karol Jurak wrote:
Thanks, fixed: http://hg.dovecot.org/dovecot-2.2/rev/9878986a028d I performed the test and subscription state of a deleted mailbox is still incorrectly synchronized: the mailbox is being subscribed on the first server (the one it was originally deleted on) instead of being unsubscribed on the other. One thing changed however: a subsequent attempt to unsubscribe this mailbox on the first server is now correctly synchronized. Previously every attempt to unsubscribe a nonexistent mailbox was being reverted by dsync.
Another fix: http://hg.dovecot.org/dovecot-2.2/rev/33efc5396e44
On Wednesday 22 of May 2013 15:16:57 Timo Sirainen wrote:
Another fix: http://hg.dovecot.org/dovecot-2.2/rev/33efc5396e44
Now it works as expected. Thanks.
However I discovered a similar issue when renaming a mailbox (using 33efc5396e44). After the first run of 'doveadm sync' the old mailbox name remains subscribed on the second server and the new name is not subscribed there. Repeating the sync corrects this.
participants (2)
-
Karol Jurak
-
Timo Sirainen