Organise Multiple Virtual Mailboxes#
Prerequisites#
Two or more Notmuch virtual mailboxes already configured (see Getting Started with Notmuch Virtual Mailboxes).
Use Clear, Consistent Names#
Choose short, descriptive labels:
virtual-mailboxes "Inbox" "notmuch://?query=tag:inbox"
virtual-mailboxes "Unread" "notmuch://?query=tag:inbox and tag:unread"
virtual-mailboxes "Flagged" "notmuch://?query=tag:flagged"
virtual-mailboxes "Sent" "notmuch://?query=tag:sent"
Expected result: the sidebar and browser show a readable list.
Group by Prefix#
Prefix related mailboxes to create visual groups:
virtual-mailboxes "Work/Inbox" "notmuch://?query=tag:work and tag:inbox"
virtual-mailboxes "Work/Unread" "notmuch://?query=tag:work and tag:unread"
virtual-mailboxes "Work/Flagged" "notmuch://?query=tag:work and tag:flagged"
virtual-mailboxes "Personal/Inbox" "notmuch://?query=tag:personal and tag:inbox"
virtual-mailboxes "Personal/Unread" "notmuch://?query=tag:personal and tag:unread"
Expected result: the sidebar shows mailboxes grouped under Work/ and Personal/.
If the sidebar is configured with $sidebar_short_path and $sidebar_delim_chars, it can shorten these paths into an indented tree.
Control the Order#
Virtual mailboxes appear in the sidebar and browser in the order they are declared in your config.
Put the most-used mailboxes first:
virtual-mailboxes "Inbox" "notmuch://?query=tag:inbox"
virtual-mailboxes "Unread" "notmuch://?query=tag:inbox and tag:unread"
virtual-mailboxes "Flagged" "notmuch://?query=tag:flagged"
virtual-mailboxes "Archive" "notmuch://?query=tag:archive"
Expected result: the mailboxes you check most often are at the top.
Hide Low-Traffic Mailboxes#
Use
$sidebar_new_mail_onlyto show only mailboxes with new or flagged mail:
set sidebar_new_mail_only
Pin important mailboxes so they always appear:
sidebar-pin "Inbox" "Flagged"
Expected result: quiet mailboxes are hidden until they receive new mail.
Move Mailbox Definitions to a Separate File#
Create
~/.config/neomutt/virtual-mailboxes:
virtual-mailboxes "Inbox" "notmuch://?query=tag:inbox"
virtual-mailboxes "Unread" "notmuch://?query=tag:inbox and tag:unread"
virtual-mailboxes "Flagged" "notmuch://?query=tag:flagged"
Source it from your main config:
source ~/.config/neomutt/virtual-mailboxes
Expected result: your main config stays short and mailbox definitions are easy to edit separately.
See Sidebar for display options and Sidebar Workflows for navigation tips.