Comments on: Encrypted Mutt IMAP/SMTP Passwords Linux. GNU. Freedom. Sun, 18 Nov 2018 14:42:22 +0000 hourly 1 By: Chris Hilton Fri, 08 Sep 2017 15:34:07 +0000 Oops, that should have read:
cat <<EOF | gpg -r my_gpg_id -e -
set imap_pass="my_password"
set smtp_pass="my_password"

By: Chris Hilton Fri, 08 Sep 2017 15:32:38 +0000 This keeps your password out of the filesystem:

cat <<EOF | gpg -r -e -
set imap_pass=""
set smtp_pass=""

Have a good day!

By: bioshark Tue, 06 Oct 2015 17:17:30 +0000 Thanks a lot for this elegant solution. Already applied 😉

By: Aaron Toponce Tue, 17 Feb 2015 20:40:41 +0000 No problem! Glad it's useful! 🙂

By: Alexander A. Wed, 04 Feb 2015 21:06:29 +0000 I keep coming back to this site, whenever I need to setup a new mutt installation.

By: Torsten Tue, 14 Oct 2014 10:58:52 +0000 Another option to encrypt the file without saving the cleartext to disk and without using special software like emacs or a vim plugin:
mkdir mytmpdir
mount -t ramfs -o size=1m ramfs mytmpdir
Then work in mytmpdir and afterwards
umount mytmpdir
rmdir mytmpdir
This will not save anything to disk, as the ramfs stays in RAM and will not be swapped. Then reboot to be safe, that no cleartext is left in your RAM.

By: jL Fri, 20 Sep 2013 19:05:48 +0000 Thanks a lot, very helpful

By: Encrypt your mutt email passwords « 0ddn1x: tricks with *nix Tue, 22 May 2012 15:35:39 +0000 [...] Leave a Comment TrackBack URI [...]

[WORDPRESS HASHCASH] The comment's server IP ( doesn't match the comment's URL host IP ( and so is spam.

By: Tom Dickson-Hunt Tue, 24 Apr 2012 03:48:50 +0000 Very nice. I like this a lot.

A note: if you've got a recent Emacs, then you don't have to bother with saving, shredding, etc.; simply find the new file passwords.gpg, type in its contents, and save, and Emacs will automatically encrypt it without ever writing plaintext to disk.

By: Aaron Toponce : Encrypt Your Irssi Config Tue, 28 Feb 2012 14:30:05 +0000 [...] Irssi as my client of choice, AND the fact that others have asked me about it after blogging about encrypting your IMAP/SMTP passwords with Mutt, I figured this was an appropriate [...]

By: vontrapp Fri, 27 Jan 2012 23:33:48 +0000 There's a very handy vim plugin that does gpg very nicely, taking care to not store anything to disk and other precautions so you don't have to rely on shred. Additionally shred doesn't really work as intended with journaled filesystems, iirc.

I use the one by markus braun
There's another which I know nothing of by james mccoy

Once you have the plugin plopped into the ~/.vim/plugins directory, simply edit the .gpg file:
vim ~/.mutt/private.gpg

Enter your gpg uid (recipient address) in the top buffer and close it. Then edit the bottom buffer. vim will encrypt with gpg any time it writes to disk, and it turns off viminfo and swapfiles, too, so you don't leak anything.

By: Benjamin Kerensa Mon, 09 Jan 2012 05:14:58 +0000 I wonder if Thunderbird stores passwords in plaintext =o now I'm concerned

By: sam Sun, 08 Jan 2012 13:33:19 +0000 muttrc also supports back-ticks. I have a small shell script that turns off local echo asks for my password, turns on local echo and then echos it as it exits.

set smtp_pass=`/home/sam/bin/muttpasswd`


read -s -pPassword: P
echo $P

Hope this helps.