File: 01_mail_metamail.patch

package info (click to toggle)
mailutils 1%3A0.6.1-4sarge2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 15,568 kB
  • ctags: 11,612
  • sloc: ansic: 111,948; sh: 8,899; yacc: 4,338; makefile: 2,235; exp: 2,190; lex: 1,379; lisp: 688; awk: 202; pascal: 151; sed: 23
file content (129 lines) | stat: -rw-r--r-- 4,217 bytes parent folder | download
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
Index: doc/texinfo/programs.texi
===================================================================
RCS file: /cvsroot/mailutils/mailutils/doc/texinfo/programs.texi,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -r1.56 -r1.57
--- doc/texinfo/programs.texi	12 Mar 2005 20:51:45 -0000	1.56
+++ doc/texinfo/programs.texi	25 Mar 2005 21:19:33 -0000	1.57
@@ -2021,16 +2021,25 @@
 @end itemize
 
 @item metamail
-@*Type: String.
-@*Default: Unset.
+@*Type: Boolean or String.
+@*Default: True.
 @vrindex metamail, mail variable
 
-This variable controls operation of @code{decode} command. When
-it is set, @code{decode} it contains the command line of
-@command{metamail} command that is to be used to display parts of
-a multipart message. For example:
+This variable controls operation of @code{decode} command. If
+it is unset, @code{decode} will not attempt any interpretation
+of the content of message parts. Otherwise, if @code{metamail}
+is set to @code{true}, @code{decode} will use internal metamail
+support to interpret message parts. Finally, if @code{metamail}
+is assigned a string, this string is treated as command line of
+the external @command{metamail} command which will be used to
+display parts of a multipart message. For example:
 
 @smallexample
+# Disable MIME interpretation:
+set nometamail
+# Enable built-in MIME support:
+set metamail
+# Use external program to display MIME parts:
 set metamail="metamail -m mail -p"
 @end smallexample
 
Index: mail/decode.c
===================================================================
RCS file: /cvsroot/mailutils/mailutils/mail/decode.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- mail/decode.c	12 Mar 2005 19:21:21 -0000	1.18
+++ mail/decode.c	25 Mar 2005 21:18:19 -0000	1.19
@@ -180,16 +180,18 @@
     }
   else if (util_getenv (&tmp, "metamail", Mail_env_string, 0) == 0)
     {
+      /* If `metamail' is set to a string, treat it as command line
+	 of external metamail program. */
       run_metamail (tmp, mesg);
     }
   else
     {
+      int builtin_display = 1;
       body_t body = NULL;
       stream_t b_stream = NULL;
       stream_t d_stream = NULL;
       stream_t stream = NULL;
       header_t hdr = NULL;
-      char *no_ask = NULL;
       
       message_get_body (mesg, &body);
       message_get_header (mesg, &hdr);
@@ -202,13 +204,25 @@
       else
 	stream = b_stream;
 
-      util_getenv (&no_ask, "mimenoask", Mail_env_string, 0);
-      
       display_part_header (ofile, msgset, type, encoding);
-      if (display_stream_mailcap (NULL, stream, hdr, no_ask, interactive,
-				  0,
-				  util_getenv (NULL, "verbose",
-					       Mail_env_boolean, 0) ? 0 : 9))
+
+      /* If `metamail' is set to true, enable internal mailcap
+	 support */
+      if (util_getenv (NULL, "metamail", Mail_env_boolean, 0) == 0)
+	{
+	  char *no_ask = NULL;
+	  int debug = 0;
+	  
+	  util_getenv (&no_ask, "mimenoask", Mail_env_string, 0);
+	  if (util_getenv (&debug, "verbose", Mail_env_boolean, 0) == 0
+	      && debug)
+	    debug = 9;
+	  
+	  builtin_display = display_stream_mailcap (NULL, stream, hdr, no_ask,
+						    interactive, 0, debug);
+	}
+
+      if (builtin_display)
 	{
 	  size_t lines = 0;
 	  int pagelines = util_get_crt ();
Index: mail/mail.c
===================================================================
RCS file: /cvsroot/mailutils/mailutils/mail/mail.c,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -r1.88 -r1.89
--- mail/mail.c	5 Mar 2005 09:52:36 -0000	1.88
+++ mail/mail.c	25 Mar 2005 21:18:38 -0000	1.89
@@ -259,6 +259,7 @@
   "unfold subject",
   "sender mail-followup-to reply-to from",
   "set nocmd",
+  "set metamail",
   
   /* Start in mail reading mode */
   "set mode=read",
Index: testsuite/etc/mail.rc
===================================================================
RCS file: /cvsroot/mailutils/mailutils/testsuite/etc/mail.rc,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- testsuite/etc/mail.rc	3 Nov 2002 12:20:31 -0000	1.2
+++ testsuite/etc/mail.rc	25 Mar 2005 21:18:53 -0000	1.3
@@ -1,3 +1,4 @@
 set quiet nocrt dot
 set screen=10 columns=80
 set indentprefix="> "
+set nometamail