If you are a command line and text terminal fan like myself, chances are you are using this trio daily:
– #pass for managing #passwords,
– #mutt for reading and writing #email,
– #msmtp for sending out e-mails via weird mail servers such as #MS #Exchange that mutt cannot talk to directly.
Today I figured out how to make them work together without entering or storing #cleartext passwords.
I am using GNU/Linux and have #gpg agent working.
I used pass to store my e-mail (and #ActiveDirectory) password under the name uni/mail. This generated the encrypted file ~/.password-store/uni/mail.gpg. So …
In ~/.muttrc, I put:
set imap_pass=`gpg2 --no-tty -q -d ~/.password-store/uni/mail.gpg`
In ~/.msmtprc, I put:
passwordeval gpg2 --no-tty -q -d ~/.password-store/uni/mail.gpg
Whenever I change this password, all I have to do is to store it using pass. The other programs will fetch it from there and decrypt it when they need it.
PS: There is an #Android app called “Password Store” that can sync its database with #pass via #git. Get it from #fdroid: https://f-droid.org/en/packages/dev.msfjarvis.aps/
Of course, think twice before storing your passwords on a device as insecure as a smartphone or tablet, even if they are PGP-encrypted!
I would not do it on a stock smartphone still containing the manufacturer's bloatware/spyware. Look for cleaner alternatives such as #LineageOS, #GrapheneOS, #CalyxOS or #Replicant.
@chpietsch I didn’t realise mutt was still around – I haven’t used it for a couple of decades!
But it was my standard mail client for a good few years, after I was forced to switch from ream
@transponderings Never heard of ream. I used pine before mutt. The latter is still under active development:
– web: https://mutt.org (seems to have trouble with its TLS cert right now, but you can safely accept it)
– source: https://gitlab.com/muttmua/mutt
– wiki: https://gitlab.com/muttmua/mutt/-/wikis/home
@chpietsch I’d forgotten about pine – must have used that at some point too
Must look at mutt again some time!
@chpietsch For ream (which I’d forgotten was developed at Edinburgh uni, which is probably where its core user base were), see http://freshmeat.sourceforge.net/projects/ream/
I wish I could remember what MUA I used at Edinburgh University when I was a non-graduating student at the AI department in 1996–97. They had Sun SparcStations. It must have been Pine or Elm I guess.
PS: I was able to download the source code of ream v4.18c from https://web.archive.org/web/20080828041011/http://www.cis.um.edu.mt/staff/cmeli/
It dates from the year 2000 and its makefile has a Linux target, too :-)