]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dbox/mbox: Don't auto-create INBOX if storage isn't in the INBOX namespace.
authorTimo Sirainen <tss@iki.fi>
Sat, 1 Nov 2008 14:04:24 +0000 (16:04 +0200)
committerTimo Sirainen <tss@iki.fi>
Sat, 1 Nov 2008 14:04:24 +0000 (16:04 +0200)
--HG--
branch : HEAD

src/lib-storage/index/dbox/dbox-storage.c
src/lib-storage/index/mbox/mbox-storage.c

index 9e3cd40d960c26a19d8b70f746663933b7d4dd84..3f112b98c0cd5955dcc6ffc515ffcab3388deaa3 100644 (file)
@@ -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;
index 48bf5f32e4cad026a6ab97cfdf1adff94cc26014..8a4b0ab8e2595bd299ce70454441a7448311fcc6 100644 (file)
@@ -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;