Thursday 8 February 2018

gnupg - Encrypted Mutt alias file


I use Mutt for email, and I store contacts in ~/.mutt/alias.


I want to store my alias file in a publicly-visible Git repository, but I don't want anyone else to view my contacts.


I can encrypt and decrypt my alias file with GPG. How can I make Mutt decrypt and open my alias file on startup?



Answer



I added the following line to my ~/.mutt/muttrc:


source "gpg --decrypt --quiet ~/.mutt/alias.gpg |"

The pipe character at the end of that string tells Mutt to pipe the result of the command back into Mutt.


The --quiet flag tells GPG to only return the contents of the alias.gpg file, and not also the gpg: encrypted with 2048-bit RSA key… message that it normally starts with.


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...