From 1d577701f415030bb215b997e6fb4c2ab993b1a3 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 20 Feb 2019 13:47:31 +0100 Subject: topal-patch-2 applied --- imap/src/c-client/mail.c | 2 ++ pith/mailcap.c | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/imap/src/c-client/mail.c b/imap/src/c-client/mail.c index 981025c..81f637d 100644 --- a/imap/src/c-client/mail.c +++ b/imap/src/c-client/mail.c @@ -2850,6 +2850,8 @@ BODY *mail_body_section (BODY *b, unsigned char *section) BODY *mail_body (MAILSTREAM *stream,unsigned long msgno,unsigned char *section) { BODY *b = NIL; + /* Topal hack 2 */ + mail_fetchstructure (stream,msgno,&b); /* make sure have a body */ if (section && *section && mail_fetchstructure (stream,msgno,&b) && b) return mail_body_section(b, section); diff --git a/pith/mailcap.c b/pith/mailcap.c index 5c0acda..c7f0a84 100644 --- a/pith/mailcap.c +++ b/pith/mailcap.c @@ -583,8 +583,17 @@ mc_get_command(int type, char *subtype, BODY *body, * typically two scans through the check_extension * mechanism, the mailcap entry now takes precedence. */ - if((fname = get_filename_parameter(NULL, 0, body, &e2b.from.ext)) != NULL - && e2b.from.ext && e2b.from.ext[0]){ + /* Topal hack 2 */ + fname = get_filename_parameter(NULL, 0, body, &e2b.from.ext); + if (fname == NULL) { + if (body->type == TYPEMULTIPART && + ((body->subtype && !strucmp(body->subtype, "signed")) + ||(body->subtype && !strucmp(body->subtype, "encrypted")))) + fname = cpystr("openpgp.msg"); + } + + if(fname != NULL + && e2b.from.ext && e2b.from.ext[0]){ if(strlen(e2b.from.ext) < sizeof(tmp_ext) - 2){ strncpy(ext = tmp_ext, e2b.from.ext - 1, sizeof(tmp_ext)); /* remember it */ tmp_ext[sizeof(tmp_ext)-1] = '\0'; -- cgit v1.2.3-54-g00ecf