summarylogtreecommitdiffstats
path: root/611410-no-implicit_autoview-for-text-html.patch
blob: 3bedea08479e58bbdfeac050ebe758e64428b276 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
From: Antonio Radici <antonio@debian.org>
Date: Thu, 27 Feb 2014 17:36:31 +0100
Subject: 611410-no-implicit_autoview-for-text-html
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This patch blacklist text/html from the list of documents that will be
shown automatically, the patch (the muttlib.c part) has been written by
Loïc Minier <lool@dooz.org>, I've added the documentation bit.

The patch has been forwarded upstream originally by Loïc on:
http://bugs.mutt.org/3496

The original Debian bug for this problem is:
http://bugs.debian.org/611410

Gbp-Pq: Topic upstream
---
 init.h    | 4 +++-
 muttlib.c | 3 +++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/init.h b/init.h
index e370b3a..35224c1 100644
--- a/init.h
+++ b/init.h
@@ -1251,7 +1251,9 @@ struct option_t MuttVars[] = {
   ** ``\fCcopiousoutput\fP'' flag set for \fIevery\fP MIME attachment it doesn't have
   ** an internal viewer defined for.  If such an entry is found, mutt will
   ** use the viewer defined in that entry to convert the body part to text
-  ** form.
+  ** form. MIME attachments with 'text' types, with the only exception
+  ** of text/html, are excluded: they will be shown as they are unless auto_view
+  ** is specified.
   */
   { "include",		DT_QUAD, R_NONE, OPT_INCLUDE, M_ASKYES },
   /*
diff --git a/muttlib.c b/muttlib.c
index 0fd9766..c1d565f 100644
--- a/muttlib.c
+++ b/muttlib.c
@@ -650,6 +650,9 @@ int mutt_needs_mailcap (BODY *m)
   switch (m->type)
   {
     case TYPETEXT:
+      /* we don't want to display text/html */
+      if (!ascii_strcasecmp ("html", m->subtype))
+        return 1;
       /* we can display any text, overridable by auto_view */
       return 0;
       break;