Basic Setup For Multiple Gmail Accounts In Neomutt
Just started using Neomutt, so my setup is still very basic.
It was quite a headache getting it to work with multiple Gmail accounts.
Hopefully the information below helps you and future me.
Be sure to allow less secure apps for each Gmail account
~/
|── .neomutt/
| ├── account.com.gmail.foo
| ├── account.com.gmail.bar
| ├── com.gmail.foo/
| ├── com.gmail.bar/
└── .neomuttrc
# Default account
source "~/.neomutt/account.com.gmail.account1"
# Folder hooks
folder-hook 'account.com.gmail.account1' 'source ~/.neomutt/account.com.gmail.account1'
folder-hook 'account.com.gmail.account2' 'source ~/.neomutt/account.com.gmail.account2'
# Macros to switch accounts
macro index <f2> "<enter-command>unmailboxes *<enter><enter-command>source ~/.neomutt/account.com.gmail.account1<enter><sync-mailbox><change-folder>!<enter>"
macro index <f3> "<enter-command>unmailboxes *<enter><enter-command>source ~/.neomutt/account.com.gmail.account2<enter><sync-mailbox><change-folder>!<enter>"
# Mappings
## Fetch mail shortcut
bind index G imap-fetch-mail
# General settings
set editor='vim'
set imap_user = "[email protected]"
set imap_pass = ""
set smtp_url = "smtp://[email protected]:587/"
set smtp_pass = ""
set from = "[email protected]"
set realname = "your name"
set folder = "imaps://[email protected]:993"
set spoolfile = "+INBOX"
set postponed = "+[Gmail]/Drafts"
set record = "+[Gmail]/Sent"
set trash = "+[Gmail]/Trash"
# Be sure to `mkdir -p` the following paths
set header_cache =~/.neomutt/com.gmail.account1/cache/headers
set message_cachedir =~/.neomutt/com.gmail.account1/cache/bodies
set certificate_file =~/.neomutt/com.gmail.account1/certificates
set move = no
set imap_keepalive = 900
set sort = reverse-threads
set sort_aux = last-date-received
set imap_user = "[email protected]"
set imap_pass = ""
set smtp_url = "smtp://[email protected]:587/"
set smtp_pass = ""
set from = "[email protected]"
set realname = "your name"
set folder = "imaps://[email protected]:993"
set spoolfile = "+INBOX"
set postponed = "+[Gmail]/Drafts"
set record = "+[Gmail]/Sent"
set trash = "+[Gmail]/Trash"
# Be sure to `mkdir -p` the following paths
set header_cache =~/.neomutt/com.gmail.account2/cache/headers
set message_cachedir =~/.neomutt/com.gmail.account2/cache/bodies
set certificate_file =~/.neomutt/com.gmail.account2/certificates
set move = no
set imap_keepalive = 900
set sort = reverse-threads
set sort_aux = last-date-received