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
Awhen 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-lto 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 +xthem) - 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.timeror 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.timeror 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.
qexit/close/back<escape>abort command?help/searchjscroll downkscroll upggfirst item/topGlast item/bottom<return>open/select/confirm<tab>trigger auto-completen(when searching) search nextShift-norp(when searching) search previousCtrl-uscroll half a page upwardsCtrl-dscroll half a page downwardsCtrl-nnext unread messageCtrl-pprevious unread messagezzcenter screen on current selection (similar to Vim)ztcenter screeen at top of current selection (similar to Vim)zbcenter scren at bottom of current selection (similar to Vim)
<left>or<right>orhtoggle thread open/collapsegigo to inboxgsgo to sent itemsgdgo to draftsgago to archivegShift-sgo to spamfchange folderCtrl-btoggle sidebarCtrl-jsidebar next itemCtrl-ksidebar previous itemCtrl-oopen current sidebar item<space>flag current email (toggle)ttag current email (toggle)Ttag current thread (toggle)Shift-mimove email(s) to inbox (works on tagged emails)Shift-msmove email(s) to sent items (works on tagged emails)Shift-mdmove email(s) to drafts (works on tagged emails)Shift-mamove email(s) to archive (works on tagged emails)Shift-mShift-Smove email(s) to spam (works on tagged emails)Shift-cicopy email(s) to inbox (works on tagged emails)Shift-cscopy email(s) to sent items (works on tagged emails)Shift-cdcopy email(s) to drafts (works on tagged emails)Shift-cacopy email(s) to archive (works on tagged emails)Shift-cShift-Scopy email(s) to spam (works on tagged emails)dmark current email(s) for deletion (works on tagged emails)uundelete email(s) (works on tagged emails)Shift-dquick delete current email(s) (works on tagged emails)Shift-aquick archive current email(s) (works on tagged emails)ladd/edit label\filter (limit) current mailbox (see filters cheat sheet)xclear current filter/limitCtrl-ionly show flagged messages (pressxto clear)Shift-lfilter by label+link current thread with a tagged threadccompose new mailCtrl-rrecall draft (postponed) messagerreply to messageShift-rreply allShift-fforward messagevview email attachments|pipe current email to shell commandCtrl-amark all messages as read$sync mailbox to local filesystemoremote sync current account (send/receive from IMAP)
Shift-jnext emailShift-kprevious emailrreply to messageShift-rreply allShift-fforward messagevview email attachments|pipe current email to shell commandCtrl-lcall urlscan to show all links in the current emailShift-a(when viewing a calendar invite) respond to invite
ssave current attachemnt to ~/Downloads
ysendaattach fileppostpone message (save to drafts)eedit messagetedit "to" field (recipient)fedit "from" field (sender)sedit subjectcedit "CC" fieldbedit "BCC" field