To encrypt password with mutt, we will be using GNUpg, install it :
For Debian based : $ sudo apt-get install gnupg gnupg-agent For RPM based : $ sudo yum install gnupg gnupg-agent
after installing it you need to generate an encryption key by using following.
gpg --gen-key
Select appropriate options. Enter you name, email and passphare when it asks. Do not forget your passphrase.
now create a file .pass place it in your home folder, I am placing it here :
touch ~/.mutt/.pass
contents fo following file should be :
GMail:
encrypt it by using:
cd ~/.mutt gpg --encrypt .pass
Now you will see a file is created as .pass.gpg , if it is there, you can delete orignal .pass file. After this step you have to make changes to .muttrc file. Append the following by doing appropriate changes
set imap_pass = `gpg -d ~/.mutt/.pass.gpg | awk '/GMail:/ {print $2}'`
NOTE : if imap_pass and smtp_pass are defined anywhere else, you have to remove them or comment those two lines like this :
#set imap_pass = ""#set smtp_pass = ""
Thats it, now you can start mutt and it will ask the passphrase for your key, and will never irritate you again 🙂
Good Luck.
Leave a Reply