]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
maildir -> dbox conversion: Create the destination mailbox so the conversion
authorTimo Sirainen <tss@iki.fi>
Mon, 2 Jun 2008 13:23:50 +0000 (16:23 +0300)
committerTimo Sirainen <tss@iki.fi>
Mon, 2 Jun 2008 13:23:50 +0000 (16:23 +0300)
won't fail with rename() error.

--HG--
branch : HEAD

src/plugins/convert/convert-storage.c

index 89ddd21646e2007688ba778fa65526f95bd7aacc..138987f54f410ec0e1a60adbcef2abdf2188751f 100644 (file)
@@ -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);