2012-07-17 18:18:16 +02:00
|
|
|
.TH MU EXTRACT 1 "July 2012" "User Manuals"
|
2010-08-24 20:09:43 +02:00
|
|
|
|
2012-01-22 23:11:23 +01:00
|
|
|
.SH NAME
|
2010-08-24 20:09:43 +02:00
|
|
|
|
2012-07-19 19:44:49 +02:00
|
|
|
\fBmu extract\fR is the \fBmu\fR command to display and save message parts
|
|
|
|
(attachments), and open them with other tools.
|
2010-08-24 20:09:43 +02:00
|
|
|
|
|
|
|
.SH SYNOPSIS
|
|
|
|
|
2011-05-22 12:42:19 +02:00
|
|
|
.B mu extract [options] <file>
|
2012-07-19 19:44:49 +02:00
|
|
|
|
2011-05-22 12:42:19 +02:00
|
|
|
.B mu extract [options] <file> <pattern>
|
2010-08-24 20:09:43 +02:00
|
|
|
|
|
|
|
.SH DESCRIPTION
|
|
|
|
|
2012-05-12 16:11:23 +02:00
|
|
|
\fBmu extract\fR is the \fBmu\fR sub-command for extracting MIME-parts (e.g.,
|
2012-07-17 18:18:16 +02:00
|
|
|
attachments) from mail messages. The sub-command works on message files, and
|
|
|
|
does not require the message to be indexed in the database.
|
2010-09-01 22:35:03 +02:00
|
|
|
|
2013-06-04 00:31:27 +02:00
|
|
|
For attachments, the file name used when saving it is the name of the
|
2011-05-25 21:04:13 +02:00
|
|
|
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
|
|
|
|
message.
|
2011-04-05 06:34:22 +02:00
|
|
|
|
2011-05-24 21:42:20 +02:00
|
|
|
If you specify a pattern (a case-insensitive regular expression) as the second
|
2011-05-22 12:42:19 +02:00
|
|
|
argument, all attachments with filenames matching that pattern will be
|
2011-05-24 21:42:20 +02:00
|
|
|
extracted. The regular expressions are Perl-compatible (as per the
|
|
|
|
PCRE-library).
|
2011-05-21 13:12:33 +02:00
|
|
|
|
2012-02-13 21:36:43 +01:00
|
|
|
Without any options, \fBmu extract\fR simply outputs the list of leaf
|
|
|
|
MIME-parts in the message. Only 'leaf' MIME-parts (including RFC822
|
|
|
|
attachments) are considered, \fBmultipart/*\fR etc. are ignored.
|
2010-08-24 20:09:43 +02:00
|
|
|
|
|
|
|
.SH OPTIONS
|
|
|
|
|
|
|
|
.TP
|
2010-09-01 22:35:03 +02:00
|
|
|
\fB\-a\fR, \fB\-\-save\-attachments\fR
|
|
|
|
save all MIME-parts that look like attachments.
|
|
|
|
|
2010-10-23 11:04:14 +02:00
|
|
|
.TP
|
|
|
|
\fB\-\-save\-all\fR
|
2010-09-01 22:35:03 +02:00
|
|
|
save all non-multipart MIME-parts.
|
|
|
|
|
2010-10-23 11:04:14 +02:00
|
|
|
.TP
|
|
|
|
\fB\-\-parts\fR=<parts>
|
|
|
|
only consider the following numbered parts
|
2013-06-04 00:31:27 +02:00
|
|
|
(comma-separated list). The numbers for the parts can be seen from running
|
2010-10-23 11:04:14 +02:00
|
|
|
\fBmu extract\fR without any options but only the message file.
|
|
|
|
|
|
|
|
.TP
|
2010-09-01 22:35:03 +02:00
|
|
|
\fB\-\-target\-dir\fR=<dir>
|
2010-10-23 11:04:14 +02:00
|
|
|
save the parts in the target directory rather than
|
|
|
|
the current working directory.
|
2010-09-01 22:35:03 +02:00
|
|
|
|
2010-10-23 11:04:14 +02:00
|
|
|
.TP
|
2010-09-01 22:35:03 +02:00
|
|
|
\fB\-\-overwrite\fR
|
2011-01-09 13:55:25 +01:00
|
|
|
overwrite existing files with the same name; by default overwriting is not
|
|
|
|
allowed.
|
|
|
|
|
|
|
|
.TP
|
2011-04-05 06:34:22 +02:00
|
|
|
\fB\-\-play\fR Try to 'play' (open) the attachment with the default
|
2012-01-22 23:11:23 +01:00
|
|
|
application for the particular file type. On MacOS, this uses the \fBopen\fR
|
2013-06-04 00:31:27 +02:00
|
|
|
program, on other platforms it uses \fBxdg-open\fR. You can choose a different
|
2012-01-22 23:11:23 +01:00
|
|
|
program by setting the \fBMU_PLAY_PROGRAM\fR environment variable.
|
2010-08-24 20:09:43 +02:00
|
|
|
|
2011-05-22 12:42:19 +02:00
|
|
|
.SH EXAMPLES
|
|
|
|
|
|
|
|
To display information about all the MIME-parts in a message file:
|
|
|
|
.nf
|
|
|
|
$ mu extract msgfile
|
|
|
|
.fi
|
|
|
|
|
|
|
|
To extract MIME-part 3 and 4 from this message, overwriting existing files
|
|
|
|
with the same name:
|
|
|
|
.nf
|
|
|
|
$ mu extract --parts=3,4 --overwrite msgfile
|
|
|
|
.fi
|
|
|
|
|
|
|
|
To extract all files ending in '.jpg' (case-insensitive):
|
|
|
|
.nf
|
|
|
|
$ mu extract msgfile '.*\.jpg'
|
|
|
|
.fi
|
|
|
|
|
2013-06-04 00:31:27 +02:00
|
|
|
To extract an mp3-file, and play it in the default mp3-playing application:
|
2011-05-25 21:04:13 +02:00
|
|
|
.nf
|
|
|
|
$ mu extract --play msgfile 'whoopsididitagain.mp3'
|
|
|
|
.fi
|
|
|
|
|
2010-08-24 20:09:43 +02:00
|
|
|
.SH BUGS
|
2010-10-23 11:04:14 +02:00
|
|
|
|
2011-04-05 06:34:22 +02:00
|
|
|
Please report bugs if you find them:
|
2010-08-24 20:09:43 +02:00
|
|
|
.BR http://code.google.com/p/mu0/issues/list
|
|
|
|
|
|
|
|
.SH AUTHOR
|
|
|
|
|
|
|
|
Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
|
|
|
|
|
|
|
.SH "SEE ALSO"
|
|
|
|
|
2012-01-22 23:11:23 +01:00
|
|
|
.BR mu(1)
|