summaryrefslogtreecommitdiffstats
path: root/commands.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2019-10-13 16:25:54 +0800
committerKevin McCarthy <kevin@8t8.us>2019-10-15 09:15:38 +0800
commit71d6dbea64b3f6d9676867030214236878693bcb (patch)
treef8baceff2af25b5d707c24942727378b7ad9c1e1 /commands.c
parent9a1b08bf8dc6a0b071428d65713e01f68518273d (diff)
Update mime fields when piping a message with $pipe_decode set.
Programs that process the message may get confused if the original mime fields are in the output. Add the CH_MIME flag to strip mime headers and CH_TXTPLAIN to add decoded text mime headers in their place, just as <decode-copy> does. However, make sure not to add the flags when printing, as printers highly likely won't care and users probably don't want to see those headers in their printout.
Diffstat (limited to 'commands.c')
-rw-r--r--commands.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/commands.c b/commands.c
index b88335d1..9a27614f 100644
--- a/commands.c
+++ b/commands.c
@@ -440,14 +440,21 @@ static void pipe_set_flags (int decode, int print, int *cmflags, int *chflags)
{
if (decode)
{
- *cmflags |= MUTT_CM_DECODE | MUTT_CM_CHARCONV;
*chflags |= CH_DECODE | CH_REORDER;
+ *cmflags |= MUTT_CM_DECODE | MUTT_CM_CHARCONV;
if (option (OPTWEED))
{
*chflags |= CH_WEED;
*cmflags |= MUTT_CM_WEED;
}
+
+ /* Just as with copy-decode, we need to update the
+ * mime fields to avoid confusing programs that may
+ * process the email. However, we don't want to force
+ * those fields to appear in printouts. */
+ if (!print)
+ *chflags |= CH_MIME | CH_TXTPLAIN;
}
if (print)