Mercurial > dovecot > core-2.2
diff src/doveadm/dsync/dsync-ibc-stream.c @ 19021:3fc9658c9712
dsync: Added -D parameter to disable mailbox renaming.
The renaming logic is annoyingly complex and there are some bugs left in it.
With this parameter renames are never even attempted, but instead a rename
would be done (slowly) with mailbox delete + create + fill.
Although with imapc protocol mailbox renames are rarely detected anyway.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 27 Aug 2015 13:38:44 +0200 |
parents | 11b107c8dc05 |
children | f8ab4f979e92 |
line wrap: on
line diff
--- a/src/doveadm/dsync/dsync-ibc-stream.c Thu Aug 27 12:33:47 2015 +0200 +++ b/src/doveadm/dsync/dsync-ibc-stream.c Thu Aug 27 13:38:44 2015 +0200 @@ -76,7 +76,7 @@ .optional_keys = "sync_ns_prefix sync_box sync_box_guid sync_type " "debug sync_visible_namespaces exclude_mailboxes " "send_mail_requests backup_send backup_recv lock_timeout " - "no_mail_sync no_backup_overwrite purge_remote " + "no_mail_sync no_mailbox_renames no_backup_overwrite purge_remote " "sync_since_timestamp sync_flags virtual_all_box" }, { .name = "mailbox_state", @@ -681,6 +681,8 @@ dsync_serializer_encode_add(encoder, "sync_visible_namespaces", ""); if ((set->brain_flags & DSYNC_BRAIN_FLAG_NO_MAIL_SYNC) != 0) dsync_serializer_encode_add(encoder, "no_mail_sync", ""); + if ((set->brain_flags & DSYNC_BRAIN_FLAG_NO_MAILBOX_RENAMES) != 0) + dsync_serializer_encode_add(encoder, "no_mailbox_renames", ""); if ((set->brain_flags & DSYNC_BRAIN_FLAG_NO_BACKUP_OVERWRITE) != 0) dsync_serializer_encode_add(encoder, "no_backup_overwrite", ""); if ((set->brain_flags & DSYNC_BRAIN_FLAG_PURGE_REMOTE) != 0) @@ -785,6 +787,8 @@ set->brain_flags |= DSYNC_BRAIN_FLAG_SYNC_VISIBLE_NAMESPACES; if (dsync_deserializer_decode_try(decoder, "no_mail_sync", &value)) set->brain_flags |= DSYNC_BRAIN_FLAG_NO_MAIL_SYNC; + if (dsync_deserializer_decode_try(decoder, "no_mailbox_renames", &value)) + set->brain_flags |= DSYNC_BRAIN_FLAG_NO_MAILBOX_RENAMES; if (dsync_deserializer_decode_try(decoder, "no_backup_overwrite", &value)) set->brain_flags |= DSYNC_BRAIN_FLAG_NO_BACKUP_OVERWRITE; if (dsync_deserializer_decode_try(decoder, "purge_remote", &value))