mu4e: show inline text/plain as attachment
Show inline text parts as attachments too, so we can save them; however, filter outer really small ones (ie. footers)
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
;;; mu4e-view.el -- part of mu4e, the mu mail user agent
|
;;; mu4e-view.el -- part of mu4e, the mu mail user agent
|
||||||
;;
|
;;
|
||||||
;; Copyright (C) 2011-2016 Dirk-Jan C. Binnema
|
;; Copyright (C) 2011-2017 Dirk-Jan C. Binnema
|
||||||
|
|
||||||
;; Author: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
;; Author: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||||
;; Maintainer: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
;; Maintainer: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||||
@ -531,6 +531,7 @@ add text-properties to VAL."
|
|||||||
(lambda (part)
|
(lambda (part)
|
||||||
(let* ((mtype (or (mu4e-message-part-field part :mime-type)
|
(let* ((mtype (or (mu4e-message-part-field part :mime-type)
|
||||||
"application/octet-stream"))
|
"application/octet-stream"))
|
||||||
|
(partsize (or (mu4e-message-part-field part :size) 0))
|
||||||
(attachtype (mu4e-message-part-field part :type))
|
(attachtype (mu4e-message-part-field part :type))
|
||||||
(isattach
|
(isattach
|
||||||
(or ;; we consider parts marked either
|
(or ;; we consider parts marked either
|
||||||
@ -540,7 +541,9 @@ add text-properties to VAL."
|
|||||||
;; saved), unless they are text/plain, which are
|
;; saved), unless they are text/plain, which are
|
||||||
;; usually just message footers in mailing lists
|
;; usually just message footers in mailing lists
|
||||||
(and (member 'inline attachtype)
|
(and (member 'inline attachtype)
|
||||||
(not (string-match "^text/plain" mtype))))))
|
(or
|
||||||
|
(> partsize 256) ;; filter out footers
|
||||||
|
(not (string-match "^text/plain" mtype)))))))
|
||||||
(or ;; remove if it's not an attach *or* if it's an
|
(or ;; remove if it's not an attach *or* if it's an
|
||||||
;; image/audio/application type (but not a signature)
|
;; image/audio/application type (but not a signature)
|
||||||
isattach
|
isattach
|
||||||
|
|||||||
Reference in New Issue
Block a user