]> granicus.if.org Git - neomutt/commitdiff
Attempt to fix the code path to create a new mbox
authorPietro Cerutti <gahr@gahr.ch>
Mon, 27 Aug 2018 07:51:46 +0000 (07:51 +0000)
committerPietro Cerutti <gahr@gahr.ch>
Mon, 27 Aug 2018 07:51:46 +0000 (07:51 +0000)
mx.c

diff --git a/mx.c b/mx.c
index 439fe88ae428cd5d17144d28cd21b0e17847590f..f0bcd635ddad8ab43031d729036a3d84440f1e5a 100644 (file)
--- a/mx.c
+++ b/mx.c
@@ -182,8 +182,15 @@ static int mx_open_mailbox_append(struct Context *ctx, int flags)
   ctx->magic = mx_path_probe(ctx->path, NULL);
   if (ctx->magic == MUTT_UNKNOWN)
   {
-    mutt_error(_("%s is not a mailbox"), ctx->path);
-    return -1;
+    if (flags & (MUTT_APPEND | MUTT_NEWFOLDER))
+    {
+      ctx->magic = MUTT_MAILBOX_ERROR;
+    }
+    else
+    {
+      mutt_error(_("%s is not a mailbox"), ctx->path);
+      return -1;
+    }
   }
 
   if (ctx->magic == MUTT_MAILBOX_ERROR)