From: Rocco Rutte Date: Sun, 31 May 2009 08:40:23 +0000 (+0200) Subject: Add $honor_disposition to not display attachments inline. Closes #3170. X-Git-Tag: neomutt-20160307~627 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8e8942236008878dc16603d3bd422680bca1e541;p=neomutt Add $honor_disposition to not display attachments inline. Closes #3170. Previously all MIME parts were displayed inline regardless of the Content-Disposition header (if present). With $honor_disposition set, only inline parts are displayed inline, attachments can only be viewed from the attachments menu. --- diff --git a/ChangeLog b/ChangeLog index 99c06582a..9e06d4086 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-04-25 01:56 -0400 Dan Loewenherz (c1b947f60ea6) + + * init.h: Disables the insecure SSLv2 protocol. Closes #3192. + +2009-05-30 19:37 +0200 Rocco Rutte (b080ae086a62) + + * ChangeLog, mbox.c: Keep new mail flag for mbox/mmdf folders after + closing. Closes #1362. + 2009-05-30 10:23 -0700 Vincent Lefevre (be7b3d349725) * po/fr.po: Updated French translation. diff --git a/handler.c b/handler.c index c3572bd32..a4c27ad01 100644 --- a/handler.c +++ b/handler.c @@ -1592,8 +1592,11 @@ int mutt_body_handler (BODY *b, STATE *s) handler = crypt_smime_application_smime_handler; } - - if (plaintext || handler) + /* only respect disposition == attachment if we're not + displaying from the attachment menu (i.e. pager) */ + if ((!option (OPTHONORDISP) || (b->disposition != DISPATTACH || + option(OPTVIEWATTACH))) && + (plaintext || handler)) { fseeko (s->fpin, b->offset, 0); @@ -1680,10 +1683,18 @@ int mutt_body_handler (BODY *b, STATE *s) } s->flags |= M_FIRSTDONE; } - else if (s->flags & M_DISPLAY) + /* print hint to use attachment menu for disposition == attachment + if we're not already being called from there */ + else if ((s->flags & M_DISPLAY) || (b->disposition == DISPATTACH && + !option (OPTVIEWATTACH) && + option (OPTHONORDISP) && + (plaintext || handler))) { state_mark_attach (s); - state_printf (s, _("[-- %s/%s is unsupported "), TYPE (b), b->subtype); + if (option (OPTHONORDISP) && b->disposition == DISPATTACH) + fputs (_("[-- This is an attachment "), s->fpout); + else + state_printf (s, _("[-- %s/%s is unsupported "), TYPE (b), b->subtype); if (!option (OPTVIEWATTACH)) { if (km_expand_key (type, sizeof(type), diff --git a/init.h b/init.h index 2975b8a0a..b480f8ff9 100644 --- a/init.h +++ b/init.h @@ -998,6 +998,17 @@ struct option_t MuttVars[] = { ** .pp ** The file in which Mutt will save its history. */ + { "honor_disposition", DT_BOOL, R_NONE, OPTHONORDISP, 0 }, + /* + ** .pp + ** When \fIset\fP, Mutt will not display attachments with a + ** disposition of ``attachment'' inline even if it could + ** render the part to plain text. These MIME parts can only + ** be viewed from the attachment menu. + ** .pp + ** If \fIunset\fP, Mutt will render all MIME parts it can + ** properly transform to plain text. + */ { "honor_followup_to", DT_QUAD, R_NONE, OPT_MFUPTO, M_YES }, /* ** .pp diff --git a/mutt.h b/mutt.h index 06cdab8b3..17f8db2fc 100644 --- a/mutt.h +++ b/mutt.h @@ -358,6 +358,7 @@ enum OPTHIDETHREADSUBJECT, OPTHIDETOPLIMITED, OPTHIDETOPMISSING, + OPTHONORDISP, OPTIGNORELWS, OPTIGNORELISTREPLYTO, #ifdef USE_IMAP