imapc-storage.c revision 306cfd77100131c08b243de10f6d40500f4c27c6
/* Copyright (c) 2011 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "str.h"
#include "imap-util.h"
#include "imap-arg.h"
#include "imap-resp-code.h"
#include "mail-copy.h"
#include "index-mail.h"
#include "mailbox-list-private.h"
#include "imapc-client.h"
#include "imapc-seqmap.h"
#include "imapc-sync.h"
#include "imapc-storage.h"
#define DNS_CLIENT_SOCKET_NAME "dns-client"
struct imapc_simple_context {
struct imapc_storage *storage;
int ret;
};
struct imapc_open_context {
struct imapc_mailbox *mbox;
int ret;
};
struct imapc_status_context {
struct imapc_mailbox *mbox;
struct mailbox_status *status;
int ret;
};
struct imapc_resp_code_map {
const char *code;
enum mail_error error;
};
extern struct mail_storage imapc_storage;
extern struct mailbox imapc_mailbox;
static struct imapc_resp_code_map imapc_resp_code_map[] = {
/* { IMAP_RESP_CODE_CLIENTBUG, 0 }, */
};
static bool
{
unsigned int i;
return FALSE;
for (i = 0; i < N_ELEMENTS(imapc_resp_code_map); i++) {
return TRUE;
}
}
return FALSE;
}
static struct mail_storage *imapc_storage_alloc(void)
{
struct imapc_storage *storage;
}
static void
enum mail_error default_error,
const struct imapc_command_reply *reply)
{
enum mail_error error;
const char *p;
} else {
}
}
static void
void *context)
{
} else {
}
}
void *context)
{
;
} else {
}
}
static void
{
const struct mail_index_header *hdr;
return;
}
static void
{
struct imapc_seqmap *seqmap;
const char *atom;
const struct mail_index_record *rec;
enum mail_flags flags;
unsigned int i, j;
bool seen_flags = FALSE;
return;
return;
return;
return;
seen_flags = TRUE;
return;
if (atom[0] == '\\')
}
}
}
}
if (uid == 0)
return;
}
}
}
void *context)
{
struct imapc_seqmap *seqmap;
return;
}
}
}
}
}
static int
struct mail_namespace *ns,
const char **error_r)
{
struct imapc_client_settings set;
*error_r = "missing pass";
return -1;
}
return 0;
}
{
}
static void
struct mailbox_list_settings *set)
{
}
static struct mailbox *
{
struct imapc_mailbox *mbox;
struct index_mailbox_context *ibox;
}
static void
void *context)
{
} else {
"imapc: Opening mailbox '%s' failed: %s",
}
}
{
struct imapc_open_context ctx;
return -1;
mbox->client_box =
return -1;
}
return 0;
}
{
return index_storage_mailbox_close(box);
}
static int
bool directory)
{
struct imapc_simple_context ctx;
if (directory) {
/* FIXME: hardcoded separator.. */
}
"CREATE %s", name);
}
{
"Not supported");
return -1;
}
enum mailbox_status_items items,
struct mailbox_status *status_r)
{
}
static void
void *context)
{
} else {
"imapc: STATUS for mailbox '%s' failed: %s",
}
}
enum mailbox_status_items items,
struct mailbox_status *status_r)
{
struct imapc_status_context ctx;
return 0;
}
/* mailbox isn't opened yet */
/* getting these requires opening the mailbox */
if (mailbox_open(box) < 0)
return -1;
return 0;
}
if ((items & STATUS_MESSAGES) != 0)
if ((items & STATUS_RECENT) != 0)
if ((items & STATUS_UIDNEXT) != 0)
if ((items & STATUS_UIDVALIDITY) != 0)
if ((items & STATUS_UNSEEN) != 0)
if ((items & STATUS_HIGHESTMODSEQ) != 0)
/* nothing requested */
return 0;
}
}
enum mailbox_metadata_items items,
struct mailbox_metadata *metadata_r)
{
"Not supported");
return -1;
}
{
}
struct mail_storage imapc_storage = {
.class_flags = 0,
.v = {
NULL,
NULL,
NULL,
}
};
struct mailbox imapc_mailbox = {
.v = {
NULL,
NULL,
NULL,
NULL,
}
};