Robust Mutt configs with examples for the following account types:
- Generic IMAP/SMTP
- Google (Gmail/Gsuite etc) via IMAP/SMTP
- Microsoft Office365 via IMAP/SMTP
- Microsoft Office365 using DavMail (useful if app passwords or direct IMAP/SMTP access is disabled)
I've spent a long time endlessly tuning these configs to try and create a command-line-based, email setup that doesn't feel like a gimmick or a trade-off when compared to modern web/GUI-based email clients.
I use this every day personally and for my work. I'm currently contracting for a super corporate public sector organisation who use Office365, Outlook, Teams etc and I find this setup easier and more productive than using the standard Microsoft tooling.
- Query and save contacts via abook, goobook or ldapsearch (e.g. for Office365 accounts, query only)
- Good calendar invite handling: render calendar invites inline and respond to them with
A
when viewing the calendar invite attachment - Threads also contain emails sent by you like you see in modern email clients (this is achieved via notmuch)
- Nice handling of inline text/html rendering (use
C-l
to open up all links the email - great for quickly finding unsubscribe links) - Secure configs (no hardcoded passwords etc)
- Fast global search of all mail in every account or all mail in a single account via NotMuch
- Everything looks really nice :)
- Includes all peripheral configs for isync, msmtp, notmuch etc
- Install any dependencies you need based on your use cases from the below list
- Move the stuff in .config into your existing .config directoy inside your home folder
- Move the stuff you need from the bin folder into /usr/local/bin (don't forget to
chmod +x
them) - Go through each config file and customize it - there are comments/instructions in each file
- Enable any systemd services you need (or use something like cron)
- You probably want to set the ESCDELAY env var to 0 in your bashrc, zshrc etc
- NeoMutt (latest version, all compile options enabled)
- html2text (nicer HTML email rendering)
- glow (nicer HTML email rendering)
- Lynx (render HTML emails, W3m works well too)
- Notmuch (for email search)
- Isync (for syncing emails via IMAP)
- MSMTP (for sending emails via SMTP)
- python-vobject (for interacting with calendar invites)
- python-icalendar (for interacting with calendar invites)
- python-pytz (for interacting with calendar invites)
- python-tzlocal (for interacting with calendar invites)
- DavMail (if you want to use Office365/Outlook mail and the company locks down IMAP access)
- openldap (for using ldapsearch if you want to look up contacts on office365 etc - required DavMail)
- abook (basic contact management)
- goobook (if you want to use google contacts instead)
- gcalcli (if you want to import events into a google calendar)
- urlscan (to quickly show/open links within an email)
- pandoc (if you want to compose HTML emails in markdown)
./neomutt.desktop
- a desktop file for opening mutt via the GUI inside the Kitty terminal. Stick it in /usr/share/applicationsbin/import_calendar_invite
- imports a calendar invite into google calendar with gcalcli and then calls mutt-ical to respond to the invitebin/ldap_owa_query
- allows contact searching via LDAP (used for coroprate office365/outlook accounts)bin/mailsync
- a great script that syncs your mail, originally written by Luke Smithbin/mutt-ical
- used to respond to email calendar invitesbin/mutt-trim
- clean up emails when quoting replybin/mutt-nm-search-cached
- search emails with notmuchbin/render-calendar-attachment.py
- used to render email calendar invites in Muttbin/mutt-viewical
- used to render ical attachments in Muttbin/beautiful_html_render
- best approach I've found so far.config/isync/mbsyncrc
- configuration file for isync (used to sync your emails). There are examples of many different account types to use as a starting point.config/glow/*
- various settings and themes related to Glow.config/msmtp/config
- configuration file for msmtp (used to send emails). There are examples of many different account types to use as a starting point.config/mutt/accounts/*
- individual config files for each email account you wish to use in Mutt. There are examples of many different account types to use as a starting point.config/mutt/muttrc
- the main Mutt config - use this to customize various settings/macros/bindings etc.config/mutt/styles.muttrc
- my custom styling for Mutt - you shouldn't need to tweak this much/at all.config/mutt/mailcap
- mailcap file for detrening how to render different types of emails/attachments - customize as needed (there's already quite a lot of handy stuff in there).config/notmuch/notmuchrc
- config file for notmuch (used for searching emails) - you will need to change some values in here such as your name/email.config/systemd/user/calendar-remind*
- systemd timer/service files for repeatedly callinggcalcli remind
(to generate notifications 15 mins before an event starts). Enable withsystemctl --user enable calendar-remind.timer
or delete if you don't need..config/systemd/user/gcalcli*
- systemd timer/service files for repeatedly callinggcalsync
(to sync gcalcli with google calendar). Enable withsystemctl --user enable gcalcli.timer
or delete if you don't need..config/systemd/user/mailsync*
- systemd timer/service files for repeatedly callingmailsync
(to sync your emails). Enable withsystemctl --user enable mailsync.timer
.config/systemd/user/vdirsyncer*
- systemd timer/service files for repeatedly callingvdirsyncer sync
(to sync your calendars). Enable withsystemctl --user enable vdirsyncer.timer
.config/vdirsyncer/config
- example configs for vdirsyncer (used to sync calendars, I recommend using with Khal)
All default keys are unbound to remove random, unwanted bindings and commands. Therefore all bindings are explicit.
Press ?
inside Mutt to see available keybinds for your current context.
q
exit/close/back<escape>
abort command?
help/
searchj
scroll downk
scroll upgg
first item/topG
last item/bottom<return>
open/select/confirm<tab>
trigger auto-completen
(when searching) search nextShift-n
orp
(when searching) search previousCtrl-u
scroll half a page upwardsCtrl-d
scroll half a page downwardsCtrl-n
next unread messageCtrl-p
previous unread messagezz
center screen on current selection (similar to Vim)zt
center screeen at top of current selection (similar to Vim)zb
center scren at bottom of current selection (similar to Vim)
<left>
or<right>
orh
toggle thread open/collapseg
i
go to inboxg
s
go to sent itemsg
d
go to draftsg
a
go to archiveg
Shift-s
go to spamf
change folderCtrl-b
toggle sidebarCtrl-j
sidebar next itemCtrl-k
sidebar previous itemCtrl-o
open current sidebar item<space>
flag current email (toggle)t
tag current email (toggle)T
tag current thread (toggle)Shift-m
i
move email(s) to inbox (works on tagged emails)Shift-m
s
move email(s) to sent items (works on tagged emails)Shift-m
d
move email(s) to drafts (works on tagged emails)Shift-m
a
move email(s) to archive (works on tagged emails)Shift-m
Shift-S
move email(s) to spam (works on tagged emails)Shift-c
i
copy email(s) to inbox (works on tagged emails)Shift-c
s
copy email(s) to sent items (works on tagged emails)Shift-c
d
copy email(s) to drafts (works on tagged emails)Shift-c
a
copy email(s) to archive (works on tagged emails)Shift-c
Shift-S
copy email(s) to spam (works on tagged emails)d
mark current email(s) for deletion (works on tagged emails)u
undelete email(s) (works on tagged emails)Shift-d
quick delete current email(s) (works on tagged emails)Shift-a
quick archive current email(s) (works on tagged emails)l
add/edit label\
filter (limit) current mailbox (see filters cheat sheet)x
clear current filter/limitCtrl-i
only show flagged messages (pressx
to clear)Shift-l
filter by label+
link current thread with a tagged threadc
compose new mailCtrl-r
recall draft (postponed) messager
reply to messageShift-r
reply allShift-f
forward messagev
view email attachments|
pipe current email to shell commandCtrl-a
mark all messages as read$
sync mailbox to local filesystemo
remote sync current account (send/receive from IMAP)
Shift-j
next emailShift-k
previous emailr
reply to messageShift-r
reply allShift-f
forward messagev
view email attachments|
pipe current email to shell commandCtrl-l
call urlscan to show all links in the current emailShift-a
(when viewing a calendar invite) respond to invite
s
save current attachemnt to ~/Downloads
y
senda
attach filep
postpone message (save to drafts)e
edit messaget
edit "to" field (recipient)f
edit "from" field (sender)s
edit subjectc
edit "CC" fieldb
edit "BCC" field