mirror of https://github.com/djcb/mu.git
mu4e: filter out body parts as attachments
Make the attachment heuristic yet a bit more complicated... filter out most body parts.
This commit is contained in:
parent
1c4dbe580c
commit
4c9a8ea112
|
@ -523,6 +523,7 @@ add text-properties to VAL."
|
|||
(setq mu4e~view-attach-map ;; buffer local
|
||||
(make-hash-table :size 64 :weakness nil))
|
||||
(let* ((id 0)
|
||||
(partcount (length (mu4e-message-field msg :parts)))
|
||||
(attachments
|
||||
;; we only list parts that look like attachments, ie. that have a
|
||||
;; non-nil :attachment property; we record a mapping between
|
||||
|
@ -540,9 +541,13 @@ add text-properties to VAL."
|
|||
;; list inline parts as attachment (so they can be
|
||||
;; saved), unless they are text/plain, which are
|
||||
;; usually just message footers in mailing lists
|
||||
;;
|
||||
;; however, slow bigger text parts as attachments,
|
||||
;; except when they're the only part... it's
|
||||
;; complicated.
|
||||
(and (member 'inline attachtype)
|
||||
(or
|
||||
(> partsize 256) ;; filter out footers
|
||||
(and (> partcount 1) (> partsize 256))
|
||||
(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)
|
||||
|
|
Loading…
Reference in New Issue