mail-storage.c revision 6325490fbfc239bfb9fdf045b1ce2e0264a0c9c7
/* Copyright (C) 2002-2006 Timo Sirainen */
#include "lib.h"
#include "ioloop.h"
#include "array.h"
#include "var-expand.h"
#include "mail-index-private.h"
#include "mail-storage-private.h"
#include <stdlib.h>
#include <time.h>
#include <ctype.h>
/* Message to show to users when critical error occurs */
#define CRITICAL_MSG \
"Internal error occurred. Refer to server log for more information."
/* 20 * (200+1) < 4096 which is the standard PATH_MAX. Having these settings
prevents malicious user from creating eg. "a/a/a/.../a" mailbox name and
then start renaming them to larger names from end to beginning, which
eventually would start causing the failures when trying to use too
long mailbox names. */
#define MAILBOX_MAX_HIERARCHY_LEVELS 20
#define MAILBOX_MAX_HIERARCHY_NAME_LENGTH 200
unsigned int mail_storage_module_id = 0;
unsigned int mail_storage_mail_index_module_id = 0;
void mail_storage_init(void)
{
}
void mail_storage_deinit(void)
{
if (array_is_created(&storages))
}
{
storage_class->v.class_init();
/* append it after the list, so the autodetection order is correct */
}
{
struct mail_storage *const *classes;
unsigned int i, count;
for (i = 0; i < count; i++) {
if (classes[i] == storage_class) {
break;
}
}
storage_class->v.class_deinit();
}
{
const char *str;
*flags_r = 0;
else
}
{
struct mail_storage *const *classes;
unsigned int i, count;
for (i = 0; i < count; i++) {
return classes[i];
}
return NULL;
}
struct mail_storage *
enum mail_storage_flags flags,
{
struct mail_storage *storage;
else
return NULL;
}
struct mail_storage *
{
struct mail_storage *const *classes;
struct mail_storage *storage;
unsigned int i, count;
for (i = 0; i < count; i++) {
return storage;
}
return NULL;
}
static struct mail_storage *
{
struct mail_storage *const *classes;
unsigned int i, count;
for (i = 0; i < count; i++) {
return classes[i];
}
return NULL;
}
struct mail_storage *
enum mail_storage_flags flags,
{
struct mail_storage *storage;
const char *p, *name;
/* check if we're in the form of mailformat:data
(eg. maildir:Maildir) */
p = data;
while (i_isalnum(*p)) p++;
if (*p == ':') {
} else {
i_error("Ambiguous mail location setting, "
"don't know what to do with it: %s "
"(try prefixing it with mbox: or maildir:)",
data);
} else {
}
}
return storage;
}
{
}
{
}
{
}
}
const char *fmt, ...)
{
}
}
{
char str[256];
}
const char *fmt, ...)
{
/* critical errors may contain sensitive data, so let user
see only "Internal error" with a timestamp to make it
easier to look from log files the actual error message. */
}
}
{
return storage->hierarchy_sep;
}
struct mail_storage_callbacks *callbacks,
void *context)
{
}
bool directory)
{
}
{
}
{
}
struct mailbox_list_context *
enum mailbox_list_flags flags)
{
}
struct mailbox_list *
{
}
{
}
{
}
const char *name,
enum mailbox_name_status *status)
{
}
bool *syntax_error_r,
bool *temporary_error_r)
{
}
{
}
const char *name)
{
}
const char *name)
{
}
enum mailbox_open_flags flags)
{
return box;
}
{
}
{
}
{
}
{
}
{
}
enum mailbox_status_items items,
struct mailbox_status *status)
{
}
struct mailbox_sync_context *
{
}
struct mailbox_sync_rec *sync_rec_r)
{
}
struct mailbox_status *status_r)
{
}
{
}
struct mail_keywords *
const char *const keywords[])
{
}
void mailbox_keywords_free(struct mailbox_transaction_context *t,
struct mail_keywords **_keywords)
{
}
{
}
struct mailbox_header_lookup_ctx *
{
}
{
}
struct mail_search_context *
mailbox_search_init(struct mailbox_transaction_context *t,
const enum mail_sort_type *sort_program)
{
}
{
}
{
}
struct mailbox_transaction_context *
{
}
enum mailbox_sync_flags flags)
{
struct mailbox_transaction_context *t = *_t;
}
{
struct mailbox_transaction_context *t = *_t;
t->box->v.transaction_rollback(t);
}
int mailbox_save_init(struct mailbox_transaction_context *t,
{
return -1;
return 0;
}
{
}
{
}
{
}
{
}
{
}
{
return TRUE;
levels++;
level_len = 0;
} else {
level_len++;
}
}
return TRUE;
return TRUE;
return FALSE;
}