mirror of https://github.com/djcb/mu.git
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:
parent
235dc75a1a
commit
1c4dbe580c
|
@ -1,6 +1,6 @@
|
|||
;;; 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>
|
||||
;; Maintainer: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
||||
|
@ -531,6 +531,7 @@ add text-properties to VAL."
|
|||
(lambda (part)
|
||||
(let* ((mtype (or (mu4e-message-part-field part :mime-type)
|
||||
"application/octet-stream"))
|
||||
(partsize (or (mu4e-message-part-field part :size) 0))
|
||||
(attachtype (mu4e-message-part-field part :type))
|
||||
(isattach
|
||||
(or ;; we consider parts marked either
|
||||
|
@ -540,7 +541,9 @@ add text-properties to VAL."
|
|||
;; saved), unless they are text/plain, which are
|
||||
;; usually just message footers in mailing lists
|
||||
(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
|
||||
;; image/audio/application type (but not a signature)
|
||||
isattach
|
||||
|
|
Loading…
Reference in New Issue