From: Timo Sirainen Date: Mon, 2 Jun 2008 13:23:50 +0000 (+0300) Subject: maildir -> dbox conversion: Create the destination mailbox so the conversion X-Git-Tag: 1.1.rc8~17 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6be7148f26de26e4eebd69265147c44e169fdf83;p=thirdparty%2Fdovecot%2Fcore.git maildir -> dbox conversion: Create the destination mailbox so the conversion won't fail with rename() error. --HG-- branch : HEAD --- diff --git a/src/plugins/convert/convert-storage.c b/src/plugins/convert/convert-storage.c index 89ddd21646..138987f54f 100644 --- a/src/plugins/convert/convert-storage.c +++ b/src/plugins/convert/convert-storage.c @@ -146,6 +146,15 @@ static int mailbox_convert_maildir_to_dbox(struct mail_storage *src_storage, bool t; int ret; + /* create as non-selectable mailbox so the dbox-Mails directory + isn't created yet */ + if (mail_storage_mailbox_create(dest_storage, dest_name, TRUE) < 0) { + i_error("Mailbox conversion: " + "Couldn't create mailbox %s: %s", + dest_name, storage_error(dest_storage)); + return -1; + } + src_path = mail_storage_get_mailbox_path(src_storage, src_name, &t); dest_path = mail_storage_get_mailbox_path(dest_storage, dest_name, &t);