Recipe 8.6 Encrypted Mail with mutt

8.6.1 Problem

You want to send and receive encrypted email conveniently with the mutt mailer.

8.6.2 Solution

mutt comes with configuration files pgp2.rc, pgp5.rc, and gpg.rc, ready to use with pgp2, pgp5, and gpg, respectively. Include one of these files inside your ~/.muttrc. (For GnuPG support, obviously include gpg.rc.)

8.6.3 Discussion

Compose a message normally. Notice the headers include a setting called PGP:

From: Daniel Barrett <dbarrett@oreilly.com>
To: Shawn Smith <smith@example.com>
Cc:
Bcc:
Subject: Test message
Reply-To:
Fcc:
PGP: Clear

By default, encryption is disabled (Clear). To change this, type p to display the PGP options, and choose to encrypt, sign, or both. When you send the message (press y), you'll be presented with the available private keys for encrypting or signing. Select one and the message will be sent.

To decrypt a message you receive, simply view it. mutt will prompt for your GnuPG passphrase and display the decrypted message.

8.6.4 See Also

mutt(1), and Mutt's supplied documentation in /usr/share/doc/mutt*, in particular the file PGP-Notes.txt. The home page for Mutt is http://www.mutt.org.



    Chapter 9. Testing and Monitoring