diff options
author | Kevin McCarthy <kevin@8t8.us> | 2022-10-13 13:25:51 -0700 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2022-10-13 13:25:51 -0700 |
commit | 25b695304b1e74a7e2d221ca2f7dfec0afca5bf2 (patch) | |
tree | 2d465f3017be55f6b5e46d6d6f3aba241c1ef776 | |
parent | a1c86bd2033d5eaf756517a2fcd539a9a8b85cd9 (diff) |
Allow Fcc'ing to IMAP in batch mode.
There are some prompts that can cause it to abruptly fail, but it
turns out SMTP has some of those too.
For now, abort if $confirmcreate is set.
Certificate prompts were fixed in commit c46db2be for 2.2.7.
-rw-r--r-- | imap/imap.c | 13 | ||||
-rw-r--r-- | send.c | 25 |
2 files changed, 9 insertions, 29 deletions
diff --git a/imap/imap.c b/imap/imap.c index 445cff2e..b92c2dcf 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -1050,10 +1050,15 @@ static int imap_open_mailbox_append (CONTEXT *ctx, int flags) if (rc == -1) return -1; - snprintf (buf, sizeof (buf), _("Create %s?"), mailbox); - if (option (OPTCONFIRMCREATE) && - mutt_query_boolean (OPTCONFIRMCREATE, buf, 1) < 1) - return -1; + if (option (OPTCONFIRMCREATE)) + { + if (option (OPTNOCURSES)) + return -1; + + snprintf (buf, sizeof (buf), _("Create %s?"), mailbox); + if (mutt_query_boolean (OPTCONFIRMCREATE, buf, 1) < 1) + return -1; + } if (imap_create_mailbox (idata, mailbox) < 0) return -1; @@ -1266,31 +1266,6 @@ static int save_fcc_mailbox_part (BUFFER *fcc_mailbox, SEND_CONTEXT *sctx, mutt_strcmp ("/dev/null", mutt_b2s (fcc_mailbox)))) return 0; - /* Don't save a copy when we are in batch-mode, and the FCC - * folder is on an IMAP server: This would involve possibly lots - * of user interaction, which is not available in batch mode. - * - * Note: A patch to fix the problems with the use of IMAP servers - * from non-curses mode is available from Brendan Cully. However, - * I'd like to think a bit more about this before including it. - */ -#ifdef USE_IMAP - if ((flags & SENDBATCH) && - mx_is_imap (mutt_b2s (fcc_mailbox))) - { - mutt_sleep (1); - mutt_error _("Warning: Fcc to an IMAP mailbox is not supported in batch mode"); - /* L10N: - Printed after the "Fcc to an IMAP mailbox is not supported" message. - To make it clearer that the message doesn't mean Mutt is aborting - sending the mail too. - %s is the full mailbox URL, including imap(s):// - */ - mutt_error (_("Skipping Fcc to %s"), mutt_b2s (fcc_mailbox)); - return 0; - } -#endif - rc = mutt_write_fcc (mutt_b2s (fcc_mailbox), sctx, NULL, 0, NULL); if (rc && (flags & SENDBATCH)) { |