- Initialize the email database, optionally specifying the Maildir directory and email addresses:
mu init --maildir=path/to/directory --firstname.lastname@example.org
- Index new emails:
- Find messages using a specific keyword (in message body, subject, sender, ...):
mu find keyword
- Find messages to Alice with subject
jellyfishcontaining the words
mu find to:alice subject:jellyfish apples OR oranges
- Find unread messages about words starting with
*only works at the end of the search term) in the Sent Items folder:
mu find 'subject:soc*' flag:unread maildir:'/Sent Items'
- Find messages from Sam with attached images, between 2 KiB and 2 MiB, written in 2021:
mu find 'mime:image/* size:2k..2m date:20210101..20211231 from:sam
- List contacts with
Bobin either name or email address:
mu cfind Bob
mu [COMMON-OPTIONS] [[COMMAND] [COMMAND-OPTIONS]]
For information about the commmon options, see Common Options.
mu is the general command shows help about the specific commands:
add: add specific messages to the database.
cfind: find contacts
extract: extract attachments and other MIME-parts
find: find messages in the database
help: get help for some command
index: (re)index the messages in a Maildir
info: show information about the mu database
init: initialize the mu database
mkdir: create a new Maildir
remove: remove specific messages from the database
server: start a server process (for
view: view a specific message
Each of the commands have their own manpage
mu is a set of tools for dealing with Maildirs and the e-mail messages in them.
mu's main purpose is to enable searching of e-mail messages. It does so by periodically scanning a Maildir directory tree and analyzing the e-mail messages found (this is called 'indexing'). The results of this analysis are stored in a database, which can then be queried.
In addition to indexing and searching,
mu also offers functionality for viewing messages, extracting attachments and creating maildirs, and searching and exporting contact information.
mu can be used from the command line or can be integrated with various e-mail clients.
This manpage gives a general overview of the available commands (
find, etc.); each
mu command has its own man-page as well.
mu commands support colorized output, and do so by default. If you don't want colors, you can use
mu's output is in the current locale, with the exceptions of the output specifically meant for output to UTF8-encoded files. In practice, this means that the output of commands
extract is always encoded according to the current locale.
The same is true for
cfind, with some exceptions, where the output is always UTF-8, regardless of the locale:
cfindthe exception is
--format=bbdb. This is hard-coded to UTF-8, and as such specified in the output-file, so emacs/bbdb can handle it correctly without guessing.
findthe output is encoded according the locale for
--format=plain(the default), and UTF-8 for all other formats.
Database and File
mu index and
cfind work with the database, while the other ones work on individual mail files. Hence, running
extract does not require the mu database.
makes mu generate extra debug information, useful for debugging the program itself. By default, debug information goes to the log file, ~/.cache/mu/mu.log. It can safely be deleted when mu is not running. When running with --debug option, the log file can grow rather quickly. See the note on logging below.
causes mu not to output informational messages and progress information to standard output, but only to the log file. Error messages will still be sent to standard error. Note that mu index is much faster with --quiet, so it is recommended you use this option when using mu from scripts etc.
causes mu to not output log messages to standard error, in addition to sending them to the log file.
do not use ANSI colors. The environment variable
NO_COLOR can be used as an alternative to
prints mu version and copyright information.
lists the various command line options.
This command returns 0 upon successful completion, or a non-zero exit code otherwise. Typical values are 2 (no matches found), 11 (database schema mismatch) and 12 (failed to acquire database lock).
no matches found (2)
Nothing matching found; try a different query
database schema mismatch (11)
You need to re-initialize
mu, see mu-init(1)
failed to acquire lock (19)
Some other program has exclusive access to the mu (Xapian) database
Please report bugs at https://github.com/djcb/mu/issues.
Dirk-Jan C. Binnema <email@example.com>
This manpage is part of
Copyright © 2022-2023 Dirk-Jan C. Binnema. License GPLv3+: GNU GPL version 3 or later https://gnu.org/licenses/gpl.html. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
mu-add(1), mu-bookmarks(5), mu-cfind(1), mu-easy(7), mu-extract(1), mu-fields(1), mu-find(1), mu-index(1), mu-info(1), mu-remove(1), mu-server(1), mu-verify(1), mu-view(1).