Setting up mutt with pass to handle encrypted passwords

1

1

As mentioned in the comments on this article, https://blog.christophersmart.com/2016/08/10/command-line-password-management-with-pass/ and as described in this blog entry, http://schnizle.in/blog/posts/2014-11-24-Howto:-Setup-mutt-(with-native-imap-+-msmpt-+-gpg-+-pass)/ I tried to setup mutt with gnu passwordmanager „pass“.

I am on Debian Stretch and installed mutt via apt, which is as I found out actually NeoMutt 1.7.2.

First I copied gpg.rc from /usr/share/doc/mutt/examples/ to ~/.mutt and sourced it in my .muttrc.

I than tried out a barely minimal configuration just to check if it's working. Here it is:

# make mutt aware to use gpg
source ~/.mutt/gpg.rc

# use program "pass" to handle and decrypt passwords
set my_pass='pass mail/posteo/dasboeh'

# Imap settings
set from="username@posteo.de"
set hostname="posteo.de"
set imap_login="username"
set imap_pass=$$my_pass
set folder="imaps://username@posteo.de@posteo.de/"
set postponed="=Drafts"
set record="=Sent"
set spoolfile="=INBOX"

When I start up mutt it doesn't even ask me for my gpg password. It tries to authentificate with plain and fails (obviously). Btw. testing connection with plain password in .muttrc works flawlessly.

Can anyone help me? Thanks!

Stefan Boehringer

Posted 2017-11-23T06:15:20.250

Reputation: 13

Answers

2

I had the same problem and I was able to solve it like this:

1) let mutt print your password (it it is working you should see your password in clear text)

:set imap_pass

2) I saw a leading $, so I changed set imap_pass

set imap_pass=$my_pass

3) I have special characters in my password so I had to quote the result

set my_pass="`pass ...`"

Also be very careful to use the correct quotes as they have different meaning: https://gitlab.com/muttmua/mutt/wikis/MuttGuide/Syntax#-

Daniel Uhl

Posted 2017-11-23T06:15:20.250

Reputation: 36