Command-Line Options#
Overview#
NeoMutt has four modes of operation:
Mode |
Purpose |
Activated by |
|---|---|---|
|
Display version, license, or usage info |
|
|
Query config options and aliases |
|
|
Compose and send an email |
|
|
Start the Terminal User Interface |
Default (no arguments) |
The default mode, when no arguments are given, is tui.
In addition, there are shared options that apply to all modes. These control config files, extra commands, mailbox type, and debug logging.
All options have both short (-X) and long (--name) forms.
The two forms are interchangeable and may be freely mixed on the same command line.
Note: The
=syntax is not supported. For example,--config=fileis invalid. Use--config fileinstead.
Help Mode#
Help mode displays usage information, the NeoMutt version, or the license text. NeoMutt prints the requested information and exits.
Short |
Long |
Argument |
Description |
|---|---|---|---|
|
|
Overview of command-line options |
|
|
|
|
Detailed help for a mode |
|
|
NeoMutt version and build parameters |
|
|
|
NeoMutt copyright and license |
Detailed Help#
The -h option accepts an optional mode name for more detailed help.
Valid mode names are: shared, help, info, send, tui, all.
# Show the overview
neomutt --help
# Detailed help for send mode
neomutt --help send
# Show help for all modes
neomutt --help all
Version and License#
Using -v once prints the version.
Using -v twice (i.e.
-vv) prints the license.
The long option --license is equivalent to -vv.
neomutt --version
neomutt -vv
neomutt --license
Info Mode#
Info mode queries NeoMutt’s configuration and exits. It is useful for scripting and debugging config problems.
Short |
Long |
Argument |
Description |
|---|---|---|---|
|
|
|
Lookup email aliases |
|
|
Dump all config options |
|
|
|
Dump only changed config options |
|
|
|
|
Query config options |
|
|
Add one-liner documentation |
|
|
|
Hide the value of sensitive options |
Alias Lookup#
The -A option looks up one or more email aliases.
Multiple aliases can be specified as space-separated arguments.
The argument list is terminated by -- or another option flag.
# Lookup a single alias
neomutt --alias flatcap
# Lookup multiple aliases
neomutt --alias flatcap gahr rocco
Dump Config#
Using -D once dumps all config options.
Using -D twice (i.e.
-DD) dumps only the options that differ from their defaults.
The long option --dump-changed-config is equivalent to -DD.
# Dump all config
neomutt --dump-config
# Dump only changed options
neomutt -DD
neomutt --dump-changed-config
Query Config#
The -Q option queries one or more specific config options.
Multiple option names can be specified as space-separated arguments.
The argument list is terminated by -- or another option flag.
# Query a single option
neomutt --query sort
# Query multiple options
neomutt --query alias_format index_format
Modifiers: -O and -S#
The -O and -S options modify the output of -D and -Q.
-Oadds a one-liner documentation comment above each option.-Shides the values of sensitive options (e.g. passwords).
These modifiers may be combined.
# Dump config with documentation
neomutt --dump-config --with-docs
# Dump changed config, hiding sensitive values
neomutt --dump-changed-config --hide-sensitive
# Query options with docs and hidden secrets
neomutt --with-docs --query alias_format index_format
Send Mode#
Send mode composes and sends an email from the command line. If any required parts are missing (e.g. no recipients or no subject), NeoMutt will start the TUI to prompt for them.
Short |
Long |
Argument |
Description |
|---|---|---|---|
|
|
|
Attach files (terminated by |
|
|
|
Add a Bcc: address |
|
|
Use crypto (signing/encryption) |
|
|
|
|
Add a Cc: address |
|
|
Edit message (draft/include) |
|
|
|
|
Use a draft email file |
|
|
|
Include a body file |
|
|
|
Set the Subject: header |
|
|
Add To: addresses |
Addresses#
To: addresses may appear in two places on the command line:
Before any options — leading non-option arguments are treated as To: addresses.
2.
After -- — trailing arguments after the -- separator are treated as To: addresses.
Aliases defined in the config may be used in place of email addresses.
# Address before options
neomutt flatcap --subject 'Meeting Notes'
# Address after --
neomutt --subject 'Meeting Notes' -- flatcap@example.com
# Multiple recipients
neomutt --subject 'Team Update' -- alice@example.com bob@example.com
Attachments#
The -a option accepts multiple space-separated file arguments.
The file list is terminated by -- or another option flag.
# Attach a single file
neomutt --subject 'Report' --attach report.pdf -- boss@example.com
# Attach multiple files
neomutt --subject 'Receipts' --attach receipt1.pdf receipt2.pdf -- rocco
# Attach files, then add addresses after --
neomutt --attach photo1.jpg photo2.jpg -- friends@example.com
Drafts and Includes#
A draft file (-H) is a complete email with headers and body.
An include file (-i) provides only the body text.
The -E option enables editing of the draft or include file in the
composer before sending.
# Send from a draft file
neomutt --draft ~/drafts/proposal.eml
# Include a body file and set the subject
neomutt --include meeting-notes.txt --subject 'Notes' -- team@example.com
# Edit the draft before sending
neomutt --edit-message --draft ~/drafts/proposal.eml
Piping Input#
Email body text can be piped via stdin:
echo 'Build succeeded' | neomutt --subject 'CI Report' -- dev@example.com
cat secret.txt | neomutt gahr --subject 'Secret' --crypto
Combined Example#
neomutt jim@example.com \
--cc bob@example.com \
--bcc alice@example.com \
--subject 'Party Planning' \
--include party-details.txt \
--attach map.pdf guest-list.csv
TUI Mode#
TUI mode starts NeoMutt’s Terminal User Interface.
This is the default when no command-line arguments are given.
By default, NeoMutt opens the Index Dialog with the $spool_file mailbox.
Short |
Long |
Argument |
Description |
|---|---|---|---|
|
|
|
Open this mailbox |
|
|
Open NNTP browser |
|
|
|
|
Use this NNTP server |
|
|
Resume postponed email |
|
|
|
Open mailbox read-only |
|
|
|
Open mailbox browser |
|
|
|
Check for new mail (exit if none) |
|
|
|
Check for any mail (exit if none) |
Opening a Mailbox#
# Open a specific mailbox
neomutt --folder ~/Mail/inbox
# Open read-only
neomutt --folder ~/Mail/archive --read-only
Mail Checks#
The -Z and -z options cause NeoMutt to check a mailbox before starting.
If the condition is not met, NeoMutt exits immediately.
-Zchecks for new (unread) mail.-zchecks for any mail.
# Only start if there is new mail
neomutt --check-new-mail
# Only start if there is any mail in a specific folder
neomutt --folder ~/Mail/work --check-any-mail
Postponed Messages#
The -p option resumes editing a previously postponed email.
neomutt --postponed
Mailbox Browser#
The -y option opens the mailbox browser instead of going directly to a
mailbox.
neomutt --browser
NNTP (Usenet)#
The -G option opens the NNTP newsgroup browser.
The -g option specifies an NNTP server to connect to.
# Open the NNTP browser
neomutt --nntp-browser
# Connect to a specific news server
neomutt --nntp-server news.example.com
Parsing Behavior#
This section describes how NeoMutt interprets the command line.
Option Syntax#
NeoMutt uses getopt_long for command-line parsing.
All short options have equivalent long options.
Short options use a single dash:
-s 'Hello'Long options use a double dash:--subject 'Hello'The=sign is not supported.--subject='Hello'is invalid and will produce an error.
Leading Arguments#
Any arguments that appear before the first option flag are treated as To: addresses and activate send mode.
# 'alice@example.com' is a To: address (appears before -s)
neomutt alice@example.com -s 'Hello'
Trailing Arguments#
Arguments that appear after -- are treated as To: addresses.
neomutt --subject 'Hello' -- alice@example.com bob@example.com
Multi-Value Options (Mop Up)#
Three options accept multiple space-separated arguments:
Option |
Long |
Collects until |
|---|---|---|
|
|
|
|
|
|
|
|
|
The argument list for these options ends when -- or another option
beginning with - is encountered.
# -A collects both 'flatcap' and 'gahr'
neomutt --alias flatcap gahr
# -a collects both files, then -- separates addresses
neomutt --attach notes.txt slides.pdf -- team@example.com
Double-Flag Options#
Two options change meaning when specified twice:
Once |
Twice |
Long Equivalent |
Effect |
|---|---|---|---|
|
|
|
Version → License |
|
|
|
All config → Changed only |
# Version
neomutt -v
# License (double -v)
neomutt -vv
Error Handling#
If NeoMutt encounters an unknown option or a missing required argument, it prints an error message and shows the help overview.
# Unknown option — prints error and help
neomutt --foobar
# Missing argument — prints error and help
neomutt --config
Quick Reference#
neomutt [<address> ...] [options] [-- <address> ...]
Shared:
-n, --no-system-config Don't read system config file
-F, --config <file> Use this user config file (repeatable)
-e, --command <command> Run extra config command (repeatable)
-m, --mbox-type <type> Set default mailbox type
-d, --debug-level <level> Set logging level (0-5)
-l, --debug-file <file> Set logging file
Help:
-h, --help [<mode>] Show help (modes: shared, help, info, send, tui, all)
-v, --version Show version
-vv, --license Show license
Info:
-A, --alias <alias> [...] Lookup email aliases
-D, --dump-config Dump all config options
-DD, --dump-changed-config Dump changed config options
-Q, --query <option> [...] Query config options
-O, --with-docs Add one-liner documentation (modifies -D, -Q)
-S, --hide-sensitive Hide sensitive values (modifies -D, -Q)
Send:
-a, --attach <file> [...] Attach files
-b, --bcc <address> Add Bcc: address
-C, --crypto Use crypto (signing/encryption)
-c, --cc <address> Add Cc: address
-E, --edit-message Edit draft/include before sending
-H, --draft <file> Use draft email file
-i, --include <file> Include body file
-s, --subject <subject> Set Subject: header
TUI:
-f, --folder <mailbox> Open this mailbox
-G, --nntp-browser Open NNTP browser
-g, --nntp-server <server> Use this NNTP server
-p, --postponed Resume postponed email
-R, --read-only Open mailbox read-only
-y, --browser Open mailbox browser
-Z, --check-new-mail Check for new mail (exit if none)
-z, --check-any-mail Check for any mail (exit if none)