X-Git-Url: https://git.llucax.com/software/mutt-debian.git/blobdiff_plain/19304f7c526fbe36ba0db2fb80bcaf3bd974d81d..90ca98902668310adea2bd544a61a3d6c9c12f1c:/commands.c diff --git a/commands.c b/commands.c index 45b9db7..f9c2025 100644 --- a/commands.c +++ b/commands.c @@ -72,7 +72,7 @@ int mutt_display_message (HEADER *cur) mutt_parse_mime_message (Context, cur); mutt_message_hook (Context, cur, M_MESSAGEHOOK); - /* see if crytpo is needed for this message. if so, we should exit curses */ + /* see if crypto is needed for this message. if so, we should exit curses */ if (WithCrypto && cur->security) { if (cur->security & ENCRYPT) @@ -109,7 +109,7 @@ int mutt_display_message (HEADER *cur) } - mutt_mktemp (tempfile); + mutt_mktemp (tempfile, sizeof (tempfile)); if ((fpout = safe_fopen (tempfile, "w")) == NULL) { mutt_error _("Could not create temporary file!"); @@ -146,7 +146,7 @@ int mutt_display_message (HEADER *cur) } res = mutt_copy_message (fpout, Context, cur, cmflags, - (option (OPTWEED) ? (CH_WEED | CH_REORDER) : 0) | CH_DECODE | CH_FROM); + (option (OPTWEED) ? (CH_WEED | CH_REORDER) : 0) | CH_DECODE | CH_FROM | CH_DISPLAY); if ((safe_fclose (&fpout) != 0 && errno != EPIPE) || res < 0) { mutt_error (_("Could not copy message")); @@ -222,7 +222,8 @@ int mutt_display_message (HEADER *cur) if ((r = mutt_system (buf)) == -1) mutt_error (_("Error running \"%s\"!"), buf); unlink (tempfile); - keypad (stdscr, TRUE); + if (!option (OPTNOCURSES)) + keypad (stdscr, TRUE); if (r != -1) mutt_set_flag (Context, cur, M_READ, 1); if (r != -1 && option (OPTPROMPTAFTER)) @@ -246,6 +247,29 @@ void ci_bounce_message (HEADER *h, int *redraw) char *err = NULL; int rc; + /* RfC 5322 mandates a From: header, so warn before bouncing + * messages without one */ + if (h) + { + if (!h->env->from) + { + mutt_error _("Warning: message has no From: header"); + mutt_sleep (2); + } + } + else if (Context) + { + for (rc = 0; rc < Context->msgcount; rc++) + { + if (Context->hdrs[rc]->tagged && !Context->hdrs[rc]->env->from) + { + mutt_error ("Warning: message has no From: header"); + mutt_sleep (2); + break; + } + } + } + if(h) strfcpy(prompt, _("Bounce message to: "), sizeof(prompt)); else @@ -391,7 +415,7 @@ static int _mutt_pipe_message (HEADER *h, char *cmd, } pipe_msg (h, fpout, decode, print); - fclose (fpout); + safe_fclose (&fpout); rc = mutt_wait_filter (thepid); } else @@ -706,8 +730,6 @@ int mutt_save_message (HEADER *h, int delete, char prompt[SHORT_STRING], buf[_POSIX_PATH_MAX]; CONTEXT ctx; struct stat st; - BUFFY *tmp = NULL; - struct utimbuf ut; *redraw = 0; @@ -841,26 +863,7 @@ int mutt_save_message (HEADER *h, int delete, mx_close_mailbox (&ctx, NULL); if (need_buffy_cleanup) - { - if (option(OPTCHECKMBOXSIZE)) - { - tmp = mutt_find_mailbox (buf); - if (tmp && !tmp->new) - mutt_update_mailbox (tmp); - } - else - { - /* fix up the times so buffy won't get confused */ - if (st.st_mtime > st.st_atime) - { - ut.actime = st.st_atime; - ut.modtime = time (NULL); - utime (buf, &ut); - } - else - utime (buf, NULL); - } - } + mutt_buffy_cleanup (buf, &st); mutt_clear_error (); return (0);