vacation subject:capybara maildir:/inbox
Terms without an explicit field-prefix, (like 'vacation' above) are interpreted like:
to:vacation or subject:vacation or body:vacation or ...
The language is case-insensitive for terms and attempts to 'flatten' any diacritics, so angtrom matches Ångström. If terms contain whitespace, they need to be quoted:
This is a so-called phrase query, which means that we match against subjects that contain the literal phrase "hi there". Remember that you need to escape those quotes when using this from the command-line:
mu find subject:\"hi there\"
(subject:beethoven or subject:bach) and not body:elvis
If you do not explicitly specify an operator between terms, and is implied, so the queries
subject:chip AND subject:dale
are equivalent. For readability, we recommend the second version. Note that a pure not - e.g. searching for not apples is quite a 'heavy' query.
subject:/h.llo/ # match hallo, hello, ... subject:/
Note the difference between 'maildir:/foo' and 'maildir:/foo/'; the latter matches messages in the '/foo' maildir, while the latter matches all messages in all maildirs that match 'foo', such as '/foo', '/bar/cuux/foo', '/fooishbar' etc. Wildcards are an older mechanism for matching where a term with a rightmost * (and only in that position) matches any term that starts with the part before the *; they are supported for backward compatibility and mu translates them to regular expressions internally:
is equivalent to
As a note of caution, certain wild-cards and regular expression can take quite a bit longer than 'normal' queries.
cc,c Cc (carbon-copy) recipient(s) bcc,h Bcc (blind-carbon-copy) recipient(s) from,f Message sender to,t To: recipient(s) subject,s Message subject body,b Message body maildir,m Maildir msgid,i Message-ID prio,p Message priority ( low, normal or high) flag,g Message Flags date,d Date range size,z Message size range embed,e Search inside embedded text parts file,j Attachment filename mime,y MIME-type of one or more message parts tag,x Tags for the message list,v Mailing list (e.g. the List-Id value)
The shortcut character can be used instead of the full name:
is the same as
For queries that are not one-off, we would recommend the longer name for readabilty. There are also the special fields contact:, which matches all contact-fields ( from, to, cc and bcc), and recip, which matches all recipient-fields ( to, cc and bcc). Hence, for instance,
is equivalent to
(from:email@example.com or to:firstname.lastname@example.org or cc:from:email@example.com or bcc:firstname.lastname@example.org)
date:20170505..20170602 date:2017-05-05..2017-06-02 date:..2017-10-01T12:00 date:2015-06-01.. date:2016..2016
You can also use the special 'dates' now and today:
Finally, you can use relative 'ago' times which express some time before now and consist of a number followed by a unit, with units s for seconds, M for minutes, h for hours, d for days, w for week, m for months and y for years. Some examples:
d,draft Draft Message f,flagged Flagged n,new New message (in new/ Maildir) p,passed Passed ('Handled') r,replied Replied s,seen Seen t,trashed Marked for deletion a,attach Has attachment z,signed Signed message x,encrypted Encrypted message l,list Mailing-list message
flag:attach flag:replied g:x
Encrypted messages may be signed as well, but this is only visible after decrypting and thus, invisible to mu.
Note the starting '/'. If you want to match mails in the 'root' maildir, you can do with a single '/':
If you have maildirs (or any fields) that include spaces, you need to quote them, ie.
Note that from the command-line, such queries must be quoted:
mu find 'maildir:"/Sent Items"'
bee AND bird
Find all messages with either Frodo or Sam:
Frodo OR Sam
Find all messages with the 'wombat' as subject, and 'capibara' anywhere:
subject:wombat and capibara
Find all messages in the 'Archive' folder from Fred:
from:fred and maildir:/Archive
Find all unread messages with attachments:
flag:attach and flag:unread
Find all messages with PDF-attachments:
Find all messages with attached images: