MU FIND(1)		    General Commands Manual		    MU FIND(1)

NAME
       mu-find - find e-mail messages in the mu database.

SYNOPSIS
       mu [COMMON-OPTIONS] find [OPTIONS] SEARCH_EXPRESSION

DESCRIPTION
       mu find is the mu command for searching e-mail message that were stored
       earlier using mu index(1).

SEARCHING MAIL
       mu find starts a search for messages in the database that match some
       search pattern. The search patterns are described in detail in mu-
       query(7).


       For example:

	      $ mu find subject:snow and date:2009..



       would find all messages in 2009 with `snow' in the subject field, e.g:

	      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


FIND OPTIONS
       The find-command has various options that influence the way mu displays
       the results. If you don't specify anything, the defaults are
       --fields="d f s", --sortfield=date and --reverse.

   -f, --fields fields
       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:

	      $ mu find subject:snow --fields "d f s"



       lists 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 search parameters, such as:
	      t       *t*o: recipient
	      d       Sent *d*ate of the message
	      f       Message sender (*f*rom:)
	      g       Message flags (fla*g*s)
	      l       Full path to the message (*l*ocation)
	      s       Message *s*ubject
	      i       Message-*i*d
	      m       *m*aildir



       For the complete list, try the command: mu info fields.

   -s, --sortfield field and -z,--reverse
       Specify the field to sort the search results by and the direction
       (i.e., `reverse' means that the sort should be reverted - Z-A).
       Examples include:

	      cc,c	      Cc (carbon-copy) recipient(s)
	      date,d	      Message sent date
	      from,f	      Message sender
	      maildir,m       Maildir
	      msgid,i	      Message id
	      prio,p	      Nessage priority
	      subject,s       Message subject
	      to,t	      To:-recipient(s)



       For the complete list, try the command: mu info fields.


       Thus, for example, to sort messages by date, you could specify:

	      $ mu find fahrrad --fields "d f s" --sortfield=date --reverse

   -n, --maxnum number
       If number > 0, display maximally that number of entries. If not
       specified, all matching entries are displayed.

   --summary-len number
       If number > 0, use that number of lines of the message to provide a
       summary.

   --format plain|links|xml|sexp
       Output results in the specified format.


       —   The default is plain, i.e normal output with one line per message.

       —   links outputs the results as a maildir with symbolic links to the
	   found messages. This enables easy integration with mail-clients
	   (see below for more information). This requires --linksdir.

       —   xml formats the search results as XML.

       —   sexp formats the search results as an s-expression as used in Lisp
	   programming environments.

   --linksdir dir and -c, --clearlinks
       When using --format=links, output the results as a maildir with
       symbolic links to the found messages. This enables easy integration
       with mail-clients (see below for more information). mu will create the
       maildir if it does not exist yet.

   --after timestamp
       Only show messages whose message files were last modified (mtime) after
       timestamp. timestamp is a UNIX time_t value, the number of seconds
       since 1970-01-01 (in UTC).


       From the command line, you can use the date command to get this value.
       For example, only consider messages modified (or created) in the last 5
       minutes, you could specify
	      --after=`date +%s --date='5 min ago'`

   -b, --bookmark bookmark
       Use a bookmarked search query. Using this option, a query from your
       bookmark file will be prepended to other search queries. See mu-
       bookmarks(5) for the details of the bookmarks file.

   -u, --skip-dups
       Whenever there are multiple messages with the same message-id field,
       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 offlineimap.

   -r, --include-related
       Include messages being referred to by 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'.

   -t, --threads
       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.


       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:
	      | 	    | normal | orphan | duplicate |
	      |-------------+--------+--------+-----------|
	      | first child | `->    | `*>    | `=>	  |
	      | other	    | |->    | |*>    | |=>	  |

