2011-02-13 09:46:50 +01:00
|
|
|
#+style: <link rel="stylesheet" type="text/css" href="mu.css"/>
|
|
|
|
#+html:<a href="index.html"><img src="mu.png" border="0" align="right"/></a>
|
|
|
|
#+title: Mu Cheatsheet
|
|
|
|
|
|
|
|
* Mu Cheatsheet
|
|
|
|
|
2011-05-25 07:14:22 +02:00
|
|
|
Here are some tips for using =mu=. If you want to know more, please refer to the
|
|
|
|
=mu= man pages. For a quick warm-up, there's the =mu-easy= man-page.
|
2011-02-13 09:46:50 +01:00
|
|
|
|
|
|
|
** Indexing your mail
|
|
|
|
|
|
|
|
You can index your mail with:
|
|
|
|
#+begin_src sh
|
|
|
|
$ mu index
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
If =mu= did not guess the right Maildir, you can set it explicitly:
|
|
|
|
#+begin_src sh
|
|
|
|
$ mu index --maildir=~/MyMaildir
|
|
|
|
#+end_src
|
2011-05-25 07:14:22 +02:00
|
|
|
|
|
|
|
*** Excluding directories from indexing
|
2011-02-13 09:46:50 +01:00
|
|
|
If you want to exclude certain directories from being indexed (for example,
|
|
|
|
directories with spam-messages), put a file called =.noindex= in the directory
|
|
|
|
to exlude, and it will be ignored when indexing (including its children)
|
2011-05-25 07:14:22 +02:00
|
|
|
|
2011-05-25 21:04:13 +02:00
|
|
|
|
2011-02-13 09:46:50 +01:00
|
|
|
** Finding messages
|
|
|
|
|
|
|
|
After you have indexed your messages, you can search them. Here are some
|
|
|
|
examples.
|
|
|
|
|
2011-05-22 12:42:19 +02:00
|
|
|
*** messages about Helsinki (in message body, subject, sender, ...)
|
2011-02-13 09:46:50 +01:00
|
|
|
|
|
|
|
#+begin_src sh
|
|
|
|
$ mu find Helsinki
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
*** messages to Jack with subject jellyfish containing the word tumbleweed
|
|
|
|
|
|
|
|
#+begin_src sh
|
|
|
|
$ mu find to:Jack subject:jellyfish tumbleweed
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
*** messages between 2 kilobytes and a 2Mb, written in December 2009 with an attachment from Bill
|
|
|
|
|
|
|
|
#+begin_src sh
|
|
|
|
$ mu find size:2k..2m date:20091201..20093112 flag:attach from:bill
|
|
|
|
#+end_src
|
|
|
|
|
2011-05-20 20:31:46 +02:00
|
|
|
*** unread messages about soccer or socrates or ...
|
|
|
|
|
|
|
|
#+begin_src sh
|
|
|
|
$ mu find 'subject:soc*' flag:unread
|
|
|
|
#+end_src
|
2011-05-24 21:42:20 +02:00
|
|
|
|
2011-05-25 21:04:13 +02:00
|
|
|
|
2011-05-26 22:39:54 +02:00
|
|
|
** Finding contacts
|
2011-05-24 21:42:20 +02:00
|
|
|
|
|
|
|
Contacts (names + email addresses) are cached separately, and can be
|
|
|
|
searched with =mu cfind= (after your messages have been indexed):
|
2011-05-20 20:31:46 +02:00
|
|
|
|
2011-05-24 21:42:20 +02:00
|
|
|
*** all contacts with 'john' in either name or e-mail address
|
|
|
|
#+begin_src sh
|
|
|
|
$ mu cfind john
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
=mu cfind= takes a regular expression for matching.
|
2011-05-22 12:42:19 +02:00
|
|
|
|
2011-05-24 21:42:20 +02:00
|
|
|
You can export the contact information to a number of formats for use in
|
|
|
|
e-mail clients. For examples:
|
2011-05-22 12:42:19 +02:00
|
|
|
|
2011-05-24 21:42:20 +02:00
|
|
|
*** export /all/ your contacts to the =mutt= addressbook format
|
|
|
|
|
|
|
|
#+begin_src sh
|
|
|
|
$ mu cfind --format=mutt-alias
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
Other formats are: =plain=, =mutt-ab=, =wl= (Wanderlust), =org-contact=,
|
|
|
|
=bbdb= and =csv= (comma-separated values).
|
|
|
|
|
|
|
|
|
|
|
|
** Retrieving attachments from messages
|
|
|
|
|
2011-05-22 12:42:19 +02:00
|
|
|
You can retrieve attachments from messages using =mu extract=, which takes a
|
|
|
|
message file as an argument. Without any other arguments, it displays the
|
|
|
|
MIME-parts of the message. You can then get specific attachments:
|
|
|
|
|
|
|
|
#+begin_src sh
|
|
|
|
$ mu extract --parts=3,4 my-msg-file
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
will get you parts 3 and 4. You can also extract files based on their name:
|
|
|
|
|
|
|
|
#+begin_src sh
|
|
|
|
$ mu extract my-msg-file '.*\.jpg'
|
|
|
|
#+end_src
|
|
|
|
|
2011-05-24 21:42:20 +02:00
|
|
|
The second argument is a case-insensitive regular expression, and the
|
|
|
|
command will extract any files matching the pattern -- in the example, all
|
|
|
|
=.jpg=-files.
|
|
|
|
|
|
|
|
Do not confuse the '.*' regular expression in =mu extract= (and =mu cfind=
|
|
|
|
with the '*' wildcard in =mu find=.
|
2011-05-20 20:31:46 +02:00
|
|
|
|
2011-05-26 22:39:54 +02:00
|
|
|
** Getting more colorful output
|
|
|
|
|
|
|
|
Some of the =mu= commands, such as =mu find=, =mu cfind= and =mu view=
|
|
|
|
support colorized output. By default this is turned off, but you can enable
|
|
|
|
it with =--color=, or setting the =MU_COLORS= environment variable to
|
|
|
|
non-empty.
|
2011-05-20 20:31:46 +02:00
|
|
|
|
2011-05-26 22:39:54 +02:00
|
|
|
#+begin_src sh
|
|
|
|
$ mu find --color capibara
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
(since =mu= version 0.9.6)
|
|
|
|
|
2011-02-13 09:46:50 +01:00
|
|
|
** Further processing of matched messages
|
|
|
|
|
|
|
|
If you need to process the results of your queries with some other program,
|
|
|
|
you can return the results as a list of absolute paths to the messages found:
|
|
|
|
|
|
|
|
For example, to get the number of lines in all your messages mentioning
|
|
|
|
/banana/, you could use something like:
|
|
|
|
|
|
|
|
#+begin_src sh
|
|
|
|
$ mu find --fields="'l'" banana | xargs wc -l
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
Note that we use ='l'=, so the returned message paths will be quoted. This is
|
|
|
|
useful if you have maildirs with spaces in their names.
|
|
|
|
|
2011-05-26 22:39:54 +02:00
|
|
|
For further processing, also the ~--format=(xml|json|sexp)~ can be useful. For
|
|
|
|
example,
|
|
|
|
|
|
|
|
#+begin_src sh
|
|
|
|
$ mu find --format=xml pancake
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
will give you a list of pancake-related messages in XML-format.
|
2011-02-13 09:46:50 +01:00
|
|
|
|
|
|
|
** Integration with mail clients
|
|
|
|
|
2011-05-22 12:42:19 +02:00
|
|
|
The =mu-find= man page contains examples for =mutt= and =wanderlust=.
|
2011-02-13 09:46:50 +01:00
|
|
|
|
|
|
|
#+html:<hr/><div align="center">© 2011 Dirk-Jan C. Binnema</div>
|
|
|
|
#+begin_html
|
|
|
|
<script type="text/javascript">
|
|
|
|
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
|
|
|
|
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
|
|
|
|
</script>
|
|
|
|
<script type="text/javascript">
|
|
|
|
var pageTracker = _gat._getTracker("UA-578531-1");
|
|
|
|
pageTracker._trackPageview();
|
|
|
|
</script>
|
|
|
|
#+end_html
|