]> granicus.if.org Git - neomutt/commitdiff
mxapi: fix creation of new mailboxes
authorRichard Russon <rich@flatcap.org>
Fri, 21 Dec 2018 13:17:01 +0000 (13:17 +0000)
committerRichard Russon <rich@flatcap.org>
Fri, 21 Dec 2018 13:17:01 +0000 (13:17 +0000)
mx.c

diff --git a/mx.c b/mx.c
index 6364d8beb4fe5c614460e6c34cb12823f673aa83..0ec980d22a5361a96c9dbb6bd729bd4a79c38466 100644 (file)
--- a/mx.c
+++ b/mx.c
@@ -273,6 +273,12 @@ struct Context *mx_mbox_open(struct Mailbox *m, const char *path, int flags)
     /* int rc = */ mx_path_canon2(m, Folder);
   }
 
+  if ((m->magic == MUTT_UNKNOWN) && (flags & MUTT_NEWFOLDER))
+  {
+    m->magic = MboxType;
+    m->mx_ops = mx_get_ops(m->magic);
+  }
+
   if (!m->account)
   {
     struct Account *a = mx_ac_find(m);