static void
dsync_brain_slave_send_mailbox_lost(struct dsync_brain *brain,
- const struct dsync_mailbox *dsync_box)
+ const struct dsync_mailbox *dsync_box,
+ bool ignore)
{
struct dsync_mailbox delete_box;
memcpy(delete_box.mailbox_guid, dsync_box->mailbox_guid,
sizeof(delete_box.mailbox_guid));
t_array_init(&delete_box.cache_fields, 0);
- delete_box.mailbox_lost = TRUE;
+ if (ignore)
+ delete_box.mailbox_ignore = TRUE;
+ else
+ delete_box.mailbox_lost = TRUE;
dsync_ibc_send_mailbox(brain->ibc, &delete_box);
}
brain->master_brain ? 'M' : 'S',
guid_128_to_string(dsync_box->mailbox_guid));
}
- dsync_brain_slave_send_mailbox_lost(brain, dsync_box);
+ dsync_brain_slave_send_mailbox_lost(brain, dsync_box, TRUE);
return TRUE;
}
//FIXME: verify this from log, and if not log an error.
dsync_brain_set_changes_during_sync(brain, t_strdup_printf(
"Mailbox GUID %s was lost",
guid_128_to_string(dsync_box->mailbox_guid)));
- dsync_brain_slave_send_mailbox_lost(brain, dsync_box);
+ dsync_brain_slave_send_mailbox_lost(brain, dsync_box, FALSE);
return TRUE;
}
if (mailbox_sync(box, MAILBOX_SYNC_FLAG_FULL_READ) < 0) {
brain->master_brain ? 'M' : 'S',
guid_128_to_string(dsync_box->mailbox_guid));
}
- dsync_brain_slave_send_mailbox_lost(brain, dsync_box);
+ dsync_brain_slave_send_mailbox_lost(brain, dsync_box, FALSE);
return TRUE;
}
i_assert(local_dsync_box.uid_validity != 0);
if (ret == 0 || resync) {
brain->require_full_resync = TRUE;
dsync_brain_sync_mailbox_deinit(brain);
- dsync_brain_slave_send_mailbox_lost(brain, dsync_box);
+ dsync_brain_slave_send_mailbox_lost(brain, dsync_box, FALSE);
return TRUE;
}
return TRUE;
}
+ if (dsync_box->mailbox_ignore) {
+ /* ignore this box */
+ if (brain->debug)
+ i_debug("brain %c: Ignoring missing remote box GUID %s",
+ brain->master_brain ? 'M' : 'S',
+ guid_128_to_string(dsync_box->mailbox_guid));
+ dsync_brain_sync_mailbox_deinit(brain);
+ return TRUE;
+ }
if (dsync_box->mailbox_lost) {
/* remote lost the mailbox. it's probably already deleted, but
verify it on next sync just to be sure */
.chr = 'B',
.required_keys = "mailbox_guid uid_validity uid_next messages_count "
"first_recent_uid highest_modseq highest_pvt_modseq",
- .optional_keys = "mailbox_lost cache_fields have_guids have_save_guids have_only_guid128"
+ .optional_keys = "mailbox_lost mailbox_ignore "
+ "cache_fields have_guids have_save_guids have_only_guid128"
},
{ .name = "mailbox_attribute",
.chr = 'A',
if (dsync_box->mailbox_lost)
dsync_serializer_encode_add(encoder, "mailbox_lost", "");
+ if (dsync_box->mailbox_ignore)
+ dsync_serializer_encode_add(encoder, "mailbox_ignore", "");
if (dsync_box->have_guids)
dsync_serializer_encode_add(encoder, "have_guids", "");
if (dsync_box->have_save_guids)
if (dsync_deserializer_decode_try(decoder, "mailbox_lost", &value))
box->mailbox_lost = TRUE;
+ if (dsync_deserializer_decode_try(decoder, "mailbox_ignore", &value))
+ box->mailbox_ignore = TRUE;
if (dsync_deserializer_decode_try(decoder, "have_guids", &value))
box->have_guids = TRUE;
if (dsync_deserializer_decode_try(decoder, "have_save_guids", &value) ||