2012-05-22 09:19:49 +02:00
|
|
|
.TH MU-EASY 1 "May 2012" "User Manuals"
|
2010-09-26 16:33:22 +02:00
|
|
|
|
2011-11-11 08:13:35 +01:00
|
|
|
.SH NAME
|
2010-09-26 16:33:22 +02:00
|
|
|
|
|
|
|
mu easy \- a quick introduction to mu
|
|
|
|
|
|
|
|
.SH DESCRIPTION
|
|
|
|
|
2010-11-30 21:11:40 +01:00
|
|
|
\fBmu\fR is a set of tools for dealing with e-mail messages in Maildirs. There
|
2011-01-16 12:55:00 +01:00
|
|
|
are many options, which are all described in the man pages for the various
|
2011-04-05 06:34:22 +02:00
|
|
|
sub-commands. This man pages jumps over all of the details and gives examples
|
|
|
|
of some common use cases. If the use cases described here do not precisely do
|
2011-01-16 12:55:00 +01:00
|
|
|
what you want, please check the more extensive information in the man page
|
|
|
|
about the sub-command you are using -- for example, the mu-index or mu-find
|
|
|
|
man pages.
|
2010-09-26 16:33:22 +02:00
|
|
|
|
2010-10-25 23:25:14 +02:00
|
|
|
\fBNOTE\fR: the \fBindex\fR command (and therefore, the ones that depend on
|
|
|
|
that, such as \fBfind\fR), require that you store your mail in the
|
2010-09-26 16:33:22 +02:00
|
|
|
Maildir-format. If you don't do so, you can still use the other commands, but
|
2010-11-30 21:11:40 +01:00
|
|
|
you won't be able to index/search your mail.
|
2010-09-26 16:33:22 +02:00
|
|
|
|
2012-01-21 11:12:41 +01:00
|
|
|
By default, \fBmu\fR uses colorized output when your terminal is capable of
|
|
|
|
doing so. If you don't like color, you can use the \fB--nocolor\fR
|
|
|
|
command-line option, or set the \fBMU_NOCOLOR\fR environment variable to
|
|
|
|
non-empty.
|
|
|
|
|
2010-09-26 16:33:22 +02:00
|
|
|
.SH INDEXING YOUR E-MAIL
|
2011-04-05 06:34:22 +02:00
|
|
|
|
2010-10-25 23:25:14 +02:00
|
|
|
Before you can search e-mails, you'll first need to index them:
|
2010-09-26 16:33:22 +02:00
|
|
|
|
|
|
|
.nf
|
2011-11-11 08:13:35 +01:00
|
|
|
\fB$ mu index\fR
|
2010-09-26 16:33:22 +02:00
|
|
|
.fi
|
|
|
|
|
2010-10-25 23:25:14 +02:00
|
|
|
The process can take a few minutes, depending on the amount of mail you have,
|
|
|
|
the speed of your computer, hard drive etc. Usually, indexing should be able to
|
|
|
|
reach a speed of a few hundred messages per second.
|
2010-09-26 16:33:22 +02:00
|
|
|
|
2010-10-25 23:25:14 +02:00
|
|
|
\fBmu index\fR guesses the top-level Maildir to do its job; if it guesses
|
2011-04-05 06:34:22 +02:00
|
|
|
wrongly, you can use the \fI--maildir\fR option to specify the top-level
|
2010-10-25 23:25:14 +02:00
|
|
|
directory that should be processed. See the \fBmu-index\fR man page for more
|
2011-04-05 06:34:22 +02:00
|
|
|
details.
|
2010-09-26 16:33:22 +02:00
|
|
|
|
2010-11-08 07:29:39 +01:00
|
|
|
Normally, \fBmu index\fR visits all the directories under the top-level
|
|
|
|
Maildir; however, you can exclude certain directories (say, the 'trash'
|
|
|
|
or 'spam' folders) by creating a file called \fI.noindex\fR in the directory.
|
2011-04-05 06:34:22 +02:00
|
|
|
When \fBmu\fR sees such a file, it will exclude this directory and its
|
2012-05-22 09:19:49 +02:00
|
|
|
sub-directories from indexing. Also see \fB.noupdate\fR in the \fBmu-index\fR
|
|
|
|
manpage.
|
2010-11-08 07:29:39 +01:00
|
|
|
|
2010-09-26 16:33:22 +02:00
|
|
|
.SH SEARCHING YOUR E-MAIL
|
2011-03-31 22:08:26 +02:00
|
|
|
|
2011-04-05 06:34:22 +02:00
|
|
|
After you have indexed your mail, you can start searching it. By default, the
|
|
|
|
search results are printed on standard output. Alternatively, the output can
|
|
|
|
take the form of Maildir with symbolic links to the found messages. This
|
|
|
|
enables integration with e-mail clients; see the \fBmu-find\fR man page for
|
|
|
|
details, the syntax of the search parameters and so on. Here, we just give
|
|
|
|
some examples for common cases.
|
2010-09-26 16:33:22 +02:00
|
|
|
|
2010-10-09 14:12:12 +02:00
|
|
|
First, let's search for all messages sent to Julius Caesar regarding fruit:
|
|
|
|
|
|
|
|
.nf
|
2011-11-11 08:13:35 +01:00
|
|
|
\fB$ mu find t:julius fruit\fR
|
2010-10-09 14:12:12 +02:00
|
|
|
.fi
|
|
|
|
|
|
|
|
This should return something like:
|
|
|
|
|
|
|
|
.nf
|
|
|
|
2008-07-31T21:57:25 EEST John Milton <jm@example.com> Fere libenter homines id quod volunt credunt
|
|
|
|
.fi
|
|
|
|
|
|
|
|
This means there is a message to 'julius' with 'fruit' somewhere in the
|
2011-04-05 06:34:22 +02:00
|
|
|
message. In this case, it's a message from John Milton. Note that the date
|
|
|
|
format depends on your the language/locale you are using.
|
2010-10-09 14:12:12 +02:00
|
|
|
|
|
|
|
How do we know that the message was sent to Julius Caesar? Well, it's not
|
|
|
|
visible from the results above, because the default fields that are shown are
|
2010-11-21 14:44:55 +01:00
|
|
|
date/sender/subject. However, we can change this using the \fI--fields\fR
|
2010-10-09 14:12:12 +02:00
|
|
|
parameter (see the \fBmu-find\fR man page for the details):
|
|
|
|
|
|
|
|
.nf
|
2011-11-11 08:13:35 +01:00
|
|
|
\fB$ mu find --fields="t s" t:julius fruit\fR
|
2010-10-09 14:12:12 +02:00
|
|
|
.fi
|
|
|
|
|
|
|
|
In other words, display the 'To:'-field (t) and the subject (s). This should
|
|
|
|
return something like:
|
|
|
|
.nf
|
|
|
|
Julius Caesar <jc@example.com> Fere libenter homines id quod volunt credunt
|
|
|
|
.fi
|
|
|
|
|
2010-11-21 14:44:55 +01:00
|
|
|
This is the same message found before, only with some different fields
|
|
|
|
displayed.
|
2010-10-09 14:12:12 +02:00
|
|
|
|
2010-10-25 23:25:14 +02:00
|
|
|
By default, \fBmu\fR uses the logical AND for the search parameters -- that
|
|
|
|
is, it displays messages that match all the parameters. However, we can use
|
|
|
|
logical OR as well:
|
2010-10-09 14:12:12 +02:00
|
|
|
|
|
|
|
.nf
|
2011-11-11 08:13:35 +01:00
|
|
|
\fB$ mu find t:julius OR f:socrates\fR
|
2010-10-09 14:12:12 +02:00
|
|
|
.fi
|
|
|
|
|
|
|
|
In other words, display messages that are either sent to Julius Caesar
|
|
|
|
\fBor\fR are from Socrates. This could return something like:
|
|
|
|
|
2010-09-26 16:33:22 +02:00
|
|
|
.nf
|
2010-10-09 14:12:12 +02:00
|
|
|
2008-07-31T21:57:25 EEST Socrates <soc@example.com> cool stuff
|
|
|
|
2008-07-31T21:57:25 EEST John Milton <jm@example.com> Fere libenter homines id quod volunt credunt
|
2010-09-26 16:33:22 +02:00
|
|
|
.fi
|
|
|
|
|
2011-05-25 21:04:13 +02:00
|
|
|
What if we want to see some of the body of the message? You can get
|
|
|
|
a 'summary' of the first lines of the message using the \fI--summary\fR
|
|
|
|
option, which will 'summarize' the first \fIn\fR lines of the message:
|
2010-10-09 14:12:12 +02:00
|
|
|
|
|
|
|
.nf
|
2011-11-11 08:13:35 +01:00
|
|
|
\fB$ mu find --summary napoleon m:/archive\fR
|
2010-10-09 14:12:12 +02:00
|
|
|
.fi
|
|
|
|
|
|
|
|
.nf
|
|
|
|
1970-01-01T02:00:00 EET Napoleon Bonaparte <nb@example.com> rock on dude
|
|
|
|
Summary: Le 24 février 1815, la vigie de Notre-Dame de la Garde signala le
|
|
|
|
trois-mâts le Pharaon, venant de Smyrne, Trieste et Naples. Comme
|
|
|
|
d'habitude, un pilote côtier partit aussitôt du port, rasa le château
|
|
|
|
.fi
|
|
|
|
|
|
|
|
The summary consists of the first n lines of the message with all superfluous
|
|
|
|
whitespace removed.
|
|
|
|
|
|
|
|
Also note the \fBm:/archive\fR parameter in the query. This means that we only
|
|
|
|
match messages in a maildir called '/archive'.
|
|
|
|
|
2010-11-21 14:44:55 +01:00
|
|
|
.SH MORE QUERIES
|
|
|
|
|
2010-11-26 07:25:42 +01:00
|
|
|
Let's list a few more queries that may be interesting; please note that
|
|
|
|
searches for message flags, priority and date ranges are only available in mu
|
|
|
|
version 0.9 or later.
|
2010-11-21 14:44:55 +01:00
|
|
|
|
|
|
|
Get all important messages which are signed:
|
|
|
|
.nf
|
2011-11-11 08:13:35 +01:00
|
|
|
\fB$ mu find flag:signed prio:high \fR
|
2010-11-21 14:44:55 +01:00
|
|
|
.fi
|
|
|
|
|
|
|
|
Get all messages from Jim without an attachment:
|
|
|
|
.nf
|
2011-11-11 08:13:35 +01:00
|
|
|
\fB$ mu find from:jim AND NOT flag:attach\fR
|
2010-11-21 14:44:55 +01:00
|
|
|
.fi
|
|
|
|
|
2011-08-13 09:40:31 +02:00
|
|
|
Get all unread messages where the subject mentions Ångström:
|
2010-11-21 14:44:55 +01:00
|
|
|
.nf
|
2011-11-11 08:13:35 +01:00
|
|
|
\fB$ mu find subject:Ångström flag:unread\fR
|
2010-11-26 07:25:42 +01:00
|
|
|
.fi
|
|
|
|
which is equivalent to:
|
|
|
|
.nf
|
2011-11-11 08:13:35 +01:00
|
|
|
\fB$ mu find subject:angstrom flag:unread\fR
|
2010-11-26 07:25:42 +01:00
|
|
|
.fi
|
|
|
|
because does mu is case-insensitive and accent-insensitive.
|
|
|
|
|
2011-08-13 09:40:31 +02:00
|
|
|
Get all unread messages between March 2002 and August 2003 about some bird (or
|
2010-11-26 07:25:42 +01:00
|
|
|
a Swedish rock band):
|
|
|
|
.nf
|
2011-08-13 09:40:31 +02:00
|
|
|
\fB$ mu find date:20020301..20030831 nightingale flag:unread\fR
|
2010-11-21 14:44:55 +01:00
|
|
|
.fi
|
|
|
|
|
2011-05-25 21:04:13 +02:00
|
|
|
Get all messages received today:
|
2010-11-21 17:43:03 +01:00
|
|
|
.nf
|
2010-11-26 07:25:42 +01:00
|
|
|
\fB$ mu find date:today..now\fR
|
2010-11-21 17:43:03 +01:00
|
|
|
.fi
|
2010-11-26 07:25:42 +01:00
|
|
|
|
2011-11-11 08:13:35 +01:00
|
|
|
Get all messages we got in the last two weeks about emacs:
|
2010-11-26 07:25:42 +01:00
|
|
|
.nf
|
|
|
|
\fB$ mu find date:2w..now emacs\fR
|
|
|
|
.fi
|
|
|
|
|
2011-05-20 20:31:46 +02:00
|
|
|
Another powerful feature (since 0.9.6) are wildcard searches, where you can
|
|
|
|
search for the last \fIn\fR characters in a word. For example, you can search
|
|
|
|
for:
|
|
|
|
.nf
|
|
|
|
\fB$ mu find 'subject:soc*'\fR
|
|
|
|
.fi
|
|
|
|
and get mails about soccer, Socrates, society, and so on. Note, it's important
|
|
|
|
to quote the search query, otherwise the shell will interpret
|
|
|
|
the '*'.
|
|
|
|
|
2011-05-21 15:09:17 +02:00
|
|
|
You can also search for messages with a certain attachment using their
|
|
|
|
filename, for example:
|
|
|
|
|
|
|
|
.nf
|
2011-12-01 20:30:02 +01:00
|
|
|
\fB$ mu find 'file:pic*'\fR
|
2011-05-21 15:09:17 +02:00
|
|
|
.fi
|
2011-12-01 20:30:02 +01:00
|
|
|
will get you all messages with an attachment starting with 'pic'.
|
2011-05-21 15:09:17 +02:00
|
|
|
|
2011-11-11 08:13:35 +01:00
|
|
|
If you want to find attachments with a certain MIME-type, you can use the
|
|
|
|
following:
|
|
|
|
|
|
|
|
Get all messages with PDF attachments:
|
|
|
|
.nf
|
2011-12-01 20:30:02 +01:00
|
|
|
\fB$ mu find mime:application/pdf\fR
|
2011-11-11 08:13:35 +01:00
|
|
|
.fi
|
|
|
|
|
|
|
|
or even:
|
|
|
|
|
|
|
|
Get all messages with image attachments:
|
|
|
|
.nf
|
2011-12-01 20:30:02 +01:00
|
|
|
\fB$ mu find 'mime:image/*'\fR
|
2011-11-11 08:13:35 +01:00
|
|
|
.fi
|
|
|
|
|
2011-12-01 20:30:02 +01:00
|
|
|
|
2011-11-11 08:13:35 +01:00
|
|
|
Note that (1) the '*' wildcard can only be used as the rightmost thing in a
|
|
|
|
search query, and (2) that you need to quote the search term, because
|
|
|
|
otherwise your shell will interpret the '*' (expanding it to all files in the
|
|
|
|
current directory -- probably not what you want).
|
2011-05-20 20:31:46 +02:00
|
|
|
|
2010-10-09 14:12:12 +02:00
|
|
|
.SH DISPLAYING MESSAGES
|
|
|
|
|
2011-04-05 06:34:22 +02:00
|
|
|
We might also want to display the complete messages instead of the header
|
|
|
|
information. This can be done using \fBmu view\fR command. Note that this
|
|
|
|
command does not use the database; you simply provide it the path to a
|
|
|
|
message.
|
2010-10-09 14:12:12 +02:00
|
|
|
|
|
|
|
Therefore, if you want to display some message from a search query, you'll
|
|
|
|
need its path. To get the path (think \fBl\fRocation) for our first example we
|
|
|
|
can use:
|
|
|
|
|
|
|
|
.nf
|
2011-11-11 08:13:35 +01:00
|
|
|
\fB$ mu find --fields="l" t:julius fruit\fR
|
2010-10-09 14:12:12 +02:00
|
|
|
.fi
|
|
|
|
|
|
|
|
And we'll get someting like:
|
|
|
|
.nf
|
|
|
|
/home/someuser/Maildir/archive/cur/1266188485_0.6850.cthulhu:2,
|
|
|
|
.fi
|
2011-11-11 08:13:35 +01:00
|
|
|
We can now display this message:
|
2010-10-09 14:12:12 +02:00
|
|
|
|
|
|
|
.nf
|
2010-11-30 21:11:40 +01:00
|
|
|
\fB$ mu view /home/someuser/Maildir/archive/cur/1266188485_0.6850.cthulhu:2,\fR
|
2010-10-09 14:12:12 +02:00
|
|
|
|
2010-11-30 21:11:40 +01:00
|
|
|
From: John Milton <jm@example.com>
|
|
|
|
To: Julius Caesar <jc@example.com>
|
|
|
|
Subject: Fere libenter homines id quod volunt credunt
|
|
|
|
Date: 2008-07-31T21:57:25 EEST
|
2010-10-09 14:12:12 +02:00
|
|
|
|
2010-11-30 21:11:40 +01:00
|
|
|
OF Mans First Disobedience, and the Fruit
|
|
|
|
Of that Forbidden Tree, whose mortal tast
|
|
|
|
Brought Death into the World, and all our woe,
|
|
|
|
[...]
|
2010-10-09 14:12:12 +02:00
|
|
|
.fi
|
2010-09-26 16:33:22 +02:00
|
|
|
|
2011-04-05 06:34:22 +02:00
|
|
|
.SH FINDING CONTACTS
|
|
|
|
|
|
|
|
While \fBmu find\fR searches for messages, there is also \fBmu cfind\fR to
|
|
|
|
find \fIcontacts\fR, that is, names + addresses. Without any search
|
|
|
|
expression, \fBmu cfind\fR lists all of your contacts.
|
|
|
|
|
|
|
|
.nf
|
2011-11-11 08:13:35 +01:00
|
|
|
\fB$ mu cfind julius\fR
|
2011-04-05 06:34:22 +02:00
|
|
|
.fi
|
|
|
|
|
|
|
|
will find all contacts with 'julius' in either name or e-mail address. Note
|
2011-05-24 21:42:20 +02:00
|
|
|
that \fBmu cfind\fR accepts a \fIregular expression\fR.
|
2011-04-05 06:34:22 +02:00
|
|
|
|
|
|
|
\fBmu cfind\fR also supports a \fI--format=\fR-parameter, which sets the
|
|
|
|
output to some specific format, so the results can be imported into another
|
|
|
|
program. For example, to export your contact information to a \fBmutt\fR
|
|
|
|
address book file, you can use something like:
|
|
|
|
|
|
|
|
.nf
|
2011-11-11 08:13:35 +01:00
|
|
|
\fB$ mu cfind --format=mutt-alias > ~/mutt-aliases \fR
|
2011-04-05 06:34:22 +02:00
|
|
|
.fi
|
|
|
|
|
|
|
|
Then, you can use them in \fBmutt\fR if you add something like \fBsource
|
|
|
|
~/mutt-aliases\fR to your \fImuttrc\fR.
|
|
|
|
|
2010-09-26 16:33:22 +02:00
|
|
|
.SH AUTHOR
|
|
|
|
Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
|
|
|
|
|
|
|
.SH "SEE ALSO"
|
2011-05-25 21:04:13 +02:00
|
|
|
.BR mu(1)
|
|
|
|
.BR mu-index(1)
|
|
|
|
.BR mu-find(1)
|
|
|
|
.BR mu-mkdir(1)
|
|
|
|
.BR mu-view(1)
|
|
|
|
.BR mu-extract(1)
|