From 151a2a323f1ed00217016df2be57d04c67592ce6 Mon Sep 17 00:00:00 2001 From: Daniel Fleischer Date: Mon, 30 Aug 2021 14:42:59 +0300 Subject: [PATCH] Extracting attachments #2116 Different MIME configuration needs a fallback logic. Instead of looking for the attachment "fname" in `("attachment" . (filename "fname"))` structure, we find the same file name in `("mime-type" . (name . "fname"))` structure by searching, since we don't know the MIME type beforehand. Thanks @thierryvolpiatto. --- mu4e/mu4e-view-gnus.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mu4e/mu4e-view-gnus.el b/mu4e/mu4e-view-gnus.el index bd07e613..f703d232 100644 --- a/mu4e/mu4e-view-gnus.el +++ b/mu4e/mu4e-view-gnus.el @@ -491,7 +491,10 @@ containing commas." #'completing-read-multiple)) dir) (dolist (part parts) - (let ((fname (cdr (assoc 'filename (assoc "attachment" (cdr part)))))) + (let ((fname (or (cdr (assoc 'filename (assoc "attachment" (cdr part)))) + (cl-loop for item in part + for name = (and (listp item) (assoc-default 'name item)) + thereis (and (stringp name) name))))) (when fname (push `(,fname . ,(cdr part)) handles) (push fname files))))