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.
{
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)