dovecot-2.2: maildir: Autocreate missing cur/ new/ tmp/ director...

dovecot at dovecot.org dovecot at dovecot.org
Sun Sep 22 07:40:15 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/6942a3da740c
changeset: 16820:6942a3da740c
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Sep 22 07:40:01 2013 +0300
description:
maildir: Autocreate missing cur/ new/ tmp/ directories only with Maildir++ and imapdir.
\Noselect mailboxes aren't possible with those layouts, but with other
layouts they are and they shouldn't get automatically created just by
selecting them.

diffstat:

 src/lib-storage/index/maildir/maildir-storage.c |  9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diffs (19 lines):

diff -r 801714cba91b -r 6942a3da740c src/lib-storage/index/maildir/maildir-storage.c
--- a/src/lib-storage/index/maildir/maildir-storage.c	Sun Sep 22 07:24:26 2013 +0300
+++ b/src/lib-storage/index/maildir/maildir-storage.c	Sun Sep 22 07:40:01 2013 +0300
@@ -351,7 +351,14 @@
 	if (ret < 0)
 		return -1;
 
-	/* tmp/ directory doesn't exist. does the maildir? */
+	/* tmp/ directory doesn't exist. does the maildir? autocreate missing
+	   dirs only with Maildir++ and imapdir layouts. */
+	if (strcmp(box->list->name, MAILBOX_LIST_NAME_MAILDIRPLUSPLUS) != 0 &&
+	    strcmp(box->list->name, MAILBOX_LIST_NAME_IMAPDIR) != 0) {
+		mail_storage_set_error(box->storage, MAIL_ERROR_NOTFOUND,
+			T_MAIL_ERR_MAILBOX_NOT_FOUND(box->vname));
+		return -1;
+	}
 	root_dir = mailbox_list_get_root_forced(box->list,
 						MAILBOX_LIST_PATH_TYPE_MAILBOX);
 	if (strcmp(box_path, root_dir) == 0) {


More information about the dovecot-cvs mailing list