How to set up multiple accounts with Mutt E-mail Client
Thanks to this article by Christoph Berg
Directories and files
~/
|── .mutt/
| ├── account.com.gmail.foo
| ├── account.com.gmail.bar
| ├── com.gmail.foo/
| └── com.gmail.bar/
└── .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.foo
# 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
set imap_user = "[email protected]"
set imap_pass = "<PASSWORD>"
set smtp_url = "smtp://[email protected]:587/"
set smtp_pass = "<PASSWORD>"
set from = "[email protected]"
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
set imap_user = "[email protected]"
set imap_pass = "<PASSWORD>"
set smtp_url = "smtp://[email protected]:587/"
set smtp_pass = "<PASSWORD>"
set from = "[email protected]"
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
I have four accounts set up the way described above.
Two of the accounts are gmail and it works fine whereas the other account is on another server.
Problem I'm having is the gmail accounts work fine when the default account is set to gmail.
When I try and change to the accounts on the other server I get login failed.
Same thing a happens if I try and change the default account as one of the other two accounts, the other accounts work and when I try change to gmail I get again login failed.
Individually the accounts work fine but seems like change of server causes a problem.
Any thoughts?
Thank you