On Saturday Nov 26 2016, Hippo Man wrote:
> In the headers buffer, I want to loop through a group of messages whose
> headers have been selected within a region, and I want to access all the
> attachments from any messages that contain them.
>
> I am able to successfully loop through the messages, but the *:parts*
> attribute is missing for each of these messages. What do I need to do in
> order to get the message parts by means of the following function? ...
>
> (defun process-all-attachments ()
> (interactive)
> (let ((start (if (region-active-p) (region-beginning) (point-min)))
> (end (if (region-active-p) (region-end) (point-max))))
> (save-excursion
> (save-restriction
> (narrow-to-region start end)
> (mu4e-headers-for-each
> (lambda (msg)
> (let ((flags (mu4e-message-field msg :flags)))
> (when (member 'attach flags)
> *;; WHAT DO I DO HERE TO GET ALL OF THE MESSAGE PARTS???*
> ))))))))
>
In headers-mode, mu4e uses reduced message-objects (for performance
reasons), which don't include e.g. message bodies, mime-parts etc.
If you want to, say, extract the attachments for such messages, one
possibility would be to use the :path field and shell out to "mu
extract".
Kind regards,
Dirk.
--
Dirk-Jan C. Binnema Helsinki, Finland
e:dj...@djcbsoftware.nl w:
www.djcbsoftware.nl
pgp: D09C E664 897D 7D39 5047 A178 E96A C7A1 017D DA3C