Searching and Filtering Email#
This tutorial teaches the basic search and limit workflow in the index. If you’re new to reading mail in NeoMutt, start with Reading Your First Email.
Basic Search#
Open a mailbox in the index.
Press / and type a word from a message subject, then press <Enter>.
Press n to jump to the next match.
Expected result: the cursor moves to messages that match the search string.
Filter the Message List with Limit#
Press l in the index to limit the view.
Enter a pattern like
~f alice@example.com.Press <Enter> to apply the limit.
Press l again and enter
*to clear the limit.
Expected result: the index shows only matching messages while the limit is active.
NeoMutt’s Pattern Matching Language#
Try these common patterns:
~f alice@example.com (from)
~s "build report" (subject)
~d <1w (date within 1 week)
~b "error code" (body)
Expected result: you can target specific message fields using patterns.
Search by Sender, Subject, Date, and Body#
Limit to a sender with
~f.Limit to last week with
~d <1w.Limit to a keyword in the body with
~b.
Expected result: you can filter messages by common criteria.
Combine Patterns#
Combine with AND by listing patterns:
~f alice@example.com ~s report
Use OR with
|:
(~f alice@example.com | ~f bob@example.com)
Exclude with
!:
~s report !~b draft
Expected result: you can build precise queries.
Save and Reuse Search Patterns#
Create a macro for a frequent search:
macro index ,r "<limit>~f alice@example.com ~s report<Enter>" "Limit to reports from Alice"
Use
,rin the index.
Expected result: you can repeat complex searches quickly.
Full-Text Search with Notmuch#
Notmuch adds full-text search and tag-based queries.
If you need whole-mailbox searching, set up Notmuch and use notmuch:// virtual mailboxes.
See How to Use Notmuch.
Next Steps#
“I want to organize with tags.” Continue with Organising Email with Tags.