virtual-sync.c revision 7fc0ca6c1f664de6506afa816200d115f9f80391
5394bed8aaef2a6c1c870a34a23a7824e1f370bbStephan Bosch/* Copyright (c) 2008-2014 Dovecot authors, see the included COPYING file */
5394bed8aaef2a6c1c870a34a23a7824e1f370bbStephan Bosch const char *const *kw_all;
5394bed8aaef2a6c1c870a34a23a7824e1f370bbStephan Bosch /* messages expunged within this sync */
1e653c7406ec0b062c0bacfdf2e7568a3f860500Stephan Bosch /* all messages in this sync, sorted by mailbox_id
1e653c7406ec0b062c0bacfdf2e7568a3f860500Stephan Bosch (but unsorted inside it for now, since it doesn't matter) */
1e653c7406ec0b062c0bacfdf2e7568a3f860500Stephan Bosch uint32_t all_mails_idx, all_mails_prev_mailbox_id;
d82ad7143c057c565e1fd5f3580645556ed0bcc9Stephan Boschstatic void virtual_sync_set_uidvalidity(struct virtual_sync_context *ctx)
d82ad7143c057c565e1fd5f3580645556ed0bcc9Stephan Bosch offsetof(struct mail_index_header, uid_validity),
5394bed8aaef2a6c1c870a34a23a7824e1f370bbStephan Boschstatic void virtual_sync_external_flags(struct virtual_sync_context *ctx,
5394bed8aaef2a6c1c870a34a23a7824e1f370bbStephan Bosch const char *const *kw_names;
069def4dc35022852d569b7ab75a3b19d2cb0f1cTimo Sirainen if (!mail_set_uid(bbox->sync_mail, real_uid)) {
069def4dc35022852d569b7ab75a3b19d2cb0f1cTimo Sirainen /* we may have reopened the mailbox, which could have
c911297407bdcc7c7936305eb8f791b450d6375cTimo Sirainen caused the mail to be expunged already. */
const void *ext_data;
ext_name_offset = 0;
ext_mailbox_count = 0;
box_path);
ext_mailbox_count = 0;
ret = 0;
prev_mailbox_id = 0;
for (i = 0; i < ext_mailbox_count; i++) {
box_path);
box_path);
box_path);
T_BEGIN {
const unsigned char *nameptr;
const char *name;
} T_END;
if (ret < 0)
ret = 0;
if (i < ext_mailbox_count) {
ret = 0;
for (i = 0; i < count; i++) {
ret = 0;
return ret;
const void *ext_data;
for (i = 0; i < count; i++) {
i_assert(i == 0 ||
sizeof(struct virtual_mail_index_record),
sizeof(uint32_t));
const void *data;
if (flags != 0) {
if (flags != 0) {
kw_names);
int ret;
0, NULL);
return ret;
if (uid_count == 0)
i_unreached();
for (i = 0; i < uid_count; i++) {
&vseq))
if (uid_count == 0)
if (rec_count == 0 ||
&dest))
i_unreached();
for (i = 0; i < uid_count; i++) {
unsigned int i, count;
for (i = 0; i < count; i++) {
const void *data;
old_msg_count = 0;
&removed_uids);
unsigned int i, n = 0, count;
if (i == count)
for (; i < count; ) {
unsigned int i, n = 0, count;
for (; i < count; ) {
if (!iter_done) {
&added_uids);
&temp_uids);
&removed_uids);
&removed_uids);
unsigned int *idx1_r,
unsigned int *idx2_r)
&idx);
return FALSE;
return TRUE;
&idx1);
case MAILBOX_SYNC_TYPE_FLAGS:
case MAILBOX_SYNC_TYPE_MODSEQ:
const unsigned int uidval_pos =
unsigned int mailbox_offset;
int ret;
if (!bbox_index_opened) {
&status);
if (ret < 0) {
if (!bbox_index_opened) {
} T_END;
return ret;
const void *data;
unsigned int j = 0, uidmap_count = 0;
if (messages == 0)
for (i = 0; i < messages; i++) {
for (; j < uidmap_count; j++) {
&uidmap_count);
j = uidmap_count;
for (; j < uidmap_count; j++) {
for (; j < uidmap_count; j++) {
for (i = 0; i < count; i++) {
for (j = 0; j < uidmap_count; j++) {
unsigned int i, count;
if (count == 0) {
&idx))
i_unreached();
const void *data;
const void *data;
const void *mail_data;
unsigned int i, count;
int ret;
for (i = 0; i < count; i++) {
return ret;
unsigned int i, count;
for (i = 0; i < count; i++)
if (success) {
return ret;
int ret;
if (ret <= 0) {
if (ret < 0)
return ret;
if (ret < 0)
if (ret == 0)
struct mailbox_sync_context *
int ret = 0;
return sync_ctx;