From: Timo Sirainen Date: Sat, 1 Nov 2008 14:04:24 +0000 (+0200) Subject: dbox/mbox: Don't auto-create INBOX if storage isn't in the INBOX namespace. X-Git-Tag: 1.2.alpha4~115 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=69dce7efadb6d543c8015cadc6dc1d756a445adc;p=thirdparty%2Fdovecot%2Fcore.git dbox/mbox: Don't auto-create INBOX if storage isn't in the INBOX namespace. --HG-- branch : HEAD --- diff --git a/src/lib-storage/index/dbox/dbox-storage.c b/src/lib-storage/index/dbox/dbox-storage.c index 9e3cd40d96..3f112b98c0 100644 --- a/src/lib-storage/index/dbox/dbox-storage.c +++ b/src/lib-storage/index/dbox/dbox-storage.c @@ -291,7 +291,8 @@ dbox_mailbox_open(struct mail_storage *_storage, const char *name, if (dbox_cleanup_if_exists(_storage, path)) return dbox_open(storage, name, flags); else if (errno == ENOENT) { - if (strcmp(name, "INBOX") == 0) { + if (strcmp(name, "INBOX") == 0 && + (_storage->ns->flags & NAMESPACE_FLAG_INBOX) != 0) { /* INBOX always exists, create it */ if (create_dbox(_storage, path) < 0) return NULL; diff --git a/src/lib-storage/index/mbox/mbox-storage.c b/src/lib-storage/index/mbox/mbox-storage.c index 48bf5f32e4..8a4b0ab8e2 100644 --- a/src/lib-storage/index/mbox/mbox-storage.c +++ b/src/lib-storage/index/mbox/mbox-storage.c @@ -666,7 +666,8 @@ mbox_mailbox_open(struct mail_storage *_storage, const char *name, if (input != NULL) return mbox_mailbox_open_stream(storage, name, input, flags); - if (strcmp(name, "INBOX") == 0) { + if (strcmp(name, "INBOX") == 0 && + (_storage->ns->flags & NAMESPACE_FLAG_INBOX) != 0) { /* make sure INBOX exists */ if (verify_inbox(_storage) < 0) return NULL;