Mercurial > dovecot > core-2.2
changeset 10746:28c3486864f6 HEAD
mbox: Fail at startup if service doesn't have client_limit=1.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 18 Feb 2010 07:13:29 +0200 |
parents | 5284f3662431 |
children | c0c4898fc803 |
files | src/lib-storage/index/mbox/Makefile.am src/lib-storage/index/mbox/mbox-storage.c |
diffstat | 2 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/index/mbox/Makefile.am Thu Feb 18 07:06:42 2010 +0200 +++ b/src/lib-storage/index/mbox/Makefile.am Thu Feb 18 07:13:29 2010 +0200 @@ -3,6 +3,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/src/lib \ -I$(top_srcdir)/src/lib-settings \ + -I$(top_srcdir)/src/lib-master \ -I$(top_srcdir)/src/lib-mail \ -I$(top_srcdir)/src/lib-imap \ -I$(top_srcdir)/src/lib-index \
--- a/src/lib-storage/index/mbox/mbox-storage.c Thu Feb 18 07:06:42 2010 +0200 +++ b/src/lib-storage/index/mbox/mbox-storage.c Thu Feb 18 07:13:29 2010 +0200 @@ -4,6 +4,7 @@ #include "ioloop.h" #include "istream.h" #include "restrict-access.h" +#include "master-service.h" #include "mbox-storage.h" #include "mbox-lock.h" #include "mbox-file.h" @@ -118,11 +119,17 @@ static int mbox_storage_create(struct mail_storage *_storage, struct mail_namespace *ns, - const char **error_r ATTR_UNUSED) + const char **error_r) { struct mbox_storage *storage = (struct mbox_storage *)_storage; const char *dir; + if (master_service_get_client_limit(master_service) > 1) { + /* we can't handle locking related problems. */ + *error_r = "mbox requires client_limit=1 for service"; + return -1; + } + storage->set = mail_storage_get_driver_settings(_storage); dir = mailbox_list_get_path(ns->list, NULL,