Mark Lucernas
Oct 09, 2020

Email Configurations

Setting up with Gmail Account

First, create an App Password for Mutt.

Then edit your .muttrc with these basic configurations

# User Info
set from = "user@gmail.com"
set realname = "User Name"

# Receive options
set imap_user = "user@gmail.com"
set imap_pass = "Gmail App Password for mutt"
set folder = "imaps://imap.gmail.com:993"
set spoolfile = "imaps://imap.gmail.com/INBOX"
set postponed ="+[Gmail]/Drafts"

set header_cache =~/.mutt/cache/headers
set message_cachedir =~/.mutt/cache/bodies
set certificate_file =~/.mutt/certificates

# Send optionns
set smtp_url = "smtps://user@gmail.com@smtp.gmail.com:465/"
set smtp_pass = "Gmail App Password for mutt"
set move = no
set imap_keepalive = 900

Ref:

Encrypting Passwords

GNUpg

For Debian based: sudo apt-get install gnupg gnupg-agent For RPM based : sudo yum install gnupg gnupg-agent

Generate encryption key. Enter name, email and passphrase.

gpg --gen-key

Create a new file ~/.mutt/.pass containing the password(s) in this format:

GMail: <password_goes_here>

Encrypt .pass

cd ~/.mutt
gpg --encrypt .pass

Then set imap and smtp password in your muttrc

set imap_pass = `gpg -d ~/.mutt/.pass.gpg | awk '/GMail:/ {print $2}'`
set smpt_pass = `gpg -d ~/.mutt/.pass.gpg | awk '/GMail:/ {print $2}'`

Delete your password footprint

shred ~/.mutt/.pass
rm ~/.mutt/.pass

Done!

Ref:


Resources