mbox-storage.c revision 01cbf4ac5d44137ab434791be7f838d98d0fcf3b
de62ce819d59a529530da4b57be1b8d6dad13d6bTimo Sirainen/* Copyright (C) 2002-2003 Timo Sirainen */
af49da69a12b5383b89c7b2fa574c2a85b9ca310Timo Sirainen#include "subscription-file/subscription-file.h"
40ac30b9267c710f5fcdd4b2f6bcd7718a631843Timo Sirainen#define CREATE_MODE 0770 /* umask() should limit it more */
8562f8de469e87ad4104747cebec6b133fa3a0f5Timo Sirainenint mbox_set_syscall_error(struct index_mailbox *ibox, const char *function)
de62ce819d59a529530da4b57be1b8d6dad13d6bTimo Sirainen "%s failed with mbox file %s: %m", function, ibox->path);
518781a0a4ba2403f23dbadda445b107fbb87daaPhil Carmodystatic int mbox_handle_errors(struct index_storage *istorage)
de62ce819d59a529530da4b57be1b8d6dad13d6bTimo Sirainen struct mail_storage *storage = &istorage->storage;
af49da69a12b5383b89c7b2fa574c2a85b9ca310Timo Sirainen mail_storage_set_error(storage, "Permission denied");
de62ce819d59a529530da4b57be1b8d6dad13d6bTimo Sirainen mail_storage_set_error(storage, "Not enough disk space");
return FALSE;
return TRUE;
const char *path;
return TRUE;
return TRUE;
return TRUE;
return TRUE;
return FALSE;
static const char *get_root_dir(void)
return path;
return path;
return NULL;
if (!only_root) {
return path;
return path;
static const char *create_root_dir(void)
return NULL;
return NULL;
return path;
static struct mail_storage *
int autodetect;
if (autodetect) {
if (p == NULL) {
return NULL;
} while (p != NULL);
return NULL;
return name;
return name;
return name;
if (*p == sep)
return dup;
int newdir;
return TRUE;
return FALSE;
return FALSE;
return TRUE;
return FALSE;
return FALSE;
const char *name)
return NULL;
if (p == NULL)
const char *name)
const char *index_dir;
int fd;
static struct mailbox *
sizeof(uint64_t));
return NULL;
static struct mailbox *
const char *path;
return NULL;
return NULL;
return NULL;
return NULL;
name);
path);
return NULL;
int directory)
const char *path, *p;
int fd;
if (p != NULL) {
if (directory) {
name);
if (p != NULL) {
newpath);
const char *path;
const char *name,
const char *path;
unsigned int min_newmail_notify_interval)
if (flags == 0)
NULL,