Using GPG with Alpine

Adapted from http://spevack.org/AlpineGPG

General Setup
The goal is to be able to use Alpine and GPG as follows:


 * Send a message that is encrypted, signed, or both signed and encrypted.
 * Receive a message that is encrypted, and successfully decrypt it.
 * Receive a message that is signed, and successfully verify the signature.

You need:


 * Alpine
 * ez-pine-gpg
 * gnupg

Install
Aline is packaged as an RPM, and is easily installed. ez-pine-gpg is shipped as a .tgz file -- you should extract it, and run the installation tool that comes with it.

Configuration
You'll have to make some changes to your ~/.pinerc file. Here's a sample of mine:

display-filters=_LEADING("-BEGIN PGP")_ /home/max/bin/ez-pine-gpg-incoming
 * 1) This variable takes a list of programs that message text is piped into
 * 2) after MIME decoding, prior to display.

sending-filters=/home/max/bin/ez-pine-gpg-sign _INCLUDEALLHDRS_, /home/max/bin/ez-pine-gpg-encrypt _RECIPIENTS_ gpg-identifier, /home/max/bin/ez-pine-gpg-sign-and-encrypt _INCLUDEALLHDRS_ _RECIPIENTS_ gpg-identifier
 * 1) This defines a program that message text is piped into before MIME
 * 2) encoding, prior to sending

Make the following changes:


 * /home/max/bin should be replaced with the installation path that you specified.
 * In two places, the gpg-identifier after _RECIPIENTS_ should be replaced with your GPG public key's identifier. The reason you include your own GPG identifier here is so that if you send an encrypted message to "Alice", that message is also encrypted with your public key -- if you don't do this, then you will not be able to open that message in your sent-mail folder and remind yourself of what you wrote.