mutt_message (h ? _("Message bounced.") : _("Messages bounced."));
}
-void mutt_pipe_message_to_state (HEADER *h, STATE *s)
+static void pipe_print_set_flags (int decode, int *cmflags, int *chflags)
{
- int cmflags = 0;
- int chflags = CH_FROM;
-
- if (option (OPTPIPEDECODE))
+ if (decode)
{
- cmflags |= M_CM_DECODE | M_CM_CHARCONV;
- chflags |= CH_DECODE | CH_REORDER;
+ *cmflags |= M_CM_DECODE | M_CM_CHARCONV;
+ *chflags |= CH_DECODE | CH_REORDER;
if (option (OPTWEED))
{
- chflags |= CH_WEED;
- cmflags |= M_CM_WEED;
+ *chflags |= CH_WEED;
+ *cmflags |= M_CM_WEED;
}
}
+}
+
+void mutt_pipe_message_to_state (HEADER *h, STATE *s)
+{
+ int cmflags = 0;
+ int chflags = CH_FROM;
+
+ pipe_print_set_flags (option (OPTPIPEDECODE), &cmflags, &chflags);
if (option (OPTPIPEDECODE))
mutt_parse_mime_message (Context, h);
return -1;
}
+/* XXX - merge this with mutt_pipe_message_to_state? */
+
static void print_msg (FILE *fp, CONTEXT *ctx, HEADER *h)
{
- int cmflags = M_CM_DECODE | M_CM_CHARCONV;
- int chflags = CH_DECODE | CH_REORDER;
+ int cmflags = 0;
+ int chflags = CH_FROM;
- if (option (OPTWEED))
- {
- cmflags |= M_CM_WEED;
- chflags |= CH_WEED;
- }
+ pipe_print_set_flags (option (OPTPRINTDECODE), &cmflags, &chflags);
#ifdef HAVE_PGP
- if (h->pgp & PGPENCRYPT)
+ if (option (OPTPRINTDECODE) && (h->pgp & PGPENCRYPT))
{
if (!pgp_valid_passphrase ())
return;
}
#endif
- mutt_parse_mime_message (ctx, h);
+ if (option (OPTPRINTDECODE))
+ mutt_parse_mime_message (ctx, h);
+
mutt_copy_message (fp, ctx, h, cmflags, chflags);
}
{ "print_cmd", DT_SYN, R_NONE, UL "print_command", 0 },
/*
*/
+ { "print_decode", DT_BOOL, R_NONE, OPTPRINTDECODE, 1 },
+ /*
+ ** .pp
+ ** Used in connection with the print-message command. If this
+ ** option is set, the message is decoded before it is passed to the
+ ** external command specified by $$print_command. If this option
+ ** is unset, no processing will be applied to the message when
+ ** printing it. The latter setting may be useful if you are using
+ ** some advanced printer filter which is able to properly format
+ ** e-mail messages for printing.
+ */
{ "prompt_after", DT_BOOL, R_NONE, OPTPROMPTAFTER, 1 },
/*
** .pp