Notmuch Advanced Queries#
Prerequisites#
Notmuch integration working in NeoMutt.
A notmuch database already indexed.
Build Complex Queries#
Use boolean operators in a query:
named-mailboxes "Important" "notmuch://?query=tag:inbox and tag:flagged"
Open the mailbox.
Expected result: only messages matching the combined query are shown.
Create a Virtual Mailbox from a Query#
Bind the
vfolder-from-queryfunction:
bind index,pager \eX vfolder-from-query
Press Alt-X and enter a query such as:
tag:inbox and from:boss@example.com
Expected result: NeoMutt opens a virtual mailbox using your query.
Use Windowed Queries#
Windowed queries limit results to a moving time window.
Enable windowed queries:
set nm_query_window_enable = yes
set nm_query_window_duration = 2
set nm_query_window_timebase = "week"
Ensure important items are always included:
set nm_query_window_or_terms = "tag:unread and tag:flagged"
Expected result: queries use a rolling two-week window but keep unread/flagged messages visible.
See How to Use Notmuch for full configuration details.