goto oa_fail1;
}
- ctx->magic = DefaultMagic;
- /* We can only deal with mbox and mmdf mailboxes */
- if ((ctx->magic != MUTT_MBOX) && (ctx->magic != MUTT_MMDF))
- goto oa_fail1;
-
if (setup_paths (ctx) != 0)
goto oa_fail2;
- ctx->mx_ops = &mx_comp_ops;
- ci->child_ops = mx_get_ops (ctx->magic);
- if (!ci->child_ops)
- {
- mutt_error (_("Can't find mailbox ops for mailbox type %d"), ctx->magic);
- goto oa_fail2;
- }
-
/* Lock the realpath for the duration of the append.
* It will be unlocked in the close */
if (!lock_realpath (ctx, 1))
mutt_error (_("Compress command failed: %s"), ci->open);
goto oa_fail2;
}
+ ctx->magic = mx_get_magic (ctx->path);
+ }
+ else
+ ctx->magic = DefaultMagic;
+
+ /* We can only deal with mbox and mmdf mailboxes */
+ if ((ctx->magic != MUTT_MBOX) && (ctx->magic != MUTT_MMDF))
+ {
+ mutt_error (_("Unsupported mailbox type for appending."));
+ goto oa_fail2;
+ }
+
+ ci->child_ops = mx_get_ops (ctx->magic);
+ if (!ci->child_ops)
+ {
+ mutt_error (_("Can't find mailbox ops for mailbox type %d"), ctx->magic);
+ goto oa_fail2;
}
if (ci->child_ops->open_append (ctx, flags) != 0)