Skip to content

Instantly share code, notes, and snippets.

@AysadKozanoglu
Forked from miguelmota/README.md
Last active November 15, 2016 04:53
Show Gist options
  • Save AysadKozanoglu/07ffb0386bd931b0ca6bf311fda5e286 to your computer and use it in GitHub Desktop.
Save AysadKozanoglu/07ffb0386bd931b0ca6bf311fda5e286 to your computer and use it in GitHub Desktop.
Multiple accounts with Mutt E-Mail Client
How to set up multiple accounts with Mutt E-mail Client

Thanks to this article by Christoph Berg

Instructions

Directories and files

~/
|── .mutt/
|   ├── account.com.gmail.foo/
|   ├── account.com.gmail.bar/
|   ├── com.gmail.foo
|   └── com.gmail.bar
└── .muttrc
~/.muttrc
# Folder hooks
folder-hook 'account.com.gmail.foo' 'source ~/.mutt/account.com.gmail.foo'
folder-hook 'account.com.gmail.bar' 'source ~/.mutt/account.com.gmail.bar'

# Default account
source ~/.mutt/account.com.gmail.miguelmota2         

# Macros for switching accounts
macro index <f2> '<sync-mailbox><enter-command>source ~/.mutt/account.com.gmail.foo<enter><change-folder>!<enter>'
macro index <f3> '<sync-mailbox><enter-command>source ~/.mutt/account.com.gmail.bar<enter><change-folder>!<enter>'

# Fetch mail shortcut
bind index G imap-fetch-mail
~/.mutt/account.com.gmail.foo
set imap_user = "foo@gmail.com"                       
set imap_pass = "<PASSWORD>"                                    
set smtp_url = "smtp://foo@smtp.gmail.com:587/"       
set smtp_pass = "<PASSWORD>"                                    
set from = "foo@gmail.com"                            
set realname = "Foo"                                  
set folder = "imaps://imap.gmail.com:993"                     
set spoolfile = "+INBOX"                                      
set postponed = "+[Gmail]/Drafts"                             
set header_cache = ~/.mutt/com.gmail.foo/cache/headers            
set message_cachedir = ~/.mutt/com.gmail.foo/cache/bodies         
set certificate_file = ~/.mutt/com.gmail.foo/certificates         
~/.mutt/account.com.gmail.bar
set imap_user = "bar@gmail.com"                       
set imap_pass = "<PASSWORD>"                                    
set smtp_url = "smtp://bar@smtp.gmail.com:587/"       
set smtp_pass = "<PASSWORD>"                                    
set from = "bar@gmail.com"                            
set realname = "Bar"                                  
set folder = "imaps://imap.gmail.com:993"                     
set spoolfile = "+INBOX"                                      
set postponed = "+[Gmail]/Drafts"                             
set header_cache = ~/.mutt/com.gmail.bar/cache/headers            
set message_cachedir = ~/.mutt/com.gmail.bar/cache/bodies         
set certificate_file = ~/.mutt/com.gmail.bar/certificates         
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment