summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-02-20 13:47:31 +0100
committerErich Eckner <git@eckner.net>2021-01-20 19:18:53 +0100
commit1d577701f415030bb215b997e6fb4c2ab993b1a3 (patch)
tree0b4c6f00dd2c1c891df6165a8cf8ddcf20a01d9e
parent4fcb1dccfa8ee416684d560a5c0f45aed8a12807 (diff)
downloadalpine-1d577701f415030bb215b997e6fb4c2ab993b1a3.tar.xz
topal-patch-2 appliedtopal-patch
-rw-r--r--imap/src/c-client/mail.c2
-rw-r--r--pith/mailcap.c13
2 files changed, 13 insertions, 2 deletions
diff --git a/imap/src/c-client/mail.c b/imap/src/c-client/mail.c
index 981025c1..81f637d1 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 5c0acda9..c7f0a847 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';