2022-04-30 00:10:31 +02:00
|
|
|
.TH MU FIND 1 "29 April 2022" "User Manuals"
|
2010-08-15 19:29:15 +02:00
|
|
|
|
2011-09-22 20:00:52 +02:00
|
|
|
.SH NAME
|
2010-08-15 19:29:15 +02:00
|
|
|
|
2011-05-01 17:31:00 +02:00
|
|
|
mu find \- find e-mail messages in the \fBmu\fR database.
|
2010-08-15 19:29:15 +02:00
|
|
|
|
|
|
|
.SH SYNOPSIS
|
|
|
|
|
|
|
|
.B mu find [options] <search expression>
|
|
|
|
|
|
|
|
.SH DESCRIPTION
|
|
|
|
|
2017-10-25 22:45:38 +02:00
|
|
|
\fBmu find\fR is the \fBmu\fR command for searching e-mail message
|
2018-03-10 21:08:17 +01:00
|
|
|
that were stored earlier using \fBmu index\fR(1).
|
2010-08-15 19:29:15 +02:00
|
|
|
|
2010-11-12 20:00:03 +01:00
|
|
|
.SH SEARCHING MAIL
|
|
|
|
|
2017-10-25 22:45:38 +02:00
|
|
|
\fBmu find\fR starts a search for messages in the database that match
|
|
|
|
some search pattern. The search patterns are described in detail in
|
2018-03-10 21:08:17 +01:00
|
|
|
.BR mu-query (7).
|
2017-10-25 22:45:38 +02:00
|
|
|
.
|
|
|
|
|
|
|
|
For example:
|
2010-11-25 22:14:20 +01:00
|
|
|
|
|
|
|
.nf
|
2022-04-30 00:10:31 +02:00
|
|
|
$ mu find subject:snow and date:2009..
|
2010-11-25 22:14:20 +01:00
|
|
|
.fi
|
|
|
|
|
2022-04-30 00:10:31 +02:00
|
|
|
would find all messages in 2009 with 'snow' in the subject field, e.g:
|
2011-01-05 19:35:50 +01:00
|
|
|
|
|
|
|
.nf
|
|
|
|
2009-03-05 17:57:33 EET Lucia <lucia@example.com> running in the snow
|
|
|
|
2009-03-05 18:38:24 EET Marius <marius@foobar.com> Re: running in the snow
|
|
|
|
.fi
|
|
|
|
|
|
|
|
Note, this the default, plain-text output, which is the default, so you don't
|
|
|
|
have to use \fB--format=plain\fR. For other types of output (such as symlinks,
|
2022-01-29 09:41:05 +01:00
|
|
|
XML or s-expressions), see the discussion in the \fBOPTIONS\fR-section below
|
|
|
|
about \fB--format\fR.
|
2010-08-15 19:29:15 +02:00
|
|
|
|
2010-09-05 20:20:46 +02:00
|
|
|
The search pattern is taken as a command-line parameter. If the search
|
2017-10-25 22:45:38 +02:00
|
|
|
parameter consists of multiple parts (as in the example) they are
|
|
|
|
treated as if there were a logical \fBand\fR between them.
|
2012-07-09 10:17:28 +02:00
|
|
|
|
2019-12-28 10:19:12 +01:00
|
|
|
For details on the possible queries, see
|
2020-01-22 20:54:34 +01:00
|
|
|
.BR mu-query (7).
|
2011-07-22 20:10:54 +02:00
|
|
|
|
2010-11-12 20:00:03 +01:00
|
|
|
.SH OPTIONS
|
2010-08-15 19:29:15 +02:00
|
|
|
|
2018-03-10 21:08:17 +01:00
|
|
|
Note, some of the important options are described in the \fBmu\fR(1) man-page
|
2010-11-12 20:00:03 +01:00
|
|
|
and not here, as they apply to multiple mu-commands.
|
2010-08-15 19:29:15 +02:00
|
|
|
|
|
|
|
The \fBfind\fR-command has various options that influence the way \fBmu\fR
|
|
|
|
displays the results. If you don't specify anything, the defaults are
|
2011-09-22 20:00:52 +02:00
|
|
|
\fI\-\-fields="d f s"\fR, \fI\-\-sortfield=date\fR and \fI\-\-reverse\fR.
|
2010-08-15 19:29:15 +02:00
|
|
|
|
|
|
|
.TP
|
|
|
|
\fB\-f\fR, \fB\-\-fields\fR=\fI<fields>\fR
|
|
|
|
specifies a string that determines which fields are shown in the output. This
|
|
|
|
string consists of a number of characters (such as 's' for subject or 'f' for
|
|
|
|
from), which will replace with the actual field in the output. Fields that are
|
|
|
|
not known will be output as-is, allowing for some simple formatting.
|
|
|
|
|
|
|
|
For example:
|
2011-01-05 19:35:50 +01:00
|
|
|
|
2010-08-15 19:29:15 +02:00
|
|
|
.nf
|
2010-11-25 22:14:20 +01:00
|
|
|
$ mu find subject:snow --fields "d f s"
|
2010-08-15 19:29:15 +02:00
|
|
|
.fi
|
2011-01-05 19:35:50 +01:00
|
|
|
|
2010-08-15 19:29:15 +02:00
|
|
|
would list the date, subject and sender of all messages with 'snow' in the
|
|
|
|
their subject.
|
|
|
|
|
|
|
|
The table of replacement characters is superset of the list mentions for
|
2022-04-30 00:10:31 +02:00
|
|
|
search parameters, such as:
|
2010-08-15 19:29:15 +02:00
|
|
|
.nf
|
2021-06-11 09:40:01 +02:00
|
|
|
t \fBt\fRo: recipient
|
|
|
|
d Sent \fBd\fRate of the message
|
|
|
|
f Message sender (\fBf\fRrom:)
|
|
|
|
g Message flags (fla\fBg\fRs)
|
|
|
|
l Full path to the message (\fBl\fRocation)
|
|
|
|
s Message \fBs\fRubject
|
|
|
|
i Message-\fBi\fRd
|
|
|
|
m \fBm\fRaildir
|
2010-08-15 19:29:15 +02:00
|
|
|
.fi
|
|
|
|
|
2022-04-30 00:10:31 +02:00
|
|
|
For the complete, up-to-date list, see:
|
|
|
|
.BR mu-fields(1)
|
2010-08-15 19:29:15 +02:00
|
|
|
|
2018-03-10 21:08:17 +01:00
|
|
|
The message flags are described in \fBmu-query\fR(7). As an example, a
|
2018-03-10 21:07:38 +01:00
|
|
|
message which is 'seen', has an attachment and is signed would
|
|
|
|
have 'asz' as its corresponding output string, while an encrypted new
|
|
|
|
message would have 'nx'.
|
2010-08-15 19:29:15 +02:00
|
|
|
|
|
|
|
.TP
|
2011-09-22 20:00:52 +02:00
|
|
|
\fB\-s\fR, \fB\-\-sortfield\fR \fR=\fI<field>\fR and \fB\-z\fR,
|
|
|
|
\fB\-\-reverse\fR specifies the field to sort the search results by, and the
|
2022-04-30 00:10:31 +02:00
|
|
|
direction (i.e., 'reverse' means that the sort should be reverted - Z-A). Examples include:
|
2010-08-15 19:29:15 +02:00
|
|
|
|
|
|
|
.nf
|
2011-05-01 17:31:00 +02:00
|
|
|
cc,c Cc (carbon-copy) recipient(s)
|
2015-04-19 14:44:40 +02:00
|
|
|
date,d Message sent date
|
|
|
|
from,f Message sender
|
|
|
|
maildir,m Maildir
|
|
|
|
msgid,i Message id
|
|
|
|
prio,p Nessage priority
|
|
|
|
subject,s Message subject
|
2011-05-01 17:31:00 +02:00
|
|
|
to,t To:-recipient(s)
|
2010-08-15 19:29:15 +02:00
|
|
|
.fi
|
|
|
|
|
2022-05-06 21:00:29 +02:00
|
|
|
For the complete list use can use the \fBmu fields\fR command; see:
|
2022-04-30 00:10:31 +02:00
|
|
|
.BR mu-fields(1)
|
|
|
|
|
2010-08-15 19:29:15 +02:00
|
|
|
Thus, for example, to sort messages by date, you could specify:
|
|
|
|
|
|
|
|
.nf
|
2011-09-22 20:00:52 +02:00
|
|
|
$ mu find fahrrad --fields "d f s" --sortfield=date --reverse
|
2010-08-15 19:29:15 +02:00
|
|
|
.fi
|
|
|
|
|
2011-09-22 20:00:52 +02:00
|
|
|
Note, if you specify a sortfield, by default, messages are sorted in reverse
|
|
|
|
(descending) order (e.g., from lowest to highest). This is usually a good
|
2010-11-20 13:40:23 +01:00
|
|
|
choice, but for dates it may be more useful to sort in the opposite direction.
|
2010-08-15 19:29:15 +02:00
|
|
|
|
2013-09-27 16:11:04 +02:00
|
|
|
.TP
|
|
|
|
\fB\-n\fR, \fB\-\-maxnum=<number>\fR
|
|
|
|
If > 0, display maximally that number of entries. If not specified, all matching entries are displayed.
|
|
|
|
|
2012-04-28 11:56:57 +02:00
|
|
|
.TP
|
|
|
|
\fB\-\-summary-len=<number>\fR
|
2012-07-12 17:09:04 +02:00
|
|
|
If > 0, use that number of lines of the message to provide a summary.
|
2012-04-28 11:56:57 +02:00
|
|
|
|
2011-08-03 22:04:38 +02:00
|
|
|
.TP
|
|
|
|
\fB\-\-format\fR=\fIplain|links|xquery|xml|sexp\fR
|
2011-01-05 19:35:50 +01:00
|
|
|
output results in the specified format.
|
|
|
|
|
|
|
|
The default is \fBplain\fR, i.e normal output with one line per message.
|
|
|
|
|
|
|
|
\fBlinks\fR outputs the results as a maildir with symbolic links to the found
|
|
|
|
messages. This enables easy integration with mail-clients (see below for more
|
2016-11-19 15:17:43 +01:00
|
|
|
information).
|
2011-01-05 19:35:50 +01:00
|
|
|
|
|
|
|
\fBxml\fR formats the search results as XML.
|
|
|
|
|
|
|
|
\fBsexp\fR formats the search results as an s-expression as used in Lisp
|
|
|
|
programming environments.
|
|
|
|
|
|
|
|
\fBxquery\fR shows the Xapian query corresponding to your search terms. This
|
|
|
|
is meant for for debugging purposes.
|
2011-09-22 20:00:52 +02:00
|
|
|
|
2010-08-15 19:29:15 +02:00
|
|
|
.TP
|
2010-08-27 07:26:41 +02:00
|
|
|
\fB\-\-linksdir\fR \fR=\fI<dir>\fR and \fB\-c\fR, \fB\-\-clearlinks\fR
|
2010-08-15 19:29:15 +02:00
|
|
|
output the results as a maildir with symbolic links to the found
|
2016-11-19 15:17:43 +01:00
|
|
|
messages. This enables easy integration with mail-clients (see below
|
|
|
|
for more information). \fBmu\fR will create the maildir if it does not
|
|
|
|
exist yet.
|
|
|
|
|
|
|
|
If you specify \fB\-\-clearlinks\fR, all existing symlinks will be
|
|
|
|
cleared from the target directories; this allows for re-use of the
|
|
|
|
same maildir. However, this option will delete any symlink it finds,
|
|
|
|
so be careful.
|
2010-08-15 19:29:15 +02:00
|
|
|
|
|
|
|
.nf
|
2021-06-11 09:40:01 +02:00
|
|
|
$ mu find grolsch --format=links --linksdir=~/Maildir/search --clearlinks
|
2010-08-15 19:29:15 +02:00
|
|
|
.fi
|
|
|
|
|
|
|
|
will store links to found messages in \fI~/Maildir/search\fR. If the directory
|
|
|
|
does not exist yet, it will be created.
|
|
|
|
|
|
|
|
Note: when \fBmu\fR creates a Maildir for these links, it automatically
|
|
|
|
inserts a \fI.noindex\fR file, to exclude the directory from \fBmu
|
|
|
|
index\fR.
|
|
|
|
|
2012-07-12 14:53:36 +02:00
|
|
|
.TP
|
|
|
|
\fB\-\-after=\fR\fI<timestamp>\fR only show messages whose message files were
|
|
|
|
last modified (\fBmtime\fR) 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 messages modified (or created) in the last 5
|
|
|
|
minutes, you could specify
|
|
|
|
.nf
|
|
|
|
--after=`date +%s --date='5 min ago'`
|
|
|
|
.fi
|
|
|
|
This is assuming the GNU \fBdate\fR command.
|
|
|
|
|
|
|
|
|
2011-07-10 13:19:45 +02:00
|
|
|
.TP
|
|
|
|
\fB\-\-exec\fR=\fI<command>\fR
|
|
|
|
the \fB\-\-exec\fR command causes the \fIcommand\fR to be executed on each
|
|
|
|
matched message; for example, to see the raw text of all messages
|
|
|
|
matching 'milkshake', you could use:
|
|
|
|
.nf
|
|
|
|
$ mu find milkshake --exec='less'
|
|
|
|
.fi
|
|
|
|
which is roughly equivalent to:
|
|
|
|
.nf
|
|
|
|
$ mu find milkshake --fields="l" | xargs less
|
|
|
|
.fi
|
|
|
|
|
|
|
|
|
2010-11-13 16:29:20 +01:00
|
|
|
.TP
|
|
|
|
\fB\-b\fR, \fB\-\-bookmark\fR=\fI<bookmark>\fR
|
|
|
|
use a bookmarked search query. Using this option, a query from your bookmark
|
2018-03-10 21:08:17 +01:00
|
|
|
file will be prepended to other search queries. See \fBmu-bookmarks\fR(1) for the
|
2010-11-13 16:29:20 +01:00
|
|
|
details of the bookmarks file.
|
2010-08-15 19:29:15 +02:00
|
|
|
|
2012-12-16 14:25:14 +01:00
|
|
|
|
|
|
|
.TP
|
2019-12-28 06:48:06 +01:00
|
|
|
\fB\-\-skip\-dups\fR,\fB-u\fR whenever there are multiple messages with the
|
|
|
|
same name, only show the first one. This is useful if you have copies of the
|
|
|
|
same message, which is a common occurrence when using e.g. Gmail together with
|
|
|
|
\fBofflineimap\fR.
|
2012-12-25 18:42:07 +01:00
|
|
|
|
|
|
|
.TP
|
2020-05-12 23:56:55 +02:00
|
|
|
\fB\-\-include\-related\fR,\fB-r\fR also include messages being referred to by
|
2019-12-28 06:48:06 +01:00
|
|
|
the matched messages -- i.e.. include messages that are part of the same
|
|
|
|
message thread as some matched messages. This is useful if you want
|
|
|
|
Gmail-style 'conversations'. Note, finding these related messages make
|
|
|
|
searches slower.
|
2012-12-16 14:25:14 +01:00
|
|
|
|
2012-10-21 15:02:06 +02:00
|
|
|
.TP
|
2021-02-12 17:49:55 +01:00
|
|
|
\fB\-t\fR, \fB\-\-threads\fR show messages in a 'threaded' format --
|
|
|
|
that is, with indentation and arrows showing the conversation threads
|
|
|
|
in the list of matching messages. When using this, sorting is
|
|
|
|
chronological (by date), based on the newest message in a thread.
|
2011-06-24 11:08:25 +02:00
|
|
|
|
|
|
|
Messages in the threaded list are indented based on the depth in the
|
|
|
|
discussion, and are prefix with a kind of arrow with thread-related
|
|
|
|
information about the message, as in the following table:
|
|
|
|
|
|
|
|
.nf
|
|
|
|
| | normal | orphan | duplicate |
|
|
|
|
|-------------+--------+--------+-----------|
|
|
|
|
| first child | `-> | `*> | `=> |
|
|
|
|
| other | |-> | |*> | |=> |
|
|
|
|
.fi
|
|
|
|
|
2012-12-17 21:30:07 +01:00
|
|
|
Here, an 'orphan' is a message without a parent message (in the list of
|
2011-06-24 11:08:25 +02:00
|
|
|
matches), and a duplicate is a message whose message-id was already seen
|
2012-12-17 21:30:07 +01:00
|
|
|
before; not this may not really be the same message, if the message-id was
|
|
|
|
copied.
|
2011-06-24 11:08:25 +02:00
|
|
|
|
2013-05-28 09:55:26 +02:00
|
|
|
The algorithm used for determining the threads is based on Jamie Zawinksi's
|
2011-06-24 11:08:25 +02:00
|
|
|
description:
|
|
|
|
.BR http://www.jwz.org/doc/threading.html
|
2011-06-23 23:20:24 +02:00
|
|
|
|
2011-11-11 08:13:35 +01:00
|
|
|
|
2010-08-15 19:29:15 +02:00
|
|
|
.SS Integrating mu find with mail clients
|
|
|
|
|
|
|
|
.TP
|
|
|
|
|
|
|
|
\fBmutt\fR
|
2011-01-05 19:35:50 +01:00
|
|
|
|
2010-08-15 19:29:15 +02:00
|
|
|
For \fBmutt\fR you can use the following in your \fImuttrc\fR; pressing the F8
|
|
|
|
key will start a search, and F9 will take you to the results.
|
|
|
|
|
|
|
|
.nf
|
|
|
|
# mutt macros for mu
|
2011-01-16 12:55:00 +01:00
|
|
|
macro index <F8> "<shell-escape>mu find --clearlinks --format=links --linksdir=~/Maildir/search " \\
|
2010-08-15 19:29:15 +02:00
|
|
|
"mu find"
|
2011-01-05 19:35:50 +01:00
|
|
|
macro index <F9> "<change-folder-readonly>~/Maildir/search" \\
|
|
|
|
"mu find results"
|
2010-08-15 19:29:15 +02:00
|
|
|
.fi
|
|
|
|
|
|
|
|
|
|
|
|
.TP
|
|
|
|
|
|
|
|
\fBWanderlust\fR
|
2011-01-05 19:35:50 +01:00
|
|
|
|
2011-04-12 21:43:21 +02:00
|
|
|
\fBSam B\fR suggested the following on the \fBmu\fR-mailing list. First add
|
2013-05-28 09:55:26 +02:00
|
|
|
the following to your Wanderlust configuration file:
|
2011-04-12 21:43:21 +02:00
|
|
|
|
|
|
|
.nf
|
|
|
|
(require 'elmo-search)
|
|
|
|
(elmo-search-register-engine
|
|
|
|
'mu 'local-file
|
|
|
|
:prog "/usr/local/bin/mu" ;; or wherever you've installed it
|
|
|
|
:args '("find" pattern "--fields" "l") :charset 'utf-8)
|
|
|
|
|
|
|
|
(setq elmo-search-default-engine 'mu)
|
|
|
|
;; for when you type "g" in folder or summary.
|
|
|
|
(setq wl-default-spec "[")
|
|
|
|
.fi
|
|
|
|
|
|
|
|
Now, you can search using the \fBg\fR key binding; you can also create
|
|
|
|
permanent virtual folders when the messages matching some expression by adding
|
|
|
|
something like the following to your \fIfolders\fR file.
|
|
|
|
|
|
|
|
.nf
|
|
|
|
VFolders {
|
|
|
|
[date:today..now]!mu "Today"
|
|
|
|
|
|
|
|
[size:1m..100m]!mu "Big"
|
|
|
|
|
2011-08-13 09:40:31 +02:00
|
|
|
[flag:unread]!mu "Unread"
|
2011-04-12 21:43:21 +02:00
|
|
|
}
|
|
|
|
.fi
|
|
|
|
|
|
|
|
After restarting Wanderlust, the virtual folders should appear.
|
|
|
|
|
2011-01-05 19:35:50 +01:00
|
|
|
.SH RETURN VALUE
|
2011-01-12 22:14:51 +01:00
|
|
|
|
2012-03-18 18:06:45 +01:00
|
|
|
\fBmu find\fR returns 0 upon successful completion; if the search was
|
2011-01-12 22:14:51 +01:00
|
|
|
performed, there needs to be a least one match. Anything else leads to a
|
2011-03-05 08:42:35 +01:00
|
|
|
non-zero return value, for example:
|
2011-01-12 22:14:51 +01:00
|
|
|
|
2011-05-20 20:31:46 +02:00
|
|
|
.nf
|
2011-01-12 22:14:51 +01:00
|
|
|
| code | meaning |
|
|
|
|
|------+--------------------------------|
|
|
|
|
| 0 | ok |
|
|
|
|
| 1 | general error |
|
2022-01-29 09:41:05 +01:00
|
|
|
| 4 | no matches (for 'mu find') |
|
2011-05-20 20:31:46 +02:00
|
|
|
.fi
|
2011-01-05 19:35:50 +01:00
|
|
|
|
2011-06-02 10:09:50 +02:00
|
|
|
|
|
|
|
.SH ENCODING
|
|
|
|
|
|
|
|
\fBmu find\fR output is encoded according the locale for \fI--format=plain\fR
|
2011-08-03 22:04:38 +02:00
|
|
|
(the default), and UTF-8 for all other formats (\fIsexp\fR,
|
2011-06-02 10:09:50 +02:00
|
|
|
\fIxml\fR).
|
|
|
|
|
|
|
|
|
2010-08-15 19:29:15 +02:00
|
|
|
.SH BUGS
|
|
|
|
|
2010-09-05 20:20:46 +02:00
|
|
|
Please report bugs if you find them:
|
2014-12-20 23:08:17 +01:00
|
|
|
.BR https://github.com/djcb/mu/issues
|
2010-11-29 20:32:15 +01:00
|
|
|
If you have specific messages which are not matched correctly, please attach
|
2013-06-08 16:34:34 +02:00
|
|
|
them (appropriately censored if needed).
|
2010-08-15 19:29:15 +02:00
|
|
|
|
|
|
|
.SH AUTHOR
|
|
|
|
|
|
|
|
Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
|
|
|
|
|
|
|
.SH "SEE ALSO"
|
|
|
|
|
2018-03-10 21:08:17 +01:00
|
|
|
.BR mu (1),
|
|
|
|
.BR mu-index (1),
|
|
|
|
.BR mu-query (7)
|
2022-04-30 00:10:31 +02:00
|
|
|
.BR mu-fields (1)
|