--- mutt-1.3.27/PATCHES.orig Tue Jan 15 10:03:20 2002 +++ mutt-1.3.27/PATCHES Wed Jan 23 12:37:44 2002 @@ -0,0 +1 @@ +Feature patch: mailcap-fix 1.3.27 by Stefan `Sec` Zehl --- mutt-1.3.27/attach.c.orig Mon Jan 7 20:08:38 2002 +++ mutt-1.3.27/attach.c Wed Jan 23 12:37:44 2002 @@ -283,7 +283,7 @@ /* for compatibility with metamail */ -static int is_mmnoask (const char *buf) +int is_mmnoask (const char *buf) { char tmp[LONG_STRING], *p, *q; int lng; @@ -340,9 +340,6 @@ if (mutt_needs_mailcap (b)) { if (option (OPTIMPLICITAUTOVIEW)) - return 1; - - if (is_mmnoask (type)) return 1; } --- mutt-1.3.27/attach.h.orig Tue Sep 11 13:15:17 2001 +++ mutt-1.3.27/attach.h Wed Jan 23 12:37:44 2002 @@ -28,6 +28,7 @@ void mutt_pipe_attachment_list (FILE *fp, int tag, BODY *top, int filter); void mutt_print_attachment_list (FILE *fp, int tag, BODY *top); +int is_mmnoask (const char *buf); void mutt_attach_bounce (FILE *, HEADER *, ATTACHPTR **, short, BODY *); void mutt_attach_resend (FILE *, HEADER *, ATTACHPTR **, short, BODY *); void mutt_attach_forward (FILE *, HEADER *, ATTACHPTR **, short, BODY *); --- mutt-1.3.27/commands.c.orig Mon Dec 3 11:17:57 2001 +++ mutt-1.3.27/commands.c Wed Jan 23 12:37:44 2002 @@ -26,6 +26,7 @@ #include "copy.h" #include "mx.h" #include "pager.h" +#include "attach.h" #include #include #include @@ -72,6 +73,30 @@ snprintf (buf, sizeof (buf), "%s/%s", TYPE (cur->content), cur->content->subtype); + + if (cur->mailcap && !mutt_is_autoview (cur->content, buf)) + { + if (is_mmnoask (buf)) + rc = M_YES; + else + rc = query_quadoption (OPT_USEMAILCAP, + _("Display message using mailcap?")); + if (rc < 0) + return 0; + else if (rc == M_YES) + { + MESSAGE *msg; + + if ((msg = mx_open_message (Context, cur->msgno)) != NULL) + { + mutt_view_attachment (msg->fp, cur->content, M_REGULAR, + NULL, NULL, 0); + mx_close_message (&msg); + mutt_set_flag (Context, cur, M_READ, 1); + } + return 0; + } + } mutt_parse_mime_message (Context, cur); mutt_message_hook (Context, cur, M_MESSAGEHOOK); --- mutt-1.3.27/hdrline.c.orig Mon Dec 17 11:04:48 2001 +++ mutt-1.3.27/hdrline.c Wed Jan 23 12:37:45 2002 @@ -617,9 +617,11 @@ case 'Z': ch = ' '; + if (hdr->mailcap) + ch = 'M'; #ifdef HAVE_PGP - if (hdr->pgp & PGPGOODSIGN) + else if (hdr->pgp & PGPGOODSIGN) ch = 'S'; else if (hdr->pgp & PGPENCRYPT) ch = 'P'; --- mutt-1.3.27/init.h.orig Mon Dec 10 11:09:03 2001 +++ mutt-1.3.27/init.h Wed Jan 23 12:37:45 2002 @@ -2274,6 +2274,16 @@ ** generated unless the user explicitly sets one using the ``$my_hdr'' ** command. */ + { "use_mailcap", DT_QUAD, R_NONE, OPT_USEMAILCAP, M_ASKYES }, + /* + ** .pp + ** When \fIset\fP, Mutt will use mailcap entries to display attachments + ** which can't be displayed in the pager (due to missing the copiousoutput + ** flag). + ** If \fIunset\fP, these attachments will not be displayed. + ** The MM_NOASK environment variable specifies a comma seperated list of + ** types to always display, regardless of the setting of use_mailcap. + */ #ifdef HAVE_GETADDRINFO { "use_ipv6", DT_BOOL, R_NONE, OPTUSEIPV6, 1}, /* --- mutt-1.3.27/mutt.h.orig Tue Jan 15 22:00:32 2002 +++ mutt-1.3.27/mutt.h Wed Jan 23 12:38:04 2002 @@ -262,6 +262,7 @@ OPT_SSLSTARTTLS, #endif + OPT_USEMAILCAP, OPT_PRINT, OPT_INCLUDE, OPT_DELETE, @@ -615,6 +616,7 @@ #endif unsigned int mime : 1; /* has a Mime-Version header? */ + unsigned int mailcap : 1; /* requires mailcap to display? */ unsigned int flagged : 1; /* marked important? */ unsigned int tagged : 1; unsigned int deleted : 1; --- mutt-1.3.27/mx.c.orig Tue Jan 15 22:09:53 2002 +++ mutt-1.3.27/mx.c Wed Jan 23 12:37:45 2002 @@ -1573,7 +1573,12 @@ #ifdef HAVE_PGP /* NOTE: this _must_ be done before the check for mailcap! */ h->pgp = pgp_query (h->content); + if (!h->pgp) #endif /* HAVE_PGP */ + + if (mutt_needs_mailcap (h->content)) + h->mailcap = 1; + if (!ctx->pattern) {