Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
131 lines (94 sloc) 3.81 KB
.TH MU CFIND 1 "July 2012" "User Manuals"
\fBmu cfind\fR is the \fBmu\fR command to find contacts in the \fBmu\fR
database and export them for use in other programs.
.B mu cfind [options] [<pattern>]
\fBmu cfind\fR is the \fBmu\fR command for finding \fIcontacts\fR (name and
e-mail address of people who were either sender or receiver of mail). There
are different output formats available, for importing the contacts into
other programs.
When you index your messages (see \fBmu index\fR), \fBmu\fR creates a list of
unique e-mail addresses found and the accompanying name, and caches this
list. In case the same e-mail address is used with different names, the most
recent non-empty name is used.
\fBmu cfind\fR starts a search for contacts that match a \fIregular
expression\fR. For example:
$ mu cfind '@gmail\.com'
would find all contacts with a gmail-address, while
$ mu cfind Mary
would find all contact with Mary in either name or e-mail address.
If you do not specify any search expression, \fBmu cfind\fR will return the
full list of contacts. Note, \fBmu cfind\fR uses does not directly use the
database, but uses a cache file with e-mail addresses that is populated during
the indexing process.
The regular expressions are Perl-compatible (as per the PCRE-library).
sets the output format to the given value. The following are available:
| --format= | description |
| plain | default, simple list |
| mutt-alias | mutt alias-format |
| mutt-ab | mutt external address book format |
| wl | wanderlust addressbook format |
| org-contact | org-mode org-contact format |
| bbdb | BBDB format |
| csv | comma-separated values |
\fB\-\-personal\fR only show addresses seen in messages where one of 'my'
e-mail addresses was seen in one of the address fields; this is to exclude
addresses only seen in mailing-list messages. See the \fB\-\-my-address\fR
parameter in \fBmu index\fR.
\fB\-\-after=\fR\fI<timestamp>\fR only show addresses last seen after
\fI<timestamp>\fR. \fI<timestamp>\fR is a UNIX \fBtime_t\fR value, the number
of seconds since 1970-01-01 (in UTC).
From the command line, you can use the \fBdate\fR command to get this
value. For example, only consider addresses last seen after 2009-06-01, you
could specify
--after=`date +%s --date='2009-06-01'`
\fBmu cfind\fR returns 0 upon successful completion -- that is, at least one
contact was found. Anything else leads to a non-zero return value, for
| code | meaning |
| 0 | ok |
| 1 | general error |
| 2 | no matches (for 'mu cfind') |
You can use \fBmu cfind\fR as an external address book server for
\fBmutt\fR. For this to work, add the following to your \fImuttrc\fR:
set query_command = "mu cfind --format=mutt-ab '%s'"
Now, in mutt, you can easily search for e-mail address using the
\fBquery\fR-command, which is (by default) accessible by pressing \fBQ\fR.
\fBmu cfind\fR output is encoded according to the current locale except for
\fI--format=bbdb\fR. This is hard-coded to UTF-8, and as such specified in the
output-file, so emacs/bbdb can handle it correctly without guessing.
Please report bugs if you find them at
Dirk-Jan C. Binnema <>
.BR mu(1)
.BR mu-index(1)
.BR mu-find(1)
.BR pcrepattern(3)
Something went wrong with that request. Please try again.