Mutt Command Guide
Mutt: A Powerful Text-Based Mail Reader
Mutt is a highly configurable command-line email client that supports MIME, GPG, PGP, and threading. It's a favorite among developers and power users for its efficiency and flexibility.
Sending Emails with Mutt
Mutt allows you to send emails directly from the command line with various options. Here are some common use cases:
# Send E-Mail with subject, cc, and attachment.
mutt -s "Site Backup" -a backup.tar -c user@example.com user2@example.com
# Send E-Mail with blind carbon copy (bcc).
mutt -s "hello" -b user2@example.com user@example.com
Message Selection and Tagging
Mutt provides a powerful system for selecting and tagging messages using search expressions. This is crucial for managing large mailboxes efficiently.
Common Selection Patterns:
~b expr: Messages withexprin the body.~f from-to: Messages from a specific sender.~N: New messages.~U: Unread messages.~R: Read messages.~A: All messages.
Logical Operators:
Combine patterns using logical operators like AND (~P ~N), OR (~P | ~N), and parentheses for complex queries.
Date-Based Filtering
Filter messages based on their received date using flexible date formats and operators.
Date Formats:
DD/MM/YY~d 20/1/95-31/10/95: Messages from 20/01/95 to 31/10/95.~d -31/10/95: Messages before 31/10/95.~d 20/1/95-: Messages after 20/01/95.~d 20/1/95*2w: Messages within two weeks around 20/01/95.~d <1m: Messages newer than 1 month.~d >1y: Messages older than 1 year.
Operators like * (around), + (after), and - (before) offer precise date filtering.
Essential Keyboard Shortcuts
Mastering Mutt's keyboard shortcuts significantly speeds up email management.
Common Actions:
d: Delete message.N: Mark as new.C: Copy message to another folder.o, O: Change sort order, reverse sort.shift+d (D): Delete messages using a pattern.shift+t (T): Select messages using a pattern.ctrl+t: Deselect messages using a pattern.esc+v, V: Collapse thread, collapse all threads.w,W: Add, remove flags.
Example of a complex shortcut: T ~U ;WN ctrl+t . marks unread messages, removes their new flag, and de-selects them.