Mutt offlineimap

From wikinotes

Instructions to integrate offlineimap with mutt.

NOTE:

If authorizing with google's OAUTH2 token rather than LOGIN, you cannot use msmtp. Use mutt's internal smtp settings

Install

See offlineimap.

Configuration

First, set up offlineimap to synchronize emails from IMAP to maildir.

Next, We will setup account-hooks with account-specific settings in ~/.mutt/accounts/${account}, that configures the maildir directory mutt should use for the account.

# ~/.mutt/folders/work

set from = "you@work.com"
set sendmail = "/usr/bin/msmtp -a work"
set folder = ~/.mail
set mbox = "+work/archive"
set postponed = "+pers/drafts"


Finally, we will set up a folder-hook that sources account settings when mailbox is loaded.

# ~/.mutt/muttrc

folder-hook work/* source +/.mutt/folders/work