Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
99 lines (71 sloc) 2.52 KB
.TH MU EXTRACT 1 "January 2012" "User Manuals"
mu extract\- display and save message parts (attachments), and open them with
other tools.
.B mu extract [options] <file>
.B mu extract [options] <file> <pattern>
\fBmu extact\fR is the \fBmu\fR sub-command for extracting MIME-parts (e.g.,
attachments) from mail messages. It works on message files, and does not
require the message to be indexed in the database.
For attachments, the file name used when saving it, is the name of the
attachment in the message. If there is no such name, or when saving
non-attachment MIME-parts, a name is derived from the message-id of the
If you specify a pattern (a case-insensitive regular expression) as the second
argument, all attachments with filenames matching that pattern will be
extracted. The regular expressions are Perl-compatible (as per the
Without any options, \fBmu extract\fR simply outputs the list of MIME-parts in
the message.
\fB\-a\fR, \fB\-\-save\-attachments\fR
save all MIME-parts that look like attachments.
save all non-multipart MIME-parts.
only consider the following numbered parts
(comma-separated list).The numbers for the parts can be seen from running
\fBmu extract\fR without any options but only the message file.
save the parts in the target directory rather than
the current working directory.
overwrite existing files with the same name; by default overwriting is not
\fB\-\-play\fR Try to 'play' (open) the attachment with the default
application for the particular file type. On MacOS, this uses the \fBopen\fR
program, on other platforms is uses \fBxdg-open\fR. You can choose a different
program by setting the \fBMU_PLAY_PROGRAM\fR environment variable.
To display information about all the MIME-parts in a message file:
$ mu extract msgfile
To extract MIME-part 3 and 4 from this message, overwriting existing files
with the same name:
$ mu extract --parts=3,4 --overwrite msgfile
To extract all files ending in '.jpg' (case-insensitive):
$ mu extract msgfile '.*\.jpg'
To extract an mp3-file, and play it in the the default mp3-playing application.
$ mu extract --play msgfile 'whoopsididitagain.mp3'
Please report bugs if you find them:
Dirk-Jan C. Binnema <>
.BR mu(1)
Jump to Line
Something went wrong with that request. Please try again.