[Dovecot] dsync 2.1.10 does not correctly handle renames of mailbox subtrees

Karol Jurak karol.jurak at gmail.com
Tue Feb 12 12:19:56 EET 2013


Hi,

It seems that dsync 2.1.10 does not correctly handle renames of mailbox
subtrees. The scenario is as follows.

There are two servers, A and B, both running dovecot 2.1.10 and configured
to use mdbox. Automatic replication between them is disabled, ie.
replication plugin is not active and replicator service
has process_min_avail = 0. I perform the following actions:

1. On A: doveadm mailbox create -u test_user a a/b a/b/c d
2. On A: doveadm sync -u test_user -d

The result is as expected: on both A and B there are a/b/c and d mailboxes.

Now I connect to A via IMAP and rename a/b to d/b. The result is as
expected: on A there are a and d/b/c mailboxes. Next I execute on A
'doveadm sync -u mailstoragetest -d' and now the result is not as expected:
there are a/b/c and d/b subtrees on both A and B and a/b is just a
directory, ie. it does not contain dbox-Mails (the rest are proper
mailboxes).

dovecot.mailbox.logs have the following records appended to them:

A:
#2112: rename 33259783092361d18c60ba1c7cfe973c (2013-02-12 10:42:55) - this
probably is the rename of a/b to d/b (recursive, ie. including children -
in this case a/b/c => d/b/c) by the IMAP client
#2136: rename ee2be6da91ae879476b152d7ca041f1b (1970-01-01 01:00:00) -
rename of d/b/c to a/b/c by dsync (unexpected/incorrect)

B:
#1104: rename 33259783092361d18c60ba1c7cfe973c (1970-01-01 01:00:00) -
rename of a/b to d/b (non recursive) by dsync

What seems to be missing is the record in A's dovecot.mailbox.log
describing the rename of a/b/c to d/b/c (or in general case the set of
records describing the renames of all the children of a/b). Would appending
such records allow dsync to make correct decisions as to which mailboxes
and on which servers to rename?

Thanks for any help.

# 2.1.10: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.32-5-amd64 x86_64 Debian 6.0.1
auth_master_user_separator = *
auth_username_format = %Ln
default_vsz_limit = 2 G
dotlock_use_excl = no
dsync_remote_cmd = ssh -l%{login} %{host} doveadm dsync-server -u%u -l5
log_path = /var/log/dovecot.log
log_timestamp = "%Y-%m-%d %H:%M:%S "
mail_access_groups = mail
mail_location = mdbox:~/mdbox:ALT=/var/vmail/alt/%n
mail_plugins = acl
namespace inbox {
  inbox = yes
  location =
  mailbox Drafts {
    special_use = \Drafts
  }
  mailbox Junk {
    special_use = \Junk
  }
  mailbox Sent {
    special_use = \Sent
  }
  mailbox "Sent Messages" {
    special_use = \Sent
  }
  mailbox Trash {
    special_use = \Trash
  }
  prefix =
  separator = /
}
passdb {
  args = /etc/dovecot/dovecot-ldap.conf
  driver = ldap
}
plugin {
  acl = vfile
}
protocols = imap lmtp pop3
service aggregator {
  fifo_listener replication-notify-fifo {
    mode = 0666
  }
  unix_listener replication-notify {
    mode = 0666
  }
}
service auth {
  executable = /usr/lib/dovecot/auth
  unix_listener auth-client {
    mode = 0660
  }
  unix_listener auth-master {
    mode = 0600
  }
  unix_listener auth-userdb {
    mode = 0666
  }
  user = root
}
service dict {
  unix_listener dict {
    mode = 0666
  }
}
service doveadm {
  process_min_avail = 1
  service_count = 1024
}
service imap-login {
  chroot = login
  executable = /usr/lib/dovecot/imap-login
  inet_listener imap {
    address = *
    port = 143
  }
  service_count = 0
  user = dovecot
}
service imap {
  executable = /usr/lib/dovecot/imap
}
service lmtp {
  inet_listener lmtp {
    port = 24
  }
  process_limit = 48
}
service pop3-login {
  chroot = login
  executable = /usr/lib/dovecot/pop3-login
  inet_listener pop3 {
    address = *
    port = 110
  }
  service_count = 0
  user = dovecot
}
service pop3 {
  executable = /usr/lib/dovecot/pop3
}
ssl = no
userdb {
  args = /etc/dovecot/dovecot-ldap.conf
  driver = ldap
}
protocol imap {
  imap_client_workarounds = tb-extra-mailbox-sep
  mail_plugins = acl
}
protocol lmtp {
  mail_plugins = acl
}
protocol pop3 {
  pop3_uidl_format = %08Xu%08Xv
}
protocol lda {
  mail_plugins = acl
}

-- 
Karol Jurak


More information about the dovecot mailing list