mutt

communicationLinux/Unix
The mutt command is one of the most frequently used commands in Linux/Unix-like operating systems. mutt Text-based email client for Unix-like systems

Quick Reference

Command Name:

mutt

Category:

communication

Platform:

Linux/Unix

Basic Usage:

mutt [options] [arguments]

Common Use Cases

    Syntax

    mutt [options] [-Z] [-f mailbox] [-e command] [--] [addresses...]

    Options

    Option Description
    -a file Attach a file to the message
    -b address Specify a BCC (blind carbon copy) recipient
    -c address Specify a CC (carbon copy) recipient
    -D Print debugging information
    -e command Specify a command to execute after initialization
    -f mailbox Specify which mailbox to load
    -F muttrc Specify an alternative initialization file
    -h Display help
    -H file Specify a draft file for message
    -i file Include specified file in message body
    -m type Specify a default mailbox type
    -n Do not read the system Muttrc
    -p Resume a postponed message
    -R Open mailbox in read-only mode
    -s subject Specify a subject (must be enclosed in quotes if it contains spaces)
    -v Display the Mutt version number and compile-time definitions
    -x Simulate the mailx send mode
    -y Start with a listing of all mailboxes specified by the mailboxes command
    -z When used with -f, don't start if there are no messages
    -Z Open the first folder with new mail, exit immediately if none
    -- End of options, followed by recipient addresses

    Common Keyboard Commands in Mutt:

    Key Action
    ? Help
    q Quit
    m Compose new mail
    r Reply to sender
    g Reply to all
    f Forward message
    d Delete message
    u Undelete message
    s Save message
    c Change to a different mailbox
    / Search
    t Tag message
    $ Save changes to mailbox

    Examples

    How to Use These Examples

    The examples below show common ways to use the mutt command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.

    Basic Examples:

    mutt
    Start mutt with default settings and open your inbox.
    mutt -f ~/mail/archive
    Open a specific mailbox file.

    Advanced Examples:

    mutt -s "Subject line" recipient@example.com
    Compose a new email with a pre-filled subject line.
    mutt -s "Hello" -a file.pdf recipient@example.com Compose a new email with an attachment. mutt -s "Weekly Report" -c cc@example.com recipient@example.com < report.txt Send contents of report.txt as an email with carbon copy. echo "Message body" | mutt -s "Quick note" recipient@example.com Pipe text into mutt to send a quick email. mutt -R -f saved_messages Open a mailbox in read-only mode. mutt -m muttrc.alternative Use an alternative configuration file. mutt -b "hidden@example.com" -s "Secret" recipient@example.com Send a message with a BCC (blind carbon copy). mutt -s "Test Message" -e "set signature='~/.signature.professional'" recipient@example.com Use a command-line option to override a configuration setting.

    Try It Yourself

    Practice makes perfect! The best way to learn is by trying these examples on your own system with real files.

    Understanding Syntax

    Pay attention to the syntax coloring: commands, options, and file paths are highlighted differently.

    Notes

    Mutt is a powerful, highly configurable text-based email client for Unix-like systems. First released in 1995, it has become a favorite among system administrators, developers, and power users who prefer terminal-based applications for their efficiency and customizability. Mutt follows the Unix philosophy of doing one thing well, focusing specifically on reading and sending email. Key features of the mutt command: 1. Text-Based Interface: Mutt operates entirely within a terminal, making it usable over SSH connections and on servers without graphical environments. Its efficient interface allows for quick email management with keyboard shortcuts. 2. High Customizability: Nearly every aspect of Mutt can be customized through its configuration files (~/.muttrc). Users can define keybindings, colors, headers, and behaviors to match their workflow precisely. 3. Threading Support: Mutt excels at displaying conversation threads, making it easy to follow email discussions with many participants or lengthy exchanges. 4. MIME Support: Despite its text-based nature, Mutt can handle attachments, HTML content, and various character encodings. It can view or save attachments and even display HTML emails through external renderers. 5. Multiple Account Support: Mutt can be configured to handle multiple email accounts, allowing users to switch between them easily. 6. Powerful Sorting and Filtering: Emails can be sorted and filtered in various ways, including by date, subject, sender, recipient, or custom patterns. 7. Integration with External Tools: Mutt works seamlessly with external programs for specific tasks. For example, it can use text editors for message composition, address books for contact management, and PGP/GPG for email encryption. 8. Mailbox Formats: Mutt supports various mailbox formats including mbox, Maildir, MH, and IMAP/POP3 protocols for remote access. 9. Search Capabilities: Powerful search functions allow users to find messages quickly, even in large mailboxes. 10. Scripting Support: Mutt can be scripted for automated tasks, making it useful for processing emails programmatically. Common use cases for Mutt include: - Managing email on remote servers via SSH connections - Handling large volumes of email efficiently - Automating email tasks through scripts - Secure email communication with PGP/GPG encryption - Working in environments where graphical interfaces are unavailable or impractical - Processing email as part of larger workflows or scripts While Mutt has a steeper learning curve than graphical email clients, users who invest time in learning its commands and configuration options often find it to be more efficient and powerful than GUI alternatives. Its minimal resource requirements also make it suitable for older hardware or situations where system resources are limited. It's worth noting that while Mutt itself handles message reading and composition, it typically relies on external programs like sendmail, Postfix, or SMTP clients for actual mail delivery, and fetchmail or direct IMAP/POP3 access for retrieving messages.

    Related Commands

    These commands are frequently used alongside mutt or serve similar purposes:

    Use Cases

    Learn By Doing

    The best way to learn Linux commands is by practicing. Try out these examples in your terminal to build muscle memory and understand how the mutt command works in different scenarios.

    $ mutt
    View All Commands