]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dsync: Refuse to run if we detect virtual hierarchy separators differ for mail locations.
authorTimo Sirainen <tss@iki.fi>
Tue, 6 Jul 2010 18:14:39 +0000 (19:14 +0100)
committerTimo Sirainen <tss@iki.fi>
Tue, 6 Jul 2010 18:14:39 +0000 (19:14 +0100)
The real separators can differ, but to work properly there must be a default
namespace with a separator defined.

--HG--
branch : HEAD

src/dsync/dsync.c

index 50276f8a7d768432bbb5ea838977c2140dfc59c6..f4fd464a9c2fab8de0b1880358edabeab5322036 100644 (file)
@@ -8,6 +8,7 @@
 #include "master-service-settings.h"
 #include "mail-storage-service.h"
 #include "mail-user.h"
+#include "mail-namespace.h"
 #include "dsync-brain.h"
 #include "dsync-worker.h"
 #include "dsync-proxy-server.h"
@@ -256,6 +257,13 @@ int main(int argc, char *argv[])
                                              &mail_user2) < 0)
                        i_fatal("User init failed");
 
+               if (mail_namespaces_get_root_sep(mail_user->namespaces) !=
+                   mail_namespaces_get_root_sep(mail_user2->namespaces)) {
+                       i_fatal("Mail locations must use the same "
+                               "virtual mailbox hierarchy separator "
+                               "(specify separator for the default namespace)");
+               }
+
                worker2 = dsync_worker_init_local(mail_user2, alt_char);
                if (reverse_workers) {
                        workertmp = worker1;