cmd-copy.c revision 62f49ddfc6fddae2c512961e17d8c7b963108bb4
/* Copyright (c) 2002-2010 Dovecot authors, see the included COPYING file */
#include "imap-common.h"
#include "str.h"
#include "ostream.h"
#include "imap-resp-code.h"
#include "imap-util.h"
#include "imap-commands.h"
#include "imap-search-args.h"
#include <time.h>
#define COPY_CHECK_INTERVAL 100
{
return;
}
}
struct mailbox_transaction_context *t,
struct mail_search_args *search_args,
const char **src_uidset_r,
unsigned int *copy_count_r)
{
struct mail_search_context *search_ctx;
struct mailbox_transaction_context *src_trans;
struct mail_save_context *save_ctx;
unsigned int copy_count = 0;
struct msgset_generator_context srcset_ctx;
int ret;
ret = 1;
ret = 0;
break;
}
if ((++copy_count % COPY_CHECK_INTERVAL) == 0)
save_ctx = mailbox_save_alloc(t);
}
if (mailbox_search_deinit(&search_ctx) < 0)
ret = -1;
if (mailbox_transaction_commit(&src_trans) < 0)
ret = -1;
return ret;
}
{
struct mail_storage *dest_storage;
struct mailbox_transaction_context *t;
struct mail_search_args *search_args;
enum mailbox_sync_flags sync_flags = 0;
enum imap_sync_flags imap_flags = 0;
unsigned int copy_count;
int ret;
/* <message set> <mailbox> */
return FALSE;
if (!client_verify_open_mailbox(cmd))
return TRUE;
if (ret <= 0)
return ret < 0;
return TRUE;
if (ret <= 0)
else if (mailbox_transaction_commit_get_changes(&t, &changes) < 0)
ret = -1;
else if (copy_count == 0) {
/* not supported by backend (virtual) */
} else {
}
}
if (ret > 0)
else if (ret == 0) {
/* some messages were expunged, sync them */
"Some of the requested messages no longer exist.");
} else {
return TRUE;
}
}