diff src/doveadm/dsync/dsync-brain.c @ 16398:4883a8e1db13

dsync: Added -x parameter to exclude mailboxes from sync. Multiple -x parameters can be added. Giving \flag as parameter means that the mailbox with the given SPECIAL-USE \flag is skipped. For example: doveadm sync -x '\All' -x '\Flagged' -x '\Important' mdbox:~/mdbox
author Timo Sirainen <tss@iki.fi>
date Sun, 26 May 2013 21:57:36 +0300
parents 2d6a3035a6f7
children 5593d6129712
line wrap: on
line diff
--- a/src/doveadm/dsync/dsync-brain.c	Sun May 26 21:44:50 2013 +0300
+++ b/src/doveadm/dsync/dsync-brain.c	Sun May 26 21:57:36 2013 +0300
@@ -103,6 +103,8 @@
 	if (set->sync_ns != NULL)
 		brain->sync_ns = set->sync_ns;
 	brain->sync_box = p_strdup(brain->pool, set->sync_box);
+	brain->exclude_mailboxes = set->exclude_mailboxes == NULL ? NULL :
+		p_strarray_dup(brain->pool, set->exclude_mailboxes);
 	memcpy(brain->sync_box_guid, set->sync_box_guid,
 	       sizeof(brain->sync_box_guid));
 	brain->lock_timeout = set->lock_timeout_secs;
@@ -124,6 +126,7 @@
 	ibc_set.sync_ns_prefix = set->sync_ns == NULL ? NULL :
 		set->sync_ns->prefix;
 	ibc_set.sync_box = set->sync_box;
+	ibc_set.exclude_mailboxes = set->exclude_mailboxes;
 	memcpy(ibc_set.sync_box_guid, set->sync_box_guid,
 	       sizeof(ibc_set.sync_box_guid));
 	ibc_set.sync_type = sync_type;
@@ -312,6 +315,8 @@
 						     ibc_set->sync_ns_prefix);
 	}
 	brain->sync_box = p_strdup(brain->pool, ibc_set->sync_box);
+	brain->exclude_mailboxes = ibc_set->exclude_mailboxes == NULL ? NULL :
+		p_strarray_dup(brain->pool, ibc_set->exclude_mailboxes);
 	memcpy(brain->sync_box_guid, ibc_set->sync_box_guid,
 	       sizeof(brain->sync_box_guid));
 	i_assert(brain->sync_type == DSYNC_BRAIN_SYNC_TYPE_UNKNOWN);