2.5 Initializing the message store

The first time you run mu, you need to initialize its store (database). The default location for that is ~/.cache/mu/xapian, but you can change this using the --muhome option, and remember to pass that to the other commands as well. Alternatively, you can use an environment variable MUHOME.

Assuming that your maildir is at ~/Maildir, we issue the following command:

  $ mu init --maildir=~/Maildir

You can add some e-mail addresses, so mu recognizes them as yours:

  $ mu init --maildir=~/Maildir --personal-address=jim@example.com \
    --personal-address=bob@example.com

(An older synonym for --personal-address is --my-address, which is still supported).

mu remembers the maildir and your addresses and uses them when indexing messages. If you want to change them, you need to init once again.

The addresses may also be basic PCRE regular expressions, wrapped in slashes, for example:

  $ mu init --maildir=~/Maildir '--personal-address=/foo-.*@example\.com/'

If you want to see the values for your message-store, you can use mu info.

Note: unfortunately, PCRE regular expressions are not the same as Emacs regular expressions. Very simple ones match, but e.g. (foo|bar) in PCRE syntax is specified as \(foo\|bar\) in Emacs/mu4e.

The good news is that mu4e can do the conversion automatically; however for this to work, users needs to install the pcre2el package (available in MELPA), and ensure it is available in load-path when Emacs runs (a normal package-installation takes care of this). After that, mu4e takes care of the translation automatically.

It is possible to come up with complicated PCRE regular expressions that are not translatable; if necessary, experiment with pcre2el to avoid this.