mailbox-list.c revision 697ff56bf3cdc9e7989ea2a70accf866b14b64d1
b22a4a60c59146081d6d32e37aa9e8cd10f4dab2Timo Sirainen/* Copyright (c) 2006-2015 Dovecot authors, see the included COPYING file */
#include "mailbox-list-private.h"
#include <time.h>
#include <ctype.h>
#include <unistd.h>
#include <dirent.h>
struct mailbox_list_fs_context {
void mailbox_lists_init(void)
void mailbox_lists_deinit(void)
unsigned int i, count;
for (i = 0; i < count; i++) {
*idx_r = i;
return TRUE;
return FALSE;
unsigned int idx;
unsigned int idx;
const struct mailbox_list *
unsigned int idx;
return NULL;
return *class_p;
unsigned int idx;
if (!expand_home) {
args++;
args++;
args++;
return str;
bool expand_home,
const char **error_r)
value++;
const char **error_r)
location++;
location++;
if (p == NULL)
return path;
unsigned int len;
return FALSE;
vname++;
(dirstart &&
unsigned char chr;
char *ret, *p;
if (*p == src)
*p = dest;
return ret;
const char *vname)
return storage_name;
return storage_name;
return ret;
const char *vname)
unsigned int num;
(unsigned char)*vname);
const char *storage_name)
return vname;
for (i = 0; i < name_len; i++) {
return vname;
const struct mailbox_list_settings *
struct mail_namespace *
return mode;
struct mail_user *
data++;
const char *name,
&path) < 0)
&path);
path);
if (p == NULL) {
const char *expanded_full)
const char *ret;
slash_count++;
slash2_count++;
if (slash_count == 0)
slash_count--;
if (slash_count != 0)
if (slash2_count == 0)
slash2_count--;
if (slash2_count != 0)
return ret;
const char **error_r)
i_unreached();
} else if (p == NULL) {
if (p == unexpanded)
i_unreached();
if (!home) {
const char **error_r)
const char *root_dir;
i_unreached();
const char *error;
const char **error_r)
return TRUE;
return FALSE;
return FALSE;
T_BEGIN {
const char *const *names;
const char *n = *names;
if (!allow_internal_dirs &&
} T_END;
return ret;
return TRUE;
return FALSE;
return FALSE;
const char **path_r)
int ret;
return ret;
const char **path_r)
int ret;
i_unreached();
if (ret == 0)
return ret > 0;
const char *path;
i_unreached();
return path;
const char **path_r)
switch (type) {
return pattern;
const char *pattern;
int ret;
return ret;
unsigned int len;
*flags_r = 0;
int ret;
if (ret < 0) {
const char *errstr;
if (ret < 0)
switch (existence) {
case MAILBOX_EXISTENCE_NONE:
case MAILBOX_EXISTENCE_SELECT:
const char *vname;
i_unreached();
fname++;
&inbox) <= 0)
i_unreached();
flags_r);
const char *path;
return TRUE;
return FALSE;
return TRUE;
int ret;
&index_dir);
if (ret <= 0)
return ret;
&root_dir);
if (ret <= 0)
return ret;
int ret;
return ret;
const char *error;
const char *error;
return TRUE;
levels++;
level_len = 0;
level_len++;
return TRUE;
return TRUE;
return FALSE;
#ifdef HAVE_DIRENT_D_TYPE
switch (d->d_type) {
case DT_UNKNOWN:
case DT_REG:
case DT_DIR:
case DT_LNK:
return type;
const char *dir_path,
const struct dirent *d)
int ret;
T_BEGIN {
ret = 0;
} T_END;
return ret;
return FALSE;
return FALSE;
return TRUE;
const char **name)
unsigned int len;
return FALSE;
return FALSE;
return FALSE;
&path) <= 0)
return FALSE;
return FALSE;
return TRUE;
const char *str;
const char *error_string;
return FALSE;
return TRUE;