]> granicus.if.org Git - mutt/commitdiff
When an attachment's content-disposition is different from "inline",
authorThomas Roessler <roessler@does-not-exist.org>
Mon, 26 Jul 1999 17:08:07 +0000 (17:08 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Mon, 26 Jul 1999 17:08:07 +0000 (17:08 +0000)
and if the user sets the use_cdisp option, don't auto_view this
part.

doc/manual.sgml.in
handler.c
init.h
mutt.h
parse.c

index b8dea7924419b3eff6fb979fb4b2086f77e9e155..a9bff4a68767d4e4b27a3c3e0ace377ab5124b01 100644 (file)
@@ -4378,6 +4378,15 @@ When <em/set/, Mutt will invoke <ref id="sendmail" name="&dollar;sendmail">
 with the <tt/-B8BITMIME/ flag when sending 8-bit messages to enable ESMTP
 negotiation.
 
+<sect2>use&lowbar;cdisp<label id="use_cdisp">
+<p>
+Type: boolean<newline>
+Default: unset
+
+When this option is set, mutt will restrict the auto_view feature to
+body parts which carry a content-disposition field with the value
+inline, or no such field.
+
 <sect2>use&lowbar;domain<label id="use_domain">
 <p>
 Type: boolean<newline>
index 39dfff94add751beeb80206ae3d01d063e462e11..39561e22684038ba007853641ce1e12870dd6776 100644 (file)
--- a/handler.c
+++ b/handler.c
@@ -1324,7 +1324,7 @@ void mutt_body_handler (BODY *b, STATE *s)
   /* first determine which handler to use to process this part */
 
   snprintf (type, sizeof (type), "%s/%s", TYPE (b), b->subtype);
-  if (mutt_is_autoview (b, type))
+  if (mutt_is_autoview (b, type) && (b->disposition == DISPINLINE || !option (OPTUSECDISP)))
   {
     rfc1524_entry *entry = rfc1524_new_entry ();
 
diff --git a/init.h b/init.h
index dfbdfd38250bf46c5a799ce616cec75cb40b94e2..4b5d5df077e06775ba47bd3997842b5bf56727cd 100644 (file)
--- a/init.h
+++ b/init.h
@@ -286,6 +286,7 @@ struct option_t MuttVars[] = {
   { "tmpdir",          DT_PATH, R_NONE, UL &Tempdir, 0 },
   { "to_chars",                DT_STR,  R_BOTH, UL &Tochars, UL " +TCF" },
   { "use_8bitmime",    DT_BOOL, R_NONE, OPTUSE8BITMIME, 0 },
+  { "use_cdisp",       DT_BOOL, R_NONE, OPTUSECDISP, 0 },
   { "use_domain",      DT_BOOL, R_NONE, OPTUSEDOMAIN, 1 },
   { "use_from",                DT_BOOL, R_NONE, OPTUSEFROM, 1 },
   { "user_agent",      DT_BOOL, R_NONE, OPTXMAILER, 1},
diff --git a/mutt.h b/mutt.h
index 6d4ab16fdc13c4341a19a558ea9bbc0686cb6f4f..94a2b9771bd2f6e5f13ba5ffa5b1be491ed402f3 100644 (file)
--- a/mutt.h
+++ b/mutt.h
@@ -325,6 +325,7 @@ enum
   OPTTILDE,
   OPTUNCOLLAPSEJUMP,
   OPTUSE8BITMIME,
+  OPTUSECDISP,
   OPTUSEDOMAIN,
   OPTUSEFROM,
   OPTWAITKEY,
diff --git a/parse.c b/parse.c
index 5897f8e25c9d4ad0415941ecaa59fa194afd6a81..b7fe43a549f56f13498479efbcd00c0358e32fb2 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -327,12 +327,12 @@ static void parse_content_disposition (char *s, BODY *ct)
 {
   PARAMETER *parms;
 
-  if (!mutt_strncasecmp ("inline", s, 6))
-    ct->disposition = DISPINLINE;
+  if (!mutt_strncasecmp ("attach", s, 6))
+    ct->disposition = DISPATTACH;
   else if (!mutt_strncasecmp ("form-data", s, 9))
     ct->disposition = DISPFORMDATA;
   else
-    ct->disposition = DISPATTACH;
+    ct->disposition = DISPINLINE;
 
   /* Check to see if a default filename was given */
   if ((s = strchr (s, ';')) != NULL)