Perfect β neomutt + Gmail (app password) on Arch is a very solid setup. Below is a clean, modern neomutt config with Gmail-specific fixes.
Google Account β Security β 2-Step Verification β App passwords
sudo pacman -S neomutt ca-certificates
(Optional but recommended later)
sudo pacman -S pass gnupg
mkdir -p ~/.config/neomutt
chmod 700 ~/.config/neomutt
~/.config/neomutt/neomuttrc############
# Identity #
############
set from = "your@gmail.com"
set realname = "Your Name"
########
# IMAP #
########
set imap_user = "your@gmail.com"
set imap_pass = "APP_PASSWORD"
set folder = "imaps://imap.gmail.com:993"
set spoolfile = "+INBOX"
########
# SMTP #
########
set smtp_url = "smtp://your@gmail.com@smtp.gmail.com:587/"
set smtp_pass = "APP_PASSWORD"
set smtp_authenticators = "login"
################
# Gmail Folders #
################
set record = "+[Gmail]/Sent Mail"
set postponed = "+[Gmail]/Drafts"
set trash = "+[Gmail]/Trash"
#################
# Gmail behavior #
#################
set move = no # Gmail uses labels
set imap_keepalive = 300
set imap_pipeline_depth = 1
set sleep_time = 0
#######
# TLS #
#######
set ssl_force_tls = yes
###################
# Neomutt niceties #
###################
set sidebar_visible = yes
set sidebar_width = 30
set sidebar_short_path = yes
bind index,pager \CP sidebar-prev
bind index,pager \CN sidebar-next
bind index,pager \CO sidebar-open
bind index,pager \CC sidebar-close
############
# Defaults #
############
set editor = "nvim"
set pager_index_lines = 10
set sort = threads
set strict_threads = yes
π Protect credentials
chmod 600 ~/.config/neomutt/neomuttrc
neomutt
You should see your Gmail inbox and sidebar immediately.
pass instead of plain text passwordspass insert gmail/app
neomuttrcset imap_pass = "`pass gmail/app`"
set smtp_pass = "`pass gmail/app`"
Neomutt will execute pass and insert the password securely.
Correct Gmail folder names
[Gmail]/Sent Mail
[Gmail]/Drafts
[Gmail]/Trash
Archive (All Mail)
[Gmail]/All Mail
Do not enable message moving
set move = no
Start neomutt with debug:
neomutt -d 5
Common issues:
I can help you add:
Just tell me what you want next.
Alright π letβs build you a proper power-user neomutt setup on Arch with everything:
β multiple Gmail accounts β offline Maildir sync (mbsync) β GPG signing & encryption β sidebar, theme, statusline β clean file layout you wonβt hate later
This is a battle-tested setup, not a blog-post toy.
~/.config/neomutt/
βββ neomuttrc
βββ accounts/
β βββ gmail-main.rc
β βββ gmail-work.rc
βββ colors.rc
βββ statusline.rc
βββ gpg.rc
βββ sidebar.rc
~/.mail/
βββ gmail-main/
βββ gmail-work/
~/.mbsyncrc
sudo pacman -S neomutt isync pass gnupg ca-certificates
Optional but nice:
sudo pacman -S lynx w3m urlscan
For each Gmail account:
pass:pass insert gmail/main
pass insert gmail/work
~/.mbsyncrcIMAPAccount gmail-main
Host imap.gmail.com
User your@gmail.com
PassCmd "pass gmail/main"
SSLType IMAPS
IMAPStore gmail-main-remote
Account gmail-main
MaildirStore gmail-main-local
Path ~/.mail/gmail-main/
Inbox ~/.mail/gmail-main/INBOX
Channel gmail-main
Master :gmail-main-remote:
Slave :gmail-main-local:
Patterns *
Create Slave
SyncState *
Remove None
Expunge None
############################
IMAPAccount gmail-work
Host imap.gmail.com
User work@gmail.com
PassCmd "pass gmail/work"
SSLType IMAPS
IMAPStore gmail-work-remote
Account gmail-work
MaildirStore gmail-work-local
Path ~/.mail/gmail-work/
Inbox ~/.mail/gmail-work/INBOX
Channel gmail-work
Master :gmail-work-remote:
Slave :gmail-work-local:
Patterns *
Create Slave
SyncState *
Remove None
Expunge None
mbsync -a
(Optional cron/systemd later.)
~/.config/neomutt/neomuttrcset mailcap_path = ~/.mailcap
set folder = ~/.mail
set header_cache = ~/.cache/neomutt
set message_cachedir = ~/.cache/neomutt
set editor = nvim
set charset = utf-8
set sort = threads
set strict_threads = yes
# Load components
source ~/.config/neomutt/sidebar.rc
source ~/.config/neomutt/colors.rc
source ~/.config/neomutt/statusline.rc
source ~/.config/neomutt/gpg.rc
# Default account
source ~/.config/neomutt/accounts/gmail-main.rc
accounts/gmail-main.rcset realname = "Your Name"
set from = "your@gmail.com"
set spoolfile = "+gmail-main/INBOX"
set record = "+gmail-main/[Gmail]/Sent Mail"
set postponed = "+gmail-main/[Gmail]/Drafts"
set trash = "+gmail-main/[Gmail]/Trash"
set smtp_url = "smtp://your@gmail.com@smtp.gmail.com:587/"
set smtp_pass = "`pass gmail/main`"
set smtp_authenticators = "login"
accounts/gmail-work.rcset realname = "Your Name (Work)"
set from = "work@gmail.com"
set spoolfile = "+gmail-work/INBOX"
set record = "+gmail-work/[Gmail]/Sent Mail"
set postponed = "+gmail-work/[Gmail]/Drafts"
set trash = "+gmail-work/[Gmail]/Trash"
set smtp_url = "smtp://work@gmail.com@smtp.gmail.com:587/"
set smtp_pass = "`pass gmail/work`"
set smtp_authenticators = "login"
macro index,pager <F2> "<enter-command>source ~/.config/neomutt/accounts/gmail-main.rc<enter>"
macro index,pager <F3> "<enter-command>source ~/.config/neomutt/accounts/gmail-work.rc<enter>"
sidebar.rcset sidebar_visible = yes
set sidebar_width = 30
set sidebar_short_path = yes
bind index,pager \CP sidebar-prev
bind index,pager \CN sidebar-next
bind index,pager \CO sidebar-open
bind index,pager \CC sidebar-close
gpg --full-generate-key
gpg.rcset pgp_autosign = yes
set pgp_replyencrypt = yes
set pgp_timeout = 1800
set crypt_use_gpgme = yes
set crypt_autosign = yes
set crypt_replyencrypt = yes
Sign manually while composing:
p β s
Encrypt:
p β e
colors.rccolor normal white black
color status black cyan
color indicator black yellow
color sidebar_new yellow black
color sidebar_highlight cyan black
color quoted green black
color quoted1 cyan black
color quoted2 blue black
color error red black
statusline.rcset status_format = "[%a] %r | %f | %L msgs | %p%% | %y"
Sync mail:
mbsync -a
Open mail:
neomutt
Switch accounts:
If you want, next we can add:
Just tell me which rabbit hole you want first.