mu4e queries are the same as the ones that mu find
understands12. You can consult the
mu-query man-page for the details. In addition, mu4e provides a
command mu4e-analyze-last-query, which shows how the mu server has
interpreted the query, similar to what the --analyze option does for
mu find.
Additionally, mu4e supports TAB-completion for queries. There is
completion for all search keywords such as and, from:, or
date: and also for certain values, i.e., the possible values for
flag:, prio:, mime:, and maildir:.
Let’s look at some examples here.
bananas
from:john and flag:attach and bananas
subject:wombat and date:20170601..20170630
/projects folder
maildir:/projects and mime:application/pdf
/Sent Items folder. Note that
maildirs with spaces must be quoted.
"maildir:/Sent Items" and rupert
flag:signed and prio:high
from:jim and not flag:attach
to, from,
cc, bcc):
contact:alice
subject:Ångström and flag:unread
date:20120301..20130831 and nightingale and flag:unread
date:today..now
date:2w.. and emacs
list:mu-discuss.googlegroups.com
Note — in The headers view you may see the ‘friendly name’ for a list; however, when searching you need the real name. You can see the real name for a mailing list from the friendly name’s tool-tip.
subject:soc*
NOT flag:list
file:pic*
mime:application/pdf
Get all messages with image attachments, and note that the ‘*’ wildcard can only appear as the term’s rightmost character:
mime:image/*
Get all messages with files that end in .ppt; this uses the
regular-expression support, which is powerful but relatively slow:
file:/\.ppt$/
with the caveat that command-line queries are subject to
the shell’s interpretation before mu sees them