virtual-storage.c revision 77d8223da3da23b731257596abefa77e4485b77d
/* Copyright (c) 2008-2010 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "array.h"
#include "ioloop.h"
#include "str.h"
#include "mkdir-parents.h"
#include "unlink-directory.h"
#include "index-mail.h"
#include "mail-copy.h"
#include "mail-search.h"
#include "mailbox-list-private.h"
#include "virtual-plugin.h"
#include "virtual-transaction.h"
#include "virtual-storage.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <dirent.h>
#define VIRTUAL_LIST_CONTEXT(obj) \
struct virtual_mailbox_list {
};
extern struct mail_storage virtual_storage;
extern struct mailbox virtual_mailbox;
{
}
{
else {
return t_strdup_printf("<hidden>%c%s",
}
}
{
enum mail_error error;
}
static struct mail_storage *virtual_storage_alloc(void)
{
struct virtual_storage *storage;
}
static void
struct mailbox_list_settings *set)
{
}
struct virtual_backend_box *
{
struct virtual_backend_box *const *bboxes;
unsigned int i, count;
for (i = 0; i < count; i++) {
return bboxes[i];
}
return NULL;
}
struct virtual_backend_box *
{
struct virtual_backend_box *const *bboxes;
unsigned int i, count;
if (mailbox_id == 0)
return NULL;
for (i = 0; i < count; i++) {
return bboxes[i];
}
return NULL;
}
const char *name)
{
const char *const *names;
unsigned int i, count;
for (i = 0; i < count; i++) {
return TRUE;
}
return FALSE;
}
struct virtual_backend_box *bbox)
{
enum mail_error error;
&error);
/* this mailbox wasn't explicitly specified. just skip it. */
return 0;
}
if (error == MAIL_ERROR_NOTFOUND) {
/* the virtual mailbox exists, we just can't open it.
change the error type. */
}
"Virtual mailbox open failed because of mailbox %s: %s",
return -1;
}
struct virtual_backend_box *bbox,
enum mailbox_flags flags)
{
struct mail_namespace *ns;
const char *mailbox;
return 1;
}
enum mailbox_flags flags)
{
struct virtual_backend_box *const *bboxes;
unsigned int i, count;
int ret;
for (i = 0; i < count; ) {
if (ret <= 0) {
if (ret < 0)
break;
} else {
i++;
}
}
if (i == count)
return 0;
else {
/* failed */
for (; i > 0; i--) {
}
return -1;
}
}
static struct mailbox *
{
struct virtual_mailbox *mbox;
sizeof(struct virtual_mail_index_record),
sizeof(uint32_t));
}
{
struct virtual_backend_box **bboxes;
unsigned int i, count;
for (i = 0; i < count; i++) {
continue;
}
}
{
int ret = 0;
return -1;
}
/* exists, open it */
return -1;
return -1;
} else {
return -1;
}
if (ret == 0) {
}
if (ret < 0) {
return -1;
}
}
{
}
{
}
static int
bool directory ATTR_UNUSED)
{
"Can't create virtual mailboxes");
return -1;
}
static int
{
"Can't update virtual mailboxes");
return -1;
}
static int
{
"Virtual mailboxes have no GUIDs");
return -1;
}
static void
{
}
{
struct virtual_backend_box *const *bboxes;
unsigned int i, count;
for (i = 0; i < count; i++) {
else {
}
}
}
static int
enum mailbox_list_file_type type,
enum mailbox_info_flags *flags)
{
const char *virtual_path;
int ret;
return ret;
/* see if it's a selectable mailbox */
NULL);
*flags |= MAILBOX_NOSELECT;
return ret;
}
struct mailbox_list *list)
{
struct virtual_mailbox_list *mlist;
}
const struct virtual_backend_uidmap *map)
{
}
static bool
{
struct virtual_backend_box *bbox;
struct mailbox_status status;
const struct virtual_backend_uidmap *uids;
else {
}
return FALSE;
return FALSE;
return FALSE;
return TRUE;
}
static void
bool only_with_msgs)
{
struct virtual_backend_box *const *bboxes;
unsigned int i, count;
for (i = 0; i < count; i++) {
}
}
static void
{
}
{
if (mbox->inconsistent)
return TRUE;
return index_storage_is_inconsistent(box);
}
struct mail_storage virtual_storage = {
.class_flags = 0,
.v = {
NULL,
NULL,
NULL,
NULL,
}
};
struct mailbox virtual_mailbox = {
.v = {
NULL,
NULL,
NULL,
}
};