Rocco Rutte:
[apps/madmutt.git] / muttlib.c
index 72566aa..94c7816 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -1225,16 +1225,10 @@ int mutt_save_confirm (const char *s, struct stat *st)
   }
 #endif
 
-  if (stat (s, st) != -1) {
-    if (magic == -1) {
-      mutt_error (_("%s is not a mailbox!"), s);
-      return 1;
-    }
-
+  if (magic > 0 && !mx_access (s, W_OK)) {
     if (option (OPTCONFIRMAPPEND) &&
-        (!TrashPath || (mutt_strcmp (s, TrashPath) != 0)))
+        (!TrashPath || (mutt_strcmp (s, TrashPath) != 0))) {
       /* if we're appending to the trash, there's no point in asking */
-    {
       snprintf (tmp, sizeof (tmp), _("Append messages to %s?"), s);
       if ((rc = mutt_yesorno (tmp, M_YES)) == M_NO)
         ret = 1;
@@ -1242,6 +1236,13 @@ int mutt_save_confirm (const char *s, struct stat *st)
         ret = -1;
     }
   }
+
+  if (stat (s, st) != -1) {
+    if (magic == -1) {
+      mutt_error (_("%s is not a mailbox!"), s);
+      return 1;
+    }
+  }
   else {
 #ifdef USE_IMAP
     if (magic != M_IMAP)