LinuxCommandLibrary

mu

Manage and search email messages

TLDR

Initialize the email database, optionally specifying the Maildir directory and email addresses

$ mu init --maildir=[path/to/directory] --my-address=[name@example.com]
copy

Index new emails
$ mu index
copy

Find messages using a specific keyword (in message body, subject, sender, ...)
$ mu find [keyword]
copy

Find messages to Alice with subject jellyfish containing the words apples or oranges
$ mu find to:[alice] subject:[jellyfish] [apples] OR [oranges]
copy

Find unread messages about words starting with soc (the * only works at the end of the search term) in the Sent Items folder
$ mu find 'subject:[soc]*' flag:[unread] maildir:'/[Sent Items]'
copy

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]
copy

List contacts with Bob in either name or email address
$ mu cfind [Bob]
copy

SYNOPSIS

mu command [ options ]

PARAMETERS

index
    Indexes e-mail messages.

find
    Finds e-mail messages matching certain criteria.

view
    Shows the content of an e-mail message.

extract
    Extracts attachments from e-mail messages.

cfind
    Continues the search after first finding email

mkdir
    Creates a Xapian database. Useful for creating new databases

compact
    Compacts the database to save space and improve performance

--maildir=path
    Specifies the mail directory to use.

--dbpath=path
    Specifies the path to the Xapian database.

DESCRIPTION

mu is a tool for dealing with e-mail messages, primarily intended to help with quickly finding messages.

It indexes e-mail messages stored in maildirs (or other formats) and allows for quick searching based on various criteria like sender, subject, date, keywords, and content. mu aims to provide a fast, efficient, and powerful way to manage and search through large amounts of e-mail. It also provides tools for viewing and handling e-mail messages once they have been found. mu relies on xapian database for indexing of email messages and offers features for both command-line and graphical interface usage. For example it can be used by emacs to manage emails. It is designed to be a backend to other email tools.

QUERY LANGUAGE

mu uses a powerful query language to specify search criteria. Queries can include conditions based on sender, recipient, subject, date, keywords, message ID, flags, and more.

The query language supports boolean operators (AND, OR, NOT) and fuzzy matching.

CONFIGURATION

mu's behavior can be customized through a configuration file located at ~/.mu/mu.conf. This file allows users to set default options, specify mail directories, and configure other parameters.

HISTORY

mu was created by Dirk-Jan C. Binnema. Development started with the aim of providing a fast and efficient email management solution, particularly for users with large email archives.

Over time, mu has evolved to include more features and improve performance. It has gained popularity amongst users who require powerful search capabilities and integration with other tools like Emacs.

SEE ALSO

xapian(1), mail(1)

Copied to clipboard