Nowadays, typical e-mail messages can be thought of as a series of “MIME-parts”, which are sections of the message. The most prominent of those parts is the ’body’, which is the main text of the message your are reading.
Other MIME-parts in the messages include attachments.
Many e-mail messages contain attachments, which are MIME-parts that encode files which you can extract.
To save attachments as files on your computer, mu4e’s message-view
offers the command mu4e-view-save-attachments; its default keybinding is
e (think extract).
When point is on the attachment label in the message, e.g., on something that
looks like [4. application/pdf; Some Document.pdf]..., the Gnus’ binding for
e prevails, which is gnus-mime-view-part-externally. You can of
course customize this in the usual (Emacs) way.
After invoking the command, you can enter the file names to save, comma-separated, with completion support. Press RET to save the chosen attachments as files to your computer. If you do not specify any attachments, all are saved.
mu4e determines the target directory, using the variable
mu4e-attachment-dir (which can be either file-system path or a function;
see its docstring for details. However, you can manually set the target by
calling mu4e-view-save-attachments with a prefix argument.
When completing the file names, mu4e-view-completion-minor-mode is
active, which offers mu4e-view-complete-all (bound to C-c C-a to
complete all files11.
mu4e-view-save-attachments assumes unique filenames for the attachments,
which is requirement of the underlying completion mechanism works. If there are
duplicates, only one is recognized.
Furthermore, file names that match crm-separator (by default, commas) are
not supported (see completing-read-multiple for further details). For
such corner-cases, it is recommended to use mu4e-view-mime-part-action
instead, which does not have this limitation.
Not all MIME-parts are message bodies or attachments, and it can be useful to operate on those other parts as well.
To do so, there is mu4e-view-mime-part-action (default key-binding
A). You can pass the number of the MIME-part (as seen in the message view)
as a prefix argument; otherwise you get to get to choose from a completion menu.
After choosing one or more MIME-parts, you can specify an action to apply to
them; see the variable mu4e-view-mime-part-actions for the possibilities.
You can add your own actions as well, see MIME-part actions for an
example.
mu uses some heuristics to decide if a part should be treated
as an attachment; including inline parts that specify a filename. The
heuristic tries to balance false-positive and false-negatives, both of which are
possible
Except when using ’Helm’; in that case, use the Helm-mechanism for selecting multiple